-
Notifications
You must be signed in to change notification settings - Fork 7
/
findlist.awk
85 lines (82 loc) · 4.35 KB
/
findlist.awk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
BEGIN {
print "// THIS FILE IS AUTOGENERATED BY findlist.sh"
print ""
print "/** \\file"
print " * \\brief Automatically generated function prototypes and documentation"
print " */"
print ""
}
{
gsub(/^[ \t]+/,"",$1);
gsub(/^[ \t]+/,"",$2);
gsub(/^"/,"",$2);
gsub(/"$/,"",$2);
gsub(/^[ \t]+/,"",$3);
gsub(/^[ \t]+/,"",$4);
gsub(/^[ \t]+/,"",$5);
gsub(/[ \t]+$/,"",$5);
URC=$1
NAME=$2;
IDENTIFIER=$3;
MUSTFINAL=$4;
CBONOK=$5;
print ""
print ""
print "/** \\typedef ucxhPARSER_urc" IDENTIFIER "Event_t";
print " * Event generated upon the reception of the URC `+" URC "`";
print " * \\note Some parts of this documentation is automatically generated.";
print " * \\urc +" URC;
print " * \\sa ucxhPARSER_setOn" IDENTIFIER "()";
print " * \\sa on" URC "_createEvent()";
print " */";
print ""
print "/** \\brief Register the callback to invoke upon reception of the `+" URC "` URC or command response for `" NAME "`";
print " * The callback is invoked independent of if the URC is received in AT mode or through the EDM AT channel.";
print " * If no callback is registered, the callback optinally registered with `ucxhPARSER_setOnURCParsed()` will be invoked instead.";
print " * \\note This function is automatically generated.";
print " * \\urc " URC;
print " * \\param [in] callback The callback to invoke upon reception of `+" URC "`";
print " * \\param [in] pEvent The event passed to the callback";
print " * \\returns TRUE if registration succeeded, FALSE otherwize.";
print " * \\sa on" URC "_createEvent()";
print " * \\sa ucxhPARSER_setOnX" URC "Error()";
print " * \\sa ucxhPARSER_setOnXXX()";
print " * \\ingroup autogenerated";
print " */";
print "bool ucxhPARSER_setOn" IDENTIFIER "(int (*callback)(ucxhPARSER_urc" IDENTIFIER "Event_t *pEvent));";
print ""
print "/** \\brief Register the callback to invoke in case the command `AT+" URC "` for `" NAME "` failed with `ERROR`.";
print " * The callback is invoked independent of if the URC is received in AT mode or through the EDM AT channel.";
print " * If no callback is registered, the callback optinally registered with `ucxhPARSER_setOnErrorReceived()` will be invoked instead.";
print " * \\note This function is automatically generated.";
print " * \\urc " URC;
print " * \\cmd AT+" URC;
print " * \\param [in] callback The callback to invoke upon reception of `ERROR` for `AT+" URC "`";
print " * \\param [in] _ TBD";
print " * \\returns TRUE if registration succeeded, FALSE otherwize.";
print " * \\sa ucxhPARSER_setOnXXXError()";
print " * \\ingroup autogenerated";
print " */";
print "bool ucxhPARSER_setOn" URC "Error(int (*callback)(void *_));";
print ""
print "/** \\brief Create a struct ucxhPARSER_urc" IDENTIFIER "Event_t from the parameters in a `+" URC "` URC.";
print " * Declaration for a function which parses a line to create an event for a URC or reponse to a command request `" IDENTIFIER "`,"
print " * with the actual URC or command is `" URC "`.";
print " * After this function has been invoked by the parser, the parser will forward the event to whoever registered itself";
print " * as listener with the function `\\ref ucxhPARSER_setOn" IDENTIFIER "()`";
print " * \\note The actual definition is NOT autogenerated, and must fulfill the requirements outlined in \\ref extending."
print " * \\note All code required to invoke this function is automatically generated.";
print " * \\param [in] numParams Number of parameters in ppParams, or 0";
print " * \\param [in] ppParams The parameters, or NULL";
print " * \\param [out] pEvent The event to be generated by the function";
print " * \\returns ucxhURC_PARSE_RESULT_OK if parsing succeded, ucxhURC_PARSE_RESULT_NEED_MORE if (at least) another invocation is required, or ucxhURC_PARSE_RESULT_ERROR if unable to parse.";
print " * \\note Some parts of this documentation is automatically generated.";
print " * \\urc +" URC;
print " * \\sa ucxhPARSER_setOn" IDENTIFIER "()";
print " * \\sa onUUU_createEvent()";
print " * \\ingroup eventcreation";
print " */";
print "ucxhURC_parseResult_t on" URC "_createEvent(uint8_t numParams, const char *ppParams[], ucxhPARSER_urc" IDENTIFIER "Event_t *pEvent);"
}
END {
}