From Colin O'Flynn:
[obnox/wireshark/wip.git] / color_filters.h
index 3daff3115314473291e3bb6631915b64ae8ba139..5d5c1ad1cff213523f913389ffc76a340e940368 100644 (file)
 #ifndef  __COLOR_FILTERS_H__
 #define  __COLOR_FILTERS_H__
 
-#define TEMP_COLOR_PREFIX       "___tmp_color_filter___"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define CONVERSATION_COLOR_PREFIX       "___conversation_color_filter___"
 /** @file
  *  Color filters.
  */
 
 /* Data for a color filter. */
 typedef struct _color_filter {
-        gchar     *filter_name;   /* name of the filter */
-        gchar     *filter_text;   /* text of the filter expression */
-        color_t    bg_color;      /* background color for packets that match */
-        color_t    fg_color;      /* foreground color for packets that match */
-       gboolean   disabled;      /* set if the filter is disabled */
-       gboolean   selected;      /* set if the filter is selected in the color dialog box */
-
-        /* only used inside of color_filters.c */
-        dfilter_t *c_colorfilter; /* compiled filter expression */
-
-        /* only used outside of color_filters.c (beside init) */
-        void      *edit_dialog;   /* if filter is being edited, dialog
-                                   * box for it */
+    gchar     *filter_name;   /* name of the filter */
+    gchar     *filter_text;   /* text of the filter expression */
+    color_t    bg_color;      /* background color for packets that match */
+    color_t    fg_color;      /* foreground color for packets that match */
+    gboolean   disabled;      /* set if the filter is disabled */
+    gboolean   selected;      /* set if the filter is selected in the color dialog box */
+
+    /* only used inside of color_filters.c */
+    dfilter_t *c_colorfilter; /* compiled filter expression */
+
+    /* only used outside of color_filters.c (beside init) */
+    void      *edit_dialog;   /* if filter is being edited, dialog
+                               * box for it */
 } color_filter_t;
 
 
 /** Init the color filters (incl. initial read from file). */
 void color_filters_init(void);
 
+/** Reload the color filters */
+void color_filters_reload(void);
+
 /** Cleanup remaining color filter zombies */
 void color_filters_cleanup(void);
 
@@ -59,6 +66,12 @@ void color_filters_cleanup(void);
  */
 gboolean color_filters_used(void);
 
+/** Are there any temporary coloring filters used?
+ *
+ * @return TRUE, if temporary coloring filters are used
+ */
+gboolean tmp_color_filters_used(void);
+
 /** En-/disable color filters
  *
  * @param enable TRUE to enable (default)
@@ -79,10 +92,10 @@ color_filters_set_tmp(guint8 filt_nr, gchar *filter, gboolean disabled);
  *
  */
 void
-color_filters_reset_tmp();
+color_filters_reset_tmp(void);
 
 /* Prime the epan_dissect_t with all the compiler
- * color filters of the current filter list. 
+ * color filters of the current filter list.
  *
  * @param the epan dissector details
  */
@@ -94,10 +107,8 @@ void color_filters_prime_edt(epan_dissect_t *edt);
  * @param edt the dissected packet
  * @return the matching color filter or NULL
  */
-color_filter_t *
-color_filters_colorize_packet(gint row, epan_dissect_t *edt);
-
-
+const color_filter_t *
+color_filters_colorize_packet(epan_dissect_t *edt);
 
 /** Clone the currently active filter list.
  *
@@ -161,6 +172,7 @@ gboolean color_filters_export(gchar *path, GSList *cfl, gboolean only_selected);
  * @param filter_string the filter string
  * @param bg_color background color
  * @param fg_color foreground color
+ * @param disabled gboolean
  * @return the new color filter
  */
 color_filter_t *color_filter_new(
@@ -182,6 +194,8 @@ void color_filter_delete(color_filter_t *colorf);
  */
 void color_filter_list_delete(GSList **cfl);
 
-
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
 
 #endif