Next: , Previous: Automatic buffers, Up: Automatic buffers


11.1 An overview of the autobuf type

Autobufs are very similar to strings, with the principle difference being that autobufs can contain any byte, including the null byte. Also note that while a string contains ‘char’ data, an autobuf contains ‘unsigned char’ data. Most functions that work on strings also have versions for autobufs, with the exception that since autobufs are designed to hold generic character-sized data rather than text, explicitly textual functions have no such counterpart.

Autobufs are stored in a structure, ‘struct autobuf’, which has a ‘typedef’ name of ‘Autobuf’. All members of ‘Autobuf’ are private.

All the ‘Autobuf’ functions are declared in libretto/autobuf.h.