]> sigrok.org Git - libsigrok.git/blobdiff - include/libsigrok/libsigrok.h
Restore number "categories" in sr_configkey.
[libsigrok.git] / include / libsigrok / libsigrok.h
index 1030f258fed69ccc066ad6d9dd0695f38435b74e..a384f611d53cf687a1c52cac90b44d13df1dcf44 100644 (file)
@@ -546,11 +546,11 @@ struct sr_analog_spec {
 /** Generic option struct used by various subsystems. */
 struct sr_option {
        /* Short name suitable for commandline usage, [a-z0-9-]. */
-       char *id;
+       const char *id;
        /* Short name suitable for GUI usage, can contain UTF-8. */
-       char *name;
+       const char *name;
        /* Description of the option, in a sentence. */
-       char *desc;
+       const char *desc;
        /* Default value for this option. */
        GVariant *def;
        /* List of possible values, if this is an option with few values. */
@@ -645,17 +645,22 @@ struct sr_key_info {
        /** Data type like SR_T_STRING, etc if applicable. */
        int datatype;
        /** Short, lowercase ID string, e.g. "serialcomm", "voltage". */
-       char *id;
+       const char *id;
        /** Full capitalized name, e.g. "Serial communication". */
-       char *name;
+       const char *name;
        /** Verbose description (unused currently). */
-       char *description;
+       const char *description;
 };
 
-#define SR_CONF_GET  (1 << 31)
-#define SR_CONF_SET  (1 << 30)
-#define SR_CONF_LIST (1 << 29)
-#define SR_CONF_MASK 0x1fffffff
+/** Configuration capabilities. */
+enum sr_configcap {
+       /** Value can be read. */
+       SR_CONF_GET = (1 << 31),
+       /** Value can be written. */
+       SR_CONF_SET = (1 << 30),
+       /** Possible values can be enumerated. */
+       SR_CONF_LIST = (1 << 29),
+};
 
 /** Configuration keys */
 enum sr_configkey {
@@ -975,14 +980,8 @@ enum sr_configkey {
 
        /*--- Special stuff -------------------------------------------------*/
 
-       /** Scan options supported by the driver. */
-       SR_CONF_SCAN_OPTIONS = 40000,
-
-       /** Device options for a particular device. */
-       SR_CONF_DEVICE_OPTIONS,
-
        /** Session filename. */
-       SR_CONF_SESSIONFILE,
+       SR_CONF_SESSIONFILE = 40000,
 
        /** The device supports specifying a capturefile to inject. */
        SR_CONF_CAPTUREFILE,