Leptonica 1.68
C Image Processing Library

parseprotos.c File Reference

Parse output of cpp to generate ANSII C function prototypes from a file of C functions. More...

#include <string.h>
#include "allheaders.h"

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)

Detailed Description

Parse output of cpp to generate ANSII C function prototypes from a file of C functions.

Definition in file parseprotos.c.


Define Documentation

#define L_BUF_SIZE   512

Definition at line 39 of file parseprotos.c.

Referenced by cleanProtoSignature().


Function Documentation

static l_int32 getNextNonCommentLine ( SARRAY sa,
l_int32  start,
l_int32 pnext 
) [static]

Definition at line 216 of file parseprotos.c.

References ERROR_INT, NULL, PROCNAME, sarrayGetCount(), and sarrayGetString().

Referenced by searchForProtoSignature().

static l_int32 getNextNonBlankLine ( SARRAY sa,
l_int32  start,
l_int32 pnext 
) [static]

Definition at line 262 of file parseprotos.c.

References ERROR_INT, NULL, PROCNAME, sarrayGetCount(), and sarrayGetString().

Referenced by searchForProtoSignature().

static l_int32 getNextNonDoubleSlashLine ( SARRAY sa,
l_int32  start,
l_int32 pnext 
) [static]

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]
static char * captureProtoSignature ( SARRAY sa,
l_int32  start,
l_int32  stop,
l_int32  charindex 
) [static]
static char * cleanProtoSignature ( char *  str) [static]
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]
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]
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().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines