Module: sip-router
Branch: janakj/mysql
Commit: 956802dcd657e128f94c064d24f45dc918e9d2a9
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=956802d…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Mon Feb 16 23:09:32 2009 +0100
db_con renamed to db1_con in files originating from kamailio/db_mysql.
The structure db_con has been renamed in lib/srdb1 to db1_con, thus we
need to change the name of the structure in all files originating from
kamailio/modules/db_mysql (and using lib/srdb1).
---
modules/db_mysql/km_dbase.c | 30 +++++++++++++++---------------
modules/db_mysql/km_dbase.h | 26 +++++++++++++-------------
modules/db_mysql/km_res.c | 6 +++---
modules/db_mysql/km_res.h | 4 ++--
modules/db_mysql/km_row.c | 2 +-
modules/db_mysql/km_row.h | 2 +-
modules/db_mysql/km_val.c | 2 +-
modules/db_mysql/km_val.h | 2 +-
8 files changed, 37 insertions(+), 37 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=956…
Module: sip-router
Branch: janakj/mysql
Commit: 205f28ce7929d6a43e4c649b9db25bcd70b9d19b
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=205f28c…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Fri Oct 17 08:01:23 2008 +0000
- docs extension: explain fetch_result functionality better to prevent errors
because of wrong usage, found from Juha Heinanen
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5088 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_mysql/km_dbase.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/modules/db_mysql/km_dbase.c b/modules/db_mysql/km_dbase.c
index 726a881..ecc3106 100644
--- a/modules/db_mysql/km_dbase.c
+++ b/modules/db_mysql/km_dbase.c
@@ -251,7 +251,15 @@ int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
}
/**
- * Gets a partial result set.
+ * \brief Gets a partial result set, fetch rows from a result
+ *
+ * Gets a partial result set, fetch a number of rows from a database result.
+ * This function initialize the given result structure on the first run, and
+ * fetches the nrows number of rows. On subsequenting runs, it uses the
+ * existing result and fetches more rows, until it reaches the end of the
+ * result set. Because of this the result needs to be null in the first
+ * invocation of the function. If the number of wanted rows is zero, the
+ * function returns anything with a result of zero.
* \param _h structure representing the database connection
* \param _r pointer to a structure representing the result
* \param nrows number of fetched rows
Module: sip-router
Branch: janakj/mysql
Commit: c56b4491a617caa82be13a8ed95949f04b7980f0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c56b449…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu Nov 13 16:14:34 2008 +0000
- add a comment about the NULL value behaviour of libmysql
- add some doxygen documentation
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5197 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_mysql/km_val.c | 26 ++++++++++++++++++++------
modules/db_mysql/km_val.h | 26 ++++++++++++++++++++------
2 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/modules/db_mysql/km_val.c b/modules/db_mysql/km_val.c
index 8cb485f..3af1e65 100644
--- a/modules/db_mysql/km_val.c
+++ b/modules/db_mysql/km_val.c
@@ -22,7 +22,7 @@
*/
/*! \file
- * \brief DB_MYSQL :: Data conversion
+ * \brief DB_MYSQL :: Data conversions
* \ingroup db_mysql
* Module: \ref db_mysql
*/
@@ -36,8 +36,15 @@
#include <stdio.h>
-/*! \brief
- * Convert str to db value, does not copy strings
+/*!
+ * \brief Convert a str to a db value, does not copy strings
+ *
+ * Convert a str to a db value, does not copy strings.
+ * \param _t destination value type
+ * \param _v destination value
+ * \param _s source string
+ * \param _l string length
+ * \return 0 on success, negative on error
*/
int db_mysql_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int _l)
{
@@ -47,7 +54,7 @@ int db_mysql_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int
LM_ERR("invalid parameter value\n");
return -1;
}
-
+ /* A NULL string is a NULL value in mysql, otherwise its an empty value */
if (!_s) {
memset(_v, 0, sizeof(db_val_t));
/* Initialize the string pointers to a dummy empty
@@ -143,8 +150,15 @@ int db_mysql_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int
}
-/*! \brief
- * Used when converting result from a query
+/*!
+ * \brief Converting a value to a string
+ *
+ * Converting a value to a string, used when converting result from a query
+ * \param _c database connection
+ * \param _v source value
+ * \param _s target string
+ * \param _len target string length
+ * \return 0 on success, negative on error
*/
int db_mysql_val2str(const db_con_t* _c, const db_val_t* _v, char* _s, int* _len)
{
diff --git a/modules/db_mysql/km_val.h b/modules/db_mysql/km_val.h
index 4f034cc..f9cb609 100644
--- a/modules/db_mysql/km_val.h
+++ b/modules/db_mysql/km_val.h
@@ -22,7 +22,7 @@
*/
/*! \file
- * \brief DB_MYSQL :: Conversions
+ * \brief DB_MYSQL :: Data conversions
* \ref val.c
* \ingroup db_mysql
* Module: \ref db_mysql
@@ -37,15 +37,29 @@
#include "../../db/db.h"
-/**
- * Does not copy strings
+/*!
+ * \brief Convert a str to a db value, does not copy strings
+ *
+ * Convert a str to a db value, does not copy strings.
+ * \param _t destination value type
+ * \param _v destination value
+ * \param _s source string
+ * \param _l string length
+ * \return 0 on success, negative on error
*/
int db_mysql_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int _l);
-/**
- * Used when converting result from a query
+/*!
+ * \brief Converting a value to a string
+ *
+ * Converting a value to a string, used when converting result from a query
+ * \param _c database connection
+ * \param _v source value
+ * \param _s target string
+ * \param _len target string length
+ * \return 0 on success, negative on error
*/
int db_mysql_val2str(const db_con_t* _con, const db_val_t* _v, char* _s, int* _len);
-#endif /* VAL_H */
+#endif