Răsfoiți Sursa

More cleanup applied :

Delete the crc32file function from crc.c. This is a test function, that is not
exported and thus not used anywhere. It also deletes the main function there
that is commented out.

Remove the "/bin/sh" shebang in the sourced scripts in the ./scripts
directory. These files are not meant for direct execution and are installed
in /usr/lib/ anyway. This fix comes from the debian package dir (see next
patch).

Remove the now unnecessary patch in the debian packaging directories.

Adds some documentation for the replace callback in the api.txt documentation
in the db dir. It also extends the comment for this function in db.h.

Credits go to Henning Westerholt <[email protected]>


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1687 689a6050-402a-0410-94f2-e92a70836424
Bogdan-Andrei Iancu 18 ani în urmă
părinte
comite
bf01159fa7
2 a modificat fișierele cu 30 adăugiri și 1 ștergeri
  1. 5 1
      lib/srdb1/db.h
  2. 25 0
      lib/srdb1/doc/db-api.txt

+ 5 - 1
lib/srdb1/db.h

@@ -138,7 +138,11 @@ typedef int (*db_update_f) (db_con_t* _h, db_key_t* _k, db_op_t* _o, db_val_t* _
 			    db_key_t* _uk, db_val_t* _uv, int _n, int _un);
 
 /*
- * Insert a row and replace if one already 
+ * Insert a row and replace if one already exists.
+ * handle: structure representing database connection
+ * keys: key names
+ * vals: values of the keys
+ * n: number of key=value pairs
  */
 typedef int (*db_replace_f) (db_con_t* handle, db_key_t* keys, db_val_t* vals, int n);
 

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

@@ -591,3 +591,28 @@ _t: Table name
 The function returns 0 if everything is OK, otherwise the function returns
 value < 0.
 
+
+2.10 Callback dbf.replace
+
+2.10.1 Description
+
+The function implements the REPLACE SQL directive. It is possible to insert
+a row and replace if one already exists. The old row will be deleted before
+the insertion of the new data.
+
+2.10.2 Prototype
+
+   int (*db_replace_f) (db_con_t* handle, db_key_t* keys, db_val_t* vals, int n);
+
+2.10.3 Parameters
+
+The function takes 4 parameters:
+handle: structure representing database connection
+keys: key names
+vals: values of the keys
+n: number of key=value pairs
+
+2.10.4 Return Value
+
+The function returns 0 if everything is OK, otherwise the function returns
+value < 0.