LMMS
Loading...
Searching...
No Matches
state.c File Reference
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include "lv2/atom.h"
#include "lv2/atom-forge.h"
#include "lv2/presets.h"
#include "lv2/state.h"
#include "lilv_config.h"
#include "lilv_internal.h"
#include "sratom/sratom.h"

Classes

struct  Property
struct  PortValue
struct  PathMap
struct  PropertyArray
struct  LilvStateImpl

Macros

#define USTR(s)
#define SET_PSET(e, p, u)

Functions

static int abs_cmp (const void *a, const void *b, void *user_data)
static int rel_cmp (const void *a, const void *b, void *user_data)
static int property_cmp (const void *a, const void *b)
static int value_cmp (const void *a, const void *b)
static void path_rel_free (void *ptr)
static PortValueappend_port_value (LilvState *state, const char *port_symbol, const void *value, uint32_t size, uint32_t type)
static const char * lilv_state_rel2abs (const LilvState *state, const char *path)
static void append_property (LilvState *state, PropertyArray *array, uint32_t key, const void *value, size_t size, uint32_t type, uint32_t flags)
static LV2_State_Status store_callback (LV2_State_Handle handle, uint32_t key, const void *value, size_t size, uint32_t type, uint32_t flags)
static const voidretrieve_callback (LV2_State_Handle handle, uint32_t key, size_t *size, uint32_t *type, uint32_t *flags)
static bool lilv_state_has_path (const char *path, void *state)
static char * make_path (LV2_State_Make_Path_Handle handle, const char *path)
static char * abstract_path (LV2_State_Map_Path_Handle handle, const char *abs_path)
static char * absolute_path (LV2_State_Map_Path_Handle handle, const char *state_path)
static const LV2_Feature ** add_features (const LV2_Feature *const *features, const LV2_Feature *map, const LV2_Feature *make)
static char * absolute_dir (const char *path)
static const char * state_strerror (LV2_State_Status st)
LILV_API LilvStatelilv_state_new_from_instance (const LilvPlugin *plugin, LilvInstance *instance, LV2_URID_Map *map, const char *file_dir, const char *copy_dir, const char *link_dir, const char *save_dir, LilvGetPortValueFunc get_value, void *user_data, uint32_t flags, const LV2_Feature *const *features)
LILV_API void lilv_state_emit_port_values (const LilvState *state, LilvSetPortValueFunc set_value, void *user_data)
LILV_API void lilv_state_restore (const LilvState *state, const LV2_State_Interface *iface, LV2_Handle handle, LilvSetPortValueFunc set_value, void *user_data, uint32_t flags, const LV2_Feature *const *features)
static LilvStatenew_state_from_model (LilvWorld *world, LV2_URID_Map *map, SordModel *model, const SordNode *node, const char *dir)
LILV_API LilvStatelilv_state_new_from_world (LilvWorld *world, const LV2_URID_Map *map, const LilvNode *node)
LILV_API LilvStatelilv_state_new_from_file (LilvWorld *world, const LV2_URID_Map *map, const LilvNode *subject, const char *path)
static void set_prefixes (SerdEnv *env)
LILV_API LilvStatelilv_state_new_from_string (LilvWorld *world, const LV2_URID_Map *map, const char *str)
static SerdWriterttl_writer (SerdSink sink, void *stream, const SerdNode *base, SerdEnv **new_env)
static SerdWriterttl_file_writer (FILE *fd, const SerdNode *node, SerdEnv **env)
static void add_to_model (SordWorld *world, SerdEnv *env, SordModel *model, const SerdNode s, const SerdNode p, const SerdNode o)
static void remove_manifest_entry (SordWorld *world, SordModel *model, const char *subject)
static int add_state_to_manifest (LilvWorld *lworld, const LilvNode *plugin_uri, const char *manifest_path, const char *state_uri, const char *state_path)
static bool link_exists (const char *path, void *data)
static void write_property_array (const LilvState *state, const PropertyArray *array, Sratom *sratom, uint32_t flags, const SerdNode *subject, LV2_URID_Unmap *unmap, const char *dir)
static int lilv_state_write (LilvWorld *world, LV2_URID_Map *map, LV2_URID_Unmap *unmap, const LilvState *state, SerdWriter *writer, const char *uri, const char *dir)
static void lilv_state_make_links (const LilvState *state, const char *dir)
LILV_API int lilv_state_save (LilvWorld *world, LV2_URID_Map *map, LV2_URID_Unmap *unmap, const LilvState *state, const char *uri, const char *dir, const char *filename)
LILV_API char * lilv_state_to_string (LilvWorld *world, LV2_URID_Map *map, LV2_URID_Unmap *unmap, const LilvState *state, const char *uri, const char *base_uri)
LILV_API int lilv_state_delete (LilvWorld *world, const LilvState *state)
static void free_property_array (LilvState *state, PropertyArray *array)
LILV_API void lilv_state_free (LilvState *state)
LILV_API bool lilv_state_equals (const LilvState *a, const LilvState *b)
LILV_API unsigned lilv_state_get_num_properties (const LilvState *state)
LILV_API const LilvNodelilv_state_get_plugin_uri (const LilvState *state)
LILV_API const LilvNodelilv_state_get_uri (const LilvState *state)
LILV_API const char * lilv_state_get_label (const LilvState *state)
LILV_API void lilv_state_set_label (LilvState *state, const char *label)
LILV_API int lilv_state_set_metadata (LilvState *state, uint32_t key, const void *value, size_t size, uint32_t type, uint32_t flags)

Macro Definition Documentation

◆ SET_PSET

#define SET_PSET ( e,
p,
u )
Value:
* e
Definition inflate.c:1404
struct huft * u[BMAX]
Definition inflate.c:1583
SERD_API SerdStatus serd_env_set_prefix_from_strings(SerdEnv *SERD_NONNULL env, const uint8_t *SERD_NONNULL name, const uint8_t *SERD_NONNULL uri)
Set a namespace prefix.
uch * p
Definition crypt.c:594

◆ USTR

#define USTR ( s)
Value:
((const uint8_t*)(s))
unsigned s
Definition inflate.c:1555
unsigned char uint8_t
Definition mid.cpp:98

Function Documentation

◆ abs_cmp()

int abs_cmp ( const void * a,
const void * b,
void * user_data )
static

◆ absolute_dir()

char * absolute_dir ( const char * path)
static

◆ absolute_path()

char * absolute_path ( LV2_State_Map_Path_Handle handle,
const char * state_path )
static

◆ abstract_path()

char * abstract_path ( LV2_State_Map_Path_Handle handle,
const char * abs_path )
static

◆ add_features()

const LV2_Feature ** add_features ( const LV2_Feature *const * features,
const LV2_Feature * map,
const LV2_Feature * make )
static

Return a new features array which is feature added to features.

◆ add_state_to_manifest()

int add_state_to_manifest ( LilvWorld * lworld,
const LilvNode * plugin_uri,
const char * manifest_path,
const char * state_uri,
const char * state_path )
static

◆ add_to_model()

void add_to_model ( SordWorld * world,
SerdEnv * env,
SordModel * model,
const SerdNode s,
const SerdNode p,
const SerdNode o )
static

◆ append_port_value()

PortValue * append_port_value ( LilvState * state,
const char * port_symbol,
const void * value,
uint32_t size,
uint32_t type )
static

◆ append_property()

void append_property ( LilvState * state,
PropertyArray * array,
uint32_t key,
const void * value,
size_t size,
uint32_t type,
uint32_t flags )
static

◆ free_property_array()

void free_property_array ( LilvState * state,
PropertyArray * array )
static

◆ lilv_state_has_path()

bool lilv_state_has_path ( const char * path,
void * state )
static

◆ lilv_state_make_links()

void lilv_state_make_links ( const LilvState * state,
const char * dir )
static

◆ lilv_state_rel2abs()

const char * lilv_state_rel2abs ( const LilvState * state,
const char * path )
static

◆ lilv_state_write()

int lilv_state_write ( LilvWorld * world,
LV2_URID_Map * map,
LV2_URID_Unmap * unmap,
const LilvState * state,
SerdWriter * writer,
const char * uri,
const char * dir )
static

◆ link_exists()

bool link_exists ( const char * path,
void * data )
static

◆ make_path()

char * make_path ( LV2_State_Make_Path_Handle handle,
const char * path )
static

◆ new_state_from_model()

LilvState * new_state_from_model ( LilvWorld * world,
LV2_URID_Map * map,
SordModel * model,
const SordNode * node,
const char * dir )
static

◆ path_rel_free()

void path_rel_free ( void * ptr)
static

◆ property_cmp()

int property_cmp ( const void * a,
const void * b )
static

◆ rel_cmp()

int rel_cmp ( const void * a,
const void * b,
void * user_data )
static

◆ remove_manifest_entry()

void remove_manifest_entry ( SordWorld * world,
SordModel * model,
const char * subject )
static

◆ retrieve_callback()

const void * retrieve_callback ( LV2_State_Handle handle,
uint32_t key,
size_t * size,
uint32_t * type,
uint32_t * flags )
static

◆ set_prefixes()

void set_prefixes ( SerdEnv * env)
static

◆ state_strerror()

const char * state_strerror ( LV2_State_Status st)
static

◆ store_callback()

LV2_State_Status store_callback ( LV2_State_Handle handle,
uint32_t key,
const void * value,
size_t size,
uint32_t type,
uint32_t flags )
static

◆ ttl_file_writer()

SerdWriter * ttl_file_writer ( FILE * fd,
const SerdNode * node,
SerdEnv ** env )
static

◆ ttl_writer()

SerdWriter * ttl_writer ( SerdSink sink,
void * stream,
const SerdNode * base,
SerdEnv ** new_env )
static

◆ value_cmp()

int value_cmp ( const void * a,
const void * b )
static

◆ write_property_array()

void write_property_array ( const LilvState * state,
const PropertyArray * array,
Sratom * sratom,
uint32_t flags,
const SerdNode * subject,
LV2_URID_Unmap * unmap,
const char * dir )
static