clients/lib/xmmsclient/collparser.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "xmmsclient/xmmsclient.h"
#include "xmmsclientpriv/xmmsclient.h"
#include "xmmsc/xmmsc_idnumbers.h"

Go to the source code of this file.

Defines

#define XMMS_COLLECTION_PARSER_DEFAULT_NAMESPACE   "Collections"
#define TOKEN_MATCH_CHAR(symbol, type)   if (*tmp == (symbol)) { *newpos = tmp + 1; return coll_token_new (type, NULL); }
#define TOKEN_MATCH_STRING(expr, type)   if (strncmp (expr, tmp, strlen (expr)) == 0) { *newpos = tmp + strlen (expr); return coll_token_new (type, NULL); }
#define TOKEN_ASSERT(token, tktype)
#define PARSER_TRY(func)

Functions

int xmmsv_coll_parse (const char *pattern, xmmsv_coll_t **coll)
 Try to parse the given pattern to produce a collection structure.
int xmmsv_coll_parse_custom (const char *pattern, xmmsv_coll_parse_tokens_f parse_f, xmmsv_coll_parse_build_f build_f, xmmsv_coll_t **coll)
 Try to parse the given pattern to produce a collection structure, using custom token-parsing and collection-building functions.
xmmsv_coll_token_txmmsv_coll_default_parse_tokens (const char *str, const char **newpos)
 The default token parser.
xmmsv_coll_txmmsv_coll_default_parse_build (xmmsv_coll_token_t *tokens)
 Default collection structure builder.

Define Documentation

#define PARSER_TRY ( func   ) 
Value:
do { \
    pos = func (tokens, &coll); \
    if (coll) { \
        *ret = coll; \
        return pos; \
    } \
} while (0)

Definition at line 58 of file collparser.c.

#define TOKEN_ASSERT ( token,
tktype   ) 
Value:
do { \
    if (!token || (token->type != tktype)) { \
        *ret = NULL; \
        return tokens; \
    } \
} while (0)

Definition at line 51 of file collparser.c.

#define TOKEN_MATCH_CHAR ( symbol,
type   )     if (*tmp == (symbol)) { *newpos = tmp + 1; return coll_token_new (type, NULL); }

Definition at line 48 of file collparser.c.

Referenced by xmmsv_coll_default_parse_tokens().

#define TOKEN_MATCH_STRING ( expr,
type   )     if (strncmp (expr, tmp, strlen (expr)) == 0) { *newpos = tmp + strlen (expr); return coll_token_new (type, NULL); }

Definition at line 49 of file collparser.c.

Referenced by xmmsv_coll_default_parse_tokens().

#define XMMS_COLLECTION_PARSER_DEFAULT_NAMESPACE   "Collections"

Definition at line 27 of file collparser.c.


Generated on Tue Feb 23 18:17:57 2010 for XmmsClient by  doxygen 1.6.1