libsigrok  0.4.0
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

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 217 of file resource.c.

References SR_ERR_ARG, and SR_OK.

Referenced by sr_init().

+ Here is the caller graph for this function: