#include <glib.h>
#include "ws_symbol_export.h"
#include <wsutil/color.h>
Go to the source code of this file.
|
#define | COLORFILTERS_FILE_NAME "colorfilters" |
|
#define | CONVERSATION_COLOR_PREFIX "___conversation_color_filter___" |
|
|
WS_DLL_PUBLIC bool | color_filters_init (char **err_msg, color_filter_add_cb_func add_cb) |
|
WS_DLL_PUBLIC bool | color_filters_reload (char **err_msg, color_filter_add_cb_func add_cb) |
|
WS_DLL_PUBLIC void | color_filters_cleanup (void) |
|
WS_DLL_PUBLIC bool | color_filters_used (void) |
|
WS_DLL_PUBLIC bool | tmp_color_filters_used (void) |
|
WS_DLL_PUBLIC char * | color_filters_get_tmp (uint8_t filt_nr) |
|
WS_DLL_PUBLIC bool | color_filters_set_tmp (uint8_t filt_nr, const char *filter, bool disabled, char **err_msg) |
|
WS_DLL_PUBLIC const color_filter_t * | color_filters_tmp_color (uint8_t filter_num) |
|
WS_DLL_PUBLIC bool | color_filters_reset_tmp (char **err_msg) |
|
WS_DLL_PUBLIC void | color_filters_prime_edt (struct epan_dissect *edt) |
|
WS_DLL_PUBLIC bool | color_filters_use_hfid (int hfid) |
|
WS_DLL_PUBLIC bool | color_filters_use_proto (int proto_id) |
|
WS_DLL_PUBLIC const color_filter_t * | color_filters_colorize_packet (struct epan_dissect *edt) |
|
WS_DLL_PUBLIC void | color_filters_clone (void *user_data, color_filter_add_cb_func add_cb) |
|
WS_DLL_PUBLIC bool | color_filters_import (const char *path, void *user_data, char **err_msg, color_filter_add_cb_func add_cb) |
|
WS_DLL_PUBLIC bool | color_filters_read_globals (void *user_data, char **err_msg, color_filter_add_cb_func add_cb) |
|
WS_DLL_PUBLIC bool | color_filters_apply (GSList *tmp_cfl, GSList *edit_cfl, char **err_msg) |
|
WS_DLL_PUBLIC bool | color_filters_write (GSList *cfl, char **err_msg) |
|
WS_DLL_PUBLIC bool | color_filters_export (const char *path, GSList *cfl, bool only_selected, char **err_msg) |
|
WS_DLL_PUBLIC color_filter_t * | color_filter_new (const char *name, const char *filter_string, color_t *bg_color, color_t *fg_color, bool disabled) |
|
WS_DLL_PUBLIC void | color_filter_delete (color_filter_t *colorf) |
|
WS_DLL_PUBLIC void | color_filter_list_delete (GSList **cfl) |
|
◆ color_filter_add_cb_func
typedef void(* color_filter_add_cb_func) (color_filter_t *colorf, void *user_data) |
A color filter was added (while importing). (color_filters.c calls this for every filter coming in)
- Parameters
-
colorf | the new color filter |
user_data | from caller |
◆ color_filter_delete()
Delete a single color filter (g_free'ed).
- Parameters
-
colorf | the color filter to be removed |
◆ color_filter_list_delete()
WS_DLL_PUBLIC void color_filter_list_delete |
( |
GSList ** |
cfl | ) |
|
Delete a filter list including all entries.
- Parameters
-
cfl | the filter list to delete |
◆ color_filter_new()
WS_DLL_PUBLIC color_filter_t * color_filter_new |
( |
const char * |
name, |
|
|
const char * |
filter_string, |
|
|
color_t * |
bg_color, |
|
|
color_t * |
fg_color, |
|
|
bool |
disabled |
|
) |
| |
Create a new color filter (g_malloc'ed).
- Parameters
-
name | the name of the filter |
filter_string | the filter string |
bg_color | background color |
fg_color | foreground color |
disabled | bool |
- Returns
- the new color filter
◆ color_filters_apply()
WS_DLL_PUBLIC bool color_filters_apply |
( |
GSList * |
tmp_cfl, |
|
|
GSList * |
edit_cfl, |
|
|
char ** |
err_msg |
|
) |
| |
Apply a changed filter list.
- Parameters
-
tmp_cfl | the temporary color filter list to apply |
edit_cfl | the edited permanent color filter list to apply |
err_msg | a string with error message |
◆ color_filters_cleanup()
WS_DLL_PUBLIC void color_filters_cleanup |
( |
void |
| ) |
|
Cleanup remaining color filter zombies
◆ color_filters_clone()
Clone the currently active filter list.
- Parameters
-
user_data | will be returned by each call to color_filter_add_cb() |
add_cb | the callback function to add color filter |
◆ color_filters_colorize_packet()
Colorize a specific packet.
- Parameters
-
- Returns
- the matching color filter or NULL
◆ color_filters_export()
WS_DLL_PUBLIC bool color_filters_export |
( |
const char * |
path, |
|
|
GSList * |
cfl, |
|
|
bool |
only_selected, |
|
|
char ** |
err_msg |
|
) |
| |
Save filters (export) to some other filter file.
- Parameters
-
path | the path to the filter file |
cfl | the filter list to write |
only_selected | true if only the selected filters should be saved |
err_msg | a string with error message |
- Returns
- true, if write succeeded
◆ color_filters_get_tmp()
WS_DLL_PUBLIC char * color_filters_get_tmp |
( |
uint8_t |
filt_nr | ) |
|
Get the filter string of a temporary color filter
- Parameters
-
filt_nr | a number 1-10 pointing to a temporary color |
- Returns
- the current filter string which is assigned to the specified slot, or NULL if not available.
◆ color_filters_import()
WS_DLL_PUBLIC bool color_filters_import |
( |
const char * |
path, |
|
|
void * |
user_data, |
|
|
char ** |
err_msg, |
|
|
color_filter_add_cb_func |
add_cb |
|
) |
| |
Load filters (import) from some other filter file.
- Parameters
-
path | the path to the import file |
user_data | will be returned by each call to color_filter_add_cb() |
err_msg | a string with error message |
add_cb | the callback function to add color filter |
- Returns
- true, if read succeeded
◆ color_filters_init()
Init the color filters (incl. initial read from file).
◆ color_filters_read_globals()
Read filters from the global filter file (not the users file).
- Parameters
-
user_data | will be returned by each call to color_filter_add_cb() |
err_msg | a string with error message |
add_cb | the callback function to add color filter |
- Returns
- true, if read succeeded
◆ color_filters_reload()
◆ color_filters_reset_tmp()
WS_DLL_PUBLIC bool color_filters_reset_tmp |
( |
char ** |
err_msg | ) |
|
Reset the temporary color filters
◆ color_filters_set_tmp()
WS_DLL_PUBLIC bool color_filters_set_tmp |
( |
uint8_t |
filt_nr, |
|
|
const char * |
filter, |
|
|
bool |
disabled, |
|
|
char ** |
err_msg |
|
) |
| |
Set the filter string of a temporary color filter
- Parameters
-
filt_nr | a number 1-10 pointing to a temporary color |
filter | the new filter-string |
disabled | whether the filter-rule should be disabled |
err_msg | a string with error message |
◆ color_filters_tmp_color()
WS_DLL_PUBLIC const color_filter_t * color_filters_tmp_color |
( |
uint8_t |
filter_num | ) |
|
Get a temporary color filter.
- Parameters
-
filter_num | A number from 1 to 10 specifying the color to fetch. |
- Returns
- The corresponding color or NULL.
◆ color_filters_use_hfid()
WS_DLL_PUBLIC bool color_filters_use_hfid |
( |
int |
hfid | ) |
|
Check if any of the enabled compiled color filters of the current filter list depend on a given header field.
- Parameters
-
hfid | The header field ID to check |
- Returns
- true if the color filter contains the header field.
◆ color_filters_use_proto()
WS_DLL_PUBLIC bool color_filters_use_proto |
( |
int |
proto_id | ) |
|
Check if any of the enabled compiled color filters of the current filter list depend on any field in a given protocol.
- Parameters
-
proto_id | The protocol ID to check |
- Returns
- true if the color filter contains a field from the protocol
◆ color_filters_used()
WS_DLL_PUBLIC bool color_filters_used |
( |
void |
| ) |
|
Color filters currently used?
- Returns
- true, if filters are used
◆ color_filters_write()
WS_DLL_PUBLIC bool color_filters_write |
( |
GSList * |
cfl, |
|
|
char ** |
err_msg |
|
) |
| |
Save filters in users filter file.
- Parameters
-
cfl | the filter list to write |
err_msg | a string with error message |
- Returns
- true if write succeeded
◆ tmp_color_filters_used()
WS_DLL_PUBLIC bool tmp_color_filters_used |
( |
void |
| ) |
|
Are there any temporary coloring filters used?
- Returns
- true, if temporary coloring filters are used