Sha256: 97ed48c67a8677c84bbbd3a536f67bbf97f2dfaf42d00e7f9546b6c0c80fd767

Contents?: true

Size: 814 Bytes

Versions: 22

Compression:

Stored size: 814 Bytes

Contents

/* err.h
 * Copyright (c) 2011, Peter Ohler
 * All rights reserved.
 */

#ifndef OX_ERR_H
#define OX_ERR_H

#include "ruby.h"

#define set_error(err, msg, xml, current) _ox_err_set_with_location(err, msg, xml, current, __FILE__, __LINE__)

typedef struct _err {
    VALUE	clas;
    char	msg[128];
} *Err;

extern VALUE	ox_arg_error_class;
extern VALUE	ox_parse_error_class;
extern VALUE	ox_syntax_error_class;

extern void	ox_err_set(Err e, VALUE clas, const char *format, ...);
extern void	_ox_err_set_with_location(Err err, const char *msg, const char *xml, const char *current, const char* file, int line);
extern void	ox_err_raise(Err e);

inline static void
err_init(Err e) {
    e->clas = Qnil;
    *e->msg = '\0';
}

inline static int
err_has(Err e) {
    return (Qnil != e->clas);
}

#endif /* OX_ERR_H */

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ox-2.14.14 ext/ox/err.h
ox-2.14.13 ext/ox/err.h
ox-2.14.12 ext/ox/err.h
ox-2.14.11 ext/ox/err.h
ox-2.14.10 ext/ox/err.h
ox-2.14.9 ext/ox/err.h
ox-2.14.8 ext/ox/err.h
ox-2.14.7 ext/ox/err.h
ox-2.14.6 ext/ox/err.h
ox-2.14.5 ext/ox/err.h
ox-2.14.4 ext/ox/err.h
ox-2.14.3 ext/ox/err.h
ox-2.14.2 ext/ox/err.h
ox-2.14.1 ext/ox/err.h
ox-2.14.0 ext/ox/err.h
ox-2.13.4 ext/ox/err.h
ox-2.13.3 ext/ox/err.h
ox-2.13.2 ext/ox/err.h
ox-2.13.1 ext/ox/err.h
ox-2.12.1 ext/ox/err.h