--- libaitio/example/test.c 2010/03/02 15:10:19 1.1.1.1.2.1 +++ libaitio/example/test.c 2010/03/04 09:54:23 1.1.1.1.2.3 @@ -37,6 +37,8 @@ int main(int argc, char **argv) if (argc > 1) { struct tagIOURL URL; int ret = 0; + char **item = NULL; + char szVal[BUFSIZ]; printf("URL:: Return=%x --- URL=%s\n", (ret = ioURLGet(argv[1], &URL)), argv[1]); @@ -49,6 +51,27 @@ int main(int argc, char **argv) printf("URL:: (%x) path=%s(%d)\n", ret & 32, URL.url_path.value, URL.url_path.vallen); printf("URL:: (%x) args=%s(%d)\n", ret & 64, URL.url_args.value, URL.url_args.vallen); printf("URL:: (%x) +++reserved=%s\n", ret & 128, URL.url_reserved); + + printf("URL:: Get sizeofArray=%d\n", io_SizeArray(URL.url_args.value, "&")); + + printf("Get_url:: %s Attribute=piuk %d\n", szVal, ioURLGetValue(&URL, "piuk", szVal, BUFSIZ)); + printf("Get_url:: %s Attribute=sg %d\n", szVal, ioURLGetValue(&URL, "sg", szVal, BUFSIZ)); + printf("Get_url:: %s Attribute=sgg %d\n", szVal, ioURLGetValue(&URL, "sgg", szVal, BUFSIZ)); + printf("Get_url:: %s Attribute=sfsf %d\n", szVal, ioURLGetValue(&URL, "sfsf", NULL, BUFSIZ)); + printf("Get_url:: %s Attribute=vv %d\n", szVal, ioURLGetValue(&URL, "vv", NULL, 0)); + printf("Get_url:: %s Attribute=vv %d\n", szVal, ioURLGetValue(&URL, "vv", szVal, BUFSIZ)); + + printf("URL:: array args=%d\n", io_MakeArray(URL.url_args.value, "&", &item, 4)); + for (ret = 0; ret < 4 && item; ret++) + printf("array:: item[%d]=%s\n", ret, item[ret]); + if (item) + free(item); + + printf("URL:: array path=%d\n", io_MakeArray(URL.url_path.value, "/", &item, 2)); + for (ret = 0; ret < 2 && item; ret++) + printf("array:: item[%d]=%s\n", ret, item[ret]); + if (item) + free(item); } return 0; }