diff options
| -rw-r--r-- | LICENSE | 2 | ||||
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | data.c | 2 | ||||
| -rw-r--r-- | format.c | 2 | ||||
| -rw-r--r-- | html.c | 2 | ||||
| -rw-r--r-- | http.c | 2 | ||||
| -rw-r--r-- | httpd.c | 2 | ||||
| -rw-r--r-- | main.c | 4 | ||||
| -rw-r--r-- | mastoapi.c | 2 | ||||
| -rw-r--r-- | snac.c | 2 | ||||
| -rw-r--r-- | snac.h | 2 | ||||
| -rw-r--r-- | upgrade.c | 2 | ||||
| -rw-r--r-- | utils.c | 2 | ||||
| -rw-r--r-- | webfinger.c | 2 | ||||
| -rw-r--r-- | xs.h | 2 | ||||
| -rw-r--r-- | xs_curl.h | 2 | ||||
| -rw-r--r-- | xs_fcgi.h | 2 | ||||
| -rw-r--r-- | xs_glob.h | 2 | ||||
| -rw-r--r-- | xs_hex.h | 2 | ||||
| -rw-r--r-- | xs_html.h | 2 | ||||
| -rw-r--r-- | xs_httpd.h | 2 | ||||
| -rw-r--r-- | xs_io.h | 2 | ||||
| -rw-r--r-- | xs_json.h | 2 | ||||
| -rw-r--r-- | xs_match.h | 2 | ||||
| -rw-r--r-- | xs_mime.h | 2 | ||||
| -rw-r--r-- | xs_openssl.h | 2 | ||||
| -rw-r--r-- | xs_random.h | 2 | ||||
| -rw-r--r-- | xs_regex.h | 2 | ||||
| -rw-r--r-- | xs_set.h | 2 | ||||
| -rw-r--r-- | xs_socket.h | 2 | ||||
| -rw-r--r-- | xs_time.h | 2 | ||||
| -rw-r--r-- | xs_unicode.h | 2 | ||||
| -rw-r--r-- | xs_unix_socket.h | 2 | ||||
| -rw-r--r-- | xs_url.h | 25 | ||||
| -rw-r--r-- | xs_version.h | 2 |
35 files changed, 59 insertions, 36 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | MIT License | 1 | MIT License |
| 2 | 2 | ||
| 3 | Copyright (c) 2022 - 2024 grunfink et al. (Fediverse: @grunfink@comam.es) | 3 | Copyright (c) 2022 - 2025 grunfink et al. (Fediverse: @grunfink@comam.es) |
| 4 | 4 | ||
| 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
| 6 | 6 | ||
diff --git a/activitypub.c b/activitypub.c index fe3fd41..24954e6 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_json.h" | 5 | #include "xs_json.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_hex.h" | 5 | #include "xs_hex.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_regex.h" | 5 | #include "xs_regex.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_io.h" | 5 | #include "xs_io.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_io.h" | 5 | #include "xs_io.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_io.h" | 5 | #include "xs_io.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_io.h" | 5 | #include "xs_io.h" |
| @@ -14,7 +14,7 @@ | |||
| 14 | int usage(void) | 14 | int usage(void) |
| 15 | { | 15 | { |
| 16 | printf("snac " VERSION " - A simple, minimalistic ActivityPub instance\n"); | 16 | printf("snac " VERSION " - A simple, minimalistic ActivityPub instance\n"); |
| 17 | printf("Copyright (c) 2022 - 2024 grunfink et al. / MIT license\n"); | 17 | printf("Copyright (c) 2022 - 2025 grunfink et al. / MIT license\n"); |
| 18 | printf("\n"); | 18 | printf("\n"); |
| 19 | printf("Commands:\n"); | 19 | printf("Commands:\n"); |
| 20 | printf("\n"); | 20 | printf("\n"); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #ifndef NO_MASTODON_API | 4 | #ifndef NO_MASTODON_API |
| 5 | 5 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #define XS_IMPLEMENTATION | 4 | #define XS_IMPLEMENTATION |
| 5 | 5 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #define VERSION "2.68" | 4 | #define VERSION "2.68" |
| 5 | 5 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_io.h" | 5 | #include "xs_io.h" |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_io.h" | 5 | #include "xs_io.h" |
diff --git a/webfinger.c b/webfinger.c index 85123bc..5db9a97 100644 --- a/webfinger.c +++ b/webfinger.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_json.h" | 5 | #include "xs_json.h" |
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_H | 3 | #ifndef _XS_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_CURL_H | 3 | #ifndef _XS_CURL_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | This is an intentionally-dead-simple FastCGI implementation; | 4 | This is an intentionally-dead-simple FastCGI implementation; |
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_GLOB_H | 3 | #ifndef _XS_GLOB_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_HEX_H | 3 | #ifndef _XS_HEX_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_HTML_H | 3 | #ifndef _XS_HTML_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_HTTPD_H | 3 | #ifndef _XS_HTTPD_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_IO_H | 3 | #ifndef _XS_IO_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_JSON_H | 3 | #ifndef _XS_JSON_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_MATCH_H | 3 | #ifndef _XS_MATCH_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_MIME_H | 3 | #ifndef _XS_MIME_H |
| 4 | 4 | ||
diff --git a/xs_openssl.h b/xs_openssl.h index f339ac6..9388691 100644 --- a/xs_openssl.h +++ b/xs_openssl.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_OPENSSL_H | 3 | #ifndef _XS_OPENSSL_H |
| 4 | 4 | ||
diff --git a/xs_random.h b/xs_random.h index 78de32a..f936099 100644 --- a/xs_random.h +++ b/xs_random.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_RANDOM_H | 3 | #ifndef _XS_RANDOM_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_REGEX_H | 3 | #ifndef _XS_REGEX_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_SET_H | 3 | #ifndef _XS_SET_H |
| 4 | 4 | ||
diff --git a/xs_socket.h b/xs_socket.h index fb67b9d..6e618ba 100644 --- a/xs_socket.h +++ b/xs_socket.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_SOCKET_H | 3 | #ifndef _XS_SOCKET_H |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_TIME_H | 3 | #ifndef _XS_TIME_H |
| 4 | 4 | ||
diff --git a/xs_unicode.h b/xs_unicode.h index cfcd8ff..ef18fea 100644 --- a/xs_unicode.h +++ b/xs_unicode.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_UNICODE_H | 3 | #ifndef _XS_UNICODE_H |
| 4 | 4 | ||
diff --git a/xs_unix_socket.h b/xs_unix_socket.h index 3eb2307..462a5b3 100644 --- a/xs_unix_socket.h +++ b/xs_unix_socket.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_UNIX_SOCKET_H | 3 | #ifndef _XS_UNIX_SOCKET_H |
| 4 | 4 | ||
| @@ -1,10 +1,11 @@ | |||
| 1 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 1 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 2 | 2 | ||
| 3 | #ifndef _XS_URL_H | 3 | #ifndef _XS_URL_H |
| 4 | 4 | ||
| 5 | #define _XS_URL_H | 5 | #define _XS_URL_H |
| 6 | 6 | ||
| 7 | xs_str *xs_url_dec(const char *str); | 7 | xs_str *xs_url_dec(const char *str); |
| 8 | xs_str *xs_url_enc(const char *str); | ||
| 8 | xs_dict *xs_url_vars(const char *str); | 9 | xs_dict *xs_url_vars(const char *str); |
| 9 | xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *header); | 10 | xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *header); |
| 10 | 11 | ||
| @@ -39,6 +40,28 @@ xs_str *xs_url_dec(const char *str) | |||
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | 42 | ||
| 43 | xs_str *xs_url_enc(const char *str) | ||
| 44 | /* URL-encodes a string (RFC 3986) */ | ||
| 45 | { | ||
| 46 | xs_str *s = xs_str_new(NULL); | ||
| 47 | |||
| 48 | while (*str) { | ||
| 49 | if (isalnum(*str) || strchr("-._~", *str)) { | ||
| 50 | s = xs_append_m(s, str, 1); | ||
| 51 | } | ||
| 52 | else { | ||
| 53 | char tmp[8]; | ||
| 54 | snprintf(tmp, sizeof(tmp), "%%%02X", (unsigned char)*str); | ||
| 55 | s = xs_append_m(s, tmp, 3); | ||
| 56 | } | ||
| 57 | |||
| 58 | str++; | ||
| 59 | } | ||
| 60 | |||
| 61 | return s; | ||
| 62 | } | ||
| 63 | |||
| 64 | |||
| 42 | xs_dict *xs_url_vars(const char *str) | 65 | xs_dict *xs_url_vars(const char *str) |
| 43 | /* parse url variables */ | 66 | /* parse url variables */ |
| 44 | { | 67 | { |
diff --git a/xs_version.h b/xs_version.h index 770366a..fc3b755 100644 --- a/xs_version.h +++ b/xs_version.h | |||
| @@ -1 +1 @@ | |||
| /* 297f71e198be7819213e9122e1e78c3b963111bc 2024-11-24T18:48:42+01:00 */ | /* 9e8f5cf300ffbf453031f2ec923cef0822a41b41 2025-01-08T16:57:26+01:00 */ | ||