From 6f402e2d2f052972886712f60d592684c8671982 Mon Sep 17 00:00:00 2001 From: epoch Date: Sat, 20 Apr 2019 05:32:27 -0500 Subject: rebased on an old copy of this repo. renamed everything. rewrote the uri parser. added uricmp. wew. --- uricmp.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 uricmp.c (limited to 'uricmp.c') diff --git a/uricmp.c b/uricmp.c new file mode 100644 index 0000000..9af0fed --- /dev/null +++ b/uricmp.c @@ -0,0 +1,20 @@ +#include "uri.h" +#include + +int main(int argc,char *argv[]) { + int i; + int ret; + struct uri *a=malloc(sizeof(struct uri)); + struct uri *b=malloc(sizeof(struct uri)); + if(argc < 3) { + fprintf(stderr,"usage: uricmp uri1 uri2\n");//we didn't ask for usage so it goes to stderr + return 1; + } + urifromline(a,argv[1]); + urifromline(b,argv[2]); + for(i=0;i<8;i++) { + printf("%s ? %s\n",a->A[i],b->A[i]); + } + printf("%08x\n",ret=uricmp(a,b)); + return ret > 0 ? 2 : 0; +} -- cgit v1.2.3