Top | ![]() |
![]() |
![]() |
![]() |
CamelSExpResult | (*CamelSExpFunc) () |
CamelSExpResult | (*CamelSExpIFunc) () |
CamelSExp * | camel_sexp_new () |
|
camel_sexp_add_function () |
|
camel_sexp_add_ifunction () |
|
camel_sexp_add_variable () |
|
camel_sexp_remove_symbol () |
|
camel_sexp_set_scope () |
|
camel_sexp_input_text () |
|
camel_sexp_input_file () |
|
camel_sexp_parse () |
CamelSExpResult * | camel_sexp_eval () |
CamelSExpResult * | camel_sexp_term_eval () |
CamelSExpResult * | camel_sexp_result_new () |
|
camel_sexp_result_free () |
|
camel_sexp_resultv_free () |
|
camel_sexp_encode_bool () |
|
camel_sexp_encode_string () |
|
camel_sexp_fatal_error () |
const |
camel_sexp_error () |
CamelSExpTerm * | camel_sexp_parse_value () |
|
camel_sexp_evaluate_occur_times () |
enum | CamelSExpResultType |
struct | CamelSExpResult |
enum | CamelSExpTermType |
struct | CamelSExpSymbol |
struct | CamelSExpTerm |
struct | CamelSExp |
CamelSExpResult (*CamelSExpFunc) (CamelSExp *sexp
,,
gint argcCamelSExpResult **argv
,);
gpointer user_data
Callback type for function symbols used with camel_sexp_add_function()
.
sexp |
||
argc |
count of arguments |
|
argv |
array of values of the arguments. |
[in][array length=argc] |
user_data |
user data as passed to |
Since: 3.4
CamelSExpResult (*CamelSExpIFunc) (CamelSExp *sexp
,,
gint argcCamelSExpTerm **argv
,);
gpointer user_data
Callback type for function symbols used with camel_sexp_add_ifunction()
.
sexp |
||
argc |
count of arguments |
|
argv |
array of values of the arguments. |
[in][array length=argc] |
user_data |
user data as passed to |
Since: 3.4
void camel_sexp_add_function (CamelSExp *sexp
,,
guint scopeconst
,gchar *nameCamelSExpFunc func
,);
gpointer user_data
Adds a function symbol which can not perform short evaluation.
Use camel_sexp_add_ifunction()
for functions which can.
sexp |
||
scope |
a scope |
|
name |
a function name |
|
func |
a function callback. |
[scope call][closure user_data] |
user_data |
user data for |
Since: 3.4
void camel_sexp_add_ifunction (CamelSExp *sexp
,,
guint scopeconst
,gchar *nameCamelSExpIFunc ifunc
,);
gpointer user_data
Adds a function symbol which can perform short evaluation,
or doesn't execute everything. Use camel_sexp_add_function()
for any other types of the function symbols.
sexp |
||
scope |
a scope |
|
name |
a function name |
|
ifunc |
a function callback. |
[scope call][closure user_data] |
user_data |
user data for |
Since: 3.4
void camel_sexp_add_variable (CamelSExp *sexp
,,
guint scopeconst
,gchar *nameCamelSExpTerm *value
);
Adds a variable named name
to the given scope
, set to the given value
.
Since: 3.4
void camel_sexp_remove_symbol (CamelSExp *sexp
,,
guint scopeconst
);gchar *name
Revoes a symbol from a scope.
Since: 3.4
gint camel_sexp_set_scope (CamelSExp *sexp
,);
guint scope
sets the current scope for the scanner.
Since: 3.4
void camel_sexp_input_text (CamelSExp *sexp
,const
,gchar *text);
gint len
Prepares to scan a text buffer.
Since: 3.4
void camel_sexp_input_file (CamelSExp *sexp
,);
gint fd
Prepares to scan a file.
Since: 3.4
CamelSExpResult * camel_sexp_term_eval (CamelSExp *sexp
,CamelSExpTerm *term
);
Evaluates a part of the expression.
[skip]
a newly allocated result of the evaluation. Free
the returned pointer with camel_sexp_result_free()
, when no longer needed.
[transfer full]
Since: 3.4
CamelSExpResult * camel_sexp_result_new (CamelSExp *sexp
,);
gint type
[skip]
A new CamelSExpResult result structure, associated with sexp
.
Free with camel_sexp_result_free()
, when no longer needed.
[transfer full]
Since: 3.4
void camel_sexp_result_free (CamelSExp *sexp
,CamelSExpResult *result
);
Frees the result
and its internal data. Does nothing,
when the result
is NULL
Since: 3.4
void camel_sexp_resultv_free (CamelSExp *sexp
,,
gint argcCamelSExpResult **argv
);
Frees an array of results.
sexp |
||
argc |
a count of the |
|
argv |
an array of CamelSExpResult to free. |
[array length=argc] |
Since: 3.4
void camel_sexp_encode_bool (,
GString *string);
gboolean v_bool
Encode a bool into an s-expression string
. Bools are
encoded using #t #f syntax.
Since: 3.4
void camel_sexp_encode_string (,
GString *stringconst
);gchar *v_string
Add a c string v_string
to the s-expression stored in
the gstring s
. Quotes are added, and special characters
are escaped appropriately.
Since: 3.4
void camel_sexp_fatal_error (CamelSExp *sexp
,const
,gchar *why...
);
Sets an error from the given format and stops execution. Int replaces previously set error, if any.
Since: 3.4
CamelSExpTerm *
camel_sexp_parse_value (CamelSExp *sexp
);
[skip]
Since: 3.4
gboolean camel_sexp_evaluate_occur_times (CamelSExp *sexp
,,
time_t *start);
time_t *end
struct CamelSExpResult { CamelSExpResultType 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; };
CamelSExpResultType |
a CamelSExpResultType, defining the |
|
a boolean whether the occuring times are used |
||
start time |
||
end time |
Since: 3.4
Defines type of a CamelSExpTerm and partly also CamelSExpSymbol
integer literal |
||
boolean literal |
||
string literal |
||
time_t literal (number of seconds past the epoch) |
||
normal function, arguments are evaluated before calling |
||
immediate function, raw terms are arguments |
||
variable reference |
Since: 3.4
struct CamelSExpSymbol { gint type; /* TERM_FUNC or TERM_VAR */ gchar *name; gpointer data; union { CamelSExpFunc func; CamelSExpIFunc ifunc; } f; };
Describes a function or a variable symbol
Since: 3.4
struct CamelSExpTerm { CamelSExpTermType type; union { gchar *string; gint number; gint boolean; time_t time; struct { CamelSExpSymbol *sym; CamelSExpTerm **terms; gint termcount; } func; CamelSExpSymbol *var; } value; };
Since: 3.4