From 288727f09a1b3458c268497d111349e608c3f9fa Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Tue, 2 Aug 2022 01:20:12 +0200 Subject: init --- docs/buff.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/buff.rst (limited to 'docs/buff.rst') diff --git a/docs/buff.rst b/docs/buff.rst new file mode 100644 index 0000000..b052483 --- /dev/null +++ b/docs/buff.rst @@ -0,0 +1,29 @@ +String buffer +============= + +While reading character data from input stream, buffer used for storing +string of arbitrary length is required. `lsp_buff_t` provides preallocated +limited temporary storage which is used as intermediary buffer in construction +of `string` data with arbitrary size. + +After initialization with `lsp_buff_init`, characters are added to buffer +with `lsp_buff_push` function. Once all characters are appended, single +`string` data containing all previously appended characters, can be obtained +with `lsp_buff_pop` function. + + +Source code +----------- + +buff.h +'''''' + +.. literalinclude:: ../src_c/buff.h + :language: c + + +buff.c +'''''' + +.. literalinclude:: ../src_c/buff.c + :language: c -- cgit v1.2.3-70-g09d2