--- libaitio/src/aitio.c 2012/05/23 13:53:00 1.10.6.4 +++ libaitio/src/aitio.c 2012/08/02 00:47:47 1.12 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.c,v 1.10.6.4 2012/05/23 13:53:00 misho Exp $ +* $Id: aitio.c,v 1.12 2012/08/02 00:47:47 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -108,11 +108,7 @@ io_mm_inuse() void _init() { -#ifdef USE_MPOOL ioLibInit(IO_MPOOL, 0); -#else - ioLibInit(IO_SYSM, 0); -#endif } // fini libaitio routine @@ -171,7 +167,7 @@ inline void ioLibFini() { switch (use_mm) { - case 1: + case IO_MPOOL: mpool_destroy(&io_mpool); io_malloc = malloc; @@ -412,7 +408,7 @@ ioRegexGet(const char *csRegex, const char *csData, ch * @csRegex = Regulare expression pattern * @csData = Source data * @csNew = Data for replace - * return: NULL not match or error; !=NULL allocated new string, must be xfree after use! + * return: NULL not match or error; !=NULL allocated new string, must be io_free after use! */ char * ioRegexReplace(const char *csRegex, const char *csData, const char *csNew) @@ -428,7 +424,7 @@ ioRegexReplace(const char *csRegex, const char *csData // ___ before match len = sp + 1; - str = xmalloc(len); + str = io_malloc(len); if (!str) { LOGERR; return NULL; @@ -437,7 +433,7 @@ ioRegexReplace(const char *csRegex, const char *csData // * replace match * if (csNew) { len += strlen(csNew); - str = xrealloc(str, len); + str = io_realloc(str, len); if (!str) { LOGERR; return NULL; @@ -446,7 +442,7 @@ ioRegexReplace(const char *csRegex, const char *csData } // after match ___ len += strlen(csData) - ep; - str = xrealloc(str, len); + str = io_realloc(str, len); if (!str) { LOGERR; return NULL; @@ -460,7 +456,7 @@ ioRegexReplace(const char *csRegex, const char *csData * ioStrAst() - Function for evaluate string like asterisk variable "{text[:[-]#[:#]]}" * * @csString = Input string - * return: NULL error, !=NULL Allocated new string evaluated from input string, must be xfree() + * return: NULL error, !=NULL Allocated new string evaluated from input string, must be io_free() */ char * ioStrAst(const char *csString) @@ -478,7 +474,7 @@ ioStrAst(const char *csString) io_Errno = EINVAL; return NULL; } else { - str = strdup(strchr(csString, '{') + 1); + str = io_strdup(strchr(csString, '{') + 1); *strrchr(str, '}') = 0; } @@ -500,8 +496,8 @@ ioStrAst(const char *csString) /* ok, clear show */ ext = str; - out = strdup(ext); - xfree(str); + out = io_strdup(ext); + io_free(str); return out; } @@ -523,7 +519,7 @@ ioMkDir(const char *csDir, int mode) if (!csDir) return cx; - str = strdup(csDir); + str = io_strdup(csDir); if (!str) { LOGERR; return cx; @@ -551,7 +547,7 @@ ioMkDir(const char *csDir, int mode) } end: chdir(szOld); - xfree(str); + io_free(str); return cx; }