LibRan
0.1
Pseudo-random number distribution generator
|
LibRan error codes and messages. More...
Go to the source code of this file.
Functions | |
char * | LRstrerror (int LRerrno) |
LRstrerror(int LRerrno) - return some explanatory text regarding the given LibRan errno. More... | |
char * | LRstrerrno (int LRerrno) |
LRstrerrno(int LRerrno) - return the errno code string for the given LibRan errno. More... | |
void | LRperror (char *str, int LRerrno) |
LRperror(char *str, int LRerrno) - print out explanatory error message to stderr. More... | |
LibRan error codes and messages.
The LibRan error routines are patterned after the Standard C perror()/strerror() routines and the like.
The object creation routines like LR_new
and LR_bin_new
will return a NULL value if they fail. No error value is returned otherwise.
Many of the LibRan routines return a random variate or distribution function value. When these result in an error these functions return NAN (Not-A-Number).
The LR_obj
and LR_bin
objects have an errno attribute which can be queried.
An example code fragment:
However, the other routines, especially those that return an integer value are returning a LibRan error value if non-zero.
Use these routines to identify the specific LibRan error.
Definition in file LRerror.c.
void LRperror | ( | char * | str, |
int | LRerrno | ||
) |
LRperror(char *str, int LRerrno) - print out explanatory error message to stderr.
If the char str
string is not NULL then prepend this string to the LibRan error message with a " : " delimiter and sent to stderr .
str | String to prepend to error message |
LRerrno | LibRan error number |
char* LRstrerrno | ( | int | LRerrno | ) |
LRstrerrno(int LRerrno) - return the errno code string for the given LibRan errno.
LRerrno | LibRan error number |
char* LRstrerror | ( | int | LRerrno | ) |
LRstrerror(int LRerrno) - return some explanatory text regarding the given LibRan errno.
LRerrno | LibRan error number |