aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-sexp.h
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-01-23 12:34:33 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-23 12:34:33 +0800
commit73053088aa1a33486a1bfb9637bf37f8bf984a18 (patch)
treee169496c2a5b23da16804ba2df4e0a2e5af14be9 /e-util/e-sexp.h
parent96be0c50f7dde84249db1194e69e8b146afc0687 (diff)
downloadgsoc2013-evolution-73053088aa1a33486a1bfb9637bf37f8bf984a18.tar
gsoc2013-evolution-73053088aa1a33486a1bfb9637bf37f8bf984a18.tar.gz
gsoc2013-evolution-73053088aa1a33486a1bfb9637bf37f8bf984a18.tar.bz2
gsoc2013-evolution-73053088aa1a33486a1bfb9637bf37f8bf984a18.tar.lz
gsoc2013-evolution-73053088aa1a33486a1bfb9637bf37f8bf984a18.tar.xz
gsoc2013-evolution-73053088aa1a33486a1bfb9637bf37f8bf984a18.tar.zst
gsoc2013-evolution-73053088aa1a33486a1bfb9637bf37f8bf984a18.zip
Setup error return and return error on parse error. (parse_list): Fail if
2001-01-23 Not Zed <NotZed@Ximian.com> * e-sexp.c (e_sexp_parse): Setup error return and return error on parse error. (parse_list): Fail if we have a problem. (parse_value): Here too. (fatal_error): Fatal error handling function, jumps back to the top caller. (term_eval_and): (e_sexp_term_eval): (term_eval_sub): (term_eval_plus): (term_eval_gt): (term_eval_lt): (term_eval_or): Fail on error. (e_sexp_term_eval): Added a comment about where this can be called, which is only from inside e_sexp_eval(). (e_sexp_eval): Setup setjmp error handler. (e_sexp_error): Error accessor function. * e-sexp.h: Added a longjmp environment to the structure, and an error return to parse. svn path=/trunk/; revision=7738
Diffstat (limited to 'e-util/e-sexp.h')
-rw-r--r--e-util/e-sexp.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/e-util/e-sexp.h b/e-util/e-sexp.h
index 5cf2740fc1..cfedaea98b 100644
--- a/e-util/e-sexp.h
+++ b/e-util/e-sexp.h
@@ -5,6 +5,7 @@
#define _E_SEXP_H
#include <glib.h>
+#include <setjmp.h>
#ifdef E_SEXP_IS_GTK_OBJECT
#include <gtk/gtk.h>
@@ -98,6 +99,10 @@ struct _ESExp {
#endif
GScanner *scanner; /* for parsing text version */
ESExpTerm *tree; /* root of expression tree */
+
+ /* private stuff */
+ jmp_buf failenv;
+ char *error;
};
struct _ESExpClass {
@@ -124,7 +129,7 @@ void e_sexp_input_text (ESExp *f, const char *text, int len);
void e_sexp_input_file (ESExp *f, int fd);
-void e_sexp_parse (ESExp *f);
+int e_sexp_parse (ESExp *f);
ESExpResult *e_sexp_eval (ESExp *f);
ESExpResult *e_sexp_term_eval (struct _ESExp *f, struct _ESExpTerm *t);
@@ -135,4 +140,8 @@ void e_sexp_result_free (struct _ESExpResult *t);
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);
+
#endif /* _E_SEXP_H */