Index: ossp-pkg/sio/al.c RCS File: /v/ossp/cvs/ossp-pkg/sio/Attic/al.c,v rcsdiff -q -kk '-r1.19' '-r1.20' -u '/v/ossp/cvs/ossp-pkg/sio/Attic/al.c,v' 2>/dev/null --- 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); Index: ossp-pkg/sio/al.h RCS File: /v/ossp/cvs/ossp-pkg/sio/Attic/al.h,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/sio/Attic/al.h,v' 2>/dev/null --- 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); Index: ossp-pkg/sio/al.pod RCS File: /v/ossp/cvs/ossp-pkg/sio/Attic/al.pod,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/sio/Attic/al.pod,v' 2>/dev/null --- 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: @@ -284,6 +285,7 @@ This function fails when the offset is outside the assembly line bounds. + =item al_rc_t B(al_t *I, al_tx_t *I, al_chunk_t **I); Complete a traversal step on the assembly line I 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_t *I, al_tx_t *I, int final); + +Clean up internal state of traversal. If I is zero, you may +continue the traversal later by calling B. If +I 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 with I set to a non-zero value. + =item al_rc_t B(al_t *I, size_t I, size_t I, al_td_t I, al_rc_t (*I)(al_chunk_t *, void *), void *u); B is a wrapper function that does a full assembly line traversal in