LMMS
Loading...
Searching...
No Matches
lilv_internal.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <float.h>
#include <dlfcn.h>
#include <unistd.h>
#include "serd/serd.h"
#include "sord/sord.h"
#include "zix/tree.h"
#include "lilv_config.h"
#include "lilv/lilv.h"

Go to the source code of this file.

Classes

struct  LilvPortImpl
struct  LilvSpecImpl
struct  LilvHeader
struct  LilvLib
struct  LilvPluginImpl
struct  LilvPluginClassImpl
struct  LilvInstancePimpl
struct  LilvOptions
struct  LilvWorldImpl
struct  LilvNodeImpl
struct  LilvScalePointImpl
struct  LilvUIImpl
struct  LilvVersion

Macros

#define FOREACH_MATCH(iter)
#define LILV_ERROR(str)
#define LILV_ERRORF(fmt, ...)
#define LILV_WARN(str)
#define LILV_WARNF(fmt, ...)
#define LILV_NOTE(str)
#define LILV_NOTEF(fmt, ...)

Typedefs

typedef struct LilvVersion LilvVersion
typedef void(* LilvVoidFunc) (void)

Enumerations

enum  LilvNodeType {
  LILV_VALUE_URI , LILV_VALUE_STRING , LILV_VALUE_INT , LILV_VALUE_FLOAT ,
  LILV_VALUE_BOOL , LILV_VALUE_BLANK , LILV_VALUE_BLOB
}

Functions

LilvPortlilv_port_new (LilvWorld *world, const SordNode *node, uint32_t index, const char *symbol)
void lilv_port_free (const LilvPlugin *plugin, LilvPort *port)
LilvPluginlilv_plugin_new (LilvWorld *world, LilvNode *uri, LilvNode *bundle_uri)
void lilv_plugin_clear (LilvPlugin *plugin, LilvNode *bundle_uri)
void lilv_plugin_load_if_necessary (const LilvPlugin *p)
void lilv_plugin_free (LilvPlugin *plugin)
LilvNodelilv_plugin_get_unique (const LilvPlugin *p, const SordNode *subject, const SordNode *predicate)
void lilv_collection_free (LilvCollection *collection)
unsigned lilv_collection_size (const LilvCollection *collection)
LilvIterlilv_collection_begin (const LilvCollection *collection)
voidlilv_collection_get (const LilvCollection *collection, const LilvIter *i)
LilvPluginClasslilv_plugin_class_new (LilvWorld *world, const SordNode *parent_uri, const SordNode *uri, const char *label)
void lilv_plugin_class_free (LilvPluginClass *plugin_class)
LilvLiblilv_lib_open (LilvWorld *world, const LilvNode *uri, const char *bundle_path, const LV2_Feature *const *features)
const LV2_Descriptorlilv_lib_get_plugin (LilvLib *lib, uint32_t index)
void lilv_lib_close (LilvLib *lib)
LilvNodeslilv_nodes_new (void)
LilvPluginslilv_plugins_new (void)
LilvScalePointslilv_scale_points_new (void)
LilvPluginClasseslilv_plugin_classes_new (void)
LilvUIslilv_uis_new (void)
LilvNodelilv_world_get_manifest_uri (LilvWorld *world, const LilvNode *bundle_uri)
const uint8_tlilv_world_blank_node_prefix (LilvWorld *world)
SerdStatus lilv_world_load_file (LilvWorld *world, SerdReader *reader, const LilvNode *uri)
SerdStatus lilv_world_load_graph (LilvWorld *world, SordNode *graph, const LilvNode *uri)
LilvUIlilv_ui_new (LilvWorld *world, LilvNode *uri, LilvNode *type_uri, LilvNode *binary_uri)
void lilv_ui_free (LilvUI *ui)
LilvNodelilv_node_new (LilvWorld *world, LilvNodeType type, const char *val)
LilvNodelilv_node_new_from_node (LilvWorld *world, const SordNode *node)
int lilv_header_compare_by_uri (const void *a, const void *b, void *user_data)
int lilv_lib_compare (const void *a, const void *b, void *user_data)
int lilv_ptr_cmp (const void *a, const void *b, void *user_data)
int lilv_resource_node_cmp (const void *a, const void *b, void *user_data)
static int lilv_version_cmp (const LilvVersion *a, const LilvVersion *b)
static int lilv_version_cmp_mod (const LilvVersion *a, const LilvVersion *b)
struct LilvHeaderlilv_collection_get_by_uri (const ZixTree *seq, const LilvNode *uri)
LilvScalePointlilv_scale_point_new (LilvNode *value, LilvNode *label)
void lilv_scale_point_free (LilvScalePoint *point)
SordIterlilv_world_query_internal (LilvWorld *world, const SordNode *subject, const SordNode *predicate, const SordNode *object)
bool lilv_world_ask_internal (LilvWorld *world, const SordNode *subject, const SordNode *predicate, const SordNode *object)
LilvNodeslilv_world_find_nodes_internal (LilvWorld *world, const SordNode *subject, const SordNode *predicate, const SordNode *object)
SordModellilv_world_filter_model (LilvWorld *world, SordModel *model, const SordNode *subject, const SordNode *predicate, const SordNode *object, const SordNode *graph)
LilvNodeslilv_nodes_from_stream_objects (LilvWorld *w, SordIter *stream, SordQuadIndex field)
char * lilv_strjoin (const char *first,...)
char * lilv_strdup (const char *str)
char * lilv_get_lang (void)
char * lilv_expand (const char *path)
char * lilv_dirname (const char *path)
int lilv_copy_file (const char *src, const char *dst)
bool lilv_path_exists (const char *path, void *ignored)
char * lilv_path_absolute (const char *path)
bool lilv_path_is_absolute (const char *path)
 Return true iff path is an absolute path.
char * lilv_get_latest_copy (const char *path, const char *copy_path)
char * lilv_path_relative_to (const char *path, const char *base)
bool lilv_path_is_child (const char *path, const char *dir)
 Return true iff path is a child of dir.
int lilv_flock (FILE *file, bool lock)
char * lilv_realpath (const char *path)
int lilv_symlink (const char *oldpath, const char *newpath)
int lilv_mkdir_p (const char *path)
char * lilv_path_join (const char *a, const char *b)
 Join path a and path b with a single directory separator between them.
bool lilv_file_equals (const char *a_path, const char *b_path)
 Return true iff the given paths point to files with identical contents.
char * lilv_find_free_path (const char *in_path, bool(*exists)(const char *, void *), void *user_data)
void lilv_dir_for_each (const char *path, void *data, void(*f)(const char *path, const char *name, void *data))
static LilvVoidFunc lilv_dlfunc (void *handle, const char *symbol)

Macro Definition Documentation

◆ FOREACH_MATCH

#define FOREACH_MATCH ( iter)
Value:
for (; !sord_iter_end(iter); sord_iter_next(iter))
SORD_API bool sord_iter_end(const SordIter *iter)
Definition sord.c:575
SORD_API bool sord_iter_next(SordIter *iter)
Definition sord.c:564

◆ LILV_ERROR

#define LILV_ERROR ( str)
Value:
fprintf(stderr, "%s(): error: " str, \
__func__)

◆ LILV_ERRORF

#define LILV_ERRORF ( fmt,
... )
Value:
fprintf(stderr, "%s(): error: " fmt, \
__func__, __VA_ARGS__)
fmt[0]
Definition fileio.c:2503

◆ LILV_NOTE

#define LILV_NOTE ( str)
Value:
fprintf(stderr, "%s(): note: " str, \
__func__)

◆ LILV_NOTEF

#define LILV_NOTEF ( fmt,
... )
Value:
fprintf(stderr, "%s(): note: " fmt, \
__func__, __VA_ARGS__)

◆ LILV_WARN

#define LILV_WARN ( str)
Value:
fprintf(stderr, "%s(): warning: " str, \
__func__)

◆ LILV_WARNF

#define LILV_WARNF ( fmt,
... )
Value:
fprintf(stderr, "%s(): warning: " fmt, \
__func__, __VA_ARGS__)

Typedef Documentation

◆ LilvVersion

typedef struct LilvVersion LilvVersion

◆ LilvVoidFunc

typedef void(* LilvVoidFunc) (void)

Enumeration Type Documentation

◆ LilvNodeType

Enumerator
LILV_VALUE_URI 
LILV_VALUE_STRING 
LILV_VALUE_INT 
LILV_VALUE_FLOAT 
LILV_VALUE_BOOL 
LILV_VALUE_BLANK 
LILV_VALUE_BLOB 

Function Documentation

◆ lilv_collection_begin()

LilvIter * lilv_collection_begin ( const LilvCollection * collection)

◆ lilv_collection_free()

void lilv_collection_free ( LilvCollection * collection)

◆ lilv_collection_get()

void * lilv_collection_get ( const LilvCollection * collection,
const LilvIter * i )

◆ lilv_collection_get_by_uri()

struct LilvHeader * lilv_collection_get_by_uri ( const ZixTree * seq,
const LilvNode * uri )

Get an element of a collection of any object with an LilvHeader by URI.

◆ lilv_collection_size()

unsigned lilv_collection_size ( const LilvCollection * collection)

◆ lilv_copy_file()

int lilv_copy_file ( const char * src,
const char * dst )

Copy the file at path src to path dst.

Returns
Zero on success, or a standard errno error code.

◆ lilv_dir_for_each()

void lilv_dir_for_each ( const char * path,
void * data,
void(* )(const char *path, const char *name, void *data) )

Visit every file in the directory at path.

Parameters
pathA path to a directory.
dataOpaque user data that is passed to f.
fA function called on every entry in the directory. The path parameter is always the directory path passed to this function, the name parameter is the name of the directory entry (not its full path).

◆ lilv_dirname()

char * lilv_dirname ( const char * path)

◆ lilv_dlfunc()

LilvVoidFunc lilv_dlfunc ( void * handle,
const char * symbol )
inlinestatic

dlsym wrapper to return a function pointer (without annoying warning)

◆ lilv_expand()

char * lilv_expand ( const char * path)

Expand variables (e.g. POSIX ~ or $FOO, Windows FOO%) in path.

◆ lilv_file_equals()

bool lilv_file_equals ( const char * a_path,
const char * b_path )

Return true iff the given paths point to files with identical contents.

◆ lilv_find_free_path()

char * lilv_find_free_path ( const char * in_path,
bool(* exists )(const char *, void *),
void * user_data )

◆ lilv_flock()

int lilv_flock ( FILE * file,
bool lock )

◆ lilv_get_lang()

char * lilv_get_lang ( void )

Return the current LANG converted to Turtle (i.e. RFC3066) style. For example, if LANG is set to "en_CA.utf-8", this returns "en-ca".

◆ lilv_get_latest_copy()

char * lilv_get_latest_copy ( const char * path,
const char * copy_path )

Return the latest copy of the file at path that is newer.

◆ lilv_header_compare_by_uri()

int lilv_header_compare_by_uri ( const void * a,
const void * b,
void * user_data )

Comparator for sequences (e.g. world->plugins).

◆ lilv_lib_close()

void lilv_lib_close ( LilvLib * lib)

◆ lilv_lib_compare()

int lilv_lib_compare ( const void * a,
const void * b,
void * user_data )

Comparator for libraries (world->libs).

Libraries do have a LilvHeader, but we must also compare the bundle to handle the case where the same library is loaded with different bundles, and consequently different contents (mainly plugins).

◆ lilv_lib_get_plugin()

const LV2_Descriptor * lilv_lib_get_plugin ( LilvLib * lib,
uint32_t index )

◆ lilv_lib_open()

LilvLib * lilv_lib_open ( LilvWorld * world,
const LilvNode * uri,
const char * bundle_path,
const LV2_Feature *const * features )

◆ lilv_mkdir_p()

int lilv_mkdir_p ( const char * path)

◆ lilv_node_new()

LilvNode * lilv_node_new ( LilvWorld * world,
LilvNodeType type,
const char * str )

Note that if type is numeric or boolean, the returned value is corrupt until lilv_node_set_numerics_from_string is called. It is not automatically called from here to avoid overhead and imprecision when the exact string value is known.

◆ lilv_node_new_from_node()

LilvNode * lilv_node_new_from_node ( LilvWorld * world,
const SordNode * node )

Create a new LilvNode from node, or return NULL if impossible

◆ lilv_nodes_from_stream_objects()

LilvNodes * lilv_nodes_from_stream_objects ( LilvWorld * w,
SordIter * stream,
SordQuadIndex field )

◆ lilv_nodes_new()

LilvNodes * lilv_nodes_new ( void )

◆ lilv_path_absolute()

char * lilv_path_absolute ( const char * path)

Return path as an absolute path.

If path is absolute, an identical copy of it is returned. Otherwise, the returned path is relative to the current working directory.

◆ lilv_path_exists()

bool lilv_path_exists ( const char * path,
void * ignored )

◆ lilv_path_is_absolute()

bool lilv_path_is_absolute ( const char * path)

Return true iff path is an absolute path.

◆ lilv_path_is_child()

bool lilv_path_is_child ( const char * path,
const char * dir )

Return true iff path is a child of dir.

◆ lilv_path_join()

char * lilv_path_join ( const char * a,
const char * b )

Join path a and path b with a single directory separator between them.

◆ lilv_path_relative_to()

char * lilv_path_relative_to ( const char * path,
const char * base )

Return path relative to base if possible.

If path is not within base, a copy is returned. Otherwise, an equivalent path relative to base is returned (which may contain up-references).

◆ lilv_plugin_class_free()

void lilv_plugin_class_free ( LilvPluginClass * plugin_class)

◆ lilv_plugin_class_new()

LilvPluginClass * lilv_plugin_class_new ( LilvWorld * world,
const SordNode * parent_uri,
const SordNode * uri,
const char * label )

◆ lilv_plugin_classes_new()

LilvPluginClasses * lilv_plugin_classes_new ( void )

◆ lilv_plugin_clear()

void lilv_plugin_clear ( LilvPlugin * plugin,
LilvNode * bundle_uri )

◆ lilv_plugin_free()

void lilv_plugin_free ( LilvPlugin * plugin)

◆ lilv_plugin_get_unique()

LilvNode * lilv_plugin_get_unique ( const LilvPlugin * p,
const SordNode * subject,
const SordNode * predicate )

◆ lilv_plugin_load_if_necessary()

void lilv_plugin_load_if_necessary ( const LilvPlugin * p)

◆ lilv_plugin_new()

LilvPlugin * lilv_plugin_new ( LilvWorld * world,
LilvNode * uri,
LilvNode * bundle_uri )

Ownership of uri and bundle is taken

◆ lilv_plugins_new()

LilvPlugins * lilv_plugins_new ( void )

◆ lilv_port_free()

void lilv_port_free ( const LilvPlugin * plugin,
LilvPort * port )

◆ lilv_port_new()

LilvPort * lilv_port_new ( LilvWorld * world,
const SordNode * node,
uint32_t index,
const char * symbol )

◆ lilv_ptr_cmp()

int lilv_ptr_cmp ( const void * a,
const void * b,
void * user_data )

◆ lilv_realpath()

char * lilv_realpath ( const char * path)

◆ lilv_resource_node_cmp()

int lilv_resource_node_cmp ( const void * a,
const void * b,
void * user_data )

◆ lilv_scale_point_free()

void lilv_scale_point_free ( LilvScalePoint * point)

◆ lilv_scale_point_new()

LilvScalePoint * lilv_scale_point_new ( LilvNode * value,
LilvNode * label )

Ownership of value and label is taken

◆ lilv_scale_points_new()

LilvScalePoints * lilv_scale_points_new ( void )

◆ lilv_strdup()

char * lilv_strdup ( const char * str)

◆ lilv_strjoin()

char * lilv_strjoin ( const char * first,
... )

◆ lilv_symlink()

int lilv_symlink ( const char * oldpath,
const char * newpath )

Create a symlink at newpath that points to oldpath.

Returns
Zero on success, otherwise non-zero and errno is set.

◆ lilv_ui_free()

void lilv_ui_free ( LilvUI * ui)

◆ lilv_ui_new()

LilvUI * lilv_ui_new ( LilvWorld * world,
LilvNode * uri,
LilvNode * type_uri,
LilvNode * binary_uri )

◆ lilv_uis_new()

LilvUIs * lilv_uis_new ( void )

◆ lilv_version_cmp()

int lilv_version_cmp ( const LilvVersion * a,
const LilvVersion * b )
inlinestatic

◆ lilv_version_cmp_mod()

int lilv_version_cmp_mod ( const LilvVersion * a,
const LilvVersion * b )
inlinestatic

◆ lilv_world_ask_internal()

bool lilv_world_ask_internal ( LilvWorld * world,
const SordNode * subject,
const SordNode * predicate,
const SordNode * object )

◆ lilv_world_blank_node_prefix()

const uint8_t * lilv_world_blank_node_prefix ( LilvWorld * world)

◆ lilv_world_filter_model()

SordModel * lilv_world_filter_model ( LilvWorld * world,
SordModel * model,
const SordNode * subject,
const SordNode * predicate,
const SordNode * object,
const SordNode * graph )

◆ lilv_world_find_nodes_internal()

LilvNodes * lilv_world_find_nodes_internal ( LilvWorld * world,
const SordNode * subject,
const SordNode * predicate,
const SordNode * object )

◆ lilv_world_get_manifest_uri()

LilvNode * lilv_world_get_manifest_uri ( LilvWorld * world,
const LilvNode * bundle_uri )

◆ lilv_world_load_file()

SerdStatus lilv_world_load_file ( LilvWorld * world,
SerdReader * reader,
const LilvNode * uri )

◆ lilv_world_load_graph()

SerdStatus lilv_world_load_graph ( LilvWorld * world,
SordNode * graph,
const LilvNode * uri )

◆ lilv_world_query_internal()

SordIter * lilv_world_query_internal ( LilvWorld * world,
const SordNode * subject,
const SordNode * predicate,
const SordNode * object )