Next: , Previous: keyval_st, Up: KeyVal   [Contents]


5.2 keyval_perror

output an error message associated with a KeyValErr

Synopsis

#include <suplib/keyval.h>

void keyval_perror(
  FILE *fout,
  KeyValErr error,
  const char *spec,
  long where
);

Parameters

FILE *fout

where to print the error message

KeyValErr error

which error to print


Possible values for a KeyValErr are as follows:

KeyValErr_OK

no error

KeyValErr_NOMEM

out of memory

KeyValErr_NOKEY

no such keyword

KeyValErr_UNBAL

unbalanced quote or escape character

KeyValErr_INVAL

invalid value specification

KeyValErr_RANGE

the value is out of range

KeyValErr_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 keyval routines via an integer code of type KeyValErr. This routine acts much like the system perror routine. It takes as input the output stream, the error code, the keyval specification passed to the keyval parsing routines, and the where argument returned by those routines. It prints an error message to the passed output stream.

Author

Diab Jerius