|
|
| version 1.9.6.2, 2012/05/23 14:06:08 | version 1.10.6.2, 2012/07/30 10:55:51 |
|---|---|
| Line 571 io_MakeAV(const char * __restrict csArgs, const char * | Line 571 io_MakeAV(const char * __restrict csArgs, const char * |
| return ret; | return ret; |
| } | } |
| /* | |
| * io_MakeAV2() Parse and make attribute/value pair over input string | |
| * | |
| * @csArgs = Input argument line, will be modified! | |
| * @csDelim = Delimiter for separate | |
| * @psAttr = Output Attribute | |
| * @psValue = Output Value, if ==NULL this element not present value or not wanted for return | |
| * return: 0 error format; -1 error:: can`t read; >0 ok, number of readed items | |
| */ | |
| int | |
| io_MakeAV2(char * __restrict psArgs, const char *csDelim, | |
| char * __restrict psAttr, char * __restrict psValue) | |
| { | |
| register int ret = 0; | |
| char *pos; | |
| if (!psArgs || !csDelim) | |
| return -1; | |
| pos = strpbrk(psArgs, csDelim); | |
| if (pos) | |
| *pos++ = 0; | |
| ret++; | |
| if (psAttr) | |
| psAttr = psArgs; | |
| if (psValue) { | |
| if (pos && *pos) { | |
| ret++; | |
| psValue = pos; | |
| } else | |
| psValue = NULL; | |
| } | |
| return ret; | |
| } |