From 1ec2a37465e2d1785ace8df19f1af5bbebdff1d0 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 24 Jan 2001 00:32:35 +0000 Subject: Removed some redundant debug printfs. (e_sexp_term_eval): Dont allocate 2001-01-24 Not Zed * e-sexp.c: Removed some redundant debug printfs. (e_sexp_term_eval): Dont allocate result till we have it. so we can have a fatal error, and not leak it. (term_eval_plus): If we have to abort, free our arguments. (term_eval_sub): Same. (parse_new_term): Renamed to parse_term_new for consistency. Fixed callers. svn path=/trunk/; revision=7766 --- e-util/e-sexp.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'e-util/e-sexp.h') diff --git a/e-util/e-sexp.h b/e-util/e-sexp.h index cfedaea98b..3584abcaf5 100644 --- a/e-util/e-sexp.h +++ b/e-util/e-sexp.h @@ -123,25 +123,30 @@ void e_sexp_add_function (ESExp *f, int scope, char *name, ESExpFunc *func, v 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); +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); +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_term_eval (struct _ESExp *f, struct _ESExpTerm *t); ESExpResult *e_sexp_result_new (int type); -void e_sexp_result_free (struct _ESExpResult *t); +void e_sexp_result_free (struct _ESExpResult *t); + +/* used in normal functions if they have to abort, to free their arguments */ +void e_sexp_resultv_free (struct _ESExp *f, int argc, struct _ESExpResult **argv); /* utility functions for creating s-exp strings. */ -void e_sexp_encode_bool(GString *s, gboolean state); -void e_sexp_encode_string(GString *s, const char *string); +void e_sexp_encode_bool (GString *s, gboolean state); +void e_sexp_encode_string (GString *s, const char *string); /* only to be called from inside a callback to signal a fatal execution error */ -void e_sexp_fatal_error(struct _ESExp *f, char *why, ...); -const char *e_sexp_error(struct _ESExp *f); +void e_sexp_fatal_error (struct _ESExp *f, char *why, ...); + +/* return the error string */ +const char *e_sexp_error (struct _ESExp *f); #endif /* _E_SEXP_H */ -- cgit