• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..22-Apr-201636

code-from-errno.cH A D27-Nov-20151.8 KiB

code-to-errno.cH A D27-Nov-20151.3 KiB

err-codes.h.inH A D27-Nov-201512.8 KiB

err-sources.h.inH A D27-Nov-20152.3 KiB

errnos.inH A D27-Nov-20152.9 KiB

gettext.hH A D27-Nov-20153.2 KiB

gpg-error-config.inH A D27-Nov-20151.8 KiB

gpg-error.cH A D27-Nov-20159.9 KiB

gpg-error.def.inH A D27-Nov-2015768

gpg-error.h.inH A D27-Nov-20158 KiB

gpg-error.m4H A D27-Nov-20152.5 KiB

init.cH A D27-Nov-201510.6 KiB

init.hH A D27-Nov-20152.1 KiB

Makefile.amH A D27-Nov-20157.1 KiB

Makefile.inH A D27-Nov-201541.4 KiB

mkerrcodes.awkH A D27-Nov-20153.3 KiB

mkerrcodes.cH A D27-Nov-20152.6 KiB

mkerrcodes1.awkH A D27-Nov-20153.4 KiB

mkerrcodes2.awkH A D27-Nov-20154.6 KiB

mkerrnos.awkH A D27-Nov-20153.6 KiB

mkheader.awkH A D27-Nov-20155.9 KiB

mkstrtable.awkH A D27-Nov-20156.1 KiB

mkw32errmap.cH A D27-Nov-20156.3 KiB

READMEH A D27-Nov-20152 KiB

strerror-sym.cH A D27-Nov-20151.6 KiB

strerror.cH A D27-Nov-20154.5 KiB

strsource-sym.cH A D27-Nov-20151.4 KiB

strsource.cH A D27-Nov-20151.2 KiB

versioninfo.rc.inH A D27-Nov-20151.6 KiB

w32-add.hH A D27-Nov-20151.8 KiB

w32-gettext.cH A D27-Nov-201549.5 KiB

w32ce-add.hH A D27-Nov-2015294

README

1Notes on the source code
2========================
3
4The mechanism to generate the system error codes is delicate and
5fragile, but it's the best I could come up with that supports
6cross-compilation and dynamic self-configuration.  Here is how it
7works:
8
91. Generate list of supported system error codes.
10
11mkerrcodes1.awk generates a list of supported system error codes from
12errnos.in.  Each entry in the list is protected with #ifdef/#endif,
13and contains a GPG_ERR_* marker.  The list is stored in "_mkerrcodes.h".
14
152. The HOST cpp is run on _mkerrcodes.h.  This evaluates the known
16system error macros to something (may be a number, maybe a constant
17expression as on the GNU/Hurd), suppressing the unknown ones.  The
18output is piped into step 3.
19
203. The cpp output is filtered with grep for only those lines which
21contain a GPG_ERR_* marker.  The output is piped into step 4.
22
234. The filtered output is processed by mkerrcodes.awk, which produces
24a table of constant expressions plus GPG_ERR_* code string symbols in
25a format suitable for the C program mkerrcodes.c.  At this point we
26are crossing our fingers that the constant expressions produced by the
27system do not contain GPG_ERR_* markers.  The output is stored in
28mkerrcodes.h.
29
305. The file mkerrcodes.h is included by mkerrcodes.c, which is
31compiled to a binary executable on the BUILD system.  At this point we
32are crossing our fingers that the constant expressions produced by the
33system do not depend on the build platform anymore.  The output is
34post-processed by mkerrcodes2.awk and stored in "code-from-errno.h",
35which is subsequently used in the library.
36
37-- Marcus
38
39 Copyright 2006 g10 Code GmbH
40
41 This file is free software; as a special exception the author gives
42 unlimited permission to copy and/or distribute it, with or without
43 modifications, as long as this notice is preserved.
44
45 This file is distributed in the hope that it will be useful, but
46 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
47 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
48