diff options
Diffstat (limited to 'extcap_parser.c')
-rw-r--r-- | extcap_parser.c | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/extcap_parser.c b/extcap_parser.c index 8a5e56ad..1d06f677 100644 --- a/extcap_parser.c +++ b/extcap_parser.c @@ -25,17 +25,17 @@ #include "ws_attributes.h" void extcap_printf_complex(extcap_complex *comp) { - gchar *ret = extcap_get_complex_as_string(comp); + char *ret = extcap_get_complex_as_string(comp); printf("%s", ret); g_free(ret); } -gchar *extcap_get_complex_as_string(extcap_complex *comp) { +char *extcap_get_complex_as_string(extcap_complex *comp) { return (comp ? g_strdup(comp->_val) : NULL); } extcap_complex *extcap_parse_complex(extcap_arg_type complex_type, - const gchar *data) { + const char *data) { extcap_complex *rc = g_new0(extcap_complex, 1); @@ -45,14 +45,14 @@ extcap_complex *extcap_parse_complex(extcap_arg_type complex_type, return rc; } -gboolean extcap_compare_is_default(extcap_arg *element, extcap_complex *test) { +bool extcap_compare_is_default(extcap_arg *element, extcap_complex *test) { if (element == NULL || element->default_complex == NULL || test == NULL) - return FALSE; + return false; if (g_strcmp0(element->default_complex->_val, test->_val) == 0) - return TRUE; + return true; - return FALSE; + return false; } void extcap_free_complex(extcap_complex *comp) { @@ -61,61 +61,61 @@ void extcap_free_complex(extcap_complex *comp) { g_free(comp); } -gint extcap_complex_get_int(extcap_complex *comp) { +int extcap_complex_get_int(extcap_complex *comp) { if (comp == NULL || comp->_val == NULL || comp->complex_type != EXTCAP_ARG_INTEGER) - return (gint)0; + return (int)0; - return (gint) g_ascii_strtoll(comp->_val, NULL, 10); + return (int) g_ascii_strtoll(comp->_val, NULL, 10); } -guint extcap_complex_get_uint(extcap_complex *comp) { +unsigned extcap_complex_get_uint(extcap_complex *comp) { if (comp == NULL || comp->_val == NULL || comp->complex_type != EXTCAP_ARG_UNSIGNED) - return (guint)0; - return (guint) g_ascii_strtoull(comp->_val, NULL, 10); + return (unsigned)0; + return (unsigned) g_ascii_strtoull(comp->_val, NULL, 10); } -gint64 extcap_complex_get_long(extcap_complex *comp) { +int64_t extcap_complex_get_long(extcap_complex *comp) { if (comp == NULL || comp->_val == NULL || comp->complex_type != EXTCAP_ARG_LONG) - return (gint64)0; + return (int64_t)0; return g_ascii_strtoll(comp->_val, NULL, 10); } -gdouble extcap_complex_get_double(extcap_complex *comp) { +double extcap_complex_get_double(extcap_complex *comp) { if (comp == NULL || comp->_val == NULL || comp->complex_type != EXTCAP_ARG_DOUBLE) - return (gdouble)0; + return (double)0; return g_strtod(comp->_val, NULL); } -static gboolean matches_regex(const char *pattern, const char *subject) { +static bool matches_regex(const char *pattern, const char *subject) { if (!g_utf8_validate(subject, -1, NULL)) - return FALSE; + return false; return g_regex_match_simple(pattern, subject, (GRegexCompileFlags) (G_REGEX_CASELESS), (GRegexMatchFlags)0); } -gboolean extcap_complex_get_bool(extcap_complex *comp) { +bool extcap_complex_get_bool(extcap_complex *comp) { if (comp == NULL || comp->_val == NULL) - return FALSE; + return false; if (comp->complex_type != EXTCAP_ARG_BOOLEAN && comp->complex_type != EXTCAP_ARG_BOOLFLAG) - return FALSE; + return false; return matches_regex(EXTCAP_BOOLEAN_REGEX, comp->_val); } -gchar *extcap_complex_get_string(extcap_complex *comp) { +char *extcap_complex_get_string(extcap_complex *comp) { /* Not checking for argument type, to use this method as fallback if only strings are needed */ return comp != NULL ? comp->_val : NULL; } -static extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) { +static extcap_token_sentence *extcap_tokenize_sentence(const char *s) { GRegex *regex = NULL; GMatchInfo *match_info = NULL; GError *error = NULL; - gchar *param_value = NULL; - guint param_type = EXTCAP_PARAM_UNKNOWN; + char *param_value = NULL; + unsigned param_type = EXTCAP_PARAM_UNKNOWN; if (!g_utf8_validate(s, -1, NULL)) - return FALSE; + return false; extcap_token_sentence *rs = g_new0(extcap_token_sentence, 1); @@ -150,7 +150,7 @@ static extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) { if (regex != NULL) { g_regex_match_full(regex, s, -1, 0, (GRegexMatchFlags) 0, &match_info, &error); while (g_match_info_matches(match_info)) { - gchar *arg = g_match_info_fetch(match_info, 1); + char *arg = g_match_info_fetch(match_info, 1); if (arg == NULL) break; @@ -221,11 +221,11 @@ static extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) { return rs; } -static GList *extcap_tokenize_sentences(const gchar *s) { +static GList *extcap_tokenize_sentences(const char *s) { GList *sentences = NULL; extcap_token_sentence *item = NULL; - gchar **list, **list_iter; + char **list, **list_iter; list_iter = list = g_strsplit(s, "\n", 0); while (*list_iter != NULL) { @@ -251,7 +251,7 @@ static void extcap_free_value(extcap_value *v) { g_free(v); } -static void extcap_free_valuelist(gpointer data, gpointer user_data _U_) { +static void extcap_free_valuelist(void *data, void *user_data _U_) { extcap_free_value((extcap_value *) data); } @@ -317,19 +317,19 @@ void extcap_free_arg_list(GList *a) { g_list_free_full(a, (GDestroyNotify)extcap_free_arg); } -static gint glist_find_numbered_arg(gconstpointer listelem, gconstpointer needle) { +static int glist_find_numbered_arg(const void *listelem, const void *needle) { if (((const extcap_arg *) listelem)->arg_num == *((const int *) needle)) return 0; return 1; } -static gint glist_find_numbered_control(gconstpointer listelem, gconstpointer needle) { +static int glist_find_numbered_control(const void *listelem, const void *needle) { if (((const iface_toolbar_control *) listelem)->num == *((const int *) needle)) return 0; return 1; } -static void extcap_free_tokenized_sentence(gpointer s, gpointer user_data _U_) { +static void extcap_free_tokenized_sentence(void *s, void *user_data _U_) { extcap_token_sentence *t = (extcap_token_sentence *)s; if (t == NULL) @@ -350,7 +350,7 @@ static void extcap_free_tokenized_sentences(GList *sentences) { static extcap_value *extcap_parse_value_sentence(extcap_token_sentence *s) { extcap_value *value = NULL; - gchar *param_value = NULL; + char *param_value = NULL; int tint = 0; @@ -359,7 +359,7 @@ static extcap_value *extcap_parse_value_sentence(extcap_token_sentence *s) { if (g_ascii_strcasecmp(s->sentence, "value") == 0) { - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARG))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARG))) == NULL) { printf("no arg in VALUE sentence\n"); return NULL; @@ -373,7 +373,7 @@ static extcap_value *extcap_parse_value_sentence(extcap_token_sentence *s) { value = g_new0(extcap_value, 1); value->arg_num = tint; - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALUE))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALUE))) == NULL) { /* printf("no value in VALUE sentence\n"); */ extcap_free_value(value); @@ -381,7 +381,7 @@ static extcap_value *extcap_parse_value_sentence(extcap_token_sentence *s) { } value->call = g_strdup(param_value); - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) == NULL) { /* printf("no display in VALUE sentence\n"); */ extcap_free_value(value); @@ -389,18 +389,18 @@ static extcap_value *extcap_parse_value_sentence(extcap_token_sentence *s) { } value->display = g_strdup(param_value); - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_PARENT))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_PARENT))) != NULL) { value->parent = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT))) != NULL) { /* printf("found default value\n"); */ value->is_default = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ENABLED))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ENABLED))) != NULL) { value->enabled = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } @@ -410,7 +410,7 @@ static extcap_value *extcap_parse_value_sentence(extcap_token_sentence *s) { } static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence *s) { - gchar *param_value = NULL; + char *param_value = NULL; extcap_arg *target_arg = NULL; extcap_value *value = NULL; @@ -432,10 +432,10 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence if (sent == EXTCAP_SENTENCE_ARG) { target_arg = g_new0(extcap_arg, 1); target_arg->arg_type = EXTCAP_ARG_UNKNOWN; - target_arg->save = TRUE; + target_arg->save = true; - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARGNUM))) == NULL) { + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARGNUM))) == NULL) { extcap_free_arg(target_arg); return NULL; } @@ -445,7 +445,7 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence return NULL; } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_CALL))) == NULL) { + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_CALL))) == NULL) { extcap_free_arg(target_arg); return NULL; } @@ -457,48 +457,48 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence return NULL; } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) == NULL) { + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) == NULL) { extcap_free_arg(target_arg); return NULL; } target_arg->display = g_strdup(param_value); - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TOOLTIP))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TOOLTIP))) != NULL) { target_arg->tooltip = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_PLACEHOLDER))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_PLACEHOLDER))) != NULL) { target_arg->placeholder = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_FILE_MUSTEXIST))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_FILE_MUSTEXIST))) != NULL) { target_arg->fileexists = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_FILE_EXTENSION))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_FILE_EXTENSION))) != NULL) { target_arg->fileextension = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALIDATION))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALIDATION))) != NULL) { target_arg->regexp = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_GROUP))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_GROUP))) != NULL) { target_arg->group = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_REQUIRED))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_REQUIRED))) != NULL) { target_arg->is_required = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TYPE))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TYPE))) == NULL) { /* printf("no type in ARG sentence\n"); */ extcap_free_arg(target_arg); @@ -540,19 +540,19 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence return NULL; } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_SAVE))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_SAVE))) != NULL) { target_arg->save = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_RELOAD))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_RELOAD))) != NULL) { target_arg->reload = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_RANGE))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_RANGE))) != NULL) { - gchar *cp = g_strstr_len(param_value, -1, ","); + char *cp = g_strstr_len(param_value, -1, ","); if (cp == NULL) { printf("invalid range, expected value,value got %s\n", @@ -578,7 +578,7 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence } } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT))) != NULL) { if (target_arg->arg_type != EXTCAP_ARG_MULTICHECK && target_arg->arg_type != EXTCAP_ARG_SELECTOR) { @@ -609,7 +609,7 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence return target_arg; } -GList *extcap_parse_args(gchar *output) { +GList *extcap_parse_args(char *output) { GList *result = NULL; GList *walker = NULL; GList *temp = NULL; @@ -622,7 +622,7 @@ GList *extcap_parse_args(gchar *output) { extcap_token_sentence *sentence = (extcap_token_sentence *)walker->data; if ((ra = extcap_parse_arg_sentence(result, sentence)) != NULL) - result = g_list_append(result, (gpointer) ra); + result = g_list_append(result, (void *) ra); walker = g_list_next(walker); } @@ -632,7 +632,7 @@ GList *extcap_parse_args(gchar *output) { return result; } -GList *extcap_parse_values(gchar *output) { +GList *extcap_parse_values(char *output) { GList *result = NULL; GList *walker = NULL; GList *temp = NULL; @@ -645,7 +645,7 @@ GList *extcap_parse_values(gchar *output) { extcap_token_sentence *sentence = (extcap_token_sentence *)walker->data; if ((ra = extcap_parse_value_sentence(sentence)) != NULL) - result = g_list_append(result, (gpointer) ra); + result = g_list_append(result, (void *) ra); walker = g_list_next(walker); } @@ -657,7 +657,7 @@ GList *extcap_parse_values(gchar *output) { static extcap_interface *extcap_parse_interface_sentence(extcap_token_sentence *s) { extcap_sentence_type sent = EXTCAP_SENTENCE_UNKNOWN; - gchar *param_value = NULL; + char *param_value = NULL; extcap_interface *ri = NULL; if (s == NULL) @@ -676,7 +676,7 @@ static extcap_interface *extcap_parse_interface_sentence(extcap_token_sentence * ri->if_type = sent; - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALUE))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALUE))) == NULL && sent == EXTCAP_SENTENCE_INTERFACE) { printf("No value in INTERFACE sentence\n"); g_free(ri); @@ -684,7 +684,7 @@ static extcap_interface *extcap_parse_interface_sentence(extcap_token_sentence * } ri->call = g_strdup(param_value); - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) == NULL && sent == EXTCAP_SENTENCE_INTERFACE) { printf("No display in INTERFACE sentence\n"); g_free(ri->call); @@ -693,12 +693,12 @@ static extcap_interface *extcap_parse_interface_sentence(extcap_token_sentence * } ri->display = g_strdup(param_value); - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VERSION))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VERSION))) != NULL) { ri->version = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_HELP))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_HELP))) != NULL) { ri->help = g_strdup(param_value); } @@ -709,11 +709,11 @@ static extcap_interface *extcap_parse_interface_sentence(extcap_token_sentence * static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items, extcap_token_sentence *s) { extcap_sentence_type sent = EXTCAP_SENTENCE_UNKNOWN; - gchar *param_value = NULL; + char *param_value = NULL; iface_toolbar_control *control = NULL; iface_toolbar_value *value = NULL; GList *entry = NULL; - guint32 num = 0; + uint32_t num = 0; if (s == NULL) return NULL; @@ -731,7 +731,7 @@ static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items control = g_new0(iface_toolbar_control, 1); control->ctrl_type = INTERFACE_TYPE_UNKNOWN; - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARGNUM)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARGNUM)); if (param_value == NULL) { extcap_free_toolbar_control(control); return NULL; @@ -743,30 +743,30 @@ static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items } control->num = (int)num; - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY)); if (param_value == NULL) { extcap_free_toolbar_control(control); return NULL; } control->display = g_strdup(param_value); - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALIDATION))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALIDATION))) != NULL) { control->validation = g_strdup(param_value); } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_REQUIRED))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_REQUIRED))) != NULL) { control->is_required = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TOOLTIP)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TOOLTIP)); control->tooltip = g_strdup(param_value); - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_PLACEHOLDER)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_PLACEHOLDER)); control->placeholder = g_strdup(param_value); - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TYPE)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_TYPE)); if (param_value == NULL) { extcap_free_toolbar_control(control); return NULL; @@ -789,7 +789,7 @@ static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items return NULL; } - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ROLE)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ROLE)); if (param_value != NULL) { if (g_ascii_strcasecmp(param_value, "control") == 0) { control->ctrl_role = INTERFACE_ROLE_CONTROL; @@ -808,7 +808,7 @@ static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items control->ctrl_role = INTERFACE_ROLE_CONTROL; } - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT)); if (param_value != NULL) { if (arg_type != EXTCAP_ARG_UNKNOWN) { extcap_complex *complex = extcap_parse_complex(arg_type, param_value); @@ -826,7 +826,7 @@ static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items } } else if (sent == EXTCAP_SENTENCE_VALUE) { - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_CONTROL)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_CONTROL)); if (param_value == NULL) { printf("no control in VALUE sentence\n"); return NULL; @@ -846,21 +846,21 @@ static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items value = g_new0(iface_toolbar_value, 1); value->num = (int)num; - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALUE)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_VALUE)); if (param_value == NULL) { extcap_free_toolbar_value(value); return NULL; } value->value = g_strdup(param_value); - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY)); if (param_value == NULL) { extcap_free_toolbar_value(value); return NULL; } value->display = g_strdup(param_value); - param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT)); + param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DEFAULT)); if (param_value != NULL) { value->is_default = matches_regex(EXTCAP_BOOLEAN_REGEX, param_value); } @@ -874,7 +874,7 @@ static iface_toolbar_control *extcap_parse_control_sentence(GList *control_items return control; } -GList *extcap_parse_interfaces(gchar *output, GList **control_items) { +GList *extcap_parse_interfaces(char *output, GList **control_items) { GList *result = NULL; GList *tokens = NULL; @@ -913,7 +913,7 @@ GList *extcap_parse_interfaces(gchar *output, GList **control_items) { /* Parse a tokenized set of sentences and validate, looking for DLT definitions */ static extcap_dlt *extcap_parse_dlt_sentence(extcap_token_sentence *s) { - gchar *param_value = NULL; + char *param_value = NULL; extcap_sentence_type sent = EXTCAP_SENTENCE_UNKNOWN; extcap_dlt *result = NULL; @@ -933,7 +933,7 @@ static extcap_dlt *extcap_parse_dlt_sentence(extcap_token_sentence *s) { result->name = NULL; result->display = NULL; - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARGNUM))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_ARGNUM))) == NULL) { printf("No number in DLT sentence\n"); g_free(result); @@ -945,7 +945,7 @@ static extcap_dlt *extcap_parse_dlt_sentence(extcap_token_sentence *s) { return NULL; } - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_NAME))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_NAME))) == NULL) { printf("No name in DLT sentence\n"); g_free(result); @@ -953,7 +953,7 @@ static extcap_dlt *extcap_parse_dlt_sentence(extcap_token_sentence *s) { } result->name = g_strdup(param_value); - if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) + if ((param_value = (char *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_DISPLAY))) == NULL) { printf("No display in DLT sentence\n"); g_free(result->name); @@ -965,7 +965,7 @@ static extcap_dlt *extcap_parse_dlt_sentence(extcap_token_sentence *s) { return result; } -GList *extcap_parse_dlts(gchar *output) { +GList *extcap_parse_dlts(char *output) { GList *walker = NULL; GList *temp = NULL; |