Reformat: delete trailing whitespace
[idzebra-moved-to-github.git] / include / idzebra / isam.h
index f59cd53..043b770 100644 (file)
@@ -20,33 +20,33 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 /**
 isam.h - a generalized interface to the isam systems
 
-The isam system consists of a number of isam lists. Physically it is 
-stored in a file, or a group of related files. It is typically used 
-for storing all the occurrences of a given word, storing the document 
-number and position for each occurrence. 
+The isam system consists of a number of isam lists. Physically it is
+stored in a file, or a group of related files. It is typically used
+for storing all the occurrences of a given word, storing the document
+number and position for each occurrence.
 
 An isam list is indentified by an isam_position. This is a number (zint).
 It can be seen as a mapping from an isam_position to an ordered list of isam_
 entries.
 
-An isam list consists of one or more isam entries. We do not know the 
+An isam list consists of one or more isam entries. We do not know the
 structure of those entries, but we know the (maximum) size of such, and
 that they can be memcpy'ed around.
 
-The entries can be seen to consist of a key and a value, although we 
+The entries can be seen to consist of a key and a value, although we
 have no idea of their internal structure. We know that we have a compare
-function that can look at a part (or whole) of the isam entry (the 'key'). 
-The part not looked at (if any) will count as 'value' or 'payload'. 
+function that can look at a part (or whole) of the isam entry (the 'key').
+The part not looked at (if any) will count as 'value' or 'payload'.
 
 The entries are stored in increasing order (as defined by the compare
 function), and no duplicates are allowed.
 
-There is an effective mass-insert routine that takes a stream of values, 
+There is an effective mass-insert routine that takes a stream of values,
 each accompanied by an insert/delete flag.
 
-For reading we have cursors, that can read through an isam list in order. 
+For reading we have cursors, that can read through an isam list in order.
 They have a fast-forward function to skip values we are not interested in.
+
 */
 
 
@@ -64,25 +64,25 @@ extern "C" {
  * key_control contains all there is to know about the keys (entries) stored
  * in an isam, (and therefore operated by the rsets). Other than this info,
  * all we assume is that all keys are the same size, and they can be
- * memcpy'd around. 
+ * memcpy'd around.
  */
 struct key_control {
     /** (max) size of a key */
     int key_size;
 
-    /** Default for what level we operate on (book/chapter/verse). 
-     * for typical zebra, this is always 2 (sysno/seqno). Not used in 
+    /** Default for what level we operate on (book/chapter/verse).
+     * for typical zebra, this is always 2 (sysno/seqno). Not used in
      * isam context, but the rsets make use of this. */
-    int scope; 
+    int scope;
 
-    /** Compare function, returning -1,0,1, if p1 is less/equal/greater 
+    /** Compare function, returning -1,0,1, if p1 is less/equal/greater
      * than p2 */
     int (*cmp) (const void *p1, const void *p2);
 
     /** Debug function to write a key in the log, with a message */
     void (*key_logdump_txt) (int logmask, const void *p, const char *txt);
 
-    /** Return the sequence number of a key, to see if we are on the same 
+    /** Return the sequence number of a key, to see if we are on the same
      * record. FIXME - this makes less sense with higher-scope keys. */
     zint (*getseq)(const void *p);
 
@@ -96,7 +96,7 @@ const KEY_CONTROL *default_key_control();
   /* FIXME - in zrpn.c, time being. Needs to be moved out */
 
 
-/** isam_data_stream is a callback function for the mass-insert (merge) 
+/** isam_data_stream is a callback function for the mass-insert (merge)
  * it provides another item to insert/delete, in proper order */
 struct isam_data_stream {
     int (*read_item)(void *clientData, char **dst, int *insertMode);
@@ -120,7 +120,7 @@ struct isam_conrol {
     /** text description of the type, for debugging */
     char *desc;
     /** default filename, if none given to isam_open */
-    const char *def_filename; 
+    const char *def_filename;
 
     /* there is an isam_open function, but it is not part of this */
     /* dynamic table, as it is what provides this table */
@@ -128,7 +128,7 @@ struct isam_conrol {
     /** close the isam system */
     void (*f_close)(ISAM i);
 
-    /** Insert an entry into the isam identified by pos. If pos==0, 
+    /** Insert an entry into the isam identified by pos. If pos==0,
      * create a new isam list */
     ISAM_POS (*f_put)(ISAM is, ISAM_POS pos, const void *buf);
 
@@ -136,15 +136,15 @@ struct isam_conrol {
      * do nothing, and return 0*/
     int (*f_del)(ISAM is, ISAM_POS pos, const void *buf);
 
-    /** Find an entry in the isam list. return 0 if not found. buf must 
+    /** Find an entry in the isam list. return 0 if not found. buf must
      * contain enough to identify the item, and will be overwritten by it */
     int (*f_get)(ISAM is, ISAM_POS pos, void *buf );
 
     /** Mass-insert data from incoming stream into the isam */
-    ISAM_POS (*f_merge)(ISAM is, ISAM_POS pos, ISAM_DATA_STREAM *data); 
+    ISAM_POS (*f_merge)(ISAM is, ISAM_POS pos, ISAM_DATA_STREAM *data);
 
     /** Open a cursor to the isam list identified by pos */
-    ISAM_CUR (*f_cur_open)(ISAM is, ISAM_POS pos); 
+    ISAM_CUR (*f_cur_open)(ISAM is, ISAM_POS pos);
 
     /** Read an item at the cursor (and forward to next). return 0 at eof */
     int (*f_read)(ISAM_CUR cur, void *buf);
@@ -160,7 +160,7 @@ struct isam_conrol {
 
     /** Delete the isam list from the isam system.*/
     int (*f_unlink)(ISAM is, ISAM_POS pos);
-    
+
 };
 
 /** ISAM_s is the generic isam structure */
@@ -180,7 +180,7 @@ struct ISAM_CUR {
 
 
 /** Open the isam system */
-ISAM isam_open (BFiles bfs, 
+ISAM isam_open (BFiles bfs,
                 const char *isamtype, /* usually "b" */
                 const char *filename,  /* optional, use default from control ?? */
                 int flags, /* FIXME - define read/write, and some special ones */