version 1.1.2.5, 2011/09/08 07:02:22
|
version 1.1.2.6, 2012/02/10 17:14:21
|
Line 3
|
Line 3
|
#include <aitsess.h> |
#include <aitsess.h> |
#include <aitio.h> |
#include <aitio.h> |
|
|
|
|
int main(int argc, char **argv) |
int main(int argc, char **argv) |
{ |
{ |
tagSess *n = NULL; | ait_sess_t *n = NULL; |
array_t *inp; |
array_t *inp; |
ait_val_t *v; |
ait_val_t *v; |
int i; |
int i; |
Line 43 int main(int argc, char **argv)
|
Line 44 int main(int argc, char **argv)
|
freeSession(NULL, &n); |
freeSession(NULL, &n); |
*/ |
*/ |
|
|
if (ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n) == -1) { | sess_initSession(SHARED_IPC, "/tmp/abra-kadabra-321", &n); |
| if (ALLOC_MEMORY("/tmp/abra-kadabra-321", 1003, 4096, n) == -1) { |
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
printf("Error:: #%d - %s\n", sess_GetErrno(), sess_GetError()); |
return 2; |
return 2; |
} |
} |
Line 52 int main(int argc, char **argv)
|
Line 54 int main(int argc, char **argv)
|
DESTROY_SESSION("/tmp/abra-kadabra-321", &n); |
DESTROY_SESSION("/tmp/abra-kadabra-321", &n); |
return 2; |
return 2; |
} |
} |
freeSession(NULL, &n); | sess_freeSession(NULL, &n); |
io_arrayFree(inp); |
io_arrayFree(inp); |
io_arrayDestroy(&inp); |
io_arrayDestroy(&inp); |
printf("set session"); |
printf("set session"); |
getchar(); |
getchar(); |
ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n); | sess_initSession(SHARED_IPC, "/tmp/abra-kadabra-321", &n); |
| ALLOC_MEMORY("/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 3; |
return 3; |
Line 70 int main(int argc, char **argv)
|
Line 73 int main(int argc, char **argv)
|
for (i = 0; i < io_arraySize(inp); i++) |
for (i = 0; i < io_arraySize(inp); i++) |
printf("i=%d->%s\n", i, AIT_GET_STR(io_array(inp, i, ait_val_t*))); |
printf("i=%d->%s\n", i, AIT_GET_STR(io_array(inp, i, ait_val_t*))); |
sess_doneSession(n, &inp); |
sess_doneSession(n, &inp); |
freeSession(NULL, &n); | sess_freeSession(NULL, &n); |
getchar(); |
getchar(); |
ipc_createSession("/tmp/abra-kadabra-321", 1003, 4096, &n); | sess_initSession(SHARED_IPC, "/tmp/abra-kadabra-321", &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 4; |
return 4; |
Line 88 int main(int argc, char **argv)
|
Line 92 int main(int argc, char **argv)
|
printf("i=%d->%s\n", i, AIT_GET_STR(io_array(inp, i, ait_val_t*))); |
printf("i=%d->%s\n", i, AIT_GET_STR(io_array(inp, i, ait_val_t*))); |
sess_commitSession(n, inp); |
sess_commitSession(n, inp); |
sess_doneSession(n, &inp); |
sess_doneSession(n, &inp); |
freeSession(NULL, &n); | sess_freeSession(NULL, &n); |
getchar(); |
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()) { |