libsigrok
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions | Variables
session_file.c File Reference
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <zip.h>
#include <glib.h>
#include <glib/gstdio.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
Include dependency graph for session_file.c:

Go to the source code of this file.

Functions

SR_API int sr_session_load (const char *filename)
 Load the session from the specified filename. More...
 
int sr_session_save (const char *filename)
 Save the current session to the specified file. More...
 

Variables

struct sr_sessionsession
 
SR_PRIV struct sr_dev_driver session_driver
 

Function Documentation

SR_API int sr_session_load ( const char *  filename)

Load the session from the specified filename.

Parameters
filenameThe name of the session file to load. Must not be NULL.
Returns
SR_OK upon success, SR_ERR_ARG upon invalid arguments, SR_ERR_MALLOC upon memory allocation errors, or SR_ERR upon other errors.

Definition at line 42 of file session_file.c.

References sr_dev_driver::dev_config_set, sr_dev::driver, sr_probe::enabled, sr_dev_driver::init, sr_dev::probes, session_driver, sr_dbg(), sr_dev_new(), sr_dev_probe_add(), sr_dev_probe_name_set(), sr_dev_trigger_set(), SR_ERR, sr_err(), SR_ERR_ARG, SR_ERR_MALLOC, SR_HWCAP_CAPTURE_NUM_PROBES, SR_HWCAP_CAPTURE_UNITSIZE, SR_HWCAP_CAPTUREFILE, SR_HWCAP_SAMPLERATE, SR_MAX_PROBENAME_LEN, SR_OK, sr_parse_sizestring(), sr_session_dev_add(), and sr_session_new().

Here is the call graph for this function:

int sr_session_save ( const char *  filename)

Save the current session to the specified file.

Parameters
filenameThe name of the file where to save the current session. Must not be NULL.
Returns
SR_OK upon success, SR_ERR_ARG upon invalid arguments, or SR_ERR upon other errors.

Definition at line 170 of file session_file.c.

References sr_datastore::chunklist, sr_dev::datastore, sr_dev_driver::dev_info_get, sr_session::devs, sr_dev::driver, sr_dev::driver_index, sr_datastore::ds_unitsize, sr_probe::enabled, sr_probe::name, sr_dev_driver::name, sr_datastore::num_units, PACKAGE_VERSION, sr_dev::probes, sr_dev_has_hwcap(), SR_DI_CUR_SAMPLERATE, SR_ERR, sr_err(), SR_ERR_ARG, SR_ERR_MALLOC, SR_HWCAP_SAMPLERATE, sr_info(), SR_OK, sr_samplerate_string(), and sr_probe::trigger.

Here is the call graph for this function:

Variable Documentation

struct sr_session* session

Definition at line 41 of file session.c.

Referenced by sr_session_new().

SR_PRIV struct sr_dev_driver session_driver

Definition at line 330 of file session_driver.c.

Referenced by sr_session_load().