libsigrok
unreleased development snapshot
sigrok hardware access and backend library
|
Access to resource files. More...
#include <config.h>
#include <errno.h>
#include <stdio.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
Go to the source code of this file.
Functions | |
GSList * | sr_resourcepaths_get (int res_type) |
Get a list of paths where we look for resource (e.g. More... | |
int | sr_resource_set_hooks (struct sr_context *ctx, sr_resource_open_callback open_cb, sr_resource_close_callback close_cb, sr_resource_read_callback read_cb, void *cb_data) |
Install resource access hooks. More... | |
Access to resource files.
Definition in file resource.c.
int sr_resource_set_hooks | ( | struct sr_context * | ctx, |
sr_resource_open_callback | open_cb, | ||
sr_resource_close_callback | close_cb, | ||
sr_resource_read_callback | read_cb, | ||
void * | cb_data | ||
) |
Install resource access hooks.
ctx | libsigrok context. Must not be NULL. |
open_cb | Resource open callback, or NULL to unset. |
close_cb | Resource close callback, or NULL to unset. |
read_cb | Resource read callback, or NULL to unset. |
cb_data | User data pointer passed to callbacks. |
SR_OK | Success. |
SR_ERR_ARG | Invalid argument. |
Definition at line 263 of file resource.c.
References sr_resource::handle, name, sr_resource::size, SR_ERR_ARG, SR_OK, SR_PRIV, and sr_resource::type.
Referenced by sr_init().
GSList* sr_resourcepaths_get | ( | int | res_type | ) |
Get a list of paths where we look for resource (e.g.
firmware) files.
res_type | The type of resource to get the search paths for. |
Definition at line 47 of file resource.c.
References sr_resource::handle, name, sr_resource::size, SR_ERR, SR_ERR_ARG, SR_OK, SR_PRIV, SR_RESOURCE_FIRMWARE, sr_resourcepaths_get(), sr_resource::type, and void().
Referenced by sr_buildinfo_scpi_backends_get(), and sr_resourcepaths_get().