Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Functions | Variables
rle_error.c File Reference
#include "rle.h"
Include dependency graph for rle_error.c:

Go to the source code of this file.

Functions

int rle_alloc_error (char *pgm, char *name) const
 
int rle_get_error (int code, const char *pgmname, const char *fname)
 

Variables

static char rcs_id [] = "$Header: /l/spencer/src/urt/lib/RCS/rle_error.c,v 3.0.1.1 1992/03/04 19:33:27 spencer Exp $"
 

Function Documentation

int rle_alloc_error ( char *  pgm,
char *  name 
) const

Definition at line 46 of file rle_error.c.

48 {
49  if ( name )
50  fprintf( stderr, "%s: memory allocation failed.\n", pgm );
51  else
52  fprintf( stderr, "%s: memory allocation failed (no space for %s).\n",
53  pgm, name );
54 
55  exit( RLE_NO_SPACE );
56 
57  /* Will some compilers bitch about this because they know exit
58  * doesn't return??
59  */
60  return 0;
61 }
#define RLE_NO_SPACE
Definition: rle.h:72
int rle_get_error ( int  code,
const char *  pgmname,
const char *  fname 
)

Definition at line 76 of file rle_error.c.

80 {
81  if (! fname || strcmp( fname, "-" ) == 0 )
82  fname = "Standard Input";
83 
84  switch( code )
85  {
86  case RLE_SUCCESS: /* success */
87  break;
88 
89  case RLE_NOT_RLE: /* Not an RLE file */
90  fprintf( stderr, "%s: %s is not an RLE file\n",
91  pgmname, fname );
92  break;
93 
94  case RLE_NO_SPACE: /* malloc failed */
95  fprintf( stderr,
96  "%s: Malloc failed reading header of file %s\n",
97  pgmname, fname );
98  break;
99 
100  case RLE_EMPTY:
101  fprintf( stderr, "%s: %s is an empty file\n",
102  pgmname, fname );
103  break;
104 
105  case RLE_EOF:
106  fprintf( stderr,
107  "%s: RLE header of %s is incomplete (premature EOF)\n",
108  pgmname, fname );
109  break;
110 
111  default:
112  fprintf( stderr, "%s: Error encountered reading header of %s\n",
113  pgmname, fname );
114  break;
115  }
116  return code;
117 }
#define RLE_EMPTY
Definition: rle.h:73
#define RLE_SUCCESS
Definition: rle.h:70
#define RLE_NOT_RLE
Definition: rle.h:71
char * fname[3]
Definition: show3.c:31
#define RLE_NO_SPACE
Definition: rle.h:72
#define RLE_EOF
Definition: rle.h:74

Variable Documentation

char rcs_id[] = "$Header: /l/spencer/src/urt/lib/RCS/rle_error.c,v 3.0.1.1 1992/03/04 19:33:27 spencer Exp $"
static

Definition at line 28 of file rle_error.c.