--- libaitsess/src/sess.c 2013/01/17 13:10:49 1.5.4.1 +++ libaitsess/src/sess.c 2013/01/17 13:26:37 1.5.4.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: sess.c,v 1.5.4.1 2013/01/17 13:10:49 misho Exp $ +* $Id: sess.c,v 1.5.4.2 2013/01/17 13:26:37 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -47,7 +47,7 @@ SUCH DAMAGE. /* - * sess_FreeValues() Free all values from value array allocated from sess_GetValues() + * sess_FreeValues() - Free all values from value array allocated from sess_GetValues() * * @ppsVals = Array strings * return: none @@ -68,11 +68,12 @@ sess_FreeValues(char *** __restrict ppsVals) } /* - * sess_GetValues() Get all values from session shared memory + * sess_GetValues() - Get all values from session shared memory * * @s = Session item * @ppsVals = Return array strings - * return: -1 error: in parameter, !=-1 count of returned strings in ppsVals (must be free after use!) + * return: -1 error: in parameter, !=-1 count of returned strings in ppsVals + * (must be sess_FreeValues after use!) */ int sess_GetValues(ait_sess_t * __restrict s, char ***ppsVals) @@ -90,7 +91,7 @@ sess_GetValues(ait_sess_t * __restrict s, char ***ppsV } else *valz = NULL; - // allocated memory & mirrored shared memory into this + /* allocated memory & mirrored shared memory into this */ Shared = e_malloc(s->eom); if (!Shared) { LOGERR; @@ -123,14 +124,15 @@ sess_GetValues(ait_sess_t * __restrict s, char ***ppsV } /* - * sess_GetValue() Get value from session shared memory from attribute + * sess_GetValue() - Get value from session shared memory from attribute * * @s = Session item * @csAttr = Attribute for search * @psVal = Return string buffer * @pnLen = Length of return string buffer, // *{pnLen} input is max_size of buffer & output is really taken bytes - * return: 0 not found, -1 error: in parameter, >0 get position, if define item merged with IS_DEF + * return: 0 not found, -1 error: in parameter, >0 get position, + * if define item merged with IS_DEF */ int sess_GetValue(ait_sess_t * __restrict s, const char *csAttr, char *psVal, int *pnLen) @@ -149,7 +151,7 @@ sess_GetValue(ait_sess_t * __restrict s, const char *c return -1; } - // allocated memory & mirrored shared memory into this + /* allocated memory & mirrored shared memory into this */ Shared = e_malloc(s->eom); if (!Shared) { LOGERR; @@ -180,7 +182,7 @@ sess_GetValue(ait_sess_t * __restrict s, const char *c } /* - * sess_DelValue() Delete item from session shared memory + * sess_DelValue() - Delete item from session shared memory * * @s = Session item * @csAttr = Attribute for erasing @@ -241,7 +243,7 @@ sess_DelValue(ait_sess_t * __restrict s, const char *c } /* - * sess_SetValue() Set item into session shared memory or update if find it + * sess_SetValue() - Set item into session shared memory or update if exists * * @s = Session item * @csAttr = Attribute @@ -326,7 +328,7 @@ sess_SetValue(ait_sess_t * __restrict s, const char *c /* - * sess_prepareSession() Attach to shared memory and de-marshaling data + * sess_prepareSession() - Attach to shared memory and de-marshaling data * * @s = Session * @useDirect = Use direct shared memory if !=0 or snapshot of data to array @@ -341,11 +343,11 @@ sess_prepareSession(ait_sess_t * __restrict s, char us assert(s); if (!s) { - sess_SetErr(EINVAL, "Error:: invalid argument\n"); + sess_SetErr(EINVAL, "Invalid argument\n"); return NULL; } if (s->addr) { - sess_SetErr(EINVAL, "Error:: already attached memory\n"); + sess_SetErr(EINVAL, "Already attached memory\n"); return NULL; } @@ -357,7 +359,7 @@ sess_prepareSession(ait_sess_t * __restrict s, char us if (hdr->hdr_magic != SESS_AIT_MAGIC) { DETACH_MEMORY(s); - sess_SetErr(EINVAL, "Error:: shared memory not contains values with proper format\n"); + sess_SetErr(EINVAL, "Shared memory not contains values with proper format\n"); return NULL; } @@ -373,7 +375,7 @@ sess_prepareSession(ait_sess_t * __restrict s, char us } /* - * sess_doneSession() Free resources allocated with sess_prepareSession() + * sess_doneSession() - Free resources allocated with sess_prepareSession() * * @s = Session * @arr = Array with variables for free @@ -384,7 +386,7 @@ sess_doneSession(ait_sess_t * __restrict s, array_t ** { assert(s); if (!s) { - sess_SetErr(EINVAL, "Error:: invalid argument\n"); + sess_SetErr(EINVAL, "Invalid argument\n"); return; } @@ -396,7 +398,7 @@ sess_doneSession(ait_sess_t * __restrict s, array_t ** } /* - * sess_commitSession() Commit data to shared memory + * sess_commitSession() - Commit data to shared memory * * @s = Session * @arr = Array with variables for save @@ -410,7 +412,7 @@ sess_commitSession(ait_sess_t * __restrict s, array_t assert(s && arr); if (!s || !arr) { - sess_SetErr(EINVAL, "Error:: invalid argument\n"); + sess_SetErr(EINVAL, "Invalid argument\n"); return -1; }