diff options
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | lilv/lilv.h | 16 | ||||
-rw-r--r-- | src/util.c | 6 | ||||
-rw-r--r-- | test/lilv_test.c | 10 | ||||
-rw-r--r-- | wscript | 2 |
5 files changed, 28 insertions, 11 deletions
@@ -1,4 +1,4 @@ -lilv (0.21.3) unstable; +lilv (0.21.5) unstable; * Fix loading files with spaces in their path * Add lilv_file_uri_parse() for correct URI to path conversion @@ -6,6 +6,7 @@ lilv (0.21.3) unstable; * Add lilv_state_emit_port_values() for special port value handling * Add lilv_state_get_uri() * Add lilv_state_delete() for deleting user saved presets + * Add lilv_free() for systems picky about such things * Fix lilv_world_ask() to work with wildcards * Fix creation of duplicate manifest entries when saving state * Fix bindings for Python 3 @@ -20,7 +21,7 @@ lilv (0.21.3) unstable; * Windows fixes (thanks John Emmas) * Minor documentation improvements - -- David Robillard <d@drobilla.net> Thu, 13 Aug 2015 19:55:27 -0400 + -- David Robillard <d@drobilla.net> Thu, 13 Aug 2015 20:30:04 -0400 lilv (0.20.0) stable; diff --git a/lilv/lilv.h b/lilv/lilv.h index e907789..27ed6d0 100644 --- a/lilv/lilv.h +++ b/lilv/lilv.h @@ -101,6 +101,16 @@ typedef void LilvNodes; /**< set<Node>. */ */ /** + Free memory allocated by Lilv. + + This function exists because some systems require memory allocated by a + library to be freed by code in the same library. It is otherwise equivalent + to the standard C free() function. +*/ +LILV_API void +lilv_free(void* ptr); + +/** @name Node @{ */ @@ -119,7 +129,7 @@ lilv_uri_to_path(const char* uri); /** Convert a file URI string to a local path string. For example, "file://foo/bar%20one/baz.ttl" returns "/foo/bar one/baz.ttl". - Return value must be freed by caller. + Return value must be freed by caller with lilv_free(). @param uri The file URI to parse. @param hostname If non-NULL, set to the hostname in the URI, if any. @return `uri` converted to a path, or NULL on failure (URI is not local). @@ -196,7 +206,7 @@ lilv_node_equals(const LilvNode* value, const LilvNode* other); /** Return this value as a Turtle/SPARQL token. - Returned value must be freed by caller with free(). + Returned value must be freed by caller with lilv_free(). <table> <caption>Example Turtle Tokens</caption> <tr><th>URI</th><td><http://example.org/foo ></td></tr> @@ -261,7 +271,7 @@ lilv_node_as_string(const LilvNode* value); /** Return the path of a file URI node. Returns NULL if `value` is not a file URI. - Returned value must be freed by caller. + Returned value must be freed by caller with lilv_free(). */ LILV_API char* lilv_node_get_path(const LilvNode* value, char** hostname); @@ -65,6 +65,12 @@ CreateSymbolicLink(LPCTSTR linkpath, LPCTSTR targetpath, DWORD flags) # define PAGE_SIZE 4096 #endif +void +lilv_free(void* ptr) +{ + free(ptr); +} + char* lilv_strjoin(const char* first, ...) { diff --git a/test/lilv_test.c b/test/lilv_test.c index c40dc76..e89239c 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -269,16 +269,16 @@ test_value(void) char* tok = lilv_node_get_turtle_token(uval); TEST_ASSERT(!strcmp(tok, "<http://example.org>")); - free(tok); + lilv_free(tok); tok = lilv_node_get_turtle_token(sval); TEST_ASSERT(!strcmp(tok, "Foo")); - free(tok); + lilv_free(tok); tok = lilv_node_get_turtle_token(ival); TEST_ASSERT(!strcmp(tok, "42")); - free(tok); + lilv_free(tok); tok = lilv_node_get_turtle_token(fval); TEST_ASSERT(!strncmp(tok, "1.6180", 6)); - free(tok); + lilv_free(tok); LilvNode* uval_e = lilv_new_uri(world, "http://example.org"); LilvNode* sval_e = lilv_new_string(world, "Foo"); @@ -701,7 +701,7 @@ test_plugin(void) char* blank_tok = lilv_node_get_turtle_token(blank); TEST_ASSERT(!strncmp(blank_tok, "_:", 2)); TEST_ASSERT(!strcmp(blank_tok + 2, blank_str)); - free(blank_tok); + lilv_free(blank_tok); lilv_node_free(blank_p); lilv_nodes_free(blanks); @@ -12,7 +12,7 @@ import waflib.Logs as Logs # major increment <=> incompatible changes # minor increment <=> compatible changes (additions) # micro increment <=> no interface changes -LILV_VERSION = '0.21.3' +LILV_VERSION = '0.21.5' LILV_MAJOR_VERSION = '0' # Mandatory waf variables |