diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-10 21:25:13 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-10 21:25:13 -0400 |
commit | 726a1ff5748a7debf284377b39ce3de2f72b7f4f (patch) | |
tree | 17d95e463c4c1b1e31e51d6cf5e027906ebb666c /gnu-taler-error-codes | |
parent | d9a74736b8de37a157ffbaa6c917384b0b565034 (diff) | |
download | gana-726a1ff5748a7debf284377b39ce3de2f72b7f4f.tar.gz gana-726a1ff5748a7debf284377b39ce3de2f72b7f4f.zip |
generation of taler error codes in kotlin and typescript
Diffstat (limited to 'gnu-taler-error-codes')
-rw-r--r-- | gnu-taler-error-codes/.gitignore | 4 | ||||
-rw-r--r-- | gnu-taler-error-codes/Makefile | 16 | ||||
-rw-r--r-- | gnu-taler-error-codes/kt.footer | 3 | ||||
-rw-r--r-- | gnu-taler-error-codes/kt.header | 25 | ||||
-rw-r--r-- | gnu-taler-error-codes/kt.template | 8 | ||||
-rw-r--r-- | gnu-taler-error-codes/ts.footer | 3 | ||||
-rw-r--r-- | gnu-taler-error-codes/ts.header | 24 | ||||
-rw-r--r-- | gnu-taler-error-codes/ts.template | 8 |
8 files changed, 90 insertions, 1 deletions
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 @@ | |||
1 | taler-error-codes.h | 1 | taler-error-codes.h |
2 | taler-error-codes.ts | ||
3 | taler-error-codes.kt | ||
2 | 4 | ||
3 | combined.tmp | 5 | combined.tmp |
4 | taler-error-codes.h.tmp | 6 | taler-error-codes.h.tmp |
7 | taler-error-codes.ts.tmp | ||
8 | 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 @@ | |||
1 | FILES=taler-error-codes.h | 1 | FILES=taler-error-codes.h \ |
2 | taler-error-codes.ts \ | ||
3 | taler-error-codes.kt | ||
2 | all: check $(FILES) | 4 | all: check $(FILES) |
3 | check: registry.rec | 5 | check: registry.rec |
4 | recfix --check registry.rec | 6 | recfix --check registry.rec |
@@ -21,5 +23,17 @@ taler-error-codes.h.tmp: combined.tmp h.template | |||
21 | taler-error-codes.h: h.header taler-error-codes.h.tmp h.footer | 23 | taler-error-codes.h: h.header taler-error-codes.h.tmp h.footer |
22 | cat $^ > $@ | 24 | cat $^ > $@ |
23 | 25 | ||
26 | taler-error-codes.ts.tmp: combined.tmp ts.template | ||
27 | ../format.sh ts.template < combined.tmp > $@ | ||
28 | |||
29 | taler-error-codes.ts: ts.header taler-error-codes.ts.tmp ts.footer | ||
30 | cat $^ > $@ | ||
31 | |||
32 | taler-error-codes.kt.tmp: combined.tmp kt.template | ||
33 | ../format.sh kt.template < combined.tmp > $@ | ||
34 | |||
35 | taler-error-codes.kt: kt.header taler-error-codes.kt.tmp kt.footer | ||
36 | cat $^ > $@ | ||
37 | |||
24 | 38 | ||
25 | .PHONY: check clean distclean prep | 39 | .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 @@ | |||
1 | |||
2 | |||
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 @@ | |||
1 | /* | ||
2 | This file is part of GNU Taler | ||
3 | Copyright (C) 2012-2020 Taler Systems SA | ||
4 | |||
5 | GNU Taler is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Lesser General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNU Taler is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: LGPL3.0-or-later | ||
19 | |||
20 | Note: the LGPL does not apply to all components of GNU Taler, | ||
21 | but it does apply to this file. | ||
22 | */ | ||
23 | package net.taler.common.errorcodes | ||
24 | |||
25 | 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 @@ | |||
1 | |||
2 | |||
3 | /** | ||
4 | * {{Description}} | ||
5 | * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}). | ||
6 | * (A value of 0 indicates that the error is generated client-side). | ||
7 | */ | ||
8 | 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 @@ | |||
1 | |||
2 | |||
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 @@ | |||
1 | /* | ||
2 | This file is part of GNU Taler | ||
3 | Copyright (C) 2012-2020 Taler Systems SA | ||
4 | |||
5 | GNU Taler is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Lesser General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNU Taler is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: LGPL3.0-or-later | ||
19 | |||
20 | Note: the LGPL does not apply to all components of GNU Taler, | ||
21 | but it does apply to this file. | ||
22 | */ | ||
23 | |||
24 | 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 @@ | |||
1 | |||
2 | |||
3 | /** | ||
4 | * {{Description}} | ||
5 | * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}). | ||
6 | * (A value of 0 indicates that the error is generated client-side). | ||
7 | */ | ||
8 | TALER_EC_{{Name}} = {{Value}}, | ||