summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-03-07 15:36:07 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2011-03-07 15:36:07 +0100
commitf2e2bba844ed36ab3b9ce0c936dad673cfc865b9 (patch)
tree108183211df07ed372b16916fa7dfdbc23070f36 /src/include
parentc9ab6a163d96771d9a731ba93ec500c40683c923 (diff)
downloadabrt-f2e2bba844ed36ab3b9ce0c936dad673cfc865b9.tar.gz
abrt-f2e2bba844ed36ab3b9ce0c936dad673cfc865b9.tar.xz
abrt-f2e2bba844ed36ab3b9ce0c936dad673cfc865b9.zip
added function to parse event description from xml file
Diffstat (limited to 'src/include')
-rw-r--r--src/include/Makefile.am3
-rw-r--r--src/include/abrtlib.h3
-rw-r--r--src/include/report/event_xml_parser.h41
3 files changed, 46 insertions, 1 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 477963c3..e21b043b 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -2,7 +2,8 @@ libreport_includedir = $(includedir)/report
libreport_include_HEADERS = \
report/crash_data.h \
report/dump_dir.h \
- report/run_event.h
+ report/run_event.h \
+ report/event_xml_parser.h
libabrt_includedir = $(includedir)/abrt
libabrt_include_HEADERS = \
diff --git a/src/include/abrtlib.h b/src/include/abrtlib.h
index 116f4b36..1b2f6bbc 100644
--- a/src/include/abrtlib.h
+++ b/src/include/abrtlib.h
@@ -82,6 +82,7 @@ int vdprintf(int d, const char *format, va_list ap);
#include "abrt_types.h"
#include "dump_dir.h"
#include "run_event.h"
+#include "event_xml_parser.h"
#ifdef __cplusplus
@@ -256,6 +257,8 @@ void parse_release_for_rhts(const char *pRelease, char **product, char **version
#define load_conf_file abrt_load_conf_file
bool load_conf_file(const char *pPath, map_string_h *settings, bool skipKeysWithoutValue);
+void load_event_description_from_file(event_obj_t *event_desc, const char* filename);
+
/* Tries to create a copy of dump_dir_name in base_dir, with same or similar basename.
* Returns NULL if copying failed. In this case, logs a message before returning. */
#define steal_directory abrt_steal_directory
diff --git a/src/include/report/event_xml_parser.h b/src/include/report/event_xml_parser.h
new file mode 100644
index 00000000..caf81506
--- /dev/null
+++ b/src/include/report/event_xml_parser.h
@@ -0,0 +1,41 @@
+#include <glib.h>
+
+typedef enum
+{
+ OPTION_TYPE_TEXT,
+ OPTION_TYPE_BOOL,
+ OPTION_TYPE_PASSWORD,
+ OPTION_TYPE_NUMBER,
+ OPTION_TYPE_INVALID,
+} option_type_t;
+
+/*
+ * struct to hold information about config options
+ * it's supposed to hold information about:
+ * type -> which designates the widget used to display it and we can do some test based on the type
+ * label
+ * allowed value(s) -> regexp?
+ * name -> env variable name
+ * value -> value retrieved from the gui, so when we want to set the env
+ * evn variables, we can just traverse the list of the options
+ * and set the env variables according to name:value in this structure
+ */
+typedef struct
+{
+ const char* label;
+ const char* name; //name of the value which should be used for env variable
+ char *value;
+ option_type_t type;
+ const char* description; //can be used as tooltip in gtk app
+ const char* allowed_value;
+ int required;
+} event_option_obj_t;
+
+//structure to hold the option data
+typedef struct
+{
+ const char *name; //name of the event "Bugzilla" "RedHat Support Uploader"
+ const char *title; //window title - not used right now, maybe the "name" is enough?
+ const char *action;//action description to show in gui like: Upload report to the Red Hat bugzilla"
+ GList *options;
+} event_obj_t;