APG
… an ABNF Parser Generator
|
Header file for the lines
object.
More...
Go to the source code of this file.
Data Structures | |
struct | line |
Defines the characteristics of a single line. More... | |
Functions | |
void * | vpLinesCtor (exception *spEx, const char *cpInput, aint uiLength) |
The lines object constructor. More... | |
void | vLinesDtor (void *vpCtx) |
The lines object destructor. More... | |
line * | spLinesFirst (void *vpCtx) |
Initialize an iterator over the lines. More... | |
line * | spLinesNext (void *vpCtx) |
Returns the next line of text from the iterator. More... | |
aint | uiLinesCount (void *vpCtx) |
Returns the number of lines of text. More... | |
aint | uiLinesLength (void *vpCtx) |
Returns the number of text characters. More... | |
abool | bLinesFindLine (void *vpCtx, aint uiOffset, aint *uipLine, aint *uipRelOffset) |
Find the line that the given character is in. More... | |
Header file for the lines
object.
Definition in file lines.h.
Find the line that the given character is in.
vpCtx | Pointer to a lines context, previously returned from vpLinesCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
uiOffset | The zero-based offset of the character to find. |
uipLine | Pointer to an integer, set to the line number that the character is in on return. |
uipRelOffset | Pointer to an integer, on return, set to the offset of the character relative to the beginning of the line it is in. |
line* spLinesFirst | ( | void * | vpCtx | ) |
Initialize an iterator over the lines.
Sets up the iterator and returns the first line.
vpCtx | Pointer to a lines context, previously returned from vpLinesCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
line* spLinesNext | ( | void * | vpCtx | ) |
Returns the next line of text from the iterator.
vpCtx | Pointer to a lines context, previously returned from vpLinesCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
aint uiLinesCount | ( | void * | vpCtx | ) |
Returns the number of lines of text.
vpCtx | Pointer to a lines context, previously returned from vpLinesCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
aint uiLinesLength | ( | void * | vpCtx | ) |
Returns the number of text characters.
The number of all characters, including the line ending characters.
vpCtx | Pointer to a lines context, previously returned from vpLinesCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
void vLinesDtor | ( | void * | vpCtx | ) |
The lines
object destructor.
Releases all allocated memory and clears the context to prevent accidental reuse.
vpCtx | A pointer to a valid lines context previously return from vpLinesCtor(). Silently ignored if NULL. However, if non-NULL it must be a valid lines context pointer. The application will silently exit with BAD_CONTEXT exit code if vpCtx is invalid. |
The lines
object constructor.
Reads the character input and separates it into individual lines, generating a list of line structures, one for each line of text.
spEx | Pointer to a valid exception structure initialized with XCTOR(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
cpInput | - pointer to the array of characters |
uiLength | - the number of characters in the array |