aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-02-04 20:49:28 +0100
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commit1c59b863d8c2c2d7b5531866586baf232c0047a2 (patch)
tree2a464c22769631b28fbaf8fdb1f0c04e0b4034f9
parent14196632191339b69d9db3a242a1b8be3f960669 (diff)
downloadserd-1c59b863d8c2c2d7b5531866586baf232c0047a2.tar.gz
serd-1c59b863d8c2c2d7b5531866586baf232c0047a2.tar.bz2
serd-1c59b863d8c2c2d7b5531866586baf232c0047a2.zip
Remove serd_uri_to_path()
-rw-r--r--.clang-format1
-rw-r--r--NEWS7
-rw-r--r--doc/Doxyfile.in2
-rw-r--r--doc/man/serdi.12
-rw-r--r--include/serd/serd.h27
-rw-r--r--meson.build2
-rw-r--r--src/serd_config.h2
-rw-r--r--src/uri.c27
-rw-r--r--test/test_uri.c45
9 files changed, 11 insertions, 104 deletions
diff --git a/.clang-format b/.clang-format
index caf02057..26b69415 100644
--- a/.clang-format
+++ b/.clang-format
@@ -32,7 +32,6 @@ AttributeMacros:
- SERD_NULLABLE
- SERD_PURE_FUNC
StatementMacros:
- - SERD_DEPRECATED_BY
- SERD_LOG_FUNC
- _Pragma
...
diff --git a/NEWS b/NEWS
index 8bb8543c..80daf8d9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+serd (1.1.1) unstable; urgency=medium
+
+ * Remove SERD_DISABLE_DEPRECATED and SERD_DEPRECATED_BY
+ * Remove serd_uri_to_path()
+
+ -- David Robillard <d@drobilla.net> Wed, 13 Jul 2022 20:39:07 +0000
+
serd (0.32.0) stable; urgency=medium
* Add Windows path separator support to serd_node_new_file_uri()
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index a33ec7c4..1fd32769 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -26,8 +26,6 @@ MACRO_EXPANSION = YES
PREDEFINED = SERD_ALLOCATED \
SERD_API \
SERD_CONST_FUNC= \
- SERD_DEPRECATED_BY(x)= \
- SERD_DISABLE_DEPRECATED \
SERD_NONNULL= \
SERD_NULLABLE= \
SERD_PURE_FUNC=
diff --git a/doc/man/serdi.1 b/doc/man/serdi.1
index 14b7c4f6..a6b94f42 100644
--- a/doc/man/serdi.1
+++ b/doc/man/serdi.1
@@ -2,7 +2,7 @@
.\" SPDX-License-Identifier: ISC
.Dd April 30, 2023
.Dt SERDI 1
-.Os Serd 0.32.0
+.Os Serd 1.1.1
.Sh NAME
.Nm serdi
.Nd read and write RDF syntax
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 2e7a13e6..1ac38fcd 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -46,18 +46,6 @@
#define SERD_PURE_API SERD_API SERD_PURE_FUNC
#define SERD_CONST_API SERD_API SERD_CONST_FUNC
-#ifndef SERD_DISABLE_DEPRECATED
-# if defined(__clang__) && __clang_major__ >= 7
-# define SERD_DEPRECATED_BY(rep) __attribute__((deprecated("", rep)))
-# elif defined(__GNUC__) && __GNUC__ > 4
-# define SERD_DEPRECATED_BY(rep) __attribute__((deprecated("Use " rep)))
-# elif defined(__GNUC__)
-# define SERD_DEPRECATED_BY(rep) __attribute__((deprecated))
-# else
-# define SERD_DEPRECATED_BY(rep)
-# endif
-#endif
-
#ifdef __cplusplus
extern "C" {
# if defined(__GNUC__)
@@ -237,21 +225,6 @@ typedef struct {
static const SerdURI SERD_URI_NULL =
{{NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}};
-#ifndef SERD_DISABLE_DEPRECATED
-
-/**
- Return the local path for `uri`, or NULL if `uri` is not a file URI.
- Note this (inappropriately named) function only removes the file scheme if
- necessary, and returns `uri` unmodified if it is an absolute path. Percent
- encoding and other issues are not handled, to properly convert a file URI to
- a path, use serd_file_uri_parse().
-*/
-SERD_DEPRECATED_BY("serd_file_uri_parse")
-SERD_API const uint8_t* SERD_NULLABLE
-serd_uri_to_path(const uint8_t* SERD_NONNULL uri);
-
-#endif
-
/**
Get the unescaped path and hostname from a file URI.
diff --git a/meson.build b/meson.build
index e4d8a9e6..e4157a7d 100644
--- a/meson.build
+++ b/meson.build
@@ -13,7 +13,7 @@ project(
],
license: 'ISC',
meson_version: '>= 0.56.0',
- version: '0.32.0',
+ version: '1.1.1',
)
serd_src_root = meson.current_source_dir()
diff --git a/src/serd_config.h b/src/serd_config.h
index e649786f..e6b3aa4b 100644
--- a/src/serd_config.h
+++ b/src/serd_config.h
@@ -36,7 +36,7 @@
#define SERD_SRC_SERD_CONFIG_H
// Define version unconditionally so a warning will catch a mismatch
-#define SERD_VERSION "0.32.0"
+#define SERD_VERSION "1.1.1"
#if !defined(SERD_NO_DEFAULT_CONFIG)
diff --git a/src/uri.c b/src/uri.c
index b45f7e16..0920bf77 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -12,32 +12,6 @@
#include <stdlib.h>
#include <string.h>
-const uint8_t*
-serd_uri_to_path(const uint8_t* uri)
-{
- const uint8_t* path = uri;
- if (!is_windows_path(uri) && serd_uri_string_has_scheme(uri)) {
- if (!!strncmp((const char*)uri, "file:", 5)) {
- fprintf(stderr, "Non-file URI '%s'\n", uri);
- return NULL;
- }
-
- if (!strncmp((const char*)uri, "file://localhost/", 17)) {
- path = uri + 16;
- } else if (!strncmp((const char*)uri, "file://", 7)) {
- path = uri + 7;
- } else {
- fprintf(stderr, "Invalid file URI '%s'\n", uri);
- return NULL;
- }
-
- if (is_windows_path(path + 1)) {
- ++path; // Special case for terrible Windows file URIs
- }
- }
- return path;
-}
-
uint8_t*
serd_file_uri_parse(const uint8_t* const uri, uint8_t** const hostname)
{
@@ -45,6 +19,7 @@ serd_file_uri_parse(const uint8_t* const uri, uint8_t** const hostname)
if (hostname) {
*hostname = NULL;
}
+
if (!strncmp((const char*)uri, "file://", 7)) {
const uint8_t* auth = uri + 7;
if (*auth == '/') { // No hostname
diff --git a/test/test_uri.c b/test/test_uri.c
index ac24a2be..daa64240 100644
--- a/test/test_uri.c
+++ b/test/test_uri.c
@@ -59,50 +59,6 @@ test_file_uri(const char* const hostname,
serd_node_free(&node);
}
-#if defined(__GNUC__)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
-static void
-test_uri_to_path(void)
-{
- assert(!strcmp(
- (const char*)serd_uri_to_path((const uint8_t*)"file:///home/user/foo.ttl"),
- "/home/user/foo.ttl"));
-
- assert(!strcmp((const char*)serd_uri_to_path(
- (const uint8_t*)"file://localhost/home/user/foo.ttl"),
- "/home/user/foo.ttl"));
-
- assert(!serd_uri_to_path((const uint8_t*)"file:illegal/file/uri"));
-
- assert(!strcmp(
- (const char*)serd_uri_to_path((const uint8_t*)"file:///c:/awful/system"),
- "c:/awful/system"));
-
- assert(!strcmp(
- (const char*)serd_uri_to_path((const uint8_t*)"file:///c:awful/system"),
- "/c:awful/system"));
-
- assert(!strcmp((const char*)serd_uri_to_path((const uint8_t*)"file:///0/1"),
- "/0/1"));
-
- assert(
- !strcmp((const char*)serd_uri_to_path((const uint8_t*)"C:\\Windows\\Sucks"),
- "C:\\Windows\\Sucks"));
-
- assert(
- !strcmp((const char*)serd_uri_to_path((const uint8_t*)"C|/Windows/Sucks"),
- "C|/Windows/Sucks"));
-
- assert(!serd_uri_to_path((const uint8_t*)"http://example.org/path"));
-}
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic pop
-#endif
-
static void
test_uri_parsing(void)
{
@@ -346,7 +302,6 @@ test_relative_uri(void)
int
main(void)
{
- test_uri_to_path();
test_uri_string_has_scheme();
test_uri_parsing();
test_uri_from_string();