FLAMCLE/P-API
Command Line Executor/Parser Application Programming Interface
CLP Function Pointer (call backs)

Function prototype definitions for call backs used by CLP. More...

Typedefs

typedef int() TfF2S(void *pvGbl, void *pvHdl, const char *pcFil, char **ppBuf, int *piBuf, char *pcMsg, const int siMsg)
 Type definition for string to file call back function. More...
 
typedef int() TfSaf(void *pvGbl, void *pvHdl, const char *pcVal)
 Type definition for resource access check. More...
 
typedef int() TfClpPrintPage(void *pvHdl, const int siLev, const char *pcHdl, const char *pcPat, const char *pcFil, const char *pcOrg, const char *pcPge)
 Function 'prnHtmlDoc' of library 'libhtmldoc' called if built-in function HTMLDOC used. More...
 

Detailed Description

Function prototype definitions for call backs used by CLP.

Typedef Documentation

◆ TfF2S

typedef int() TfF2S(void *pvGbl, void *pvHdl, const char *pcFil, char **ppBuf, int *piBuf, char *pcMsg, const int siMsg)

Type definition for string to file call back function.

Read a file using the specified filename and reads the whole content into the supplied buffer. The buffer is reallocated and buffer size updated, if necessary.

Parameters
[in]pvGblPointer to to the global handle as black box given with CleExecute
[in]pvHdlPointer to a handle given for this callback
[in]pcFilFile name to read
[in,out]ppBufPointer to a buffer pointer for reallocation
[in,out]piBufPointer to the buffer size (updated after reallocation)
[out]pcMsgPointer to a buffer for the error message
[in]siMsgSize of the message buffer (should be 1024)
Returns
bytes read or negative value if error

◆ TfSaf

typedef int() TfSaf(void *pvGbl, void *pvHdl, const char *pcVal)

Type definition for resource access check.

The function is called with the complete path and the standard lexeme as value in front of each wrte of data to the CLP structure.

Parameters
[in]pvGblPointer to to the global handle as black box given with CleExecute
[in]pvHdlPointer to a handle given for this callback
[in]pcValPath=Value as resource
Returns
0 if write allowed else a authorization error

◆ TfClpPrintPage

typedef int() TfClpPrintPage(void *pvHdl, const int siLev, const char *pcHdl, const char *pcPat, const char *pcFil, const char *pcOrg, const char *pcPge)

Function 'prnHtmlDoc' of library 'libhtmldoc' called if built-in function HTMLDOC used.

The built-in function HTMLDOC use a service provider interface to create the documentation using a callback function for each page/chapter. This is this callback function. This interface is used with the function siClpPrintDocu() below. The function is called for each page/chapter and the pointer to the original manual page (pcOrg) can be used to determine if this page the first time printed or if the same page printed again. The HTML documentation can now use an link instead to print the same page again to reduce memory and redundancies in the document. The level can be used to insert Headlines to a dictionary, the path shows the real position and can be used to build files names. The path starts always with CLEP followed by COMMAND or OTHERCLP depending which tables are used. This prefix ensures uniqueness if it used for the file names. prepared page is in ASCIIDOC and must be converted to HTML. In this case the headline must be provided for the dictionary, the index terms for the index and other information can be used to build a very powerful HTML documentation.

Parameters
[in,out]pvHdlHandle for the print callback function (e.G. from opnHtmlDoc)
[in]siLevThe hierarchical level for this page/chapter
[in]pcHdlThe headline of the current chapter
[in]pcPatThe path for the corresponding parameter (NULL if the page not inside a command or other CLP string)
[in]pcFilUnique hierarchical string (can be used as file name (no extension))
[in]pcOrgThe pointer to the original manual page (can be used to determine duplicates and produce links)
[in]pcPgeThe prepared ASCIIDOC page for printing (must be converted to HTML)
Returns
Return code (0 is OK else error)