X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=decoder%2Fruntc.c;h=074882629350a5e28cb3f6c90ab1bb8f9ea34cdb;hb=refs%2Fremotes%2Fgithub%2Fmaster;hp=364e43f284e89bb4f6e2de5081ea15fe49796f64;hpb=dd37a782a8637bdee703a13c949b222b9ba8b95d;p=sigrok-test.git
diff --git a/decoder/runtc.c b/decoder/runtc.c
index 364e43f..0748826 100644
--- a/decoder/runtc.c
+++ b/decoder/runtc.c
@@ -17,6 +17,8 @@
* along with this program. If not, see .
*/
+#include
+
#include
#include
#include
@@ -37,9 +39,12 @@
#include
#endif
-int debug = FALSE;
-int statistics = FALSE;
-char *coverage_report;
+#define CHUNK_SIZE (4 * 1024 * 1024)
+
+static int debug = FALSE;
+static int statistics = FALSE;
+static char *coverage_report;
+static struct sr_context *ctx;
struct channel {
char *name;
@@ -51,18 +56,32 @@ struct option {
GVariant *value;
};
-struct pd {
+struct initial_pin_info {
char *name;
+ int value;
+};
+
+struct pd {
+ const char *name;
GSList *channels;
GSList *options;
+ GSList *initial_pins;
+};
+
+struct input {
+ const char *filename;
+ const char *format;
+ GSList *opt_list;
+ GHashTable *opt_hash;
};
struct output {
- char *pd;
+ const char *pd;
+ const char *pd_id;
int type;
- char *class;
+ const char *class_;
int class_idx;
- char *outfile;
+ const char *outfile;
int outfd;
};
@@ -73,12 +92,12 @@ struct cvg {
GSList *missed_lines;
};
-struct cvg *get_mod_cov(PyObject *py_cov, char *module_name);
-void cvg_add(struct cvg *dst, struct cvg *src);
-struct cvg *cvg_new(void);
-gboolean find_missed_line(struct cvg *cvg, char *linespec);
+static struct cvg *get_mod_cov(PyObject *py_cov, const char *module_name);
+static void cvg_add(struct cvg *dst, const struct cvg *src);
+static struct cvg *cvg_new(void);
+static gboolean find_missed_line(struct cvg *cvg, const char *linespec);
-static void logmsg(char *prefix, FILE *out, const char *format, va_list args)
+static void logmsg(const char *prefix, FILE *out, const char *format, va_list args)
{
if (prefix)
fprintf(out, "%s", prefix);
@@ -130,27 +149,32 @@ static int srd_log(void *cb_data, int loglevel, const char *format, va_list args
return SRD_OK;
}
-static void usage(char *msg)
+static void usage(const char *msg)
{
if (msg)
fprintf(stderr, "%s\n", msg);
- printf("Usage: runtc [-dPpoiOf]\n");
- printf(" -d Debug\n");
- printf(" -P \n");
- printf(" -p (optional)\n");
- printf(" -o (optional)\n");
+ printf("Usage: runtc [-dPpoiOfcS]\n");
+ printf(" -d (enables debug output)\n");
+ printf(" -P \n");
+ printf(" -p (optional)\n");
+ printf(" -o (optional)\n");
+ printf(" -N (optional)\n");
printf(" -i \n");
+ printf(" -I (optional)\n");
printf(" -O \n");
printf(" -f