version 1.1.2.2, 2011/09/07 21:06:56
|
version 1.1.2.4, 2011/09/07 23:38:39
|
Line 7 int main(int argc, char **argv)
|
Line 7 int main(int argc, char **argv)
|
{ |
{ |
tagSess *n = NULL; |
tagSess *n = NULL; |
array_t *inp; |
array_t *inp; |
|
ait_val_t *v; |
|
int i; |
|
|
inp = io_arrayFrom(&argv, argc); | inp = io_arrayInit(argc); |
| for (i = 0; i < argc; i++) { |
| v = malloc(sizeof(ait_val_t)); |
| AIT_SET_STR(v, argv[i]); |
| io_arraySet(inp, i, v); |
| } |
|
|
/* |
/* |
map_createSession("/tmp/abra-kadabra-123", 1003, 4096, &n); |
map_createSession("/tmp/abra-kadabra-123", 1003, 4096, &n); |
Line 36 int main(int argc, char **argv)
|
Line 43 int main(int argc, char **argv)
|
freeSession(NULL, &n); |
freeSession(NULL, &n); |
*/ |
*/ |
|
|
|
if (ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n) == -1) { |
|
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
|
return 2; |
|
} |
|
if (sess_commitSession(n, inp) == -1) { |
|
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
|
DESTROY_SESSION("/tmp/abra-kadabra-321", &n); |
|
return 2; |
|
} |
|
freeSession(NULL, &n); |
|
io_arrayFree(inp); |
|
io_arrayDestroy(&inp); |
|
printf("set session"); |
|
getchar(); |
ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n); |
ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n); |
if (sess_GetErrno()) { |
if (sess_GetErrno()) { |
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
return 2; | return 3; |
} |
} |
ipc_attachSession(n, NULL); | if (!(inp = sess_prepareSession(n, 0))) { |
if (!dat) | printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
return 1; | DESTROY_SESSION("/tmp/abra-kadabra-321", &n); |
// sess_SetValue(n, "piuk_gniah++", "mryyynnnnn"); | return 3; |
printf(">>> String=%s\n", n->addr); | } |
| for (i = 0; i < io_arraySize(inp); i++) |
| printf("i=%d->%s\n", i, AIT_GET_STR(io_array(inp, i, ait_val_t*))); |
| sess_doneSession(n, &inp); |
| freeSession(NULL, &n); |
getchar(); |
getchar(); |
printf("12345678 Define? %d\n", ISDEF(sess_GetValue(n, "12345678", szVal, &i))); | ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n); |
printf("111 Define? %d\n", ISDEF(sess_SetValue(n, "111", "321"))); | if (sess_GetErrno()) { |
printf("88 Define? %d\n", ISDEF(sess_GetValue(n, "88", szVal, &i))); | printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
printf("222 find=%d value=%s vlen=%d\n", ISDEF(sess_SetValue(n, "222", NULL))); | return 4; |
printf("12345678 find=%d value=%s vlen=%d\n", sess_GetValue(n, "12345678", szVal, &i), szVal, i); | } |
printf("111 find=%d value=%s vlen=%d\n", sess_GetValue(n, "111", szVal, &i), szVal, i); | if (!(inp = sess_prepareSession(n, 0))) { |
printf("222 find=%d value=%s vlen=%d\n", ISDEF(sess_GetValue(n, "222", szVal, &i)), szVal, i); | printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
printf("000 find=%d value=%s vlen=%d\n", sess_GetValue(n, "000", szVal, &i), szVal, i); | DESTROY_SESSION("/tmp/abra-kadabra-321", &n); |
printf("00 find=%d value=%s vlen=%d\n", sess_GetValue(n, "00", szVal, &i), szVal, i); | return 4; |
printf("insert Result?%d\n", ISNEW(sess_SetValue(n, "789", "Gniah40"))); | } |
printf("00 find=%d value=%s vlen=%d\n", sess_GetValue(n, "00", szVal, &i), szVal, i); | AIT_FREE_VAL(io_array(inp, 2, ait_val_t*)); |
printf(">>> String=%s\n", n->addr); | AIT_SET_STR(io_array(inp, 2, ait_val_t*), "djmy"); |
printf("update Result=%d\n", sess_SetValue(n, "789", NULL)); | for (i = 0; i < io_arraySize(inp); i++) |
// printf(">>> String=%s\n", dat); | printf("i=%d->%s\n", i, AIT_GET_STR(io_array(inp, i, ait_val_t*))); |
// sess_DelValue(n, "789"); | sess_commitSession(n, inp); |
sess_DelValue(n, "GratisT"); | sess_doneSession(n, &inp); |
sess_DelValue(n, "szUser"); | freeSession(NULL, &n); |
getchar(); |
getchar(); |
printf("end %p>>> String=%s\n", n->addr, n->addr); | ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n); |
ipc_detachSession(n); | if (sess_GetErrno()) { |
getchar(); | printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
ipc_destroySession("/tmp/abra-kadabra-123", &n); | return 3; |
| } |
| if (!(inp = sess_prepareSession(n, 0))) { |
| printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
| DESTROY_SESSION("/tmp/abra-kadabra-321", &n); |
| return 3; |
| } |
| for (i = 0; i < io_arraySize(inp); i++) |
| printf("i=%d->%s\n", i, AIT_GET_STR(io_array(inp, i, ait_val_t*))); |
| sess_doneSession(n, &inp); |
| DESTROY_SESSION("/tmp/abra-kadabra-321", &n); |
return 0; |
return 0; |
} |
} |