~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-updates

« back to all changes in this revision

Viewing changes to assuan/mkerrors

  • 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
 
# mkerrors - Extract error strings from assuan.h
3
 
#            and create C source for assuan_strerror
4
 
#       Copyright (C) 2001, 2002 Free Software Foundation, Inc.
5
 
#
6
 
# This file is part of Assuan.
7
 
#
8
 
# Assuan is free software; you can redistribute it and/or modify it
9
 
# under the terms of the GNU Lesser General Public License as
10
 
# published by the Free Software Foundation; either version 2.1 of
11
 
# the License, or (at your option) any later version.
12
 
#
13
 
# Assuan is distributed in the hope that it will be useful, but
14
 
# 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 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 mkerrors */
24
 
/* Do not edit! */
25
 
 
26
 
#include <stdio.h>
27
 
#include "assuan.h"
28
 
 
29
 
/**
30
 
 * assuan_strerror:
31
 
 * @err:  Error code 
32
 
 * 
33
 
 * This function returns a textual representaion of the given
34
 
 * errorcode. If this is an unknown value, a string with the value
35
 
 * is returned (Beware: it is hold in a static buffer).
36
 
 * 
37
 
 * Return value: String with the error description.
38
 
 **/
39
 
const char *
40
 
assuan_strerror (AssuanError err)
41
 
{
42
 
  const char *s;
43
 
  static char buf[25];
44
 
 
45
 
  switch (err)
46
 
    {
47
 
EOF
48
 
 
49
 
awk '
50
 
/ASSUAN_No_Error/    { okay=1 }
51
 
!okay              {next}
52
 
/}/                { exit 0 }
53
 
/ASSUAN_[A-Za-z_]*/ { print_code($1) }
54
 
 
55
 
 
56
 
function print_code( s )
57
 
{
58
 
printf "    case %s: s=\"", s ;
59
 
gsub(/_/, " ", s );
60
 
printf "%s\"; break;\n", tolower(substr(s,8));
61
 
}
62
 
'
63
 
 
64
 
cat <<EOF
65
 
    default:  sprintf (buf, "ec=%d", err ); s=buf; break;
66
 
    }
67
 
 
68
 
  return s;
69
 
}
70
 
 
71
 
EOF
 
 
b'\\ No newline at end of file'