gretl_errors

gretl_errors

Synopsis

enum                GretlError;
void                errmsg                              (int err,
                                                         PRN *prn);
void                warnmsg                             (PRN *prn);
const char *        errmsg_get_with_default             (int err);
const char *        gretl_errmsg_get                    (void);
const char *        gretl_warnmsg_get                   (void);
char *              maybe_save_gretl_errmsg             (int err);
void                gretl_errmsg_set                    (const char *str);
void                gretl_warnmsg_set                   (const char *str);
void                gretl_errmsg_sprintf                (const char *fmt,
                                                         ...);
void                gretl_warnmsg_sprintf               (const char *fmt,
                                                         ...);
void                gretl_errmsg_set_from_errno         (const char *s);
void                gretl_error_clear                   (void);
void                set_gretl_alarm                     (int val);
void                set_gretl_errno                     (int err);
void                set_gretl_warning                   (int w);
int                 get_gretl_errno                     (void);
int                 check_gretl_errno                   (void);
int                 check_gretl_warning                 (void);
int                 gretl_error_is_fatal                (void);
int                 gretl_errmsg_is_set                 (void);

Description

Details

enum GretlError

typedef enum {
    E_DATA = 2,
    E_SINGULAR,     /* 3 */
    E_DF,           /* 4 */
    E_ZERO,         /* 5 */
    E_TSS,          /* 6 */
    E_ESS,          /* 7 */
    E_NOTIMP,       /* 8 */
    E_UNSPEC,       /* 9 */
    E_PDWRONG,     /* 10 */
    E_FOPEN,       /* 11 */
    E_ALLOC,       /* 12 */
    E_EQN,         /* 13 */
    E_UNKVAR,      /* 14 */
    E_ARGS,        /* 15 */
    E_OLSONLY,     /* 16 */
    E_INVARG,      /* 17 */
    E_PARSE,       /* 18 */
    E_NOVARS,      /* 19 */
    E_NOOMIT,      /* 20 */
    E_NOADD,       /* 21 */
    E_ADDDUP,      /* 22 */
    E_LOGS,        /* 23 */
    E_SQUARES,     /* 24 */
    E_LAGS,        /* 25 */
    E_SQRT,        /* 26 */
    E_HIGH,        /* 27 */
    E_OBS,         /* 28 */
    E_NOCONST,     /* 29 */
    E_BADSTAT,     /* 30 */
    E_NOMERGE,     /* 31 */
    E_NOCONV,      /* 32 */
    E_CANCEL,      /* 33 */
    E_MISSDATA,    /* 34 */
    E_NAN,         /* 35 */
    E_NONCONF,     /* 36 */
    E_TYPES,       /* 37 */
    E_DATATYPE,    /* 38 */
    E_BADOPT,      /* 39 */
    E_NOIDENT,     /* 40 */
    E_EXTERNAL,    /* 41 */
    E_TOOLONG,     /* 42 */
    E_NODATA,      /* 43 */
    E_NOTPD,       /* 44 */
    E_JACOBIAN,    /* 45 */
    E_TOOFEW,      /* 46 */
    E_FUNCERR,     /* 47 : error set by function writer */
    E_STOP,        /* 48 : user aborted execution */
    E_DB_DUP,      /* 49 : duplicate vars found when saving to database */
    E_OK,          /* 50 : not really an error */
    E_MAX          /* 51 */
} GretlError;

E_DATA

E_SINGULAR

E_DF

E_ZERO

E_TSS

E_ESS

E_NOTIMP

E_UNSPEC

E_PDWRONG

E_FOPEN

E_ALLOC

E_EQN

E_UNKVAR

E_ARGS

E_OLSONLY

E_INVARG

E_PARSE

E_NOVARS

E_NOOMIT

E_NOADD

E_ADDDUP

E_LOGS

E_SQUARES

E_LAGS

E_SQRT

E_HIGH

E_OBS

E_NOCONST

E_BADSTAT

E_NOMERGE

E_NOCONV

E_CANCEL

E_MISSDATA

E_NAN

E_NONCONF

E_TYPES

E_DATATYPE

E_BADOPT

E_NOIDENT

E_EXTERNAL

E_TOOLONG

E_NODATA

E_NOTPD

E_JACOBIAN

E_TOOFEW

E_FUNCERR

E_STOP

E_DB_DUP

E_OK

E_MAX


errmsg ()

void                errmsg                              (int err,
                                                         PRN *prn);

Prints to prn a specific error message if available, otherwise a generic error message corresponding to the given err.

err :

gretl error code (see error_codes).

prn :

gretl printing struct.

warnmsg ()

void                warnmsg                             (PRN *prn);

If a gretl warning is set, prints a message to prn and zeros the warning signal.

prn :

gretl printing struct.

errmsg_get_with_default ()

const char *        errmsg_get_with_default             (int err);

err :

gretl error code (see gretl_error_codes).

Returns :

a specific error message if available, otherwise a generic error message corresponding to the given err.

gretl_errmsg_get ()

const char *        gretl_errmsg_get                    (void);

Returns :

a specific error message if available, otherwise an empty string.

gretl_warnmsg_get ()

const char *        gretl_warnmsg_get                   (void);

Returns :

the current gretl warning message, or NULL if no warning is currently in place.

maybe_save_gretl_errmsg ()

char *              maybe_save_gretl_errmsg             (int err);

Returns :

An allocated copy of the current gretl error message, or NULL if err is zero or the current message is blank.

gretl_errmsg_set ()

void                gretl_errmsg_set                    (const char *str);

If gretl_errmsg is currently blank, copy the given string into the message space; or if the error message is not blank but sufficient space remains, append str to the message.

str :

an error message.

gretl_warnmsg_set ()

void                gretl_warnmsg_set                   (const char *str);

If copy the given string into the warning message space.

str :

a warning message.

gretl_errmsg_sprintf ()

void                gretl_errmsg_sprintf                (const char *fmt,
                                                         ...);

Append a formatted message to the current gretl error message.

fmt :

format string.

... :

arguments, as to sprintf.

gretl_warnmsg_sprintf ()

void                gretl_warnmsg_sprintf               (const char *fmt,
                                                         ...);

Write a formatted message to the current gretl warning message space.

fmt :

format string.

... :

arguments, as to sprintf.

gretl_errmsg_set_from_errno ()

void                gretl_errmsg_set_from_errno         (const char *s);

If gretl_errmsg is currently blank, copy the string returned by strerror into the message space; or if the error message is not blank but sufficient space remains, append the new error info to the message.

s :

string to prepend to error message, or NULL.

gretl_error_clear ()

void                gretl_error_clear                   (void);

Blank out any previously recorded error message.


set_gretl_alarm ()

void                set_gretl_alarm                     (int val);


set_gretl_errno ()

void                set_gretl_errno                     (int err);


set_gretl_warning ()

void                set_gretl_warning                   (int w);


get_gretl_errno ()

int                 get_gretl_errno                     (void);


check_gretl_errno ()

int                 check_gretl_errno                   (void);


check_gretl_warning ()

int                 check_gretl_warning                 (void);


gretl_error_is_fatal ()

int                 gretl_error_is_fatal                (void);


gretl_errmsg_is_set ()

int                 gretl_errmsg_is_set                 (void);

Returns :

1 if the gretl error message is currently set (not blank), otherwise 0.