Debian Codegraph @

guile/src/make-enum-header.scm

raw
1 ;;; Help produce Guile wrappers for GnuTLS types.
2 ;;;
3 ;;; GnuTLS --- Guile bindings for GnuTLS.
4 ;;; Copyright (C) 2007-2025 Free Software Foundation, Inc.
5 ;;;
6 ;;; This file is part of Guile-GnuTLS.
7 ;;;
8 ;;; This library is free software; you can redistribute it and/or
9 ;;; modify it under the terms of the GNU Lesser General Public
10 ;;; License as published by the Free Software Foundation; either
11 ;;; version 2.1 of the License, or (at your option) any later version.
12 ;;;
13 ;;; This library is distributed in the hope that it will be useful,
14 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ;;; Lesser General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU Lesser General Public
19 ;;; License along with this library; if not, see <https://www.gnu.org/licenses/>.
20
21 ;;; Written by Ludovic Courtès <[email protected]>.
22
23
24 (use-modules (gnutls build enums))
25
26
27 ;;;
28 ;;; The program.
29 ;;;
30
31 (define (main . args)
32 (let ((port (current-output-port))
33 (enums %gnutls-enums))
34 (format port "/* Automatically generated, do not edit. */~%~%")
35 (format port "#ifndef GUILE_GNUTLS_ENUMS_H~%")
36 (format port "#define GUILE_GNUTLS_ENUMS_H~%")
37
38 (format port "#ifdef HAVE_CONFIG_H~%")
39 (format port "# include <config.h>~%")
40 (format port "#endif~%~%")
41 (format port "#include <gnutls/gnutls.h>~%")
42 (format port "#include <gnutls/x509.h>~%")
43 (format port "#include <gnutls/openpgp.h>~%")
44 (format port "#include <gnutls/abstract.h>~%")
45 (format port "#ifndef GNUTLS_NO_EXTENSIONS~%")
46 (format port "#define GNUTLS_NO_EXTENSIONS GNUTLS_NO_DEFAULT_EXTENSIONS~%")
47 (format port "#endif~%~%")
48
49 (for-each (lambda (enum)
50 (output-enum-declarations enum port)
51 (output-enum->c-converter enum port)
52 (output-c->enum-converter enum port))
53 enums)
54 (format port "#endif~%")))
55
56 (apply main (cdr (command-line)))
57
58 ;;; Local Variables:
59 ;;; mode: scheme
60 ;;; coding: utf-8
61 ;;; End:
62
63 ;;; arch-tag: 07d834ca-e823-4663-9143-6d22704fbb5b