From 56eafb8f94157eecca4410ff6924715fe8328386 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 6 May 2020 00:23:52 +0200 Subject: C header generation logic --- format.sh | 2 ++ gnu-name-system-record-types/.gitignore | 1 + gnu-name-system-record-types/Makefile | 17 +++++++++++++++++ gnu-name-system-record-types/h.footer | 11 +++++++++++ gnu-name-system-record-types/h.header | 28 ++++++++++++++++++++++++++++ gnu-name-system-record-types/h.template | 6 ++++++ gnu-name-system-record-types/registry.rec | 19 +++++++++++++++++++ 7 files changed, 84 insertions(+) create mode 100755 format.sh create mode 100644 gnu-name-system-record-types/.gitignore create mode 100644 gnu-name-system-record-types/h.footer create mode 100644 gnu-name-system-record-types/h.header create mode 100644 gnu-name-system-record-types/h.template diff --git a/format.sh b/format.sh new file mode 100755 index 0000000..9af69f1 --- /dev/null +++ b/format.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec recfmt "`cat $1`" diff --git a/gnu-name-system-record-types/.gitignore b/gnu-name-system-record-types/.gitignore new file mode 100644 index 0000000..0a437d0 --- /dev/null +++ b/gnu-name-system-record-types/.gitignore @@ -0,0 +1 @@ +gnu-name-system-record-types.h diff --git a/gnu-name-system-record-types/Makefile b/gnu-name-system-record-types/Makefile index 8364f52..2d0eb95 100644 --- a/gnu-name-system-record-types/Makefile +++ b/gnu-name-system-record-types/Makefile @@ -1,2 +1,19 @@ +FILES=gnu-name-system-record-types.h +all: check $(FILES) + check: recfix --check registry.rec + +distclean: + + rm -f *.tmp +clean: + rm -f $(FILES) *.tmp + +gnu-name-system-record-types.h.tmp: registry.rec h.template + ../format.sh h.template < registry.rec > $@ + +gnu-name-system-record-types.h: h.header gnu-name-system-record-types.h.tmp h.footer + cat $^ > $@ + +.PHONY: check clean distclean diff --git a/gnu-name-system-record-types/h.footer b/gnu-name-system-record-types/h.footer new file mode 100644 index 0000000..adccc7a --- /dev/null +++ b/gnu-name-system-record-types/h.footer @@ -0,0 +1,11 @@ + + + +#if 0 /* keep Emacsens' auto-indent happy */ +{ +#endif +#ifdef __cplusplus +} +#endif + +#endif diff --git a/gnu-name-system-record-types/h.header b/gnu-name-system-record-types/h.header new file mode 100644 index 0000000..fb52945 --- /dev/null +++ b/gnu-name-system-record-types/h.header @@ -0,0 +1,28 @@ +/* + This file is part of GNUnet + Copyright (C) 2012-2020 GNUnet e.V. + + GNUnet 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. + + GNUnet 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. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + + SPDX-License-Identifier: AGPL3.0-or-later + */ +#ifndef GNU_NAME_SYSTEM_RECORD_TYPES_H +#define GNU_NAME_SYSTEM_RECORD_TYPES_H + +#ifdef __cplusplus +extern "C" { +#if 0 /* keep Emacsens' auto-indent happy */ +} +#endif +#endif diff --git a/gnu-name-system-record-types/h.template b/gnu-name-system-record-types/h.template new file mode 100644 index 0000000..dbb1f61 --- /dev/null +++ b/gnu-name-system-record-types/h.template @@ -0,0 +1,6 @@ + + +/** + * {{Comment}} + */ +#define GNUNET_GNSRECORD_TYPE_{{Name}} {{Number}} diff --git a/gnu-name-system-record-types/registry.rec b/gnu-name-system-record-types/registry.rec index 4d1f72f..74cf1b6 100644 --- a/gnu-name-system-record-types/registry.rec +++ b/gnu-name-system-record-types/registry.rec @@ -11,79 +11,98 @@ %type: Name Name_t %unique: Name %mandatory: Name +%mandatory: Comment %allowed: Contact %allowed: References %sort: Number Name Contact References Number: 65536 Name: PKEY +Comment: GNS zone transfer References: LSD0001 Number: 65537 Name: NICK +Comment: GNS nick names References: LSD0001 Number: 65538 Name: LEHO +Comment: legacy hostnames References: LSD0001 Number: 65539 Name: VPN +Comment: VPN resolution References: LSD0001 Number: 65540 Name: GNS2DNS +Comment: Delegation to DNS References: LSD0001 Number: 65541 Name: BOX +Comment: Boxed records (see TLSA/SRV handling in GNS) References: LSD0001 Number: 65542 Name: PLACE +Comment: social place for SecuShare Contact: lynx@gnunet.org Number: 65543 Name: PHONE +Comment: Endpoint for conversation Contact: grothoff@gnunet.org Number: 65544 Name: RECLAIM_ATTRIBUTE +Comment: identity attribute Contact: schanzen@gnunet.org Number: 65545 Name: RECLAIM_TICKET +Comment: local ticket reference Contact: schanzen@gnunet.org Number: 65548 Name: DELEGATE +Comment: for policies Contact: schanzen@gnunet.org Number: 65549 Name: ATTRIBUTE +Comment: for reverse lookups Contact: schanzen@gnunet.org Number: 65550 Name: RECLAIM_ATTRIBUTE_REF +Comment: for reclaim records Contact: schanzen@gnunet.org Number: 65551 Name: RECLAIM_MASTER +Comment: for RECLAIM master Contact: schanzen@gnunet.org Number: 65552 Name: RECLAIM_TICKET +Comment: for reclaimOIDC clients Contact: schanzen@gnunet.org Number: 65553 Name: RECLAIM_OIDC_CLIENT +Comment: for reclaim OIDC redirect URIs Contact: schanzen@gnunet.org Number: 65554 Name: RECLAIM_ATTESTATION +Comment: for reclaim attestation Contact: schanzen@gnunet.org Number: 65555 Name: RECLAIM_ATTESTATION_REF +Comment: for attestation reference in a ticket Contact: schanzen@gnunet.org -- cgit v1.2.3