Leptonica 1.68
C Image Processing Library
|
Parse output of cpp to generate ANSII C function prototypes from a file of C functions. More...
Go to the source code of this file.
Defines | |
#define | L_BUF_SIZE 512 |
Functions | |
static l_int32 | getNextNonCommentLine (SARRAY *sa, l_int32 start, l_int32 *pnext) |
static l_int32 | getNextNonBlankLine (SARRAY *sa, l_int32 start, l_int32 *pnext) |
static l_int32 | getNextNonDoubleSlashLine (SARRAY *sa, l_int32 start, l_int32 *pnext) |
static l_int32 | searchForProtoSignature (SARRAY *sa, l_int32 begin, l_int32 *pstart, l_int32 *pstop, l_int32 *pcharindex, l_int32 *pfound) |
static char * | captureProtoSignature (SARRAY *sa, l_int32 start, l_int32 stop, l_int32 charindex) |
static char * | cleanProtoSignature (char *str) |
static l_int32 | skipToEndOfFunction (SARRAY *sa, l_int32 start, l_int32 charindex, l_int32 *pnext) |
static l_int32 | skipToMatchingBrace (SARRAY *sa, l_int32 start, l_int32 lbindex, l_int32 *prbline, l_int32 *prbindex) |
static l_int32 | skipToSemicolon (SARRAY *sa, l_int32 start, l_int32 charindex, l_int32 *pnext) |
static l_int32 | getOffsetForCharacter (SARRAY *sa, l_int32 start, char tchar, l_int32 *psoffset, l_int32 *pboffset, l_int32 *ptoffset) |
static l_int32 | getOffsetForMatchingRP (SARRAY *sa, l_int32 start, l_int32 soffsetlp, l_int32 boffsetlp, l_int32 toffsetlp, l_int32 *psoffset, l_int32 *pboffset, l_int32 *ptoffset) |
char * | parseForProtos (const char *filein, const char *prestring) |
Parse output of cpp to generate ANSII C function prototypes from a file of C functions.
char *parseForProtos() Static helpers static l_int32 getNextNonCommentLine() static l_int32 getNextNonBlankLine() static l_int32 getNextNonDoubleSlashLine() static l_int32 searchForProtoSignature() static char *captureProtoSignature() static char *cleanProtoSignature() static l_int32 skipToEndOfFunction() static l_int32 skipToMatchingBrace() static l_int32 skipToSemicolon() static l_int32 getOffsetForCharacter() static l_int32 getOffsetForMatchingRP()
Definition in file parseprotos.c.
#define L_BUF_SIZE 512 |
Definition at line 39 of file parseprotos.c.
Referenced by cleanProtoSignature().
Definition at line 216 of file parseprotos.c.
References ERROR_INT, NULL, PROCNAME, sarrayGetCount(), and sarrayGetString().
Referenced by searchForProtoSignature().
Definition at line 262 of file parseprotos.c.
References ERROR_INT, NULL, PROCNAME, sarrayGetCount(), and sarrayGetString().
Referenced by searchForProtoSignature().
Definition at line 311 of file parseprotos.c.
References ERROR_INT, NULL, PROCNAME, sarrayGetCount(), and sarrayGetString().
Referenced by searchForProtoSignature().
static l_int32 searchForProtoSignature | ( | SARRAY * | sa, |
l_int32 | begin, | ||
l_int32 * | pstart, | ||
l_int32 * | pstop, | ||
l_int32 * | pcharindex, | ||
l_int32 * | pfound | ||
) | [static] |
Definition at line 375 of file parseprotos.c.
References ERROR_INT, FALSE, getNextNonBlankLine(), getNextNonCommentLine(), getNextNonDoubleSlashLine(), getOffsetForCharacter(), getOffsetForMatchingRP(), PROCNAME, skipToMatchingBrace(), skipToSemicolon(), and TRUE.
Referenced by parseForProtos().
static char * captureProtoSignature | ( | SARRAY * | sa, |
l_int32 | start, | ||
l_int32 | stop, | ||
l_int32 | charindex | ||
) | [static] |
Definition at line 495 of file parseprotos.c.
References cleanProtoSignature(), ERROR_PTR, FREE, NULL, PROCNAME, sarrayAddString(), sarrayCreate(), sarrayDestroy(), sarrayGetString(), sarrayToString(), and stringJoin().
Referenced by parseForProtos().
static char * cleanProtoSignature | ( | char * | str | ) | [static] |
Definition at line 539 of file parseprotos.c.
References buf, ERROR_PTR, L_BUF_SIZE, NULL, PROCNAME, sarrayAddString(), sarrayCreate(), sarrayCreateWordsFromString(), sarrayDestroy(), sarrayGetCount(), sarrayGetString(), and sarrayToString().
Referenced by captureProtoSignature().
static l_int32 skipToEndOfFunction | ( | SARRAY * | sa, |
l_int32 | start, | ||
l_int32 | charindex, | ||
l_int32 * | pnext | ||
) | [static] |
Definition at line 601 of file parseprotos.c.
References ERROR_INT, getOffsetForCharacter(), PROCNAME, and skipToMatchingBrace().
Referenced by parseForProtos().
static l_int32 skipToMatchingBrace | ( | SARRAY * | sa, |
l_int32 | start, | ||
l_int32 | lbindex, | ||
l_int32 * | prbline, | ||
l_int32 * | prbindex | ||
) | [static] |
Definition at line 644 of file parseprotos.c.
References ERROR_INT, FALSE, PROCNAME, sarrayGetCount(), sarrayGetString(), and TRUE.
Referenced by searchForProtoSignature(), and skipToEndOfFunction().
static l_int32 skipToSemicolon | ( | SARRAY * | sa, |
l_int32 | start, | ||
l_int32 | charindex, | ||
l_int32 * | pnext | ||
) | [static] |
Definition at line 719 of file parseprotos.c.
References ERROR_INT, FALSE, PROCNAME, sarrayGetCount(), sarrayGetString(), and TRUE.
Referenced by searchForProtoSignature().
static l_int32 getOffsetForCharacter | ( | SARRAY * | sa, |
l_int32 | start, | ||
char | tchar, | ||
l_int32 * | psoffset, | ||
l_int32 * | pboffset, | ||
l_int32 * | ptoffset | ||
) | [static] |
Definition at line 783 of file parseprotos.c.
References ERROR_INT, FALSE, NULL, PROCNAME, sarrayGetCount(), sarrayGetString(), and TRUE.
Referenced by searchForProtoSignature(), and skipToEndOfFunction().
static l_int32 getOffsetForMatchingRP | ( | SARRAY * | sa, |
l_int32 | start, | ||
l_int32 | soffsetlp, | ||
l_int32 | boffsetlp, | ||
l_int32 | toffsetlp, | ||
l_int32 * | psoffset, | ||
l_int32 * | pboffset, | ||
l_int32 * | ptoffset | ||
) | [static] |
Definition at line 870 of file parseprotos.c.
References ERROR_INT, FALSE, NULL, PROCNAME, sarrayGetCount(), sarrayGetString(), and TRUE.
Referenced by searchForProtoSignature().
char* parseForProtos | ( | const char * | filein, |
const char * | prestring | ||
) |
Definition at line 132 of file parseprotos.c.
References captureProtoSignature(), ERROR_PTR, FREE, l_binaryRead(), L_INSERT, NULL, PROCNAME, sarrayAddString(), sarrayCreate(), sarrayCreateLinesFromString(), sarrayCreateWordsFromString(), sarrayDestroy(), sarrayGetString(), sarrayToString(), searchForProtoSignature(), skipToEndOfFunction(), and stringJoin().
Referenced by main().