~ubuntu-branches/ubuntu/feisty/gnupg2/feisty

« back to all changes in this revision

Viewing changes to tools/no-libgcrypt.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-11-24 18:48:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20061124184823-17ir9m46tl09n9k4
Tags: 2.0.0-4ubuntu1
* Synchronize to Debian, reapply remaining Ubuntu changes to pristine Debian
  version:
  - Remove libpcsclite-dev, libopensc2-dev build dependencies (they are in
    universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* no-libgcrypt.c - Replacement functions for libgcrypt.
2
2
 *      Copyright (C) 2003 Free Software Foundation, Inc.
3
3
 *
4
 
 * This file is part of GnuPG.
5
 
 *
6
 
 * GnuPG is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * GnuPG 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
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19
 
 * USA.
 
4
 * This file is free software; as a special exception the author gives
 
5
 * unlimited permission to copy and/or distribute it, with or without
 
6
 * modifications, as long as this notice is preserved.
 
7
 * 
 
8
 * This file is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY, to the extent permitted by law; without even
 
10
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.
20
12
 */
21
13
 
22
14
#include <config.h>
33
25
   ../jnlib/libjnlib.a .  ../common/util.h defines macros to map them
34
26
   to xmalloc etc. */
35
27
static void
36
 
out_of_core (void)
 
28
out_of_memory (void)
37
29
{
38
30
  log_fatal (_("error allocating enough memory: %s\n"), strerror (errno));
39
31
}
50
42
{
51
43
  void *p = malloc (n);
52
44
  if (!p)
53
 
    out_of_core ();
 
45
    out_of_memory ();
54
46
  return p;
55
47
}
56
48
 
72
64
{
73
65
  void *p = realloc (a, n);
74
66
  if (!p)
75
 
    out_of_core ();
 
67
    out_of_memory ();
76
68
  return p;
77
69
}
78
70
 
89
81
{
90
82
  void *p = calloc (n, m);
91
83
  if (!p)
92
 
    out_of_core ();
 
84
    out_of_memory ();
93
85
  return p;
94
86
}
95
87
 
99
91
{
100
92
  void *p = malloc (strlen (string)+1);
101
93
  if (!p)
102
 
    out_of_core ();
 
94
    out_of_memory ();
103
95
  strcpy( p, string );
104
96
  return p;
105
97
}