Audacious
$Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include "tuple_compiler.h"
Go to the source code of this file.
Classes | |
struct | TupleEvalNode |
struct | TupleEvalVar |
struct | TupleEvalContext |
Macros | |
#define | MAX_STR (256) |
#define | MIN_ALLOC_NODES (8) |
#define | MIN_ALLOC_BUF (64) |
#define | TUPLEZ_MAX_VARS (4) |
#define | tuple_error(ctx,...) fprintf (stderr, "Tuple compiler: " __VA_ARGS__) |
Enumerations | |
enum | { OP_RAW = 0, OP_FIELD, OP_EXISTS, OP_EQUALS, OP_NOT_EQUALS, OP_GT, OP_GTEQ, OP_LT, OP_LTEQ, OP_IS_EMPTY } |
enum | { TUPLE_VAR_FIELD = 0, TUPLE_VAR_CONST } |
Functions | |
static void | tuple_evalctx_free_var (TupleEvalVar *var) |
TupleEvalContext * | tuple_evalctx_new (void) |
void | tuple_evalctx_reset (TupleEvalContext *ctx) |
void | tuple_evalctx_free (TupleEvalContext *ctx) |
static int | tuple_evalctx_add_var (TupleEvalContext *ctx, const char *name, const int type, const TupleValueType ctype) |
static void | tuple_evalnode_insert (TupleEvalNode **nodes, TupleEvalNode *node) |
static TupleEvalNode * | tuple_evalnode_new (void) |
void | tuple_evalnode_free (TupleEvalNode *expr) |
static TupleEvalNode * | tuple_compiler_pass1 (int *level, TupleEvalContext *ctx, const char **expression) |
static bool_t | tc_get_item (TupleEvalContext *ctx, const char **str, char *buf, gssize max, char endch, bool_t *literal, char *errstr, const char *item) |
static int | tc_get_variable (TupleEvalContext *ctx, char *name, int type) |
static bool_t | tc_parse_construct (TupleEvalContext *ctx, TupleEvalNode **res, const char *item, const char **c, int *level, int opcode) |
TupleEvalNode * | tuple_formatter_compile (TupleEvalContext *ctx, const char *expr) |
static bool_t | tf_get_fieldval (TupleEvalVar *var, const Tuple *tuple) |
static TupleValueType | tf_get_var (char **tmps, int *tmpi, TupleEvalVar *var, const Tuple *tuple) |
static bool_t | tuple_formatter_eval_do (TupleEvalContext *ctx, TupleEvalNode *expr, const Tuple *tuple, GString *out) |
void | tuple_formatter_eval (TupleEvalContext *ctx, TupleEvalNode *expr, const Tuple *tuple, GString *out) |
#define MAX_STR (256) |
Definition at line 44 of file tuple_compiler.c.
Referenced by tc_parse_construct(), tuple_compiler_pass1(), and tuple_formatter_eval_do().
#define MIN_ALLOC_BUF (64) |
Definition at line 46 of file tuple_compiler.c.
#define MIN_ALLOC_NODES (8) |
Definition at line 45 of file tuple_compiler.c.
Referenced by tuple_evalctx_add_var().
#define tuple_error | ( | ctx, | |
... | |||
) | fprintf (stderr, "Tuple compiler: " __VA_ARGS__) |
Definition at line 49 of file tuple_compiler.c.
Referenced by tc_get_item(), tc_parse_construct(), tuple_compiler_pass1(), tuple_formatter_compile(), and tuple_formatter_eval_do().
#define TUPLEZ_MAX_VARS (4) |
Definition at line 47 of file tuple_compiler.c.
anonymous enum |
Enumerator | |
---|---|
OP_RAW | |
OP_FIELD | |
OP_EXISTS | |
OP_EQUALS | |
OP_NOT_EQUALS | |
OP_GT | |
OP_GTEQ | |
OP_LT | |
OP_LTEQ | |
OP_IS_EMPTY |
Definition at line 51 of file tuple_compiler.c.
anonymous enum |
Enumerator | |
---|---|
TUPLE_VAR_FIELD | |
TUPLE_VAR_CONST |
Definition at line 64 of file tuple_compiler.c.
|
static |
Definition at line 227 of file tuple_compiler.c.
Referenced by tc_parse_construct(), and tuple_compiler_pass1().
Definition at line 287 of file tuple_compiler.c.
Referenced by tc_parse_construct(), and tuple_compiler_pass1().
|
static |
Definition at line 310 of file tuple_compiler.c.
Referenced by tuple_compiler_pass1().
|
static |
Definition at line 560 of file tuple_compiler.c.
Referenced by tf_get_var(), and tuple_formatter_eval_do().
|
static |
Definition at line 588 of file tuple_compiler.c.
Referenced by tuple_formatter_eval_do().
|
static |
Definition at line 349 of file tuple_compiler.c.
Referenced by tc_parse_construct(), and tuple_formatter_compile().
|
static |
Definition at line 143 of file tuple_compiler.c.
Referenced by tc_get_variable().
void tuple_evalctx_free | ( | TupleEvalContext * | ctx | ) |
Definition at line 127 of file tuple_compiler.c.
Referenced by tuple_formatter_process_string().
|
static |
Definition at line 93 of file tuple_compiler.c.
Referenced by tuple_evalctx_free().
TupleEvalContext* tuple_evalctx_new | ( | void | ) |
Definition at line 103 of file tuple_compiler.c.
Referenced by tuple_formatter_process_string().
void tuple_evalctx_reset | ( | TupleEvalContext * | ctx | ) |
Definition at line 111 of file tuple_compiler.c.
Referenced by tuple_formatter_process_string().
void tuple_evalnode_free | ( | TupleEvalNode * | expr | ) |
Definition at line 205 of file tuple_compiler.c.
Referenced by tc_parse_construct(), tuple_compiler_pass1(), tuple_evalnode_free(), tuple_formatter_compile(), and tuple_formatter_process_string().
|
static |
Definition at line 184 of file tuple_compiler.c.
Referenced by tc_parse_construct(), and tuple_compiler_pass1().
|
static |
Definition at line 199 of file tuple_compiler.c.
Referenced by tc_parse_construct(), and tuple_compiler_pass1().
TupleEvalNode* tuple_formatter_compile | ( | TupleEvalContext * | ctx, |
const char * | expr | ||
) |
Definition at line 541 of file tuple_compiler.c.
Referenced by tuple_formatter_process_string().
void tuple_formatter_eval | ( | TupleEvalContext * | ctx, |
TupleEvalNode * | expr, | ||
const Tuple * | tuple, | ||
GString * | out | ||
) |
Definition at line 761 of file tuple_compiler.c.
Referenced by tuple_formatter_process_string().
|
static |
Definition at line 623 of file tuple_compiler.c.
Referenced by tuple_formatter_eval().