libsigrok  0.3.0
sigrok hardware access and backend library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Fields
sr_input_format Struct Reference

Input (file) format driver. More...

#include <libsigrok.h>

+ Collaboration diagram for sr_input_format:

Data Fields

char * id
 The unique ID for this input format. More...
 
char * description
 A short description of the input format, which can (for example) be displayed to the user by frontends. More...
 
int(* format_match )(const char *filename)
 Check if this input module can load and parse the specified file. More...
 
int(* init )(struct sr_input *in, const char *filename)
 Initialize the input module. More...
 
int(* loadfile )(struct sr_input *in, const char *filename)
 Load a file, parsing the input according to the file's format. More...
 

Detailed Description

Input (file) format driver.

Definition at line 375 of file libsigrok.h.

Field Documentation

char* sr_input_format::description

A short description of the input format, which can (for example) be displayed to the user by frontends.

Must not be NULL.

Definition at line 383 of file libsigrok.h.

int(* sr_input_format::format_match)(const char *filename)

Check if this input module can load and parse the specified file.

Parameters
[in]filenameThe name (and path) of the file to check.
Return values
TRUEThis module knows the format.
FALSEThis module does not know the format.

Definition at line 393 of file libsigrok.h.

char* sr_input_format::id

The unique ID for this input format.

Must not be NULL.

Definition at line 377 of file libsigrok.h.

int(* sr_input_format::init)(struct sr_input *in, const char *filename)

Initialize the input module.

Parameters
inA 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.
[in]filenameThe name (and path) of the file to use.
Return values
SR_OKSuccess
otherNegative error code.

Definition at line 406 of file libsigrok.h.

int(* sr_input_format::loadfile)(struct sr_input *in, const char *filename)

Load a file, parsing the input according to the file's format.

This function will send datafeed packets to the session bus, so the calling frontend must have registered its session callbacks beforehand.

The packet types sent across the session bus by this function must include at least SR_DF_HEADER, SR_DF_END, and an appropriate data type such as SR_DF_LOGIC. It may also send a SR_DF_TRIGGER packet if appropriate.

Parameters
inA 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.
filenameThe name (and path) of the file to use.
Return values
SR_OKSuccess
otherNegative error code.

Definition at line 428 of file libsigrok.h.


The documentation for this struct was generated from the following file: