--- libaitio/inc/aitio.h 2010/02/23 22:54:52 1.1.1.1 +++ libaitio/inc/aitio.h 2010/03/04 08:10:57 1.1.1.1.2.3 @@ -3,13 +3,32 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.h,v 1.1.1.1 2010/02/23 22:54:52 misho Exp $ +* $Id: aitio.h,v 1.1.1.1.2.3 2010/03/04 08:10:57 misho Exp $ * *************************************************************************/ #ifndef __AITIO_H #define __AITIO_H +typedef struct _tagURLItem { + int vallen; + char *value; +} url_Item_t; + +struct tagIOURL { + unsigned char url_line[BUFSIZ]; + + url_Item_t url_tech; + url_Item_t url_user; + url_Item_t url_pass; + url_Item_t url_host; + url_Item_t url_port; + url_Item_t url_path; + url_Item_t url_args; + + char *url_reserved; +}; + // io_GetErrno() Get error code of last operation inline int io_GetErrno(); // io_GetError() Get error text of last operation @@ -62,6 +81,25 @@ int ioRegexGet(const char *csRegex, const char *csData * return: NULL not match or error; !=NULL allocated new string, must be free after use! */ char *ioRegexReplace(const char *csRegex, const char *csData, const char *csNew); + +/* + * io_MakeArray() Parse and make array of arguments values + * @psArgs = Input arguments line + * @csDelim = Delimiter(s) for separate + * @args = Output array of arguments ... (must be free() after procced function!) + * @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); + +/* + * ioURLGet() Parse and get data from input URL + * @csURL = Input URL line + * @url = Output parsed URL + * return: 0 error format not find tech:// and return URL like path; + -1 error:: can`t read; >0 ok, up bits for known elements +*/ +int ioURLGet(const char *csURL, struct tagIOURL *url); #endif