From 726a1ff5748a7debf284377b39ce3de2f72b7f4f Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Wed, 10 Jun 2020 21:25:13 -0400 Subject: generation of taler error codes in kotlin and typescript --- gnu-taler-error-codes/.gitignore | 4 ++++ gnu-taler-error-codes/Makefile | 16 +++++++++++++++- gnu-taler-error-codes/kt.footer | 3 +++ gnu-taler-error-codes/kt.header | 25 +++++++++++++++++++++++++ gnu-taler-error-codes/kt.template | 8 ++++++++ gnu-taler-error-codes/ts.footer | 3 +++ gnu-taler-error-codes/ts.header | 24 ++++++++++++++++++++++++ gnu-taler-error-codes/ts.template | 8 ++++++++ 8 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 gnu-taler-error-codes/kt.footer create mode 100644 gnu-taler-error-codes/kt.header create mode 100644 gnu-taler-error-codes/kt.template create mode 100644 gnu-taler-error-codes/ts.footer create mode 100644 gnu-taler-error-codes/ts.header create mode 100644 gnu-taler-error-codes/ts.template diff --git a/gnu-taler-error-codes/.gitignore b/gnu-taler-error-codes/.gitignore index 9ce0634..9111c0f 100644 --- a/gnu-taler-error-codes/.gitignore +++ b/gnu-taler-error-codes/.gitignore @@ -1,4 +1,8 @@ taler-error-codes.h +taler-error-codes.ts +taler-error-codes.kt combined.tmp taler-error-codes.h.tmp +taler-error-codes.ts.tmp +taler-error-codes.kt.tmp diff --git a/gnu-taler-error-codes/Makefile b/gnu-taler-error-codes/Makefile index b95669f..c0bb208 100644 --- a/gnu-taler-error-codes/Makefile +++ b/gnu-taler-error-codes/Makefile @@ -1,4 +1,6 @@ -FILES=taler-error-codes.h +FILES=taler-error-codes.h \ + taler-error-codes.ts \ + taler-error-codes.kt all: check $(FILES) check: registry.rec recfix --check registry.rec @@ -21,5 +23,17 @@ taler-error-codes.h.tmp: combined.tmp h.template taler-error-codes.h: h.header taler-error-codes.h.tmp h.footer cat $^ > $@ +taler-error-codes.ts.tmp: combined.tmp ts.template + ../format.sh ts.template < combined.tmp > $@ + +taler-error-codes.ts: ts.header taler-error-codes.ts.tmp ts.footer + cat $^ > $@ + +taler-error-codes.kt.tmp: combined.tmp kt.template + ../format.sh kt.template < combined.tmp > $@ + +taler-error-codes.kt: kt.header taler-error-codes.kt.tmp kt.footer + cat $^ > $@ + .PHONY: check clean distclean prep diff --git a/gnu-taler-error-codes/kt.footer b/gnu-taler-error-codes/kt.footer new file mode 100644 index 0000000..b285e7d --- /dev/null +++ b/gnu-taler-error-codes/kt.footer @@ -0,0 +1,3 @@ + + +} diff --git a/gnu-taler-error-codes/kt.header b/gnu-taler-error-codes/kt.header new file mode 100644 index 0000000..0abbb6e --- /dev/null +++ b/gnu-taler-error-codes/kt.header @@ -0,0 +1,25 @@ +/* + This file is part of GNU Taler + Copyright (C) 2012-2020 Taler Systems SA + + GNU Taler is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNU Taler 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + + SPDX-License-Identifier: LGPL3.0-or-later + + Note: the LGPL does not apply to all components of GNU Taler, + but it does apply to this file. + */ +package net.taler.common.errorcodes + +enum class TalerErrorCode(val code: Int) { diff --git a/gnu-taler-error-codes/kt.template b/gnu-taler-error-codes/kt.template new file mode 100644 index 0000000..9934b7e --- /dev/null +++ b/gnu-taler-error-codes/kt.template @@ -0,0 +1,8 @@ + + + /** + * {{Description}} + * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_{{Name}}({{Value}}), diff --git a/gnu-taler-error-codes/ts.footer b/gnu-taler-error-codes/ts.footer new file mode 100644 index 0000000..b285e7d --- /dev/null +++ b/gnu-taler-error-codes/ts.footer @@ -0,0 +1,3 @@ + + +} diff --git a/gnu-taler-error-codes/ts.header b/gnu-taler-error-codes/ts.header new file mode 100644 index 0000000..21c7178 --- /dev/null +++ b/gnu-taler-error-codes/ts.header @@ -0,0 +1,24 @@ +/* + This file is part of GNU Taler + Copyright (C) 2012-2020 Taler Systems SA + + GNU Taler is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNU Taler 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + + SPDX-License-Identifier: LGPL3.0-or-later + + Note: the LGPL does not apply to all components of GNU Taler, + but it does apply to this file. + */ + +export enum TalerErrorCode { diff --git a/gnu-taler-error-codes/ts.template b/gnu-taler-error-codes/ts.template new file mode 100644 index 0000000..366aafb --- /dev/null +++ b/gnu-taler-error-codes/ts.template @@ -0,0 +1,8 @@ + + + /** + * {{Description}} + * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_{{Name}} = {{Value}}, -- cgit v1.2.3