]> sigrok.org Git - libsigrok.git/blobdiff - include/libsigrok/libsigrok.h
resource: New internal API for accessing resource files
[libsigrok.git] / include / libsigrok / libsigrok.h
index 63e60fba3ef5ea796a1a97b6038b266652c49aa3..6c67f570906da0f24680a504619f4e84651de8d7 100644 (file)
@@ -64,7 +64,6 @@ extern "C" {
 
 /** Status/error codes returned by libsigrok functions. */
 enum sr_error_code {
-       SR_OK_CONTINUE       =  1, /**< Keep going. */
        SR_OK                =  0, /**< No error. */
        SR_ERR               = -1, /**< Generic/unspecified error. */
        SR_ERR_MALLOC        = -2, /**< Malloc/calloc/realloc error. */
@@ -466,7 +465,7 @@ struct sr_session;
 
 struct sr_rational {
        /** Numerator of the rational number. */
-       uint64_t p;
+       int64_t p;
        /** Denominator of the rational number. */
        uint64_t q;
 };
@@ -558,6 +557,25 @@ struct sr_option {
        GSList *values;
 };
 
+/** Resource type.
+ * @since 0.4.0
+ */
+enum sr_resource_type {
+       SR_RESOURCE_FIRMWARE = 1,
+};
+
+/** Resource descriptor.
+ * @since 0.4.0
+ */
+struct sr_resource {
+       /** Size of resource in bytes; set by resource open callback. */
+       uint64_t size;
+       /** File handle or equivalent; set by resource open callback. */
+       void *handle;
+       /** Resource type (SR_RESOURCE_FIRMWARE, ...) */
+       int type;
+};
+
 /** Output module flags. */
 enum sr_output_flag {
        /** If set, this output module writes the output itself. */
@@ -947,9 +965,6 @@ enum sr_configkey {
        /** Measured quantity. */
        SR_CONF_MEASURED_QUANTITY,
 
-       /** Measured secondary quantity. */
-       SR_CONF_MEASURED_2ND_QUANTITY,
-
        /** Equivalent circuit model. */
        SR_CONF_EQUIV_CIRCUIT_MODEL,