extern struct srd_session *srd_sess;
extern gint opt_loglevel;
-extern gchar *opt_pds;
-extern gchar *opt_pd_stack;
-extern gchar *opt_pd_annotations;
-extern gchar *opt_pd_meta;
-extern gchar *opt_pd_binary;
static int opts_to_gvar(struct srd_decoder *dec, GHashTable *hash,
* That will instantiate two SPI decoders on the clock but different data
* lines.
*/
-int register_pds(const char *pdstring)
+int register_pds(const char *opt_pds, char *opt_pd_annotations)
{
struct srd_decoder *dec;
GHashTable *pd_opthash, *options, *probes;
ret = 0;
pd_name = NULL;
pd_opthash = options = probes = NULL;
- pdtokens = g_strsplit(pdstring, ",", 0);
+ pdtokens = g_strsplit(opt_pds, ",", 0);
for (pdtok = pdtokens; *pdtok; pdtok++) {
if (!(pd_opthash = parse_generic_arg(*pdtok, TRUE))) {
g_critical("Invalid protocol decoder option '%s'.", *pdtok);
return ret;
}
-int setup_pd_stack(void)
+int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations)
{
struct srd_decoder_inst *di_from, *di_to;
int ret, i;
return 0;
}
-int setup_pd_annotations(void)
+int setup_pd_annotations(char *opt_pd_annotations)
{
GSList *l;
struct srd_decoder *dec;
return 0;
}
-int setup_pd_meta(void)
+int setup_pd_meta(char *opt_pd_meta)
{
struct srd_decoder *dec;
char **pds, **pdtok;
return 0;
}
-int setup_pd_binary(void)
+int setup_pd_binary(char *opt_pd_binary)
{
GSList *l;
struct srd_decoder *dec;
gchar *opt_triggers = NULL;
gchar *opt_pds = NULL;
#ifdef HAVE_SRD
-gchar *opt_pd_stack = NULL;
-gchar *opt_pd_annotations = NULL;
-gchar *opt_pd_meta = NULL;
-gchar *opt_pd_binary = NULL;
+static gchar *opt_pd_stack = NULL;
+static gchar *opt_pd_annotations = NULL;
+static gchar *opt_pd_meta = NULL;
+static gchar *opt_pd_binary = NULL;
#endif
gchar *opt_input_format = NULL;
gchar *opt_output_format = NULL;
g_critical("Failed to create new decode session.");
goto done;
}
- if (register_pds(opt_pds) != 0)
+ if (register_pds(opt_pds, opt_pd_annotations) != 0)
goto done;
- if (setup_pd_stack() != 0)
+ if (setup_pd_stack(opt_pds, opt_pd_stack, opt_pd_annotations) != 0)
goto done;
/* Only one output type is ever shown. */
if (opt_pd_binary) {
- if (setup_pd_binary() != 0)
+ if (setup_pd_binary(opt_pd_binary) != 0)
goto done;
if (srd_pd_output_callback_add(srd_sess, SRD_OUTPUT_BINARY,
show_pd_binary, NULL) != SRD_OK)
goto done;
} else if (opt_pd_meta) {
- if (setup_pd_meta() != 0)
+ if (setup_pd_meta(opt_pd_meta) != 0)
goto done;
if (srd_pd_output_callback_add(srd_sess, SRD_OUTPUT_META,
show_pd_meta, NULL) != SRD_OK)
goto done;
} else {
if (opt_pd_annotations)
- if (setup_pd_annotations() != 0)
+ if (setup_pd_annotations(opt_pd_annotations) != 0)
goto done;
if (srd_pd_output_callback_add(srd_sess, SRD_OUTPUT_ANN,
show_pd_annotations, NULL) != SRD_OK)
void load_input_file(void);
/* decode.c */
-int register_pds(const char *pdstring);
-int setup_pd_stack(void);
-int setup_pd_annotations(void);
-int setup_pd_meta(void);
-int setup_pd_binary(void);
+int register_pds(const char *opt_pds, char *opt_pd_annotations);
+int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations);
+int setup_pd_annotations(char *opt_pd_annotations);
+int setup_pd_meta(char *opt_pd_meta);
+int setup_pd_binary(char *opt_pd_binary);
void show_pd_annotations(struct srd_proto_data *pdata, void *cb_data);
void show_pd_meta(struct srd_proto_data *pdata, void *cb_data);
void show_pd_binary(struct srd_proto_data *pdata, void *cb_data);