This source file includes following definitions.
- potion_string_boolmatch
- potion_bytes_boolmatch
- potion_string_listmatch
- potion_bytes_listmatch
- potion_string_qr
- potion_bytes_qr
- potion_string_study
- potion_string_replace
- potion_bytes_replace
- potion_string_compile
- potion_match_at
- potion_match_result
- potion_pcre_init
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "p2.h"
#include "pcre.h"
typedef struct { PNType vt; PNUniq uniq; PN_SIZE len; PN_SIZE siz; pcre *ptr; } PNMatch;
static PN potion_string_boolmatch(Potion *P, PN cl, PN self, PN str) {
}
static PN potion_bytes_boolmatch(Potion *P, PN cl, PN self, PN str) {
}
static PN potion_string_listmatch(Potion *P, PN cl, PN self, PN str) {
}
static PN potion_bytes_listmatch(Potion *P, PN cl, PN self, PN str) {
}
static PN potion_string_qr(Potion *P, PN cl, PN self, PN qr) {
}
static PN potion_bytes_qr(Potion *P, PN cl, PN self, PN qr) {
}
static PN potion_string_study(Potion *P, PN cl, PN self) {
}
static PN potion_string_replace(Potion *P, PN cl, PN self, PN str, PN with) {
}
static PN potion_bytes_replace(Potion *P, PN cl, PN self, PN str, PN with) {
}
static PN potion_string_compile(Potion *P, PN cl, PN self) {
}
static PN potion_match_at(Potion *P, PN cl, PN self) {
}
static PN potion_match_result(Potion *P, PN cl, PN self, PN str) {
}
void potion_pcre_init(Potion *P) {
PN str_vt = PN_VTABLE(PN_TSTRING);
PN byt_vt = PN_VTABLE(PN_TBYTES);
PN mat_vt = potion_type_new2(P, PN_TUSER, PN_VTABLE(PN_TLICK), potion_str(P, "Match"));
potion_method(str_vt, "match", potion_string_boolmatch, "str=S");
potion_method(byt_vt, "match", potion_bytes_boolmatch, "str=S");
potion_method(str_vt, "listmatch", potion_string_listmatch, "str=S");
potion_method(byt_vt, "listmatch", potion_bytes_listmatch, "str=S");
potion_method(str_vt, "qr", potion_string_qr, "qr=o");
potion_method(byt_vt, "qr", potion_bytes_qr, "qr=o");
potion_method(str_vt, "study", potion_string_study, 0);
potion_method(str_vt, "replace", potion_string_replace, "str=S,with=S");
potion_method(byt_vt, "replace", potion_bytes_replace, "str=S,with=S");
potion_method(str_vt, "compile", potion_string_compile, 0);
potion_type_call_is(mat_vt, PN_FUNC(potion_match_at, 0));
potion_method(mat_vt, "result", potion_match_result, "str=S");
}