| Evolution API Reference: libedataserver, utility library | ||||
|---|---|---|---|---|
ESExp;
ESExpSymbol;
ESExpResult;
ESExpTerm;
ESExp* e_sexp_new (void);
void e_sexp_ref (ESExp *f);
void e_sexp_unref (ESExp *f);
void e_sexp_add_function (ESExp *f,
int scope,
char *name,
ESExpFunc *func,
void *data);
void e_sexp_add_ifunction (ESExp *f,
int scope,
char *name,
ESExpIFunc *func,
void *data);
void e_sexp_add_variable (ESExp *f,
int scope,
char *name,
ESExpTerm *value);
void e_sexp_remove_symbol (ESExp *f,
int scope,
char *name);
int e_sexp_set_scope (ESExp *f,
int scope);
void e_sexp_input_text (ESExp *f,
const char *text,
int len);
void e_sexp_input_file (ESExp *f,
int fd);
int e_sexp_parse (ESExp *f);
ESExpResult* e_sexp_eval (ESExp *f);
ESExpResult* e_sexp_term_eval (struct _ESExp *f,
struct _ESExpTerm *t);
ESExpResult* e_sexp_result_new (struct _ESExp *f,
int type);
void e_sexp_result_free (struct _ESExp *f,
struct _ESExpResult *t);
void e_sexp_resultv_free (struct _ESExp *f,
int argc,
struct _ESExpResult **argv);
void e_sexp_encode_bool (GString *s,
gboolean state);
void e_sexp_encode_string (GString *s,
const char *string);
void e_sexp_fatal_error (struct _ESExp *f,
char *why,
...);
const char* e_sexp_error (struct _ESExp *f);
typedef struct {
#ifdef E_SEXP_IS_G_OBJECT
GObject parent_object;
#else
int refcount;
#endif
GScanner *scanner; /* for parsing text version */
ESExpTerm *tree; /* root of expression tree */
/* private stuff */
jmp_buf failenv;
char *error;
/* TODO: may also need a pool allocator for term strings, so we dont lose them
in error conditions? */
struct _EMemChunk *term_chunks;
struct _EMemChunk *result_chunks;
} ESExp;
typedef struct {
int type; /* ESEXP_TERM_FUNC or ESEXP_TERM_VAR */
char *name;
void *data;
union {
ESExpFunc *func;
ESExpIFunc *ifunc;
} f;
} ESExpSymbol;
typedef struct {
enum _ESExpResultType type;
union {
GPtrArray *ptrarray;
int number;
char *string;
int bool;
time_t time;
} value;
} ESExpResult;
typedef struct {
enum _ESExpTermType type;
union {
char *string;
int number;
int bool;
time_t time;
struct {
struct _ESExpSymbol *sym;
struct _ESExpTerm **terms;
int termcount;
} func;
struct _ESExpSymbol *var;
} value;
} ESExpTerm;
void e_sexp_add_function (ESExp *f, int scope, char *name, ESExpFunc *func, void *data);
|
|
|
|
|
|
|
|
|
void e_sexp_add_ifunction (ESExp *f, int scope, char *name, ESExpIFunc *func, void *data);
|
|
|
|
|
|
|
|
|
void e_sexp_add_variable (ESExp *f, int scope, char *name, ESExpTerm *value);
|
|
|
|
|
|
|
void e_sexp_remove_symbol (ESExp *f, int scope, char *name);
|
|
|
|
|
ESExpResult* e_sexp_term_eval (struct _ESExp *f, struct _ESExpTerm *t);
|
|
|
|
Returns : |
ESExpResult* e_sexp_result_new (struct _ESExp *f, int type);
|
|
|
|
Returns : |
void e_sexp_resultv_free (struct _ESExp *f,
int argc,
struct _ESExpResult **argv);
|
|
|
|
|