~ubuntu-branches/ubuntu/jaunty/gnupg2/jaunty-security

« back to all changes in this revision

Viewing changes to common/mkerrtok

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# mkerrtok - Create error tokens from errors.h
3
 
#            and the C source for gnupg_errortoken
4
 
#       Copyright (C) 2001, 2002 Free Software Foundation, Inc.
5
 
#
6
 
# This file is part of GnuPG.
7
 
#
8
 
# GnuPG is free software; you can redistribute it and/or modify
9
 
# it under the terms of the GNU General Public License as published by
10
 
# the Free Software Foundation; either version 2 of the License, or
11
 
# (at your option) any later version.
12
 
#
13
 
# GnuPG 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
16
 
# GNU General Public License for more details.
17
 
#
18
 
# You should have received a copy of the GNU General Public License
19
 
# along with this program; if not, write to the Free Software
20
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21
 
 
22
 
cat <<EOF
23
 
/* Generated automatically by mkerrtok */
24
 
/* Do not edit! */
25
 
 
26
 
/**
27
 
 * gnupg_error_token:
28
 
 * @err:  Error code 
29
 
 * 
30
 
 * This function returns a textual representaion of the given
31
 
 * errorcode. If this is an unknown value, a static string is returned.
32
 
 * This function differs from gnupg_strerror that it yields the string 
33
 
 * representation of the macro which is never subject to i18n.
34
 
 * 
35
 
 * Return value: String with the error token.
36
 
 **/
37
 
const char *
38
 
gnupg_error_token (int err)
39
 
{
40
 
  const char *s;
41
 
 
42
 
  switch (err)
43
 
    {
44
 
EOF
45
 
 
46
 
awk '
47
 
/GNUPG_No_Error/  { okay=1 }
48
 
!okay              {next}
49
 
/}/                { exit 0 }
50
 
/GNUPG_[A-Za-z_]*/ { print_code($1) }
51
 
 
52
 
 
53
 
function print_code( s )
54
 
{
55
 
printf "    case %s: s=\"", s ;
56
 
printf "%s\"; break;\n", substr(s,7);
57
 
}
58
 
'
59
 
 
60
 
cat <<EOF
61
 
    default:  s = "Unknown_Error"; break;
62
 
    }
63
 
 
64
 
  return s;
65
 
}
66
 
 
67
 
EOF