static void porttab_fn(const char *token, char *value, void *setting, long type, FILE *f) { PTAB *ptab = setting; if (value) { if(strlen(value) == 0) { clear_ptab(ptab); } else { chk_port_tab(value, ptab); } return; } value = (type == PORTTAB_CS378X) ? mk_t_camd35tcp_port() : mk_t_newcamd_port(); fprintf_conf(f, token, "%s\n", value); free_mk_t(value); }
static void porttab_newcamd_fn(const char *token, char *value, void *setting, FILE *f) { PTAB *ptab = setting; if (value) { if(strlen(value) == 0) { clear_ptab(ptab); } else { chk_port_tab(value, ptab); } return; } value = mk_t_newcamd_port(); fprintf_conf(f, token, "%s\n", value); free_mk_t(value); }
static void porttab_free_fn(void *setting) { clear_ptab(setting); }