das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Functions
Spice

Functions

void das_spice_err_setup ()
 Setup spice so that errors are not automatically output to the standard output channel.
 
const char * das_get_spice_error ()
 Get a spice error as string.
 
int das_send_spice_err (int nDasVer, const char *sErrType)
 Reads a spice error and outputs it as a das exception, the program should only call this if failed_ returns non-zero, and it should exit after calling this function.
 
int das_print_spice_error (const char *sProgName)
 Print a spice error to standard output.
 

Detailed Description

Function Documentation

◆ das_spice_err_setup()

void das_spice_err_setup ( )

Setup spice so that errors are not automatically output to the standard output channel.

Das2 readers (and unix programs in general) are only supposed to output data to standard out, not error messages.

◆ das_get_spice_error()

const char * das_get_spice_error ( )

Get a spice error as string.

@Warning This function is not MT safe, but then again SPICE isn't MT safe, so not a big deal.

Returns
NULL if there is no current spice error, a string pointer otherwise.

◆ das_send_spice_err()

int das_send_spice_err ( int  nDasVer,
const char *  sErrType 
)

Reads a spice error and outputs it as a das exception, the program should only call this if failed_ returns non-zero, and it should exit after calling this function.

Parameters
nDasVer- Set to 1 to get das1 compatible output, 2 to get das2 output
sErrType- Use one of the predefined strings from the core das2 library:
  • DAS2_EXCEPT_NO_DATA_IN_INTERVAL
  • DAS2_EXCEPT_ILLEGAL_ARGUMENT
  • DAS2_EXCEPT_SERVER_ERROR
Returns
The function always returns a non-zero value so that the das server knows the request did not complete.

◆ das_print_spice_error()

int das_print_spice_error ( const char *  sProgName)

Print a spice error to standard output.

Returns
89, you can set this to the calling shell if you like, or call reset_c() get process different spice input