OSSP CVS Repository

ossp - Check-in [2609]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2609
Date: 2002-Oct-18 11:09:18 (local)
2002-Oct-18 09:09:18 (UTC)
User:mlelstv
Branch:
Comment: added al_traverse_end to API, to allow future cleanup/locking

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/sio/al.c      1.19 -> 1.20     17 inserted, 0 deleted
ossp-pkg/sio/al.h      1.9 -> 1.10     2 inserted, 1 deleted
ossp-pkg/sio/al.pod      1.8 -> 1.9     10 inserted, 0 deleted

ossp-pkg/sio/al.c 1.19 -> 1.20

--- al.c 2002/10/18 08:58:19     1.19
+++ al.c 2002/10/18 09:09:18     1.20
@@ -835,6 +835,17 @@
 }
 
 /*
+ * assembly line traversal end
+ *
+ * to free resources allocated/locked during traversal
+ * currently a NOOP
+ */
+al_rc_t al_traverse_end(al_t *al, al_tx_t *tx, int final)
+{
+    return AL_OK;
+}
+
+/*
  * full assembly line traversal with callback
  *
  * traversal is aborted when callback return != AL_OK
@@ -858,6 +869,8 @@
             break;
     }
 
+    (void) al_traverse_end(al, &tx, 1);
+
     if (rc != AL_ERR_EOF)
         return AL_RC(rc);
 
@@ -892,6 +905,8 @@
     }
     *lenp = total;
 
+    (void) al_traverse_end(al, &tx, 1);
+
     if (rc != AL_ERR_EOF)
         return AL_RC(rc);
 
@@ -918,6 +933,8 @@
         al_append_bytes(tal, AL_CHUNK_PTR(view,0), step);
     }
 
+    (void) al_traverse_end(al, &tx, 1);
+
     if (rc != AL_ERR_EOF)
         return AL_RC(rc);
 


ossp-pkg/sio/al.h 1.9 -> 1.10

--- al.h 2002/10/17 15:02:49     1.9
+++ al.h 2002/10/18 09:09:18     1.10
@@ -61,8 +61,9 @@
 al_rc_t al_attach_buffer(al_t *al, char *p, size_t n);
 al_rc_t al_txalloc      (al_t *al, al_tx_t **txp);
 al_rc_t al_txfree       (al_t *al, al_tx_t *tx);
-al_rc_t al_traverse_next(al_t *al, al_tx_t *tx, al_chunk_t **alcp);
 al_rc_t al_traverse     (al_t *al, size_t off, size_t n, al_td_t dir, al_tx_t *tx);
+al_rc_t al_traverse_next(al_t *al, al_tx_t *tx, al_chunk_t **alcp);
+al_rc_t al_traverse_end (al_t *al, al_tx_t *tx, int final);
 al_rc_t al_traverse_cb  (al_t *al, size_t off, size_t n, al_td_t dir, al_rc_t (*cb)(al_chunk_t *, void *), void *u);
 al_rc_t al_copy         (al_t *al, size_t off, size_t n, al_t *tal);
 al_rc_t al_splice       (al_t *al, size_t off, size_t n, al_t *nal, al_t *tal);


ossp-pkg/sio/al.pod 1.8 -> 1.9

--- al.pod       2002/10/17 15:02:49     1.8
+++ al.pod       2002/10/18 09:09:18     1.9
@@ -67,6 +67,7 @@
 al_txfree,
 al_traverse,
 al_traverse_next,
+al_traverse_end,
 al_traverse_cb.
 
 =item B<Convenience Operations>:
@@ -284,6 +285,7 @@
 
 This function fails when the offset is outside the assembly line bounds.
 
+
 =item al_rc_t B<al_traverse_next>(al_t *I<al>, al_tx_t *I<tx>, al_chunk_t **I<alcp>);
 
 Complete a traversal step on the assembly line I<al> using the initialized
@@ -294,6 +296,14 @@
 The function returns AL_ERR_EOF when it passes the end (or beginning
 in case of backward traversal) of the assembly line.
 
+=item al_rc_t B<al_traverse_end>(al_t *I<al>, al_tx_t *I<tx>, int final);
+
+Clean up internal state of traversal. If I<final> is zero, you may
+continue the traversal later by calling B<al_traverse_next>. If
+I<final> is non-zero you need to start a new traversal. It is
+mandatory that every traversal that was started is finished by
+a call to B<al_traverse_end> with I<final> set to a non-zero value.
+
 =item al_rc_t B<al_traverse_cb>(al_t *I<al>, size_t I<off>, size_t I<n>, al_td_t I<dir>, al_rc_t (*I<cb>)(al_chunk_t *, void *), void *u);
 
 B<al_traverse_cb> is a wrapper function that does a full assembly line traversal in

CVSTrac 2.0.1