From 7e669bcf6b6336ec429da949bcb4aa456971dba2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 30 Jul 2021 10:38:27 +0200 Subject: folding history in preparation of GNU Anastasis v0.0.0 release --- contrib/Makefile.am | 31 ++++++ contrib/gana | 1 + contrib/gana-update.sh | 11 ++ contrib/gana.sh | 10 ++ contrib/gnunet.tag | 235 +++++++++++++++++++++++++++++++++++++++++++ contrib/microhttpd.tag | 122 ++++++++++++++++++++++ contrib/pogen.sh | 3 + contrib/provider-list.json | 22 ++++ contrib/redux.al.json | 33 ++++++ contrib/redux.be.json | 39 +++++++ contrib/redux.ch.json | 40 ++++++++ contrib/redux.countries.json | 166 ++++++++++++++++++++++++++++++ contrib/redux.cz.json | 33 ++++++ contrib/redux.de.json | 54 ++++++++++ contrib/redux.dk.json | 32 ++++++ contrib/redux.in.json | 39 +++++++ contrib/redux.it.json | 33 ++++++ contrib/redux.jp.json | 39 +++++++ contrib/redux.sk.json | 33 ++++++ contrib/redux.us.json | 38 +++++++ contrib/redux.xx.json | 29 ++++++ contrib/redux.xy.json | 29 ++++++ contrib/uncrustify.cfg | 95 +++++++++++++++++ contrib/uncrustify_precommit | 35 +++++++ 24 files changed, 1202 insertions(+) create mode 100644 contrib/Makefile.am create mode 160000 contrib/gana create mode 100755 contrib/gana-update.sh create mode 100755 contrib/gana.sh create mode 100644 contrib/gnunet.tag create mode 100644 contrib/microhttpd.tag create mode 100755 contrib/pogen.sh create mode 100644 contrib/provider-list.json create mode 100644 contrib/redux.al.json create mode 100644 contrib/redux.be.json create mode 100644 contrib/redux.ch.json create mode 100644 contrib/redux.countries.json create mode 100644 contrib/redux.cz.json create mode 100644 contrib/redux.de.json create mode 100644 contrib/redux.dk.json create mode 100644 contrib/redux.in.json create mode 100644 contrib/redux.it.json create mode 100644 contrib/redux.jp.json create mode 100644 contrib/redux.sk.json create mode 100644 contrib/redux.us.json create mode 100644 contrib/redux.xx.json create mode 100644 contrib/redux.xy.json create mode 100644 contrib/uncrustify.cfg create mode 100755 contrib/uncrustify_precommit (limited to 'contrib') diff --git a/contrib/Makefile.am b/contrib/Makefile.am new file mode 100644 index 0000000..4304bcf --- /dev/null +++ b/contrib/Makefile.am @@ -0,0 +1,31 @@ +# This Makefile.am is in the public domain +# Process this file with automake to produce Makefile.in + +SUBDIRS = . + +pkgdatadir= $(prefix)/share/anastasis/ + +EXTRA_DIST = \ + $(pkgdata_DATA) \ + pogen.sh \ + gana.sh \ + gana-update.sh \ + gnunet.tag \ + microhttpd.tag + +pkgdata_DATA = \ + redux.al.json \ + redux.be.json \ + redux.ch.json \ + redux.cz.json \ + redux.de.json \ + redux.dk.json \ + redux.in.json \ + redux.it.json \ + redux.jp.json \ + redux.sk.json \ + redux.us.json \ + redux.xx.json \ + redux.xy.json \ + redux.countries.json \ + provider-list.json diff --git a/contrib/gana b/contrib/gana new file mode 160000 index 0000000..0f1eb85 --- /dev/null +++ b/contrib/gana @@ -0,0 +1 @@ +Subproject commit 0f1eb8555b89056fe62e093211e53a1f9ba85d56 diff --git a/contrib/gana-update.sh b/contrib/gana-update.sh new file mode 100755 index 0000000..94b2719 --- /dev/null +++ b/contrib/gana-update.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# Helper script to recompute error codes based on submodule +# Run from exchange/ main directory. +set -eu + +# Generate taler-error-codes.h in gana and copy it to +# src/include/taler_error_codes.h +cd contrib/gana/gnu-taler-error-codes +make +cd ../../.. +cat contrib/gana/gnu-taler-error-codes/taler_error_codes.h | sed -e "s/GNU_TALER_ERROR_CODES_H/GNU_ANASTASIS_ERROR_CODES_H/" -e "s/taler_error_codes.h/anastasis_error_codes.h/" > src/include/anastasis_error_codes.h diff --git a/contrib/gana.sh b/contrib/gana.sh new file mode 100755 index 0000000..30dc799 --- /dev/null +++ b/contrib/gana.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Helper script to update to latest GANA +# Run from exchange/ main directory. +set -eu + +cd contrib/gana +git pull origin master +cd ../.. + +exec ./contrib/gana-update.sh diff --git a/contrib/gnunet.tag b/contrib/gnunet.tag new file mode 100644 index 0000000..f270ba5 --- /dev/null +++ b/contrib/gnunet.tag @@ -0,0 +1,235 @@ + + + + gnunet_util_lib.h + + gnunet_util_lib.h + + #define + GNUNET_YES + gnunet_util_lib.h + + + + #define + GNUNET_OK + gnunet_util_lib.h + + + + #define + GNUNET_NO + gnunet_util_lib.h + + + + #define + GNUNET_SYSERR + gnunet_util_lib.h + + + + #define + GNUNET_TIME_UNIT_FOREVER_ABS + gnunet_util_lib.h + + + + + + gnunet_common.h + + gnunet_db_lib.h + + #define + GNUNET_free + gnunet_common.h + (ptr) + + + #define + GNUNET_free_non_null + gnunet_common.h + (ptr) + + + #define + GNUNET_malloc_large + gnunet_common.h + (size) + + + #define + GNUNET_realloc + gnunet_common.h + (ptr, size) + + + #define + GNUNET_new + gnunet_common.h + (type) + + + #define + GNUNET_malloc + gnunet_common.h + (size) + + + #define + GNUNET_new_array + gnunet_common.h + (n, type) + + + + + gnunet_strings_lib.h + + gnunet_strings_lib.h + + #define + GNUNET_STRINGS_filename_expand + gnunet_strings_lib.h + (const char *name) + + + + + gnunet_db_lib.h + + gnunet_db_lib.h + + #define + GNUNET_DB_STATUS_SUCCESS_ONE_RESULT + gnunet_db_lib.h + + + + #define + GNUNET_DB_STATUS_SUCCESS_NO_RESULTS + gnunet_db_lib.h + + + + #define + GNUNET_DB_STATUS_HARD_ERROR + gnunet_db_lib.h + + + + #define + GNUNET_DB_STATUS_SOFT_ERROR + gnunet_db_lib.h + + + + + gnunet_pq_lib.h + + gnunet_pq_lib.h + + #define + GNUNET_PQ_query_param_auto_from_type + gnunet_pq_lib.h + (x) + + + #define + gnunet_pq_lib.h + GNUNET_PQ_result_spec_end + + + + #define + gnunet_sq_lib.h + GNUNET_SQ_result_spec_absolute_time_nbo + + + + #define + gnunet_pq_lib.h + GNUNET_PQ_result_spec_auto_from_type + (name, dst) + + + struct GNUNET_PQ_ResultSpec + GNUNET_PQ_result_spec_absolute_time + gnunet_pq_lib.h + (const char *name, struct GNUNET_TIME_Absolute *at) + + + struct GNUNET_PQ_ResultSpec + GNUNET_PQ_result_spec_absolute_time_nbo + gnunet_pq_lib.h + (const char *name, struct GNUNET_TIME_AbsoluteNBO *at) + + + #define + gnunet_pq_lib.h + GNUNET_PQ_PREPARED_STATEMENT_END + + + + #define + gnunet_pq_lib.h + GNUNET_PQ_EXECUTE_STATEMENT_END + + + + struct GNUNET_PQ_QueryParam + GNUNET_PQ_query_param_absolute_time + gnunet_pq_lib.h + (const struct GNUNET_TIME_Absolute *x) + + + struct GNUNET_PQ_QueryParam + GNUNET_PQ_query_param_absolute_time_nbo + gnunet_pq_lib.h + (const struct GNUNET_TIME_AbsoluteNBO *x) + + + struct GNUNET_SQ_QueryParam + GNUNET_SQ_query_param_absolute_time + gnunet_sq_lib.h + (const struct GNUNET_TIME_Absolute *x) + + + struct GNUNET_SQ_QueryParam + GNUNET_SQ_query_param_absolute_time_nbo + gnunet_sq_lib.h + (const struct GNUNET_TIME_Absolute *x) + + + struct GNUNET_SQ_QueryParam + GNUNET_PQ_query_param_absolute_time_nbo + gnunet_sq_lib.h + (const struct GNUNET_TIME_AbsoluteNBO *x) + + + #define + GNUNET_PQ_query_param_end + gnunet_pq_lib.h + + + + #define + GNUNET_SQ_query_param_end + gnunet_sq_lib.h + + + + int + GNUNET_PQ_ResultConverter + gnunet_pq_lib.h + )(void *cls, PGresult *result, int row, const char *fname, size_t *dst_size, void *dst) + + + int + GNUNET_SQ_ResultConverter + gnunet_sq_lib.h + )(void *cls, sqlite3_stmt *result, unsigned int column, size_t *dst_size, void *dst) + + + diff --git a/contrib/microhttpd.tag b/contrib/microhttpd.tag new file mode 100644 index 0000000..5ae125e --- /dev/null +++ b/contrib/microhttpd.tag @@ -0,0 +1,122 @@ + + + + microhttpd_lib.h + + microhttpd.h + + #define + MHD_YES + microhttpd.h + + + + #define + MHD_NO + microhttpd.h + + + + #define + MHD_HTTP_OK + microhttpd.h + + + + #define + MHD_HTTP_BAD_REQUEST + microhttpd.h + + + + #define + MHD_HTTP_URI_TOO_LONG + microhttpd.h + + + + #define + MHD_HTTP_PAYLOAD_TOO_LARGE + microhttpd.h + + + + #define + MHD_HTTP_REQUEST_TIMEOUT + microhttpd.h + + + + #define + MHD_HTTP_ACCEPTED + microhttpd.h + + + + #define + MHD_HTTP_NOT_FOUND + microhttpd.h + + + + #define + MHD_HTTP_NO_CONTENT + microhttpd.h + + + + #define + MHD_HTTP_GONE + microhttpd.h + + + + #define + MHD_HTTP_PRECONDITION_FAILED + microhttpd.h + + + + #define + MHD_HTTP_CONFLICT + microhttpd.h + + + + #define + MHD_HTTP_FORBIDDEN + microhttpd.h + + + + #define + MHD_HTTP_SERVICE_UNAVAILABLE + microhttpd.h + + + + #define + MHD_HTTP_FAILED_DEPENDENCY + microhttpd.h + + + + #define + MHD_HTTP_INTERNAL_SERVER_ERROR + microhttpd.h + + + + #define + MHD_OPTION_NOTIFY_COMPLETED + microhttpd.h + + + + int + MHD_AccessHandlerCallback + microhttpd.h + )(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) + + + diff --git a/contrib/pogen.sh b/contrib/pogen.sh new file mode 100755 index 0000000..89140ea --- /dev/null +++ b/contrib/pogen.sh @@ -0,0 +1,3 @@ +#!/bin/sh +find src -name "*.c" | sort > po/POTFILES.in +find contrib -name "*.json" | sort >> po/POTFILES.in diff --git a/contrib/provider-list.json b/contrib/provider-list.json new file mode 100644 index 0000000..37200a4 --- /dev/null +++ b/contrib/provider-list.json @@ -0,0 +1,22 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "anastasis_provider": [ + { + "url" : "http://localhost:8086/", + "currency" : "TESTKUDOS" + }, + { + "url" : "http://localhost:8087/", + "currency" : "TESTKUDOS" + }, + { + "url" : "http://localhost:8088/", + "currency" : "TESTKUDOS" + }, + { + "url" : "http://localhost:8089/", + "currency" : "TESTKUDOS" + } + ] +} diff --git a/contrib/redux.al.json b/contrib/redux.al.json new file mode 100644 index 0000000..bb4360e --- /dev/null +++ b/contrib/redux.al.json @@ -0,0 +1,33 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "nid_number", + "label": "Numri i Identitetit", + "label_i18n":{ + "en": "Identity Number", + "al": "Numri i Identitetit" + }, + "widget": "anastasis_gtk_ia_nid_al", + "uuid": "256e5d30-d65e-481b-9ac4-55f5ac03b24a", + "validation-regex": "^[0-9A-T][0-9](((0|5)[0-9])|10|11|51|52)[0-9]{3}[A-W]$", + "validation-logic": "AL_NID_check" + } + ] +} diff --git a/contrib/redux.be.json b/contrib/redux.be.json new file mode 100644 index 0000000..821a3eb --- /dev/null +++ b/contrib/redux.be.json @@ -0,0 +1,39 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "nrn_number", + "label": "National Register Number", + "label_i18n":{ + "en": "National Register Number" + }, + "widget": "anastasis_gtk_ia_nid_be", + "uuid": "0452f99a-06f7-48bd-8ac0-2e4ed9a24560", + "validation-regex": "^[0-9]{11}$", + "validation-logic": "BE_NRN_check" + } + ] +} diff --git a/contrib/redux.ch.json b/contrib/redux.ch.json new file mode 100644 index 0000000..48e8e7a --- /dev/null +++ b/contrib/redux.ch.json @@ -0,0 +1,40 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "ahv_number", + "label": "AHV number", + "label_i18n":{ + "de_DE":"AHV-Nummer", + "de_CH":"AHV-Nummer" + }, + "widget": "anastasis_gtk_ia_ahv", + "uuid" : "1da87570-ba16-4f62-8a7e-cbda92f51591", + "validation-regex": "^(756).[0-9]{4}.[0-9]{4}.[0-9]{2}|(756)[0-9]{10}$", + "validation-logic": "CH_AHV_check" + } + ] +} diff --git a/contrib/redux.countries.json b/contrib/redux.countries.json new file mode 100644 index 0000000..aaaf134 --- /dev/null +++ b/contrib/redux.countries.json @@ -0,0 +1,166 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "countries": [ + { + "code" : "al", + "name" : "Albania", + "continent" : "Europe", + "name_i18n" : { + "de_DE": "Albanien", + "en_UK": "Albania" + }, + "currency": "ALL", + "call_code" : "+355" + }, + { + "code" : "be", + "name" : "Belgium", + "continent" : "Europe", + "name_i18n" : { + "de_DE": "Belgien", + "en_UK": "Belgium" + }, + "currency": "EUR", + "call_code" : "+32" + }, + { + "code" : "ch", + "name" : "Switzerland", + "continent" : "Europe", + "name_i18n" : { + "de_DE": "Schweiz", + "de_CH": "Schwiiz", + "fr_FR": "Suisse", + "en_UK": "Swiss" + }, + "currency": "CHF", + "call_code" : "+41" + }, + { + "code" : "cz", + "name" : "Czech Republic", + "continent" : "Europe", + "name_i18n" : { + "en_UK": "Czech Republic" + }, + "currency": "CZK", + "call_code" : "+420" + }, + { + "code" : "de", + "name" : "Germany", + "continent" : "Europe", + "continent_i18n" : { "de_DE" : "Europa" }, + "name_i18n" : { + "de_DE": "Deutschland", + "de_CH": "Deutschland", + "fr_FR": "Allemagne", + "en_UK": "Germany" + }, + "currency": "EUR", + "call_code" : "+49" + }, + { + "code" : "dk", + "name" : "Denmark", + "continent" : "Europe", + "continent_i18n" : { "de_DE" : "Europa" }, + "name_i18n" : { + "en_UK": "Denmark" + }, + "currency": "DKK", + "call_code" : "+45" + }, + { + "code" : "in", + "name" : "India", + "continent" : "India", + "continent_i18n" : { "en_EN" : "India" }, + "name_i18n" : { + "de_DE": "Indien", + "de_CH": "Indien", + "fr_FR": "l'Inde", + "en_UK": "India" + }, + "currency": "INR", + "call_code" : "+91" + }, + { + "code" : "it", + "name" : "Italy", + "continent" : "Europe", + "name_i18n" : { + "de_DE": "Italien", + "en_UK": "Italy" + }, + "currency": "EUR", + "call_code" : "+39" + }, + { + "code" : "jp", + "name" : "Japan", + "continent" : "Asia", + "continent_i18n" : { "en_EN" : "Japan" }, + "name_i18n" : { + "de_DE": "Japan", + "de_CH": "Japan", + "en_UK": "Japan" + }, + "currency": "JPY", + "call_code" : "+81" + }, + { + "code" : "sl", + "name" : "Slovakia", + "continent" : "Europe", + "name_i18n" : { + "en_UK": "Slovakia" + }, + "currency": "EUR", + "call_code" : "+421" + }, + { + "code" : "us", + "name" : "United States of America (USA)", + "continent" : "North America", + "continent_i18n" : { "de_DE" : "Nordamerika" }, + "name_i18n" : { + "de_DE": "Vereinigte Staaten von Amerika (USA)", + "de_CH": "Vereinigte Staaten von Amerika (USA)", + "fr_FR": "États-Unis d'Amérique (USA)", + "en_UK": "United States of America (USA)" + }, + "currency": "USD", + "call_code" : "+1" + }, + { + "code" : "xx", + "name" : "Testland", + "continent" : "Testcontinent", + "continent_i18n" : { "de_DE" : "Testkontinent" }, + "name_i18n" : { + "de_DE": "Testlandt", + "de_CH": "Testlandi", + "fr_FR": "Testpais", + "en_UK": "Testland" + }, + "currency": "TESTKUDOS", + "call_code" : "+00" + }, + { + "code" : "xy", + "name" : "Demoland", + "continent" : "Testcontinent", + "continent_i18n" : { "de_DE" : "Testkontinent" }, + "name_i18n" : { + "de_DE":"Demolandt", + "de_CH":"Demolandi", + "fr_FR": "Demopais", + "en_UK": "Demoland" + }, + "currency": "KUDOS", + "call_code" : "+01" + } + ] +} diff --git a/contrib/redux.cz.json b/contrib/redux.cz.json new file mode 100644 index 0000000..e7118a8 --- /dev/null +++ b/contrib/redux.cz.json @@ -0,0 +1,33 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "birth_number", + "label": "Birth Number", + "label_i18n":{ + "en": "Birth Number", + "cz": "rodné číslo" + }, + "widget": "anastasis_gtk_ia_birthnumber_cz", + "uuid": "03e3a05b-1192-44f1-ac36-7425512eee1a", + "validation-regex": "^[0-9]{2}(((0|2|5|7)[0-9])|10|11|31|32|51|52|81|82)/[0-9]{3}[0-9]?$", + "validation-logic": "CZ_BN_check" + } + ] +} diff --git a/contrib/redux.de.json b/contrib/redux.de.json new file mode 100644 index 0000000..862a463 --- /dev/null +++ b/contrib/redux.de.json @@ -0,0 +1,54 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "tax_number", + "label": "Taxpayer identification number", + "label_i18n":{ + "de_DE": "Steuerliche Identifikationsnummer", + "en": "German taxpayer identification number" + }, + "widget": "anastasis_gtk_ia_tax_de", + "uuid": "dae48f85-e3ff-47a4-a4a3-ed981ed8c3c6", + "validation-regex": "^[0-9]{11}$", + "validation-logic": "DE_TIN_check" + }, + { + "type": "string", + "name": "social_security_number", + "label": "Social security number", + "label_i18n":{ + "de_DE": "Deutsche Sozialversicherungsnummer", + "en": "German Social security number" + }, + "widget": "anastasis_gtk_ia_ssn_de", + "uuid": "d5e2aa79-1c88-4cf4-a4d2-252508b38e05", + "validation-regex": "^[0-9]{8}[[:upper:]][0-9]{3}$", + "validation-logic": "DE_SVN_check", + "optional" : true + } + ] +} diff --git a/contrib/redux.dk.json b/contrib/redux.dk.json new file mode 100644 index 0000000..29c7c6c --- /dev/null +++ b/contrib/redux.dk.json @@ -0,0 +1,32 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "cpr_number", + "label": "CPR-nummer", + "label_i18n":{ + "en": "CPR Number", + "dk": "CPR-nummer" + }, + "widget": "anastasis_gtk_ia_cpr_dk", + "uuid": "38f13a4d-4302-4ada-ada1-c3ff4a8ff689", + "validation-regex": "^(0[1-9]|[1-2][0-9]|30|31)((0[1-9]|10|11|12))[0-9]{2}-[0-9A-Z]{4}$" + } + ] +} diff --git a/contrib/redux.in.json b/contrib/redux.in.json new file mode 100644 index 0000000..a53035c --- /dev/null +++ b/contrib/redux.in.json @@ -0,0 +1,39 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "aadhar_number", + "label": "Aadhar number", + "label_i18n":{ + "en": "Aadhar number" + }, + "widget": "anastasis_gtk_ia_aadhar_in", + "uuid": "55afe97a-98bc-48d1-bb37-a9658be3fdc9", + "validation-regex": "^[2-9]{1}[0-9]{3}\\s[0-9]{4}\\s[0-9]{4}$", + "validation-logic": "IN_AADHAR_check" + } + ] +} diff --git a/contrib/redux.it.json b/contrib/redux.it.json new file mode 100644 index 0000000..f744497 --- /dev/null +++ b/contrib/redux.it.json @@ -0,0 +1,33 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "fiscal_code", + "label": "Codice fiscale", + "label_i18n":{ + "it": "Codice fiscale", + "en": "Fiscal code" + }, + "widget": "anastasis_gtk_ia_cf_it", + "uuid": "88f53c51-52ad-4d63-a163-ec042589f925", + "validation-regex": "^[[:upper:]]{6}[0-9]{2}[A-EHLMPRT](([0-24-6][0-9])|(30|31|70|71))[A-MZ][0-9]{3}[A-Z]$", + "validation-logic": "IT_CF_check" + } + ] +} diff --git a/contrib/redux.jp.json b/contrib/redux.jp.json new file mode 100644 index 0000000..2a80cdf --- /dev/null +++ b/contrib/redux.jp.json @@ -0,0 +1,39 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "my_number", + "label": "My number", + "label_i18n":{ + "en": "My number", + "jp": "マイナンバー" + }, + "widget": "anastasis_gtk_ia_my_jp", + "uuid": "90848f42-a83e-4226-8186-329696c14152", + "validation-regex": "^[0-9]{12}$" + } + ] +} diff --git a/contrib/redux.sk.json b/contrib/redux.sk.json new file mode 100644 index 0000000..e2acef7 --- /dev/null +++ b/contrib/redux.sk.json @@ -0,0 +1,33 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "birth_number", + "label": "Birth Number", + "label_i18n":{ + "en": "Birth Number", + "sk": "rodné číslo" + }, + "widget": "anastasis_gtk_ia_birthnumber_sk", + "uuid": "1cd372fe-2cea-4928-9f29-66f2bdd8555c", + "validation-regex": "^[0-9]{2}(((0|2|5|7)[0-9])|10|11|31|32|51|52|81|82)/[0-9]{3}[0-9]?$", + "validation-logic": "CZ_BN_check" + } + ] +} diff --git a/contrib/redux.us.json b/contrib/redux.us.json new file mode 100644 index 0000000..17e7556 --- /dev/null +++ b/contrib/redux.us.json @@ -0,0 +1,38 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "birthplace", + "label": "Birthplace", + "widget": "anastasis_gtk_ia_birthplace", + "uuid" : "4c822e8e-89c6-11eb-95c4-8b077ad8489f" + }, + { + "type": "string", + "name": "social_security_number", + "label": "Social security number", + "label_i18n":{ + "en": "US Social security number" + }, + "widget": "anastasis_gtk_ia_ssn_us", + "uuid": "310a138c-b0b7-4985-b8b8-d00e765e9f9b", + "validation-regex": "^d{3}-d{2}-d{4}$" + } + ] +} diff --git a/contrib/redux.xx.json b/contrib/redux.xx.json new file mode 100644 index 0000000..b28af81 --- /dev/null +++ b/contrib/redux.xx.json @@ -0,0 +1,29 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "sq_number", + "label": "Square number", + "widget": "anastasis_gtk_xx_square", + "uuid" : "ed790bca-89bf-11eb-96f2-233996cf644e", + "validation-regex": "^[0-9]+$", + "validation-logic": "XX_SQUARE_check" + } + ] +} diff --git a/contrib/redux.xy.json b/contrib/redux.xy.json new file mode 100644 index 0000000..2091d9a --- /dev/null +++ b/contrib/redux.xy.json @@ -0,0 +1,29 @@ +{ + "license": "GPLv3+", + "SPDX-License-Identifier": "GPL3.0-or-later", + "required_attributes": [ + { + "type": "string", + "name": "full_name", + "label": "Full name", + "widget": "anastasis_gtk_ia_full_name", + "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" + }, + { + "type": "date", + "name": "birthdate", + "label": "Birthdate", + "widget": "anastasis_gtk_ia_birthdate", + "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" + }, + { + "type": "string", + "name": "prime_number", + "label": "Prime number", + "widget": "anastasis_gtk_xx_prime", + "uuid" : "39190a95-cacb-4412-8bae-1f7da3f980b4", + "validation-regex": "^[0-9]+$", + "validation-logic": "XY_PRIME_check" + } + ] +} diff --git a/contrib/uncrustify.cfg b/contrib/uncrustify.cfg new file mode 100644 index 0000000..8c9df2c --- /dev/null +++ b/contrib/uncrustify.cfg @@ -0,0 +1,95 @@ +input_tab_size = 2 +output_tab_size = 2 + +indent_columns = 2 +indent_with_tabs = 0 +indent_case_brace = 2 +indent_label=-16 + +code_width=80 +#cmd_width=80 + +# Leave most comments alone for now +cmt_indent_multi=false +sp_cmt_cpp_start=add + +sp_not=add + +sp_func_call_user_paren_paren=remove +sp_inside_fparen=remove +sp_after_cast=add + +ls_for_split_full=true +ls_func_split_full=true +ls_code_width=true + +# Arithmetic operations in wrapped expressions should be at the start +# of the line. +pos_arith=lead + +# Fully parenthesize boolean exprs +mod_full_paren_if_bool=true + +# Braces should be on their own line +nl_fdef_brace=add +nl_enum_brace=add +nl_struct_brace=add +nl_union_brace=add +nl_if_brace=add +nl_brace_else=add +nl_elseif_brace=add +nl_while_brace=add +nl_switch_brace=add + +# no newline between "else" and "if" +nl_else_if=remove + +nl_func_paren=remove +nl_assign_brace=remove + +# No extra newlines that cause noisy diffs +nl_start_of_file=remove +nl_after_func_proto = 2 +nl_after_func_body = 3 +# If there's no new line, it's not a text file! +nl_end_of_file=add +nl_max_blank_in_func = 3 +nl_max = 3 + +sp_inside_paren = remove + +sp_arith = add +sp_arith_additive = add + +# We want spaces before and after "=" +sp_before_assign = add +sp_after_assign = add + +# we want "char *foo;" +sp_after_ptr_star = remove +sp_between_ptr_star = remove + +# we want "if (foo) { ... }" +sp_before_sparen = add + +sp_inside_fparen = remove +sp_inside_sparen = remove + +# add space before function call and decl: "foo (x)" +sp_func_call_paren = add +sp_func_proto_paren = add +sp_func_proto_paren_empty = add +sp_func_def_paren = add +sp_func_def_paren_empty = add + +# We'd want it for "if ( (foo) || (bar) )", but not for "if (m())", +# so as uncrustify doesn't give exactly what we want => ignore +sp_paren_paren = ignore +sp_inside_paren = remove +sp_bool = force + +nl_func_type_name = force +#nl_branch_else = add +nl_else_brace = add +nl_elseif_brace = add +nl_for_brace = add diff --git a/contrib/uncrustify_precommit b/contrib/uncrustify_precommit new file mode 100755 index 0000000..2487333 --- /dev/null +++ b/contrib/uncrustify_precommit @@ -0,0 +1,35 @@ +#!/bin/sh + +# use as .git/hooks/pre-commit + +exec 1>&2 + +RET=0 +changed=$(git diff --cached --name-only) +crustified="" + +for f in $changed; +do + if echo $f | grep \\.[c,h]\$ > /dev/null + then + # compare result of uncrustify with changes + # + # only change any of the invocations here if + # they are portable across all cmp and shell + # implementations ! + uncrustify -q -c uncrustify.cfg -f $f | cmp -s $f - + if test $? = 1 ; + then + crustified=" $crustified $f" + RET=1 + fi + fi +done + +if [ $RET = 1 ]; +then + echo "Run" + echo "uncrustify --no-backup -c uncrustify.cfg ${crustified}" + echo "before committing." +fi +exit $RET -- cgit v1.2.3