#if !defined(rpeg_h)
#define rpeg_h
#include "lauxlib.h"
#include "lualib.h"
#include "rbuf.h"
typedef struct r_encoder_type {
const char *name;
int code;
} r_encoder_t;
#define ENCODE_JSON 1
#define ENCODE_LINE 2
#define ENCODE_BYTE 3
#define ENCODE_DEBUG 4
#define ENCODE_STATUS 5
#define NO_MATCH 0
#define MATCH_WITHOUT_DATA 1
#define ERR_NO_ENCODER 2
#define ERR_NO_FILE 3
#define ERR_NO_PATTERN 4
#define ERR_BAD_STARTPOS 5
#define ERR_BAD_ENDPOS 6
#define ERR_INTERNAL 7
__attribute__((unused))
static const r_encoder_t r_encoders[] = {
{"byte", ENCODE_BYTE},
{"status", ENCODE_STATUS},
{"json", ENCODE_JSON},
{"line", ENCODE_LINE},
{"debug", ENCODE_DEBUG},
{NULL, 0}
};
int r_match_C (lua_State *L);
void *extract_pattern (lua_State *L, int idx);
struct rosie_string;
struct rosie_matchresult;
int r_match_C2 (void *pattern_as_void_ptr,
struct rosie_string *input, uint32_t startpos, uint32_t endpos,
uint8_t etype, uint8_t collect_times,
Buffer *output, struct rosie_matchresult *match);
#endif