mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
parser, text: added functions for accessing state variables - headers
This commit is contained in:
parent
bc632122a5
commit
7f9fe71ed9
2 changed files with 58 additions and 14 deletions
|
@ -214,9 +214,45 @@ void psyc_setParseListBuffer2 (psycParseListState* state, char *buffer, size_t l
|
|||
}
|
||||
|
||||
static inline
|
||||
size_t psyc_getContentLength (psycParseState* s)
|
||||
size_t psyc_getParseContentLength (psycParseState *state)
|
||||
{
|
||||
return s->contentLength;
|
||||
return state->contentLength;
|
||||
}
|
||||
|
||||
static inline
|
||||
psycBool psyc_isParseContentLengthFound (psycParseState *state)
|
||||
{
|
||||
return state->contentLengthFound;
|
||||
}
|
||||
|
||||
static inline
|
||||
size_t psyc_getParseValueLength (psycParseState *state)
|
||||
{
|
||||
return state->valueLength;
|
||||
}
|
||||
|
||||
static inline
|
||||
size_t psyc_getParseCursor (psycParseState *state)
|
||||
{
|
||||
return state->cursor;
|
||||
}
|
||||
|
||||
static inline
|
||||
size_t psyc_getParseBufferLength (psycParseState *state)
|
||||
{
|
||||
return state->buffer.length;
|
||||
}
|
||||
|
||||
static inline
|
||||
size_t psyc_getParseRemainingLength (psycParseState *state)
|
||||
{
|
||||
return state->buffer.length - state->cursor;
|
||||
}
|
||||
|
||||
static inline
|
||||
const char * psyc_getParseRemainingBuffer (psycParseState *state)
|
||||
{
|
||||
return state->buffer.ptr + state->cursor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -232,12 +268,14 @@ size_t psyc_getContentLength (psycParseState* s)
|
|||
* @param value A pointer to a psycString. It will point to the
|
||||
* value/body the variable/method and its length will be set accordingly
|
||||
*/
|
||||
psycParseRC psyc_parse (psycParseState* state, char* oper, psycString* name, psycString* value);
|
||||
psycParseRC psyc_parse (psycParseState *state, char *oper,
|
||||
psycString *name, psycString *value);
|
||||
|
||||
/**
|
||||
* List value parser.
|
||||
*/
|
||||
psycParseListRC psyc_parseList (psycParseListState* state, psycString *name, psycString* value, psycString* elem);
|
||||
psycParseListRC psyc_parseList (psycParseListState *state, psycString *name,
|
||||
psycString *value, psycString *elem);
|
||||
|
||||
#endif // PSYC_PARSER_H
|
||||
|
||||
|
|
|
@ -131,6 +131,12 @@ void psyc_setTextBuffer2 (psycTextState* state,
|
|||
psyc_setTextBuffer(state, psyc_newString(buffer, length));
|
||||
}
|
||||
|
||||
static inline
|
||||
size_t psyc_getTextBytesWritten (psycTextState *state)
|
||||
{
|
||||
return state->written;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills out text templates by asking a callback for content.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue