Diff for /libaitio/example/test.c between versions 1.2 and 1.5

version 1.2, 2010/03/09 09:26:27 version 1.5, 2011/04/20 22:56:32
Line 36  int main(int argc, char **argv) Line 36  int main(int argc, char **argv)
         }          }
   
         if (argc > 2) {          if (argc > 2) {
                   char *s1, *s2;
   
                   s1 = io_Ch2Hex("PIUK_GN IAH", 256);
                   s2 = io_Hex2Ch((unsigned char*) s1, strlen(s1));
                   printf("S1=%s S2=%s\n", s1, s2);
                   free(s2);
                   free(s1);
   
                   printf( "1=%d\n", io_LTrimStr(argv[1]));
                   printf( "2=%d\n", io_RTrimStr(argv[2]));
                   printf( "3=%d\n", io_TrimStr(argv[3]));
                   printf("'%s' '%s' '%s'\n", argv[1], argv[2], argv[3]);
                 printf("test p=%s f=%s path2file=%d\n", s0[0], s0[1], io_Path2File(argv[2], s0[0], 256, s0[1], 256));                  printf("test p=%s f=%s path2file=%d\n", s0[0], s0[1], io_Path2File(argv[2], s0[0], 256, s0[1], 256));
                 return 0;                  return 0;
         }          }
Line 43  int main(int argc, char **argv) Line 55  int main(int argc, char **argv)
         if (argc > 1) {          if (argc > 1) {
                 struct tagIOURL URL;                  struct tagIOURL URL;
                 int ret = 0;                  int ret = 0;
                char **item = NULL;                array_t *item = NULL;
                 char szVal[BUFSIZ];                  char szVal[BUFSIZ];
   
                 printf("URL:: Return=%x --- URL=%s\n", (ret = ioURLGet(argv[1], &URL)), argv[1]);                  printf("URL:: Return=%x --- URL=%s\n", (ret = ioURLGet(argv[1], &URL)), argv[1]);
Line 58  int main(int argc, char **argv) Line 70  int main(int argc, char **argv)
                 printf("URL:: (%x) args=%s(%d)\n", ret & 64, URL.url_args.value, URL.url_args.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:: (%x) +++reserved=%s\n", ret & 128, URL.url_reserved);
   
                printf("URL:: Get sizeofArray=%d\n", io_SizeArray(URL.url_args.value, "&"));                printf("URL:: Get argsNum=%d\n", io_argsNum(URL.url_args.value, "&"));
   
                 memset(szVal, 0, BUFSIZ);                  memset(szVal, 0, BUFSIZ);
                 printf("Get_url:: %s Attribute=piuk %d\n", szVal, ioURLGetValue(&URL, "piuk", szVal, BUFSIZ));                  printf("Get_url:: %s Attribute=piuk %d\n", szVal, ioURLGetValue(&URL, "piuk", szVal, BUFSIZ));
Line 70  int main(int argc, char **argv) Line 82  int main(int argc, char **argv)
   
                 printf("File_url:: File=%s %d\n", szVal, ioURLGetFile(&URL, szVal, BUFSIZ));                  printf("File_url:: File=%s %d\n", szVal, ioURLGetFile(&URL, szVal, BUFSIZ));
   
                printf("URL:: array args=%d\n", io_MakeArray(URL.url_args.value, "&", &item, 4));                printf("URL:: array args=%d\n", io_arrayMake(URL.url_args.value, 4, "&", &item));
                for (ret = 0; ret < 4 && item; ret++)                for (ret = 0; ret < 4 && item->arr_data[ret]; ret++)
                        printf("array:: item[%d]=%s\n", ret, item[ret]);                        printf("array:: item[%d]=%s\n", ret, item->arr_data[ret]);
                 if (item)                  if (item)
                        free(item);                        io_arrayDestroy(&item);
   
                printf("URL:: array path=%d\n", io_MakeArray(URL.url_path.value, "/", &item, 2));                printf("URL:: array path=%d\n", io_arrayMake(URL.url_path.value, 2, "/", &item));
                for (ret = 0; ret < 2 && item; ret++)                for (ret = 0; ret < 2 && item->arr_data[ret]; ret++)
                        printf("array:: item[%d]=%s\n", ret, item[ret]);                        printf("array:: item[%d]=%s\n", ret, item->arr_data[ret]);
                 if (item)                  if (item)
                        free(item);                        io_arrayDestroy(&item);
         }          }
         return 0;          return 0;
 }  }

Removed from v.1.2  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>