]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
demo driver: Small cleanups, error handling.
[libsigrok.git] / sigrok.h
index b34d2b41820a130bd0fea7b67adff4d7abee9199..9551b8874a8ad01fb0095c57f334a8809ea21cfa 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
 #define SIGROK_ERR_MALLOC              -2 /* Malloc/calloc/realloc error */
 #define SIGROK_ERR_SAMPLERATE          -3 /* Incorrect samplerate */
 
+/* limited by uint64_t */
+#define MAX_NUM_PROBES 64
+#define MAX_PROBENAME_LEN 32
+
+
 /* Handy little macros */
 #define KHZ(n) ((n) * 1000)
 #define MHZ(n) ((n) * 1000000)
@@ -118,8 +123,8 @@ struct input {
 struct input_format {
        char *extension;
        char *description;
-       int (*format_match) (char *filename);
-       int (*in_loadfile) (char *filename);
+       int (*format_match) (const char *filename);
+       int (*in_loadfile) (const char *filename);
 };
 
 struct input_format **input_list(void);
@@ -153,6 +158,7 @@ int filter_probes(int in_unitsize, int out_unitsize, int *probelist,
                  uint64_t *length_out);
 
 char *sigrok_samplerate_string(uint64_t samplerate);
+char *sigrok_period_string(uint64_t frequency);
 
 /*--- analyzer.c ------------------------------------------------------------*/
 
@@ -210,7 +216,6 @@ struct device {
        struct datastore *datastore;
 };
 
-#define MAX_PROBENAME_LEN 32
 struct probe {
        int index;
        gboolean enabled;