aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nx/win/nxuri.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nx/win/nxuri.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/nx/win/nxuri.h')
-rw-r--r--Src/replicant/nx/win/nxuri.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Src/replicant/nx/win/nxuri.h b/Src/replicant/nx/win/nxuri.h
new file mode 100644
index 00000000..c4a7bd1a
--- /dev/null
+++ b/Src/replicant/nx/win/nxuri.h
@@ -0,0 +1,44 @@
+#pragma once
+#include "../../foundation/types.h"
+#include "../../nx/nxapi.h"
+#include "../../nx/nxstring.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /* this thing is meant to be identical to nx_string_t, but we want to try to protect it so they don't get easily cast to nx_string_t
+ since they aren't the same on all platforms */
+ typedef struct nx_uri_struct_t
+ {
+ size_t ref_count;
+ size_t len;
+ wchar_t string[1]; // utf-16
+ } nx_uri_struct_t, *nx_uri_t;
+
+ NX_API nx_uri_t NXURIRetain(nx_uri_t string);
+ NX_API void NXURIRelease(nx_uri_t string);
+
+ NX_API nx_uri_t NXURIMalloc(size_t characters);
+ NX_API int NXURICreateWithNXString(nx_uri_t *uri, nx_string_t string);
+ NX_API int NXURICreateFromPath(nx_uri_t *uri, const wchar_t *filename, const nx_uri_t path); // windows only
+ NX_API int NXURICreateWithPath(nx_uri_t *uri, const nx_uri_t filename, const nx_uri_t path);
+ NX_API int NXURICreateWithNXString(nx_uri_t *new_value, nx_string_t string);
+ NX_API int NXURICreateTempForFilepath(nx_uri_t *out_temp, nx_uri_t filename);
+ NX_API int NXURICreateTempWithExtension(nx_uri_t *out_temp, const char *extension);
+ NX_API int NXURICreateWithUTF8(nx_uri_t *value, const char *utf8);
+ NX_API int NXURICreateTemp(nx_uri_t *out_temp);
+
+ // replaces only the filename portion of the path with the desired filename
+ // e.g., filepath = /path/to/1.mp3, *out_uri = /path/to/
+ NX_API int NXURICreateRemovingFilename(nx_uri_t *out_uri, nx_uri_t filename);
+
+
+ NX_API int NXURIGetNXString(nx_string_t *string, nx_uri_t uri);
+
+ NX_API size_t NXURIGetLength(nx_uri_t string);
+
+#ifdef __cplusplus
+}
+#endif \ No newline at end of file