/* Header file for RocketAware High Reuse High Compatibility Library librock/parse.h - - - - - - - - - - - - Copyright Notice - - - - - - - - - - - - Copyright 1998-2000 Forrest J. Cavalier III See http://www.rocketaware.com/librock/ for documentation and original copies of this software. This software shall be distributed with the implementation source code according to the license terms therein. License text in librock_LIDESC_MD5=f2a00374df769e694451262ac9df1336 */ #ifndef librock_INC_PARSE_H #define librock_INC_PARSE_H #include #ifdef librock_USESTRICMP #define librock_strcasecmp stricmp #define librock_strncasecmp strnicmp #else #define librock_strcasecmp strcasecmp #define librock_strncasecmp strncasecmp #endif #ifdef __cplusplus extern "C" { #endif /******************************/ /* librock String Comparison, Parsing */ /* Modified versions of strcmp */ int librock_wordcmp(const char *s1,const char *s2); int librock_wordcasecmp(const char *word,const char *lcword); /* Modified version of strncpy, always stores \0, which could be at s1+len, so plan for it! */ char *librock_strn0cpy(char *s1,const char *s2,int len); int librock_BTSinlist(const char *bts,const char *list); /**************************************************************/ char *librock_stristr(const char *pMem,const char *pszFind); char *librock_memistr(const char *pMem,const char *pszFind,int cbMem); /**************************************************************/ /* librock String Counting Functions */ int librock_counttowh(const char *psz); /* counts consecutive non-blank characters (ASCII > ' ') */ int librock_countbl(const char *psz); /* counts consecutive blank characters \t ' ' */ int librock_countln(const char *psz); /* char count up to and including next \0 or \n */ int librock_counttoeol(const char *psz); /* char count up to but not including next \0 \n or \r */ int librock_counttoch(const char *psz,char ch); /* char count up to but not including next \0 or ch */ int librock_counttochn(const char *pStart,char ch,int n); /* char count up to but not including next \0 or nth ch */ int librock_countCid(const char *psz); /* count C language identifiers, (consecutive characters in set [A-Za-z0-9_] ) */ /**************************************************************/ /**************************************************************/ /* `librock String Scan and Conversion Functions` */ /* [Copies must retain this block. Copyright 1998-2000, Forrest J. Cavalier III d-b-a Mib Software BSD-ish license: http://www.mibsoftware.com/librock/license/ Docs & original: http://www.mibsoftware.com/librock/ ]*/ int librock_sscons(const char *psz, int radix, int *piResult); int librock_ssconsl(const char *psz, int radix, long *plResult); int librock_ssdec(const char *psz,int *piResult); int librock_sscharbe(const char *,char *pchResult); char *librock_decodeCBE(char *pszBackslashEscaped,int *pcb); int librock_ssmonth(const char *sptr,int *piMonth); /**************************************************************/ /**************************************************************/ int librock_ssfloat(const char *,float *); int librock_ssdouble(const char *,double *); /**************************************************************/ char *librock_replacetabs(char * *ppasz,int tabspacing); /**************************************************************/ int librock_base64enc(char *wptr,long *paccum,int ch); int librock_base64dec(const char *wptr,char *optr); /**************************************************************/ void librock_bits_from_ASCIIart(char * pdest, const char * psrc, int cnt); /**************************************************************/ int librock_c_parse(const char *src, int len, int *parsestate, char * *toktype); /**************************************************************/ #ifdef __cplusplus }; #endif /**************************************************************/ #include #endif