Tizen 2.0 Release
[external/libgnutls26.git] / guile / src / make-smob-header.scm
1 ;;; Help produce Guile wrappers for GnuTLS types.
2 ;;;
3 ;;; GnuTLS --- Guile bindings for GnuTLS.
4 ;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc.
5 ;;;
6 ;;; GnuTLS is free software; you can redistribute it and/or
7 ;;; modify it under the terms of the GNU Lesser General Public
8 ;;; License as published by the Free Software Foundation; either
9 ;;; version 2.1 of the License, or (at your option) any later version.
10 ;;;
11 ;;; GnuTLS is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 ;;; Lesser General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with GnuTLS; if not, write to the Free Software
18 ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
20 ;;; Written by Ludovic Courtès <ludo@chbouib.org>.
21
22
23 (use-modules (gnutls build smobs))
24
25 \f
26 ;;;
27 ;;; The program.
28 ;;;
29
30 (define (main . args)
31   (define extra? (not (null? args)))
32
33   (let ((port (current-output-port))
34         (enums (if (not extra?)
35                    %gnutls-smobs
36                    %gnutls-extra-smobs)))
37     (format port "/* Automatically generated, do not edit.  */~%~%")
38     (format port "#ifndef GUILE_GNUTLS_~aSMOBS_H~%"
39             (if extra? "EXTRA_" ""))
40     (format port "#define GUILE_GNUTLS_~aSMOBS_H~%"
41             (if extra? "EXTRA_" ""))
42     (for-each (lambda (type)
43                 (output-smob-type-declaration type port)
44                 (output-c->smob-converter type port)
45                 (output-smob->c-converter type port))
46               enums)
47     (format port "#endif~%")))
48
49 (apply main (cdr (command-line)))
50
51 ;;; Local Variables:
52 ;;; mode: scheme
53 ;;; coding: latin-1
54 ;;; End:
55
56 ;;; arch-tag: 7ae9c82f-a423-4251-9a58-6e2581267567