#include <config.h>
#include <stdio.h>
#include <glib.h>
#include "libgeda_priv.h"
Go to the source code of this file.
Define Documentation
#define TEXT_BUFFER_LINE_SIZE 1024 |
Function Documentation
TextBuffer* s_textbuffer_new |
( |
const gchar * |
data, |
|
|
const gint |
size |
|
) |
| |
- Function description
- Allocates and initialises a new TextBuffer to manage the given data buffer.
If the size argument is negative, assumes that data is null-terminated.
- Parameters:
-
data | The address of the buffer to be managed. |
size | The length of the buffer. |
- Return values:
-
Pointer | to a new TextBuffer struct. |
Definition at line 62 of file s_textbuffer.c.
- Function description
- Cleans up all of the resources associated with a given TextBuffer.
Should be called thus:
Definition at line 97 of file s_textbuffer.c.
const gchar* s_textbuffer_next |
( |
TextBuffer * |
tb, |
|
|
const gssize |
count |
|
) |
| |
- Function description
- Get some number of characters from a TextBuffer, starting at the current position. If the end of the buffer has been reached (and thus no more characters remain) returns null. If count is -1, obtains all characters up to and including the next newline.
A newline is detected as '
', or '' together with its immediately following '
', or '', in that order. All newlines are collapsed into a single '
'.
The returned character array should be considered highly volatile, and is only valid until the next call to s_textbuffer_next() or s_textbuffer_next_line().
- Parameters:
-
tb | TextBuffer to read from. |
count | Maximum number of characters to read. |
- Return values:
-
Character | array, or NULL if no characters left. |
Definition at line 128 of file s_textbuffer.c.
const gchar* s_textbuffer_next_line |
( |
TextBuffer * |
tb | ) |
|
- Function description
- Get the next line of characters from a TextBuffer, starting from the current position. If the end of the buffer has been reached (and thus no more characters remain) returns null.
The returned character array should be considered highly volatile, and is only valid until the next call to s_textbuffer_next() or s_textbuffer_next_line().
- Parameters:
-
tb | TextBuffer to read from. |
- Return values:
-
Character | array, or NULL if no characters left. |
Definition at line 193 of file s_textbuffer.c.