version 1.1, 2008/08/28 13:18:30
|
version 1.2.4.2, 2012/02/10 23:15:27
|
Line 4
|
Line 4
|
|
|
int main() |
int main() |
{ |
{ |
tagSess *n = NULL; | ait_sess_t *n = NULL; |
int i = 255; |
int i = 255; |
char *dat, szVal[256]; |
char *dat, szVal[256]; |
|
|
Line 34 int main()
|
Line 34 int main()
|
freeSession(NULL, &n); |
freeSession(NULL, &n); |
*/ |
*/ |
|
|
map_createSession("/tmp/abra-kadabra-123", 1003, 4096, &n); | sess_initSession(SHARED_IPC, "/tmp/abra-kadabra-123", &n); |
| ALLOC_MEMORY(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 2; |
} |
} |
dat = map_attachSession(n, NULL); | ATTACH_MEMORY(n); |
if (!dat) |
if (!dat) |
return 1; |
return 1; |
// getchar(); | // sess_SetValue(n, "piuk_gniah++", "mryyynnnnn"); |
// printf(">>> String=%s\n", dat); | printf(">>> String=%s\n", n->addr); |
| getchar(); |
printf("12345678 Define? %d\n", ISDEF(sess_GetValue(n, "12345678", szVal, &i))); |
printf("12345678 Define? %d\n", ISDEF(sess_GetValue(n, "12345678", szVal, &i))); |
printf("111 Define? %d\n", ISDEF(sess_SetValue(n, "111", "321"))); |
printf("111 Define? %d\n", ISDEF(sess_SetValue(n, "111", "321"))); |
printf("88 Define? %d\n", ISDEF(sess_GetValue(n, "88", szVal, &i))); |
printf("88 Define? %d\n", ISDEF(sess_GetValue(n, "88", szVal, &i))); |
Line 55 int main()
|
Line 57 int main()
|
printf("00 find=%d value=%s vlen=%d\n", sess_GetValue(n, "00", szVal, &i), szVal, i); |
printf("00 find=%d value=%s vlen=%d\n", sess_GetValue(n, "00", szVal, &i), szVal, i); |
printf("insert Result?%d\n", ISNEW(sess_SetValue(n, "789", "Gniah40"))); |
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); |
printf("00 find=%d value=%s vlen=%d\n", sess_GetValue(n, "00", szVal, &i), szVal, i); |
printf(">>> String=%s\n", dat); | printf(">>> String=%s\n", n->addr); |
printf("update Result=%d\n", sess_SetValue(n, "789", NULL)); |
printf("update Result=%d\n", sess_SetValue(n, "789", NULL)); |
// printf(">>> String=%s\n", dat); |
// printf(">>> String=%s\n", dat); |
sess_DelValue(n, "789"); | // sess_DelValue(n, "789"); |
sess_DelValue(n, "GratisT"); |
sess_DelValue(n, "GratisT"); |
sess_DelValue(n, "szUser"); |
sess_DelValue(n, "szUser"); |
getchar(); |
getchar(); |
printf("end %p>>> String=%s\n", n->addr, n->addr); |
printf("end %p>>> String=%s\n", n->addr, n->addr); |
map_detachSession(n); | DETACH_MEMORY(n); |
getchar(); |
getchar(); |
map_destroySession("/tmp/abra-kadabra-123", &n); | FREE_MEMORY(n, 42); |
| sess_freeSession(&n); |
return 0; |
return 0; |
} |
} |