Browse Source

Bumped copyright year.

default 2 months ago
parent
commit
932227bbac
35 changed files with 59 additions and 36 deletions
  1. 1 1
      LICENSE
  2. 1 1
      activitypub.c
  3. 1 1
      data.c
  4. 1 1
      format.c
  5. 1 1
      html.c
  6. 1 1
      http.c
  7. 1 1
      httpd.c
  8. 2 2
      main.c
  9. 1 1
      mastoapi.c
  10. 1 1
      snac.c
  11. 1 1
      snac.h
  12. 1 1
      upgrade.c
  13. 1 1
      utils.c
  14. 1 1
      webfinger.c
  15. 1 1
      xs.h
  16. 1 1
      xs_curl.h
  17. 1 1
      xs_fcgi.h
  18. 1 1
      xs_glob.h
  19. 1 1
      xs_hex.h
  20. 1 1
      xs_html.h
  21. 1 1
      xs_httpd.h
  22. 1 1
      xs_io.h
  23. 1 1
      xs_json.h
  24. 1 1
      xs_match.h
  25. 1 1
      xs_mime.h
  26. 1 1
      xs_openssl.h
  27. 1 1
      xs_random.h
  28. 1 1
      xs_regex.h
  29. 1 1
      xs_set.h
  30. 1 1
      xs_socket.h
  31. 1 1
      xs_time.h
  32. 1 1
      xs_unicode.h
  33. 1 1
      xs_unix_socket.h
  34. 24 1
      xs_url.h
  35. 1 1
      xs_version.h

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2022 - 2024 grunfink et al. (Fediverse: @grunfink@comam.es)
+Copyright (c) 2022 - 2025 grunfink et al. (Fediverse: @grunfink@comam.es)
 
 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:
 

+ 1 - 1
activitypub.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_json.h"

+ 1 - 1
data.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_hex.h"

+ 1 - 1
format.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_regex.h"

+ 1 - 1
html.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_io.h"

+ 1 - 1
http.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_io.h"

+ 1 - 1
httpd.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_io.h"

+ 2 - 2
main.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_io.h"
@@ -14,7 +14,7 @@
 int usage(void)
 {
     printf("snac " VERSION " - A simple, minimalistic ActivityPub instance\n");
-    printf("Copyright (c) 2022 - 2024 grunfink et al. / MIT license\n");
+    printf("Copyright (c) 2022 - 2025 grunfink et al. / MIT license\n");
     printf("\n");
     printf("Commands:\n");
     printf("\n");

+ 1 - 1
mastoapi.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef NO_MASTODON_API
 

+ 1 - 1
snac.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #define XS_IMPLEMENTATION
 

+ 1 - 1
snac.h

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #define VERSION "2.68"
 

+ 1 - 1
upgrade.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_io.h"

+ 1 - 1
utils.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_io.h"

+ 1 - 1
webfinger.c

@@ -1,5 +1,5 @@
 /* snac - A simple, minimalistic ActivityPub instance */
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #include "xs.h"
 #include "xs_json.h"

+ 1 - 1
xs.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_H
 

+ 1 - 1
xs_curl.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_CURL_H
 

+ 1 - 1
xs_fcgi.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 /*
     This is an intentionally-dead-simple FastCGI implementation;

+ 1 - 1
xs_glob.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_GLOB_H
 

+ 1 - 1
xs_hex.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_HEX_H
 

+ 1 - 1
xs_html.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_HTML_H
 

+ 1 - 1
xs_httpd.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_HTTPD_H
 

+ 1 - 1
xs_io.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_IO_H
 

+ 1 - 1
xs_json.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_JSON_H
 

+ 1 - 1
xs_match.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_MATCH_H
 

+ 1 - 1
xs_mime.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_MIME_H
 

+ 1 - 1
xs_openssl.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_OPENSSL_H
 

+ 1 - 1
xs_random.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_RANDOM_H
 

+ 1 - 1
xs_regex.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_REGEX_H
 

+ 1 - 1
xs_set.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_SET_H
 

+ 1 - 1
xs_socket.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_SOCKET_H
 

+ 1 - 1
xs_time.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_TIME_H
 

+ 1 - 1
xs_unicode.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_UNICODE_H
 

+ 1 - 1
xs_unix_socket.h

@@ -1,4 +1,4 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_UNIX_SOCKET_H
 

+ 24 - 1
xs_url.h

@@ -1,10 +1,11 @@
-/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
+/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
 
 #ifndef _XS_URL_H
 
 #define _XS_URL_H
 
 xs_str *xs_url_dec(const char *str);
+xs_str *xs_url_enc(const char *str);
 xs_dict *xs_url_vars(const char *str);
 xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *header);
 
@@ -39,6 +40,28 @@ xs_str *xs_url_dec(const char *str)
 }
 
 
+xs_str *xs_url_enc(const char *str)
+/* URL-encodes a string (RFC 3986) */
+{
+    xs_str *s = xs_str_new(NULL);
+
+    while (*str) {
+        if (isalnum(*str) || strchr("-._~", *str)) {
+            s = xs_append_m(s, str, 1);
+        }
+        else {
+            char tmp[8];
+            snprintf(tmp, sizeof(tmp), "%%%02X", (unsigned char)*str);
+            s = xs_append_m(s, tmp, 3);
+        }
+
+        str++;
+    }
+
+    return s;
+}
+
+
 xs_dict *xs_url_vars(const char *str)
 /* parse url variables */
 {

+ 1 - 1
xs_version.h

@@ -1 +1 @@
-/* 297f71e198be7819213e9122e1e78c3b963111bc 2024-11-24T18:48:42+01:00 */
+/* 9e8f5cf300ffbf453031f2ec923cef0822a41b41 2025-01-08T16:57:26+01:00 */