libsigrok  unreleased development snapshot
sigrok hardware access and backend library
Functions
resource.c File Reference

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"
+ Include dependency graph for resource.c:

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...
 

Detailed Description

Access to resource files.

Definition in file resource.c.

Function Documentation

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.

Parameters
ctxlibsigrok context. Must not be NULL.
open_cbResource open callback, or NULL to unset.
close_cbResource close callback, or NULL to unset.
read_cbResource read callback, or NULL to unset.
cb_dataUser data pointer passed to callbacks.
Return values
SR_OKSuccess.
SR_ERR_ARGInvalid argument.
Since
0.4.0

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().

+ Here is the caller graph for this function:

GSList* sr_resourcepaths_get ( int  res_type)

Get a list of paths where we look for resource (e.g.

firmware) files.

Parameters
res_typeThe type of resource to get the search paths for.
Returns
List of strings that must be freed after use, including the strings.
Since
0.6.0

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: