Functions
e_sexp_new ()
ESExp *
e_sexp_new (void);
e_sexp_add_function ()
void
e_sexp_add_function (ESExp *sexp,
gint scope,
const gchar *name,
ESExpFunc *func,
gpointer data);
e_sexp_add_ifunction ()
void
e_sexp_add_ifunction (ESExp *sexp,
gint scope,
const gchar *name,
ESExpIFunc *func,
gpointer data);
e_sexp_add_variable ()
void
e_sexp_add_variable (ESExp *sexp,
gint scope,
gchar *name,
ESExpTerm *value);
e_sexp_remove_symbol ()
void
e_sexp_remove_symbol (ESExp *sexp,
gint scope,
const gchar *name);
e_sexp_set_scope ()
gint
e_sexp_set_scope (ESExp *sexp,
gint scope);
e_sexp_input_text ()
void
e_sexp_input_text (ESExp *sexp,
const gchar *text,
gint len);
e_sexp_input_file ()
void
e_sexp_input_file (ESExp *sexp,
gint fd);
e_sexp_parse ()
gint
e_sexp_parse (ESExp *sexp);
e_sexp_resultv_free ()
void
e_sexp_resultv_free (ESExp *sexp,
gint argc,
ESExpResult **argv);
e_sexp_encode_bool ()
void
e_sexp_encode_bool (GString *s,
gboolean state);
Encode a bool into an s-expression s
. Bools are
encoded using #t #f syntax.
e_sexp_encode_string ()
void
e_sexp_encode_string (GString *s,
const gchar *string);
Add a c string string
to the s-expression stored in
the gstring s
. Quotes are added, and special characters
are escaped appropriately.
e_sexp_fatal_error ()
void
e_sexp_fatal_error (ESExp *sexp,
const gchar *why,
...);
e_sexp_get_error ()
const gchar *
e_sexp_get_error (ESExp *sexp);
e_sexp_evaluate_occur_times ()
gboolean
e_sexp_evaluate_occur_times (ESExp *sexp,
time_t *start,
time_t *end);
Types and Values
struct ESExpResult
struct ESExpResult {
ESExpResultType type;
union {
GPtrArray *ptrarray;
gint number;
gchar *string;
gint boolean;
time_t time;
} value;
gboolean time_generator;
time_t occuring_start;
time_t occuring_end;
};
struct ESExpSymbol
struct ESExpSymbol {
gint type; /* ESEXP_TERM_FUNC or ESEXP_TERM_VAR */
gchar *name;
gpointer data;
union {
ESExpFunc *func;
ESExpIFunc *ifunc;
} f;
};
struct ESExpTerm
struct ESExpTerm {
ESExpTermType type;
union {
gchar *string;
gint number;
gint boolean;
time_t time;
struct {
struct _ESExpSymbol *sym;
struct _ESExpTerm **terms;
gint termcount;
} func;
struct _ESExpSymbol *var;
} value;
};