diff options
Diffstat (limited to 'src/libdisfluid/disfluid-authors.h')
-rw-r--r-- | src/libdisfluid/disfluid-authors.h | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/src/libdisfluid/disfluid-authors.h b/src/libdisfluid/disfluid-authors.h index 149a556..6ccb8fe 100644 --- a/src/libdisfluid/disfluid-authors.h +++ b/src/libdisfluid/disfluid-authors.h @@ -1,6 +1,8 @@ #ifndef DISFLUID_AUTHORS_INCLUDED # define DISFLUID_AUTHORS_INCLUDED +# include "safe-alloc.h" + static inline size_t count_authors (void); static inline const char *author_name (size_t i); @@ -17,6 +19,8 @@ static inline bool author_is_documenter (size_t i); static inline const char *translation_credits (void); +static inline char *copyright_statement (void); + # include "disfluid-init.h" struct disfluid_author @@ -32,7 +36,7 @@ struct disfluid_author static struct disfluid_author disfluid_authors[] = { { - .name = "Vivien Kraus", + .name = N_("Vivien Kraus"), .email = "vivien@planete-kraus.eu", .uri = NULL, .is_developer = true, @@ -59,7 +63,7 @@ author_name (size_t i) { if (i < sizeof (disfluid_authors) / sizeof (disfluid_authors[0])) { - return disfluid_authors[i].name; + return _(disfluid_authors[i].name); } return NULL; } @@ -131,4 +135,62 @@ translation_credits (void) return _("translator-credits"); } +static inline char * +copyright_statement (void) +{ + ensure_init (); + int error = 0; + char *ret = NULL; + char *purpose; + error = asprintf (&purpose, _("disfluid interoperable web stack")); + if (error < 0) + { + goto cleanup; + } + char *copyright_line; + error = + asprintf (©right_line, + _("Copyright © %s the respective authors"), "2023"); + if (error < 0) + { + goto cleanup_purpose; + } + char *disclaimer; + error = asprintf (&disclaimer, + _("This program is free software: " + "you can redistribute it and/or modify it " + "under the terms of the GNU Affero General Public License " + "as published by the Free Software Foundation, " + "either version 3 of the License, " + "or (at your option) any later version.\n" + "This program is distributed in the hope that it will be useful, " + "but WITHOUT ANY WARRANTY; " + "without even the implied warranty of MERCHANTABILITY " + "or FITNESS FOR A PARTICULAR PURPOSE. " + "See the GNU Affero General Public License for more details.\n" + "You should have received a copy " + "of the GNU Affero General Public License " + "along with this program. " + "If not, see <https://www.gnu.org/licenses/>.\n")); + if (error < 0) + { + goto cleanup_copyright_line; + } + error = asprintf (&ret, "%s\n%s\n%s", purpose, copyright_line, disclaimer); + if (error < 0) + { + FREE (ret); + ret = NULL; + goto cleanup_disclaimer; + } +cleanup_disclaimer: + FREE (disclaimer); +cleanup_copyright_line: + FREE (copyright_line); +cleanup_purpose: + FREE (purpose); +cleanup: + return ret; +} + #endif /* DISFLUID_AUTHORS_INCLUDED */ |