src/libmetha/errors.c
void
lm_default_error_reporter(metha_t *m, const char *s, ...)
{
    int len;
    char *p;

    va_list va;
    va_start(va, s);

    len = strlen(s);

    if (!(p = malloc(len+8)))
        return;

    memcpy(p, "error: ", 7);
    memcpy(p+7, s, len+1);

    vfprintf(stderr, p, va);

    free(p);

    va_end(va);
}
/** 
 * The application using libmetha should 
 * provide its own message handling functions. But 
 * these are the default ones, printing to stdout and
 * stderr directly.
 **/
The application using libmetha should
provide its own message handling functions. But
these are the default ones, printing to stdout and
stderr directly.
The application using libmetha should provide its own message handling functions . But these are the default ones printing to stdout and stderr directly .
void
lm_default_error_reporter(metha_t *m, const char *s, ...)
{
    int len;
    char *p;
    va_list va;
    va_start(va, s);
    len = strlen(s);
    if (!(p = malloc(len+8)))
        return;
    memcpy(p, "error: ", 7);
    memcpy(p+7, s, len+1);
    vfprintf(stderr, p, va);
    free(p);
    va_end(va);
}
void lm_default_error_reporter ( metha_t * m , const char * s , ... ) { int len ; char * p ; va_list va ; va_start ( va , s ) ; len = strlen ( s ) ; if ( ! ( p = malloc ( len + 8 ) ) ) return ; memcpy ( p , " " , 7 ) ; memcpy ( p + 7 , s , len + 1 ) ; vfprintf ( stderr , p , va ) ; free ( p ) ; va_end ( va ) ; }
The application using libmetha should
 provide its own message handling functions.
The application using libmetha should provide its own message handling functions .