version 1.1.2.1, 2010/03/02 15:10:19
|
version 1.1.2.2, 2010/03/02 16:45:23
|
Line 113 int ioURLGet(const char *csURL, struct tagIOURL *url)
|
Line 113 int ioURLGet(const char *csURL, struct tagIOURL *url)
|
|
|
return ret; |
return ret; |
} |
} |
|
|
|
/* |
|
* io_MakeArray() Parse and make array of arguments values |
|
* @psArgs = Input arguments line ... (will be destroed after procced function!) |
|
* @csDelim = Delimiter(s) for separate |
|
* @args = Output array of arguments |
|
* @nargs = Requested count of arguments |
|
* return: 0 error format; -1 error:: can`t read; >0 ok, number of readed items |
|
*/ |
|
int io_MakeArray(char * __restrict psArgs, const char *csDelim, char *** __restrict args, int nargs) |
|
{ |
|
char **app; |
|
register int i; |
|
|
|
if (!psArgs || !args || !nargs) |
|
return -1; |
|
if (!(*args = malloc(sizeof(char*) * nargs))) { |
|
LOGERR; |
|
return -1; |
|
} else |
|
memset(*args, 0, sizeof(char*) * nargs); |
|
|
|
for (i = 0, app = *args; app < *args + nargs && (*app = strsep(&psArgs, csDelim)); |
|
**app ? i++ : i, **app ? app++ : app); |
|
return i; |
|
} |