mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-24 00:23:38 +00:00
Updated year in copyright notices.
This commit is contained in:
parent
e46559c022
commit
a38c7aeadc
27 changed files with 56 additions and 45 deletions
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2022 grunfink (Fediverse: @grunfink@comam.es)
|
||||
Copyright (c) 2022 - 2023 grunfink (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,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_encdec.h"
|
||||
|
|
2
data.c
2
data.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
|
|
2
format.c
2
format.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_regex.h"
|
||||
|
|
2
html.c
2
html.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
|
|
2
http.c
2
http.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
|
|
2
httpd.c
2
httpd.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
|
|
4
main.c
4
main.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
|
@ -11,7 +11,7 @@
|
|||
int usage(void)
|
||||
{
|
||||
printf("snac " VERSION " - A simple, minimalistic ActivityPub instance\n");
|
||||
printf("Copyright (c) 2022 grunfink - MIT license\n");
|
||||
printf("Copyright (c) 2022 - 2023 grunfink / MIT license\n");
|
||||
printf("\n");
|
||||
printf("Commands:\n");
|
||||
printf("\n");
|
||||
|
|
2
snac.c
2
snac.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#define XS_IMPLEMENTATION
|
||||
|
||||
|
|
2
snac.h
2
snac.h
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#define VERSION "2.19-dev"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
|
|
2
utils.c
2
utils.c
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_encdec.h"
|
||||
|
|
45
xs.h
45
xs.h
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_H
|
||||
|
||||
|
@ -53,7 +53,9 @@ d_char *xs_insert_m(d_char *data, int offset, const char *mem, int size);
|
|||
#define xs_insert(data, offset, data2) xs_insert_m(data, offset, data2, xs_size(data2))
|
||||
#define xs_append_m(data, mem, size) xs_insert_m(data, xs_size(data) - 1, mem, size)
|
||||
d_char *xs_str_new(const char *str);
|
||||
#define xs_str_cat(str1, str2) xs_insert(str1, xs_size(str1) - 1, str2)
|
||||
d_char *xs_str_wrap_i(const char *prefix, d_char *str, const char *suffix);
|
||||
#define xs_str_prepend_i(str, prefix) xs_str_wrap_i(prefix, str, NULL)
|
||||
#define xs_str_cat(str, suffix) xs_str_wrap_i(NULL, str, suffix)
|
||||
d_char *xs_replace_i(d_char *str, const char *sfrom, const char *sto);
|
||||
#define xs_replace(str, sfrom, sto) xs_replace_i(xs_dup(str), sfrom, sto)
|
||||
d_char *xs_fmt(const char *fmt, ...);
|
||||
|
@ -64,7 +66,6 @@ d_char *xs_crop_i(d_char *str, int start, int end);
|
|||
d_char *xs_strip_chars_i(d_char *str, const char *chars);
|
||||
#define xs_strip_i(str) xs_strip_chars_i(str, " \r\n\t\v\f")
|
||||
d_char *xs_tolower_i(d_char *str);
|
||||
d_char *xs_str_prepend_i(d_char *str, const char *prefix);
|
||||
d_char *xs_list_new(void);
|
||||
d_char *xs_list_append_m(d_char *list, const char *mem, int dsz);
|
||||
#define xs_list_append(list, data) xs_list_append_m(list, data, xs_size(data))
|
||||
|
@ -364,6 +365,19 @@ d_char *xs_str_new(const char *str)
|
|||
}
|
||||
|
||||
|
||||
d_char *xs_str_wrap_i(const char *prefix, d_char *str, const char *suffix)
|
||||
/* wraps str with prefix and suffix */
|
||||
{
|
||||
if (prefix)
|
||||
str = xs_insert_m(str, 0, prefix, strlen(prefix));
|
||||
|
||||
if (suffix)
|
||||
str = xs_insert_m(str, xs_size(str) - 1, suffix, xs_size(suffix));
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
d_char *xs_replace_i(d_char *str, const char *sfrom, const char *sto)
|
||||
/* replaces inline all sfrom with sto */
|
||||
{
|
||||
|
@ -490,18 +504,6 @@ d_char *xs_tolower_i(d_char *str)
|
|||
}
|
||||
|
||||
|
||||
d_char *xs_str_prepend_i(d_char *str, const char *prefix)
|
||||
/* prepends prefix into string */
|
||||
{
|
||||
int sz = strlen(prefix);
|
||||
|
||||
str = xs_expand(str, 0, sz);
|
||||
memcpy(str, prefix, sz);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/** lists **/
|
||||
|
||||
d_char *xs_list_new(void)
|
||||
|
@ -666,9 +668,16 @@ d_char *xs_list_set(d_char *list, int num, const char *data)
|
|||
d_char *xs_list_pop(d_char *list, char **data)
|
||||
/* pops the last element from the list */
|
||||
{
|
||||
if ((*data = xs_list_get(list, -1)) != NULL) {
|
||||
*data = xs_dup(*data);
|
||||
list = xs_list_del(list, -1);
|
||||
char *p = list, *v = NULL;
|
||||
|
||||
/* iterate to the end */
|
||||
while (xs_list_iter(&p, &v));
|
||||
|
||||
if (v != NULL) {
|
||||
*data = xs_dup(v);
|
||||
|
||||
/* collapse from the address of the element */
|
||||
list = xs_collapse(list, v - 1 - list, xs_size(v - 1));
|
||||
}
|
||||
|
||||
return list;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_CURL_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_ENCDEC_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_GLOB_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_HTTPD_H
|
||||
|
||||
|
|
2
xs_io.h
2
xs_io.h
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_IO_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_JSON_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_MIME
|
||||
|
||||
|
@ -23,6 +23,8 @@ struct _mime_info {
|
|||
{ "text/html", ".html" },
|
||||
{ "text/plain", ".txt" },
|
||||
{ "text/xml", ".xml" },
|
||||
{ "text/markdown", ".md" },
|
||||
{ "text/gemini", ".gmi" },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_OPENSSL_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_REGEX_H
|
||||
|
||||
|
|
2
xs_set.h
2
xs_set.h
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_SET_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_SOCKET_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
/* copyright (c) 2022 - 2023 grunfink / MIT license */
|
||||
|
||||
#ifndef _XS_TIME_H
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
/* 41985e780c622a078118ea7c7143dc304758d958 */
|
||||
/* 366ce5817597e9f4d735bced6b8c40ecc897608e */
|
||||
|
|
Loading…
Reference in a new issue