-/** Input (file) format driver. */
-struct sr_input_format {
- /** The unique ID for this input format. Must not be NULL. */
- char *id;
-
- /**
- * A short description of the input format, which can (for example)
- * be displayed to the user by frontends. Must not be NULL.
- */
- char *description;
-
- /**
- * Check if this input module can load and parse the specified file.
- *
- * @param[in] filename The name (and path) of the file to check.
- *
- * @retval TRUE This module knows the format.
- * @retval FALSE This module does not know the format.
- */
- int (*format_match) (const char *filename);
-
- /**
- * Initialize the input module.
- *
- * @param in A pointer to a valid 'struct sr_input' that the caller
- * has to allocate and provide to this function. It is also
- * the responsibility of the caller to free it later.
- * @param[in] filename The name (and path) of the file to use.
- *
- * @retval SR_OK Success
- * @retval other Negative error code.
- */
- int (*init) (struct sr_input *in, const char *filename);
+/** 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;
+};