Sha256: 7ccb24caa07e24a39a43dfa5078aed7da37d3346c7c47694228ae36de2a1637e

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

#ifndef _RB_ONIGURUMA_H_
#define _RB_ONIGURUMA_H_

#include <ruby.h>
#include <oniguruma.h>

#ifndef OG_M_ONIGURUMA
#define OG_M_ONIGURUMA "Oniguruma"
#endif

#ifndef OG_M_EXTENSIONS
#define OG_M_EXTENSIONS "Extensions"
#endif

#ifndef OG_C_OREGEXP
#define OG_C_OREGEXP "ORegexp"
#endif

/* Init functions */
void og_oniguruma_oregexp(VALUE mod, const char* name);
void og_oniguruma_string_ext(VALUE mod);
void og_oniguruma_match_ext(VALUE mod);

/* Ruby to C constant mapping functions */
OnigEncodingType* og_oniguruma_extract_encoding(VALUE encoding);
OnigSyntaxType* og_oniguruma_extract_syntax(VALUE syntax);

/* Gem version function */
VALUE og_oniguruma_gem_version();

#define og_oniguruma_extract_option(opt) (OnigOptionType)NUM2INT(opt)

/* Oniguruma::ORegexp C class data structure */
typedef struct og_oregexp {
  regex_t *reg;
} og_ORegexp;

#define OG_STRING_PTR(str) (UChar*)(RSTRING_PTR(str))

#define DEBUG 1

#ifdef DEBUG
# define NOTE "**NOTE***:  "
# define note(str) printf(NOTE str "\n")
# define note1(str, arg) printf(NOTE str "\n", arg)
# define note2(str, a, b) printf(NOTE str "\n", a, b)
# define note3(str, a, b, c) printf(NOTE str "\n", a, b, c)
#else
# define note(str)
# define note1(str, arg)
# define note2(str, a, b)
# define note3(str, a, b, c)
#endif

#endif /* _RB_ONIGURUMA_H_ */

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geoffgarside-oniguruma-2.0.3 ext/rb_oniguruma.h