Beispiel #1
0
int _zbar_error_spew (const void *container,
                      int verbosity)
{
    const errinfo_t *err = container;
    assert(err->magic == ERRINFO_MAGIC);
    fprintf(stderr, "%s", _zbar_error_string(err, verbosity));
    return(-err->sev);
}
Beispiel #2
0
static inline PyObject*
exc_get_message (zbarException *self,
                 void *closure)
{
    PyBaseExceptionObject *super = (PyBaseExceptionObject*)self;
    if(!PyString_Size(super->message)) {
        Py_CLEAR(super->message);
        if(!self->obj || !zbarProcessor_Check(self->obj))
            super->message = PyString_FromString("unknown zbar error");
        else {
            const void *zobj = ((zbarProcessor*)self->obj)->zproc;
            super->message = PyString_FromString(_zbar_error_string(zobj, 1));
        }
    }
    Py_INCREF(super->message);
    return(super->message);
}