version 1.1.1.1.2.2, 2010/03/02 16:45:23
|
version 1.5.14.1, 2012/03/10 15:06:17
|
Line 1
|
Line 1
|
#include <stdio.h> |
#include <stdio.h> |
|
#include <string.h> |
#include <aitio.h> |
#include <aitio.h> |
|
|
|
|
int main(int argc, char **argv) |
int main(int argc, char **argv) |
{ |
{ |
int ret; |
int ret; |
char str[256], *s; | char str[256], *s, s0[2][256]; |
|
|
if (argc < 2) { |
if (argc < 2) { |
printf("std:: %s ioPromptRead(NULL) -> %d\n", str, ioPromptRead(NULL, NULL, str, 256)); |
printf("std:: %s ioPromptRead(NULL) -> %d\n", str, ioPromptRead(NULL, NULL, str, 256)); |
Line 34 int main(int argc, char **argv)
|
Line 35 int main(int argc, char **argv)
|
free(s); |
free(s); |
} |
} |
|
|
if (argc > 1) { | if (argc > 2) { |
struct tagIOURL URL; | char *s1, *s2; |
int ret = 0; | |
char **item = NULL; | |
|
|
printf("URL:: Return=%x --- URL=%s\n", (ret = ioURLGet(argv[1], &URL)), argv[1]); | 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("URL:: (%x) ***Line=%s\n", ret, URL.url_line); | printf( "1=%d\n", io_LTrimStr(argv[1])); |
printf("URL:: (%x) tech=%s(%d)\n", ret & 1, URL.url_tech.value, URL.url_tech.vallen); | printf( "2=%d\n", io_RTrimStr(argv[2])); |
printf("URL:: (%x) user=%s(%d)\n", ret & 2, URL.url_user.value, URL.url_user.vallen); | printf( "3=%d\n", io_TrimStr(argv[3])); |
printf("URL:: (%x) pass=%s(%d)\n", ret & 4, URL.url_pass.value, URL.url_pass.vallen); | printf("'%s' '%s' '%s'\n", argv[1], argv[2], argv[3]); |
printf("URL:: (%x) host=%s(%d)\n", ret & 8, URL.url_host.value, URL.url_host.vallen); | printf("test p=%s f=%s path2file=%d\n", s0[0], s0[1], io_Path2File(argv[2], s0[0], 256, s0[1], 256)); |
printf("URL:: (%x) port=%s(%d)\n", ret & 16, URL.url_port.value, URL.url_port.vallen); | return 0; |
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:: 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; |
return 0; |
} |
} |