version 1.3.4.1, 2012/07/31 15:19:11
|
version 1.4.4.2, 2012/08/29 13:30:28
|
Line 23 makevars()
|
Line 23 makevars()
|
printf("Variable is empty? %d\n", AIT_ISEMPTY(v)); |
printf("Variable is empty? %d\n", AIT_ISEMPTY(v)); |
io_freeVar(&v); |
io_freeVar(&v); |
v = io_makeVar(ptr, 0x12345678, 42); |
v = io_makeVar(ptr, 0x12345678, 42); |
printf("Variable is ptr=%p\n", AIT_GET_PTR(v)); | printf("Variable is ptr=%p len=%u\n", AIT_GET_PTR(v), AIT_LEN(v)); |
io_freeVar(&v); |
io_freeVar(&v); |
v = io_makeVar(data, "TEST DATA !!!", 14); |
v = io_makeVar(data, "TEST DATA !!!", 14); |
printf("Variable is data=%s\n", AIT_GET_DATA(v)); | printf("Variable is data=%s len=%u\n", AIT_GET_DATA(v), AIT_LEN(v)); |
io_freeVar(&v); |
io_freeVar(&v); |
v = io_makeVar(buffer, "TEST Buffer !!!", 16); |
v = io_makeVar(buffer, "TEST Buffer !!!", 16); |
printf("Variable is buf=%s\n", AIT_GET_BUF(v)); | printf("Variable is buf=%s len=%u\n", AIT_GET_BUF(v), AIT_LEN(v)); |
io_freeVar(&v); |
io_freeVar(&v); |
v = io_makeVar(string, "TEST String ..."); |
v = io_makeVar(string, "TEST String ..."); |
printf("Variable is str=%s\n", AIT_GET_STR(v)); | printf("Variable is str=%s len=%u\n", AIT_GET_STR(v), AIT_LEN(v)); |
io_freeVar(&v); |
io_freeVar(&v); |
v = io_makeVar(blob, 1234, 10000); |
v = io_makeVar(blob, 1234, 10000); |
printf("Variable is blob=%s len=%u\n", AIT_GET_BLOB(v), AIT_LEN(v)); | printf("Variable is blob=%u len=%u\n", AIT_GET_BLOB(v), AIT_LEN(v)); |
io_freeVar(&v); |
io_freeVar(&v); |
v = io_makeVar(f32, 1.0123); |
v = io_makeVar(f32, 1.0123); |
printf("Variable is f32=%f\n", AIT_GET_F32(v)); |
printf("Variable is f32=%f\n", AIT_GET_F32(v)); |
Line 76 main(int argc, char **argv)
|
Line 76 main(int argc, char **argv)
|
ait_val_t *v; |
ait_val_t *v; |
register int i; |
register int i; |
|
|
|
if (argc < 2) { |
|
makevars(); |
|
return 0; |
|
} |
|
|
arr = io_allocVars((argc - 1 ) / 2); |
arr = io_allocVars((argc - 1 ) / 2); |
if (!arr) { |
if (!arr) { |
printf("Error:: #%d - %s\n", io_GetErrno(), io_GetError()); |
printf("Error:: #%d - %s\n", io_GetErrno(), io_GetError()); |
Line 98 main(int argc, char **argv)
|
Line 103 main(int argc, char **argv)
|
printf("search for key=0 %s\n", v ? AIT_GET_LIKE(v, char*) : ""); |
printf("search for key=0 %s\n", v ? AIT_GET_LIKE(v, char*) : ""); |
v = io_findKeyVars(arr, 99); |
v = io_findKeyVars(arr, 99); |
printf("search for key=99 %s\n", v ? AIT_GET_LIKE(v, char*) : ""); |
printf("search for key=99 %s\n", v ? AIT_GET_LIKE(v, char*) : ""); |
|
|
|
io_hashKeyVars(arr); |
|
v = io_findKeyHash(arr, "Baba Yaga #1"); |
|
printf("search for hash='Baba Yaga #1' %s\n", v ? AIT_GET_LIKE(v, char*) : ""); |
|
|
printf("Before sorting::\n"); |
printf("Before sorting::\n"); |
for (i = 0; i < io_arraySize(arr); i++) |
for (i = 0; i < io_arraySize(arr); i++) |