summaryrefslogtreecommitdiffstats
path: root/common/eurephiadb_session_common.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 23:42:48 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 23:42:48 +0200
commit3160de94065ad767590aa71d5e2b89813537c9d2 (patch)
treeb85afd12c07a1fd5f6bc513bacd3a5c00558eb60 /common/eurephiadb_session_common.c
parent201677bb8b384306e09a84c90b7f18fbc879d626 (diff)
downloadeurephia-3160de94065ad767590aa71d5e2b89813537c9d2.tar.gz
eurephia-3160de94065ad767590aa71d5e2b89813537c9d2.tar.xz
eurephia-3160de94065ad767590aa71d5e2b89813537c9d2.zip
Added more comments to the common files
Diffstat (limited to 'common/eurephiadb_session_common.c')
-rw-r--r--common/eurephiadb_session_common.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/common/eurephiadb_session_common.c b/common/eurephiadb_session_common.c
index abcd75a..8c18ceb 100644
--- a/common/eurephiadb_session_common.c
+++ b/common/eurephiadb_session_common.c
@@ -19,6 +19,16 @@
*
*/
+/**
+ * @file eurephiadb_session_common.c
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-11-28
+ *
+ * @brief Common functions for handling eurephia sessions.
+ *
+ */
+
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -31,7 +41,7 @@
#include <eurephiadb_session_struct.h>
-#ifndef DRIVER_MODE // Use the right declaration, depending on if we compile driver or plugin/exec
+#ifndef DRIVER_MODE // Use the right declaration, depending on if we compile driver or plug-in/exec
// Functions needed to be found in the database driver
int (*eDBstore_session_value) (eurephiaCTX *ctx, eurephiaSESSION *session, int mode,
const char *key, const char *val);
@@ -40,8 +50,17 @@ int eDBstore_session_value (eurephiaCTX *ctx, eurephiaSESSION *session, int mode
const char *key, const char *val);
#endif
-// Adds or updates a key in the eurephiaVALUES stack. Database is updated before the stack is updated.
-// If database fails, the stack is not updated.
+/**
+ * Adds or updates a key in the eurephiaVALUES stack. Database is updated before the stack is updated.
+ * If database fails, the stack is not updated.
+ *
+ * @param ctx eurephiaCTX
+ * @param session eurephiaSESSION, which contains information about the current user session
+ * @param key key name of the value to be stored
+ * @param val value to be stored
+ *
+ * @return Returns 1 on success, otherwise 0.
+ */
int eDBset_session_value(eurephiaCTX *ctx, eurephiaSESSION *session, const char *key, const char *val) {
eurephiaVALUES *svals = NULL;
@@ -95,7 +114,13 @@ int eDBset_session_value(eurephiaCTX *ctx, eurephiaSESSION *session, const char
}
-// Free up the memory used by a session structure
+/**
+ * Free up the memory used by a session structure. This is normally not called directly, but called via the
+ * eDBfree_session(...) macro.
+ *
+ * @param ctx eurephiaCTX
+ * @param session Pointer to the eurephiaSESSION structure to be freed.
+ */
void eDBfree_session_func(eurephiaCTX *ctx, eurephiaSESSION *session) {
if( session == NULL ) {
return;