82 const char* text = buffer;
107const char*
Com_Parse (
const char* data_p[],
char* target,
size_t size,
bool replaceWhitespaces)
135 while ((c = *
data) <=
' ') {
144 if (c ==
'/' &&
data[1] ==
'*') {
147 while (!((
data[clen] &&
data[clen] ==
'*') && (
data[clen + 1] &&
data[clen + 1] ==
'/'))) {
155 if (c ==
'/' &&
data[1] ==
'/') {
166 if (c ==
'\\' &&
data[0] ==
'n') {
167 if (replaceWhitespaces) {
171 }
else if (c ==
'\\' &&
data[0] ==
't') {
172 if (replaceWhitespaces) {
177 }
else if (c ==
'\\' &&
data[0] ==
'\"') {
180 }
else if (c ==
'\"' || !c) {
185 }
else if (c ==
'\0') {
212 if (c ==
'{' || c ==
'}' || c ==
'(' || c ==
')' || c ==
',') {
215 target[
len + 1] =
'\0';
234 if (c ==
'{' || c ==
'}' || c ==
'(' || c ==
')' || c ==
',')
261 else if (*token ==
'}')
263 }
while (depth && *text);
279 const char* end = *text - 1;
Defined CONSTANTS (Macros are elsewhere).
static bool isUnparsedToken
const char * Com_Parse(const char *data_p[], char *target, size_t size, bool replaceWhitespaces)
Parse a token out of a string.
void Com_SkipBlock(const char **text)
Skips a block of {} in our script files.
static char com_token[4096]
const char * Com_GetToken(const char **data_p)
Get the current token value.
int Com_CountTokensInBuffer(const char *buffer)
Counts the tokens in the given buffer that the Com_Parse function would extract.
void Com_UnParseLastToken(void)
Put back the last token into the parser The next call of Com_Parse will return the same token again.
int Com_GetBlock(const char **text, const char **start)
Get the start and end point of a block in the given text.
Com_TokenType_t Com_NextToken(const char **data_p)
Compute the next token.
Com_TokenType_t Com_GetType(const char **data_p)
Get the current token type.
Shared parsing functions.
QGL_EXTERN GLuint GLchar GLuint * len
QGL_EXTERN GLsizei const GLvoid * data
QGL_EXTERN GLint GLenum type
Cross-platform type definitions.