Next: , Previous: rangef_parse, Up: Ranges   [Contents]


3.2 range_perror

output an error message associated with a RangeERR

Synopsis

#include <suplib/range.h>

void range_perror(
  FILE *fout,
  RangeErr error,
  const char *spec,
  long where
);

Parameters

FILE *fout

where to print the error message

RangeErr error

which error to print


Possible values for a RangeErr are as follows:

RangeErr_OK

no error

RangeErr_NOMEM

out of memory

RangeErr_INCOMPLETE

incomplete range

RangeErr_ERANGE

number out of bounds

RangeErr_ILLNUM

not a number

RangeErr_NEGNUM

negative number

RangeErr_OFLOWSTART

overflow of start value

RangeErr_NONPOSCOUNT

non-positive count

RangeErr_OFLOWEND

overflow of end value

RangeErr_INTERNAL

internal error

RangeErr_ORDER

start greater than end

RangeErr_EMPTY

float range is empty set

RangeErr_MAXERR
const char *spec

the specification which caused the error

long where

where in the spec the error ocurred

Description

Error messages are returned by the range routines via an integer code of type RangeERR. This routine acts much like the system perror routine. It takes as input the output stream, the error code, the range specification passed to the range parsing routines, and the where argument returned by those routines. It prints an error message to the passed output stream.

Author

Diab Jerius