%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{PIL Error Codes}\label{PILRefErrorCodes}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Error codes (symbolic names and values) are common to both C/C++ and Fortran 90
API. Whenever text in the following table mentions C/C++ function, the same
holds for its Fortran 90 equivalent.


\begin{tabular}{|p{6.2cm}|p{1cm}|p{6.5cm}|}
\hline
  {\bf  Error  Symbol} &
  {\bf Code} &
  {\bf Error Description} \\
\hline
  ISDC\_OK &
  0 &
  No  error \\
\hline
  PIL\_OK &
  0 &
  No  error (alias of ISDC\_OK) \\
\hline
  PIL\_NUL\_PTR &
  -3000 &
  Null pointer passed as an argument, and function does not allow it. Can
  appear in many situations. For example passing NULL as a name of argument
  or passing NULL as a pointer to result variable causes PILGetXXX
  function to return this error code.
  \\
\hline
  PIL\_BAD\_ARG &
  -3001 &
  Bad argument passed. This error may be returned in many situations.
  Usually means that data type is incorrect, i.e. calling PILGetInt("a",..)
  when parameter "a" is of type string. Also when check for file access mode
  fails (PILGetFname) this error is returned. When PIL\_QUERY\_OVERRIDE mode
  is in effect and default value of parameter is out of range or invalid
  this error is returned (PILGetXXX)
  This error may also mean internal PIL error.
  \\
\hline
  PIL\_NO\_MEM &
  -3002 &
  Not enough memory. Means that PIL library was not able to allocate
  sufficient memory to handle request. This kind of error is very unlikely
  to happen, since PIL allocates very small amounts of memory. If it happens
  it probably means that memory is overwritten by process or machine
  (operating system) is not in good shape.
  \\
\hline
  PIL\_NO\_FILE &
  -3003 &
  Cannot open/create file. This error may be returned by PILInit when
  parameter file cannot be found/created/copied/updated and by PILgetFname
  when testing for files existence.
  \\
\hline
  PIL\_ERR\_FREAD &
  -3004 &
  Read from file failed. Means physical disk i/o error, lock problem, or 
  network problem when parameter file resides on NFS mounted partition. 
  This error may be returned by PILInit, PILFlushParameters,
  PILReloadParameters, PILClose
  \\
\hline
  PIL\_ERR\_FWRITE &
  -3005 &
  Write to file failed. Means physical disk i/o error, disk full, lock problem,
  or network problem when parameter file resides on NFS mounted partition. 
  This error may be returned by PILInit, PILFlushParameters,
  PILReloadParameters, PILClose  
  \\
\hline
\end{tabular}

\begin{tabular}{|p{6.2cm}|p{1cm}|p{6.5cm}|}
\hline
  {\bf  Error  Symbol} &
  {\bf Code} &
  {\bf Error Description} \\
\hline
  PIL\_EOS &
  -3006 &
  Unexpected end of string. This error means that given line in parameter
  file is badly formatted and does not contain 7 fields separated by ','.
  This error is handled internally by PIL library and should never be
  returned to user, since PIL library ignores all badly formatted lines
  in parameter files.
  \\
\hline
  PIL\_BAD\_NAME &
  -3007 &
  Invalid name of parameter. This error means that name of parameter found
  in parameter file contains invalid characters (ASCII-7 only are allowed).
  \\
\hline
  PIL\_BAD\_TYPE &
  -3008 &
  Invalid type of parameter in parameter file. This error means that PIL was
  not able to decode parameter type. Probably parameter file is badly
  formatted.
  \\
\hline
  PIL\_BAD\_MODE &
  -3009 &
  Invalid mode of parameter in parameter file. This error means that PIL was
  not able to decode parameter mode. Probably parameter file is badly
  formatted.
  \\
\hline
  PIL\_BAD\_LINE &
  -3010 &
  Invalid line in parameter file encountered. This error means that format
  of line in parameter file does not even resemble correct one.
  \\
\hline
  PIL\_NOT\_IMPLEMENTED &
  -3011 &
  Feature not implemented. This error means that type/mode/indirection type
  is valid (according to IRAF/XPI standard) but PIL library does not
  implement this. Example of unimplemented feature is indirection of data from 
  other parameter files.
  \\
\hline
  PIL\_FILE\_NOT\_EXIST &
  -3012 &
  File does not exist. Included for compatibility reasons. Version 1.0 of
  PIL does not return this error.
  \\
\hline
  PIL\_FILE\_EXIST &
  -3013 &
  File exists. Included for compatibility reasons. Version 1.0 of
  PIL does not return this error.
  \\
\hline
  PIL\_FILE\_NO\_RD &
  -3014 &
  File is not readable. Check file access permission/ownership and mount
  options.
  \\
\hline
  PIL\_FILE\_NO\_WR &
  -3015 &
  File is not writable. Check file access permission/ownership and mount
  options. By default PIL requires READWRITE access to the parameter file.
  \\
\hline
  PIL\_LINE\_BLANK &
  -3016 &
  Blank line encountered. Handled internally by PIL. Never returned to user.  
  \\
\hline
  PIL\_LINE\_COMMENT &
  -3017 &
  Comment line encountered. Handled internally by PIL. Never returned to user.  
  \\
\hline
  PIL\_LINE\_ERROR &
  -3018 &
  Invalid line encountered. Handled internally by PIL. Never returned to user.  
  \\
\hline
\end{tabular}

\begin{tabular}{|p{6.2cm}|p{1cm}|p{6.5cm}|}
\hline
  {\bf  Error  Symbol} &
  {\bf Code} &
  {\bf Error Description} \\
\hline
  PIL\_NOT\_FOUND &
  -3019 &
  No such parameter. This error means that no parameter of given name is
  in parameter file.  
  \\
\hline
  PIL\_PFILES\_TOO\_LONG &
  -3020 &
  PFILES environment variable too long. Included for compatibility reasons.
  Version 1.0 of PIL does not return this error.
  \\
\hline
  PIL\_PFILES\_FORMAT &
  -3021 &
  PFILES environment variable is badly formatted. Included for compatibility reasons.
  Version 1.0 of PIL does not return this error.
  \\
\hline
  PIL\_LOCK\_FAILED &
  -3022 &
  Cannot (un)lock parameter file. This error means that PIL library couldn't
  obtain exclusive access to file (by locking it). Operation still was
  performed, by consistency of data od disk is not assured.
  \\
\hline
  PIL\_BOGUS\_CMDLINE &
  -3023 &
  Bogus parameters found in command line. In other words some of parameter
  names specified in command line do not have their counterparts in 
  parameter file. This error may be returned by PILVerifyCmdLine().
  \\
\hline
  PIL\_NO\_LOGGER &
  -3024 &
  Error code used internally by PIL to signal that no logger function
  has been registered.
  \\
\hline
  PIL\_LINE\_TOO\_MANY &
  -3025 &
  Format error in parameter file. Too many (>7) comma separated
  items found.
  \\
\hline
  PIL\_LINE\_TOO\_FEW &
  -3026 &
  Format error in parameter file. Too few (<7) comma separated
  items found.
  \\
\hline
  PIL\_LINE\_UNMATCHED\_QUOTE &
  -3027 &
  Format error in parameter file. Unbalanced quote or doublequote
  character found.
  \\
\hline
  PIL\_LINE\_NO\_LF &
  -3028 &
  Format error in parameter file. No terminating LineFeed character
  found.
  \\
\hline
  PIL\_LINE\_EXTRA\_SPACES &
  -3029 &
  Format error in parameter file. Extra spaces following closing
  quote or doublequote character found.
  found.
  \\
\hline
  PIL\_BAD\_VAL\_BOOL &
  -3030 &
  Cannot convert string to boolean value. Expecting either yes or no
  string.
  \\
\hline
  PIL\_BAD\_VAL\_INT &
  -3031 &
  Cannot convert string to integer value. Expecting [+-]dddddd format
  \\
\hline
  PIL\_BAD\_VAL\_REAL &
  -3032 &
  Cannot convert string to real value. Expecting [+-]ddd[.ddd][e[+-ddd]] format
  \\
\hline
  PIL\_BAD\_VAL\_INT\_VAR\_VECTOR &
  -3033 &
  Cannot convert string to a vector of integers. Expecting space separated
  list of integer numbers.
  \\
\hline
\end{tabular}

\begin{tabular}{|p{6.2cm}|p{1cm}|p{6.5cm}|}
\hline
  PIL\_BAD\_VAL\_INT\_VECTOR &
  -3034 &
  Cannot convert string to a vector of integers. Expecting space separated
  list of integer numbers. This error is also returned when number of
  integers found in the string does not correspond to the number given
  in a call to PILGetIntVector();
  \\
\hline
  PIL\_BAD\_VAL\_REAL\_VAR\_VECTOR &
  -3035 &
  Cannot convert string to a vector of reals. Expecting space separated
  list of real numbers.
  \\
\hline
  PIL\_BAD\_VAL\_REAL\_VECTOR &
  -3036 &
  Cannot convert string to a vector of reals. Expecting space separated
  list of real numbers. This error is also returned when number of
  reals found in the string does not correspond to the number given
  in a call to PILGetRealVector() or PILGetReal4Vector().
  \\
\hline
  PIL\_OFF\_RANGE &
  -3037 &
  Value is off limits set by min and max fields. This error may be returned
  when PIL\_QUERY\_OVERRIDE mode is in effect.
  \\
\hline
  PIL\_BAD\_ENUM\_VALUE &
  -3038 &
  Value does not match any value from enumerated list (min field). This
  error may be returned when PIL\_QUERY\_OVERRIDE mode is in effect.
  \\
\hline
  PIL\_BAD\_FILE\_ACCESS &
  -3039 &
  Effective file access mode does not match the one specified in parameter
  type (i.e. file is not readable when type is "fr"). This error may be
  returned when PIL\_QUERY\_OVERRIDE mode is in effect.

  \\
\hline
\end{tabular}


