diff options
author | epoch <epoch@hacking.allowed.org> | 2019-04-20 05:32:27 -0500 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2019-04-20 05:32:27 -0500 |
commit | 6f402e2d2f052972886712f60d592684c8671982 (patch) | |
tree | 47a09324bd3c5e577ec5b7059bd6c8834bead115 /uricmp.c | |
parent | d42135919f480c8bba4ca1f043fbabf44dac708f (diff) | |
download | uritools-6f402e2d2f052972886712f60d592684c8671982.tar.gz uritools-6f402e2d2f052972886712f60d592684c8671982.zip |
rebased on an old copy of this repo. renamed everything. rewrote the uri parser. added uricmp. wew.
Diffstat (limited to 'uricmp.c')
-rw-r--r-- | uricmp.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdio.h> + +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; +} |