source: trunk/gsdl/packages/wingdbm/gdbmerrno.c@ 1013

Last change on this file since 1013 was 18, checked in by sjboddie, 26 years ago

Added windows gdbm and mg versions

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/* gdbmerrno.c - convert gdbm errors into english. */
2
3/* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson.
4 Copyright (C) 1993 Free Software Foundation, Inc.
5
6 GDBM 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, or (at your option)
9 any later version.
10
11 GDBM 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 GDBM; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 You may contact the original author by:
21 e-mail: [email protected]
22 us-mail: Philip A. Nelson
23 Computer Science Department
24 Western Washington University
25 Bellingham, WA 98226
26
27 The author of this file is:
28 e-mail: [email protected]
29
30*************************************************************************/
31
32
33/* include system configuration before all else. */
34#include "autoconf.h"
35
36#include "gdbmerrno.h"
37
38/* this is not static so that applications may access the array if they
39 like. it must be in the same order as the error codes! */
40
41const char * const gdbm_errlist[] = {
42 "No error", "Malloc error", "Block size error", "File open error",
43 "File write error", "File seek error", "File read error",
44 "Bad magic number", "Empty database", "Can't be reader", "Can't be writer",
45 "Reader can't delete", "Reader can't store", "Reader can't reorganize",
46 "Unknown update", "Item not found", "Reorganize failed", "Cannot replace",
47 "Illegal data", "Option already set", "Illegal option"
48};
49
50const char *
51gdbm_strerror(error)
52 gdbm_error error;
53{
54 if(((int)error < 0) || ((int)error > 18))
55 {
56 return("Unkown error");
57 }
58 else
59 {
60 return(gdbm_errlist[(int)error]);
61 }
62}
Note: See TracBrowser for help on using the repository browser.