/* librock/astring.h version 1998.07.20 - - - - - - - - - - - - Copyright Notice - - - - - - - - - - - - Copyright 1998 Forrest J. Cavalier III See http://www.mibsoftware.com/librock/ for documentation and original copies of this software. This software shall be distributed with the implementation source code librock/parse/astring.c, according to the librock license terms therein. License text in librock_LIDESC_MD5=f2a00374df769e694451262ac9df1336 */ /**************************************************************/ #ifndef librock_INC_ASTRING_H #define librock_INC_ASTRING_H #ifdef librock_ENABLE_FULLDECL /* librock Full feature declarations. Useful rarely. - Declarations with pointer types. - Declarations selectable function by function. - Optional declaration of test/trace wrapper functions - Function type declaration macros */ #include #else #include /*#include */ #ifndef librock_ISOLATED /*#include */ /* Declares the FILE * for afgets() */ #endif #ifdef __cplusplus extern "C" { #endif /* Equivalents to strcpy() and strncpy() */ char *librock_astrcpy(char **ppasz,const char *pSrc); #ifdef librock_SIZE_T char *librock_astrcpyX(char **ppasz,const char *pSrc,void *(*reallocfn)(void *,librock_SIZE_T)); #endif char *librock_astrn0cpy(char **ppasz,const char *pSrc,int n); #ifdef librock_SIZE_T char *librock_astrn0cpyX(char **ppasz,const char *pSrc,int n,void *(*reallocfn)(void *,librock_SIZE_T)); #endif /* NOTE: astrn0cpy Always stores the ending \0 */ /* Equivalents to strcat() and strncat() */ char *librock_astrcat(char **ppasz, const char *pszSrc); #ifdef librock_SIZE_T char *librock_astrcatX(char **ppasz,const char*pszSrc,void *(*reallocfn)(void *,librock_SIZE_T)); #endif char *librock_astrn0cat(char **ppasz,const char *pSrc,int n); #ifdef librock_SIZE_T char *librock_astrn0catX(char **ppasz,const char *pSrc,int n,void *(*reallocfn)(void *,librock_SIZE_T)); #endif /* Non-fixed buffer size line reads */ #ifdef librock_FILE char *librock_afgets(char **ppasz,librock_FILE *f); #ifdef librock_SIZE_T char*librock_afgetsX(char **ppasz,librock_FILE *f,void *(*reallocfn)(void *,librock_SIZE_T)); #endif int librock_afgettoch(char **ppasz,librock_FILE *f,char chStop); #ifdef librock_SIZE_T int librock_afgettochX(char **ppasz,librock_FILE *f,char chStop,void *(*reallocfn)(void *,librock_SIZE_T)); #endif #endif /* Cleanup. */ void librock_astrfree(char **ppasz); #ifdef librock_SIZE_T void librock_astrfreeX(char **ppsz,void *(*reallocfn)(void *,librock_SIZE_T)); #endif /* Ensure there is space for working */ char *librock_astrensure(char **ppasz,int len); #ifdef librock_SIZE_T char *librock_astrensureX(char **ppasz,int len,void *(*reallocfn)(void *,librock_SIZE_T)); #endif /* realloc() so there is no wasted space. Note: not an astring anymore. */ char *librock_astrstatic(char **ppasz); #ifdef librock_SIZE_T char *librock_astrstaticX(char **ppasz,void *(*reallocfn)(void *,librock_SIZE_T)); #endif #ifdef __cplusplus }; #endif #include #endif /* Full declaration check */ #endif /* Recursive-include check */