|
Leptonica
1.54
|
Классы | |
| struct | L_GenAssoc |
Макросы | |
| #define | TEMPLATE1 "stringtemplate1.txt" /* for assembling autogen.*.c */ |
| #define | TEMPLATE2 "stringtemplate2.txt" /* for assembling autogen.*.h */ |
Функции | |
| static l_int32 | l_getIndexFromType (const char *type, l_int32 *pindex) |
| static l_int32 | l_getIndexFromStructname (const char *sn, l_int32 *pindex) |
| static l_int32 | l_getIndexFromFile (const char *file, l_int32 *pindex) |
| static char * | l_genDataString (const char *filein, l_int32 ifunc) |
| static char * | l_genCaseString (l_int32 ifunc, l_int32 itype) |
| static char * | l_genDescrString (const char *filein, l_int32 ifunc, l_int32 itype) |
| L_STRCODE * | strcodeCreate (l_int32 fileno) |
| static void | strcodeDestroy (L_STRCODE **pstrcode) |
| l_int32 | strcodeCreateFromFile (const char *filein, l_int32 fileno, const char *outdir) |
| l_int32 | strcodeGenerate (L_STRCODE *strcode, const char *filein, const char *type) |
| l_int32 | strcodeFinalize (L_STRCODE **pstrcode, const char *outdir) |
| l_int32 | l_getStructnameFromFile (const char *filename, char **psn) |
Переменные | |
| static const l_int32 | l_ntypes = 20 |
| static const struct L_GenAssoc | l_assoc [] |
| #define TEMPLATE1 "stringtemplate1.txt" /* for assembling autogen.*.c */ |
| #define TEMPLATE2 "stringtemplate2.txt" /* for assembling autogen.*.h */ |
Input: ifunc (index into set of functions in generated file)
itype (index into type of function to be used)
Return: case string for this decoding function
Notes: (1) @ifunc and @itype have been validated, so no error can occur
|
static |
Input: filein (input file of serialized data)
ifunc (index into set of functions in output file)
Return: encoded ascii data string, or null on error reading from file
Input: filein (input file of serialized data)
ifunc (index into set of functions in generated file)
itype (index into type of function to be used)
Return: description string for this decoding function
Input: filename
&index (<return>)
Return: 0 if found, 1 on error.
Input: structname (e.g., "Pixa")
&index (<return>)
Return: 0 if found, 1 if not.
Notes: (1) This is used to identify the type of serialized file; the first word in the file is the structname. (2) For valid structname, @found == true and @index > 0.
Input: type (e.g., "PIXA")
&index (<return>)
Return: 0 if found, 1 if not.
Notes: (1) For valid type, @found == true and @index > 0.
| l_int32 l_getStructnameFromFile | ( | const char * | filename, |
| char ** | psn | ||
| ) |
Input: filename
&sn (<return> structname; e.g., "Pixa")
Return: 0 if found, 1 on error.
Input: fileno (integer that labels the two output files) Return: initialized L_StrCode, or null on error
Notes: (1) This struct exists to build two files containing code for any number of data objects. The two files are named autogen.<fileno>.c autogen.<fileno>.h
Input: filein (containing filenames of serialized data)
fileno (integer that labels the two output files)
outdir (<optional> if null, files are made in /tmp/lept/auto)
Return: 0 if OK, 1 on error
Notes: (1) The @filein has one filename on each line. Comment lines begin with "#". (2) The output is 2 files: autogen.<fileno>.c autogen.<fileno>.h
|
static |
Input: &strcode (strcode is set to null after destroying the sarrays) Return: void
Input: &strcode (destroys after .c and .h files have been generated)
outdir (<optional> if null, files are made in /tmp/lept/auto)
Return: void
Input: strcode (for accumulating data)
filein (input file with serialized data)
type (of data; use the typedef string)
Return: 0 if OK, 1 on error.
Notes: (1) The generated function name is l_autodecode_<fileno>() where <fileno> is the index label for the pair of output files. (2) To deserialize this data, the function is called with the argument 'ifunc', which increments each time strcodeGenerate() is called.
|
static |
|
static |