
NCL Home >
Documentation >
HLUs >
API
NhlPError
NhlPError, NHLPERROR, NhlErrGetId, NhlErrNumMsgs, NhlErrGetMsg, NhlErrCleanMsgs, NhlErrAddTable, NhlErrSPrintMsg, NhlErrFPrintMsg
The Fortran names of these functions are NhlFPError, NhlFErrGetId, NhlFErrNumMsgs, NhlFErrGetMsg, NhlFErrCleanMsgs, NhlFErrSprintMsg, and NhlFErrFPrintMsg. There are no Fortran bindings for NHLPERROR and NhlErrAddTable.Error handling functions for the HLU library.
C synopsis
#include <ncarg/hlu/hlu.h> const char *NhlPError( NhlErrorTypes severity, int errnum, char *format, ... ) void NHLPERROR(( NhlErrorTypes severity, int errnum, char *format, ... )) int NhlErrGetId() int NhlErrNumMsgs() NhlErrorTypes NhlErrGetMsg( int msgnum, const NhlErrMsg **msgptr ) NhlErrorTypes NhlErrClearMsgs() NhlErrorTypes NhlErrAddTable( int start, int tlen, const char **etable ) char *NhlErrSPrintMsg( char *buffer, const NhlErrMsg *msg ) const char *NhlErrFPrintMsg( FILE *fp, const NhlErrMsg *msg )
Fortran synopsis
subroutine NhlFPError(severity, errnum, message) character*(*) severity, message integer errnum subroutine NhlFErrGetId(id_ret) integer id_ret subroutine NhlFErrNumMsgs(nummsg) integer nummsg subroutine NhlFErrGetMsg(msgnum, sev, emsg, errorno, sysmsg + line, fname, ierr) integer msgnum, sev, errorno, line, ierr character*(*) emsg, sysmsg, fname subroutine NhlFErrClearMsgs(ierr) integer ierr subroutine NhlFErrSprintMsg(buffer, msgnum) character*(*) buffer integer imsg subroutine NhlFErrFprintMsg(iunit, msgnum) integer iunit, imsg
Arguments
- severity (input)
- Specifies the severity level of the error message being reported.
- errnum (input)
- Specifies a unique error number that references an error message from an installed error table.
- format (input, C only)
- Message to report with argument replacement like format string for printf.
- ... (input, C only)
- Arguments for format string aka printf.
- msgnum (input)
- Identifies the index of the error message to retrieve.
- msgptr (output, C only)
- Pointer to an NhlErrMsg pointer that fully describes an error message that was reported. This arg is used to retrieve a pointer to an NhlErrMsg.
- start (input, C only)
- Index to assign to the first error message in the table being installed.
- tlen (input, C only)
- Length of the error table being installed.
- etable (input, C only)
- Pointer to an error table to install.
- buffer (output)
- Character buffer to place the formatted message into.
- msg (input, C only)
- Pointer to an NhlErrMsg structure that fully describes an error message.
- fp (input, C only)
- File pointer to print formatted error message to.
- message (input, Fortran only)
- Message to report.
- id_ret (output, Fortran only)
- Id for Error object.
- nummsg (output, Fortran only)
- Number of error messages currently buffered.
- sev (output, Fortran only)
- Indicates the severity level of the message being retrieved.
- emsg (output, Fortran only)
- Actual text of the error message being retrieved. This corresponds to the format argument (after argument replacement) if the error was reported from C and the message argument if it was reported from Fortran.
- errorno (output, Fortran only)
- Error number of the error message being retrieved.
- sysmsg (output, Fortran only)
- Text from the error table for the message being retrieved.
- line (output, Fortran only)
- Line number the error message was reported from, or 0.
- fname (output, Fortran only)
- File name the error message was reported from, or NULL.
- ierr (output, Fortran only)
- Error code.
- iunit (input, Fortran only)
- Unit number to print formatted error message to.
Types
Type name: NhlTErrorTypes Definition: typedef enum _NhlErrType{ NhlFATAL = -4, /* "FATAL" */ NhlWARNING = -3, /* "WARNING" */ NhlINFO = -2, /* "INFO" */ NhlNOERROR = -1 /* "NOERROR" */ } NhlErrorTypes;
Type name: <none> typedef struct _NhlErrMsg{ NhlErrorTypes severity; char *msg; int errorno; const char *sysmsg; int line; char *fname; } NhlErrMsg, *NhlErrMsgList;
- severity
- Specifies level of this error message.
- msg
- Actual Text of this error message.
- errorno
- Error number of this error message.
- sysmsg
- Actual Text in the error table indexed by errorno.
- line
- Line number the error message was reported from, or 0.
- fname
- File name the error message was reported from, or NULL.