瀏覽代碼

Add documentation for fetch_result function to db api docs, extends comments
for this function.


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2049 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt 18 年之前
父節點
當前提交
516b44cc95
共有 2 個文件被更改,包括 26 次插入1 次删除
  1. 4 1
      lib/srdb1/db.h
  2. 22 0
      lib/srdb1/doc/db-api.txt

+ 4 - 1
lib/srdb1/db.h

@@ -84,7 +84,10 @@ typedef int (*db_query_f) (db_con_t* _h, db_key_t* _k,
 			   db_key_t _o, db_res_t** _r);
 
 /*
- * Fetch number of rows from result !
+ * Fetch number of rows from a result
+ * _h structure representing database connection
+ * _r db_res structure for the result
+ * _n the number of rows that should be fetched
  */
 typedef int (*db_fetch_result_f) (db_con_t* _h, db_res_t** _r, int _n);
 

+ 22 - 0
lib/srdb1/doc/db-api.txt

@@ -640,3 +640,25 @@ handle: structure representing database connection
 
 The function returns the ID as integer or returns 0 if the previous statement 
 does not use an AUTO_INCREMENT value.
+
+
+2.12 Callback dbf.fetch_result
+
+2.12.1 Description
+
+The function fetches a number of rows from a database result.
+
+2.12.2 Prototype
+   int (*db_fetch_result_f) (db_con_t* _h, db_res_t** _r, int _n)
+
+2.12.3 Parameters
+
+The function takes three parameters:
+_h: structure representing database connection
+_r: structure for the result
+_n: the number of rows that should be fetched
+
+2.12.4 Return Value
+
+The function returns 0 if everything is ok, otherwise the function returns a
+value < 0.