File: error.c

package info (click to toggle)
unar 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,664 kB
  • sloc: ansic: 52,939; objc: 39,563; cpp: 4,074; makefile: 99; perl: 10
file content (68 lines) | stat: -rwxr-xr-x 2,027 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef XADMASTER_ERROR_C
#define XADMASTER_ERROR_C

/*  $Id: error.c,v 1.6 2005/06/23 14:54:37 stoecker Exp $
    error text handling stuff

    XAD library system for archive handling
    Copyright (C) 1998 and later by Dirk Stcker <soft@dstoecker.de>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include "include/functions.h"

static const char *errtxt[] = {
"no error",
"unknown error",
"error reading input",
"error writing output",
"function call with bad parameters",
"not enough memory",
"input data is illegal or corrupted",
"command is not supported",
"missing required resource",
"error on decrunching data",
"filetype is unknown",
"opening file failed",
"file has been skipped",
"user break",
"file already exists",
"missing or wrong password",
"could not create directory",
"wrong checksum",
"verify failed",
"wrong drive geometry",
"unknown data format",
"source contains no files",
"unknown filesystem",
"name of file exists as directory",
"buffer too short",
"text encoding defective",
};

FUNCxadGetErrorText /* xadERROR errnum */
{
  /* Warning: xadMasterBase may be NULL at this point.
     DoDebug() in debug.c needs to pass NULL. */

  if(errnum < XADERR_OK || errnum > XADERR_ENCODING)
    errnum = XADERR_UNKNOWN;

  return (xadSTRPTR)errtxt[errnum];
}
ENDFUNC

#endif  /* XADMASTER_ERROR_C */