FLAMCLE/P-API
Command Line Executor/Parser Application Programming Interface
FLAMCLP.h
Go to the documentation of this file.
1 /**********************************************************************
2  * @file FLAMCLP.h
3  * @brief Definitions for <b>C</b>ommand <b>L</b>ine <b>P</b>arsing
4  * @author limes datentechnik gmbh
5  * @date 26.01.2017
6  * @copyright (c) 2017 limes datentechnik gmbh
7  *
8  * This software is provided 'as-is', without any express or implied
9  * warranty. In no event will the authors be held liable for any damages
10  * arising from the use of this software.
11  *
12  * Permission is granted to anyone to use this software for any purpose,
13  * including commercial applications, and to alter it and redistribute
14  * it freely, subject to the following restrictions:
15  * 1. The origin of this software must not be misrepresented; you must
16  * not claim that you wrote the original software. If you use this
17  * software in a product, an acknowledgment in the product
18  * documentation would be appreciated but is not required.
19  * 2. Altered source versions must be plainly marked as such, and must
20  * not be misrepresented as being the original software.
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  *
24  * If you need professional services or support for this library please
25  * contact support@flam.de.
26  *
27  **********************************************************************/
28 
30 #ifdef __cplusplus
31  extern "C" {
32 #endif
33 
34 #ifndef INC_CLP_H
35 #define INC_CLP_H
36 
38 #include <stdio.h>
39 #include "CLPDEF.h"
40 
41 /**********************************************************************/
43 #ifdef __HOSTSHORTING__
44  #define pcClpVersion FLCLPVSN
45  #define pcClpAbout FLCLPABO
46  #define pvClpOpen FLCLPOPN
47  #define siClpParsePro FLCLPRSP
48  #define siClpParseCmd FLCLPRSC
49  #define siClpProperties FLCLPPRO
50  #define siClpSyntax FLCLPSYN
51  #define siClpHelp FLCLPHLP
52  #define siClpDocu FLCLPDOC
53  #define siClpPrint FLCLPPRN
54  #define siClpLexemes FLCLPLEX
55  #define siClpGrammar FLCLPGRM
56  #define vdClpClose FLCLPCLS
57  #define pcClpError FLCLPERR
58 #endif
59 
60 /**********************************************************************/
61 
85 extern const char* pcClpVersion(const int l, const int s, char* b);
86 
104 extern const char* pcClpAbout(const int l, const int s, char* b);
105 
145 extern void* pvClpOpen(
146  const int isCas,
147  const int isPfl,
148  const int isEnv,
149  const int siMkl,
150  const char* pcOwn,
151  const char* pcPgm,
152  const char* pcBld,
153  const char* pcCmd,
154  const char* pcMan,
155  const char* pcHlp,
156  const int isOvl,
157  const TsClpArgument* psTab,
158  void* pvDat,
159  FILE* pfHlp,
160  FILE* pfErr,
161  FILE* pfSym,
162  FILE* pfScn,
163  FILE* pfPrs,
164  FILE* pfBld,
165  const char* pcDep,
166  const char* pcOpt,
167  const char* pcEnt,
168  TsClpError* psErr,
169  void* pvGbl,
170  void* pvF2S,
171  TfF2S* pfF2S,
172  void* pvSaf,
173  TfSaf* pfSaf);
174 
182 extern void vdClpReset(
183  void* pvHdl);
184 
203 extern int siClpParsePro(
204  void* pvHdl,
205  const char* pcSrc,
206  const char* pcPro,
207  const int isChk,
208  char** ppLst);
209 
226 extern int siClpParseCmd(
227  void* pvHdl,
228  const char* pcSrc,
229  const char* pcCmd,
230  const int isChk,
231  const int isPwd,
232  int* piOid,
233  char** ppLst);
234 
248 extern int siClpSyntax(
249  void* pvHdl,
250  const int isSkr,
251  const int isMin,
252  const int siDep,
253  const char* pcPat);
254 
255 
264 extern const char* pcClpInfo(
265  void* pvHdl,
266  const char* pcPat);
267 
281 extern int siClpHelp(
282  void* pvHdl,
283  const int siDep,
284  const char* pcPat,
285  const int isAli,
286  const int isMan);
287 
339 extern int siClpDocu(
340  void* pvHdl,
341  FILE* pfDoc,
342  const char* pcPat,
343  const char* pcNum,
344  const char* pcKnd,
345  const int isCmd,
346  const int isDep,
347  const int isMan,
348  const int isAnc,
349  const int isNbr,
350  const int isIdt,
351  const int isPat,
352  const unsigned int uiLev);
353 
380 extern int siClpPrint(
381  void* pvHdl,
382  const char* pcFil,
383  const char* pcNum,
384  const char* pcKnd,
385  const int isCmd,
386  const int isDep,
387  const int isAnc,
388  const int isNbr,
389  const int isShl,
390  const int isIdt,
391  const int isPat,
392  const unsigned int uiLev,
393  const int siPs1,
394  const int siPs2,
395  const int siPr3,
396  void* pvPrn,
397  TfClpPrintPage* pfPrn);
398 
399 
413 extern int siClpProperties(
414  void* pvHdl,
415  const int siMtd,
416  const int siDep,
417  const char* pcPat,
418  FILE* pfOut);
419 
430 extern int siClpLexemes(
431  void* pvHdl,
432  FILE* pfOut);
433 
444 extern int siClpGrammar(
445  void* pvHdl,
446  FILE* pfOut);
447 
464 extern void vdClpClose(
465  void* pvHdl,
466  const int siMtd);
467 
484 extern void* pvClpAlloc(
485  void* pvHdl,
486  void* pvPtr,
487  int siSiz,
488  int* piInd);
489 
497 extern char* pcClpError(
498  int siErr);
499 
501 /**********************************************************************/
502 
515 extern int siClpSymbolTableWalk(
516  void* pvHdl,
517  const unsigned int uiOpr,
518  TsClpSymWlk* psSym);
519 
530 extern int siClpSymbolTableUpdate(
531  void* pvHdl,
532  TsClpSymUpd* psSym);
533 
534 /**********************************************************************/
535 
536 #endif // INC_FLAMCLP_H
537 
538 #ifdef __cplusplus
539 }
540 #endif
541 
vdClpReset
void vdClpReset(void *pvHdl)
Reset command line parser.
pcClpVersion
const char * pcClpVersion(const int l, const int s, char *b)
Get version information.
siClpPrint
int siClpPrint(void *pvHdl, const char *pcFil, const char *pcNum, const char *pcKnd, const int isCmd, const int isDep, const int isAnc, const int isNbr, const int isShl, const int isIdt, const int isPat, const unsigned int uiLev, const int siPs1, const int siPs2, const int siPr3, void *pvPrn, TfClpPrintPage *pfPrn)
Generate documentation using a callback function.
siClpDocu
int siClpDocu(void *pvHdl, FILE *pfDoc, const char *pcPat, const char *pcNum, const char *pcKnd, const int isCmd, const int isDep, const int isMan, const int isAnc, const int isNbr, const int isIdt, const int isPat, const unsigned int uiLev)
Generate documentation for command line syntax.
pvClpAlloc
void * pvClpAlloc(void *pvHdl, void *pvPtr, int siSiz, int *piInd)
Allocate memory in CLP structure.
TfF2S
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.
Definition: CLPDEF.h:466
siClpGrammar
int siClpGrammar(void *pvHdl, FILE *pfOut)
Print the grammar of the command line compiler.
pcClpAbout
const char * pcClpAbout(const int l, const int s, char *b)
Get about information.
siClpSyntax
int siClpSyntax(void *pvHdl, const int isSkr, const int isMin, const int siDep, const char *pcPat)
Print command line syntax.
TfSaf
int() TfSaf(void *pvGbl, void *pvHdl, const char *pcVal)
Type definition for resource access check.
Definition: CLPDEF.h:486
siClpLexemes
int siClpLexemes(void *pvHdl, FILE *pfOut)
Print the lexems of the command line compiler.
TfClpPrintPage
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.
Definition: CLPDEF.h:516
siClpParseCmd
int siClpParseCmd(void *pvHdl, const char *pcSrc, const char *pcCmd, const int isChk, const int isPwd, int *piOid, char **ppLst)
Parse the command line.
CLPDEF.h
Definitions for Command Line Parsing.
pcClpInfo
const char * pcClpInfo(void *pvHdl, const char *pcPat)
Give help message for given path.
pcClpError
char * pcClpError(int siErr)
Provides error message.
vdClpClose
void vdClpClose(void *pvHdl, const int siMtd)
Close the command line parser.
pvClpOpen
void * pvClpOpen(const int isCas, const int isPfl, const int isEnv, const int siMkl, const char *pcOwn, const char *pcPgm, const char *pcBld, const char *pcCmd, const char *pcMan, const char *pcHlp, const int isOvl, const TsClpArgument *psTab, void *pvDat, FILE *pfHlp, FILE *pfErr, FILE *pfSym, FILE *pfScn, FILE *pfPrs, FILE *pfBld, const char *pcDep, const char *pcOpt, const char *pcEnt, TsClpError *psErr, void *pvGbl, void *pvF2S, TfF2S *pfF2S, void *pvSaf, TfSaf *pfSaf)
Open command line parser.
ClpArgument
Table structure for arguments.
Definition: CLPDEF.h:271
siClpParsePro
int siClpParsePro(void *pvHdl, const char *pcSrc, const char *pcPro, const int isChk, char **ppLst)
Parse the property list.
siClpProperties
int siClpProperties(void *pvHdl, const int siMtd, const int siDep, const char *pcPat, FILE *pfOut)
Generate properties.
ClpError
Defines a structure with error information.
Definition: CLPDEF.h:133
siClpHelp
int siClpHelp(void *pvHdl, const int siDep, const char *pcPat, const int isAli, const int isMan)
Print help for command line syntax.