diff --git a/Makefile b/Makefile index 0cd406a..15b11b0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ CC=gcc CFLAGS=-g3 -CFILES=tinyparser.c strings.c +CFILES=parslib.c strings.c CFILES_STREECMP=streecmp/streecmp.c -OUTPUT=tinyparser +OUTPUT=parslib all: $(CC) $(CFLAGS) $(CFILES) $(CFILES_STREECMP) -o $(OUTPUT) diff --git a/README b/README index 5a2eeaf..68c0f4e 100644 --- a/README +++ b/README @@ -1,12 +1,13 @@ -+================+ -| tinyparser | -+================+ ++=============+ +| parslib | ++=============+ - HTTP parsing prototype and algorithm development - environment for tinyproxy - my new proxy. + HTTP/s parse C library and algorithm development + environment for - my proxy library - proxlib. RES: github.com/tinyproxy/tinyproxy RES: github.com/nginx/nginx + RES: git.0xdeadbeer.xyz/0xdeadbeer/proxlib TECHNICALS @@ -16,6 +17,7 @@ TECHNICALS int parshfield(char **offset, int len, /* out */ struct point *hentries); int parstitle(char *offset, int len, /* out */ struct httitle *titl); int parsme(char **buff, /* out */ struct httpars *pars); + void printfpars(struct httpars *pars); Library is designed to follow source input unaltering. Which suggests, that it does not directly alter the input diff --git a/tinyparser.c b/parslib.c similarity index 98% rename from tinyparser.c rename to parslib.c index a882747..ac138de 100644 --- a/tinyparser.c +++ b/parslib.c @@ -1,7 +1,7 @@ #include #include #include -#include "tinyparser.h" +#include "parslib.h" #include "streecmp/streecmp.h" extern char *methods; @@ -10,7 +10,7 @@ extern char *headers; static struct nod *method_tree = NULL; static struct nod *header_tree = NULL; -static void debug_stats(struct httpars *pars) { +void printfpars(struct httpars *pars) { fprintf(stderr, "\tstats:\n" "\t\tmethod\t: %d\n" "\t\turi\t: %.*s\n" diff --git a/tinyparser.h b/parslib.h similarity index 99% rename from tinyparser.h rename to parslib.h index 09e419a..c041030 100644 --- a/tinyparser.h +++ b/parslib.h @@ -160,5 +160,6 @@ int readlin(char **buff, char **buff_lim); int parshfield(char *offset, int len, /* out */ struct point *hentries); int parstitle(char *offset, int len, /* out */ struct httitle *titl); int parsme(char *buff, /* out */ struct httpars *pars); +void printfpars(struct httpars *pars); #endif