/* 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_HC=12440211096131f5976d36be0cddca4cd9152e45 */ #ifndef librock_INC_PARSE_H #define librock_INC_PARSE_H #include #ifdef librock_USESTRICMP #ifndef librock_INC_string_HAS_stricmp #define librock_INC_string_HAS_stricmp 1 #endif #endif #ifdef librock_INC_string_HAS_stricmp #define librock_strcasecmp stricmp #define librock_strncasecmp strnicmp #define librock_stricmp stricmp #define librock_strnicmp strnicmp #else #define librock_strcasecmp strcasecmp #define librock_strncasecmp strncasecmp #define librock_stricmp strcasecmp #define librock_strnicmp 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_base64encN(char *wptr, long *paccum, const char *ptr, int amt); int librock_base64dec(const char *wptr,char *optr); int librock_base64decN(const char *wptr, int amt, char *optr); /**************************************************************/ void librock_bits_from_ASCIIart(char * pdest, const char * psrc, int cnt); /**************************************************************/ #ifdef librock_EXPERIMENTAL_c_parse_x001 int librock_c_parse_x001(const char *src, int len, int *parsestate, const char * *toktype); #endif /**************************************************************/ #ifdef __cplusplus }; #endif /**************************************************************/ #include #endif /* $Log: parse.h,v $ Revision 1.4 2002/02/10 03:41:01 forrest@mibsoftware.com rights=#1 [librock_EXPERIMENTAL_rctoken] const correctness in parameter Revision 1.3 2002/02/10 02:59:08 forrest@mibsoftware.com rights=#1 EXPERIMENTAL bracketing of rctoken. Standardized chg log. Revision 1.2 2002/01/29 04:40:03 forrest@mibsoftware.com rights=#1 Prep for publish. API clean up, TAB, space at eol removal Revision 1.1 2001/01/06 19:36:17 forrest@mibsoftware.com rights=#1 Initial import to CVS rights#1 Copyright (c) Forrest J Cavalier III d-b-a Mib Software rights#1 License text in librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45 */