sus-regex/test.c

30 lines
702 B
C
Raw Normal View History

2024-04-04 07:37:18 +03:00
#include <amogus.h>
2024-04-10 02:26:13 +03:00
#include "sus.h"
//#include "regexofhell.h"
2024-04-04 09:23:46 +03:00
#include <stdio.h>
2024-04-04 20:18:10 +03:00
#include <stdlib.h>
#include <memory.h>
void callback(char* str, int size, void* data) {
char** out = (char**)data;
*out = (char*)malloc(size);
2024-04-05 10:21:27 +03:00
if(str!=NULL)
memcpy(*out, str, size);
else abort();
2024-04-04 20:18:10 +03:00
}
2024-04-04 07:37:18 +03:00
int main() {
2024-04-10 02:26:13 +03:00
debugger_inject();
2024-04-04 09:23:46 +03:00
char* match;
2024-04-09 18:17:19 +03:00
int err;
2024-04-10 02:26:13 +03:00
// if((err=entry("me\\|\\|ow.(nya|sin|cos)XX,[](||)..|m(r(r(p..)))",callback,&match))) {
// if((err=entry("meow()*[]ww|mrrp",callback,&match))) {
// if((err=entry(regexofhell,callback,&match))) {
if((err=entry("",callback,&match))) {
// if((err=entry("me*ow[]*|mrrp",callback,&match))) {
2024-04-09 18:17:19 +03:00
printf("error: %i\n",err);
2024-04-04 09:23:46 +03:00
return 1;
2024-04-09 18:17:19 +03:00
}
2024-04-04 09:23:46 +03:00
printf("%s",match);
2024-04-04 07:37:18 +03:00
}