--- psiconv/trunk/lib/psiconv/buffer.h 2000/12/27 02:12:23 80 +++ psiconv/trunk/lib/psiconv/buffer.h 2003/11/18 11:25:10 158 @@ -69,9 +69,9 @@ error code on failure. */ extern int psiconv_buffer_fwrite_all(const psiconv_buffer buf, FILE *f); -/* Concatenate two buffers. References are updated too. Buffer extra is - untouched after this and must still be freed if you want to get rid - of it. */ +/* Concatenate two buffers: the second buffer is appended to the first. + References are updated too. Buffer extra is untouched after this and must + still be freed if you want to get rid of it. */ extern int psiconv_buffer_concat(psiconv_buffer buf, const psiconv_buffer extra); @@ -83,7 +83,8 @@ /* Add a reference to a target to the reference list. The id does not need to be defined already, though it must be by the time you call psiconv_buffer_resolve. The reference is added to the current end - of the buffer, and space is allocated for it. */ + of the buffer, and space is allocated for it. References are always + longs (psiconv_u32). */ extern int psiconv_buffer_add_reference(psiconv_buffer buf,int id); /* Resolve all references and empty the reference list. */ @@ -92,6 +93,16 @@ /* Get a unique reference id */ extern psiconv_u32 psiconv_buffer_unique_id(void); +/* Extract part of a buffer and put it into a new buffer. Note that + references and targets are not copied; you will have to resolve them + beforehand (but as this function is meant for reading buffers, they + will usually not be used). */ +extern int psiconv_buffer_subbuffer(psiconv_buffer *buf, + const psiconv_buffer org, + psiconv_u32 offset, psiconv_u32 length); + + + #ifdef __cplusplus }