Index: ossp-pkg/sio/al.c RCS File: /v/ossp/cvs/ossp-pkg/sio/Attic/al.c,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/sio/Attic/al.c,v' 2>/dev/null --- al.c 2002/10/16 09:28:17 1.11 +++ al.c 2002/10/16 09:31:55 1.12 @@ -828,24 +828,24 @@ * list traversal requires a context. It needs to be * malloced to keep its inner structure private */ -al_rc_t al_txalloc(al_t *al, al_tx_t **txpp) +al_rc_t al_txalloc(al_t *al, al_tx_t **txp) { - al_tx_t *txp; + al_tx_t *tx; - txp = (al_tx_t*)(al->m.malloc)(sizeof(al_tx_t)); - if (txp == NULL) + tx = (al_tx_t*)(al->m.malloc)(sizeof(al_tx_t)); + if (tx == NULL) return AL_RC(AL_ERR_MEM); - *txpp = txp; + *txp = tx; return AL_OK; } /* * free traversal context using proper policy function */ -al_rc_t al_txfree(al_t *al, al_tx_t *txp) +al_rc_t al_txfree(al_t *al, al_tx_t *tx) { - (al->m.free)(txp); + (al->m.free)(tx); return AL_OK; } @@ -855,17 +855,17 @@ * - do initial seek, fail if position does not exist * - save traversal parameters */ -al_rc_t al_traverse(al_t *al, size_t off, size_t n, al_td_t dir, al_tx_t *txp) +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 rc; - txp->cur = NULL; + tx->cur = NULL; - rc = al_seek(al, off, &txp->cur, &txp->skip); + rc = al_seek(al, off, &tx->cur, &tx->skip); if (rc != AL_OK) return AL_RC(rc); - txp->dir = dir; - txp->togo = n; + tx->dir = dir; + tx->togo = n; return AL_OK; } @@ -877,19 +877,19 @@ * clip view chunk to traversal bounds * advance chunk cursor according to traversal direction */ -al_rc_t al_traverse_next(al_t *al, al_tx_t *txp, al_chunk_t **alcp) +al_rc_t al_traverse_next(al_t *al, al_tx_t *tx, al_chunk_t **alcp) { size_t step; - if (txp->togo <= 0) /* XXX - togo can be negative from bad input */ + if (tx->togo <= 0) /* XXX - togo can be negative from bad input */ return AL_ERR_EOF; - if (txp->cur == NULL) /* premature EOF */ + if (tx->cur == NULL) /* premature EOF */ return AL_ERR_EOF; - step = AL_CHUNK_LEN(txp->cur); - if (step > txp->togo) - step = txp->togo; + step = AL_CHUNK_LEN(tx->cur); + if (step > tx->togo) + step = tx->togo; /* * synthetic chunk which is NOT maintained in usecount @@ -898,22 +898,22 @@ * ALLOWED is read access to chunk content * ALLOWED is modification in place of chunk content */ - txp->view = *(txp->cur); - txp->view.begin += txp->skip; - txp->view.end = txp->view.begin + step; + tx->view = *(tx->cur); + tx->view.begin += tx->skip; + tx->view.end = tx->view.begin + step; - switch (txp->dir) { + switch (tx->dir) { case AL_FORWARD: - txp->cur = NEXT(txp->cur,chunks); - txp->togo -= step; + tx->cur = NEXT(tx->cur,chunks); + tx->togo -= step; break; case AL_BACKWARD: - txp->cur = PREV(txp->cur,chunks); - txp->togo -= step; + tx->cur = PREV(tx->cur,chunks); + tx->togo -= step; break; } - *alcp = &txp->view; + *alcp = &tx->view; return AL_OK; }