]> mj.ucw.cz Git - libucw.git/blobdiff - lib/urlkey.c
- obj_parse_dump() generalized to store apart the header and the body, and
[libucw.git] / lib / urlkey.c
index 145ef484400e2573b01df9e4c65d780c08f96012..34a6fc81fc1a859ce0b7e11eed976f1ef51005bc 100644 (file)
@@ -268,5 +268,26 @@ void
 url_fingerprint(byte *url, struct fingerprint *fp)
 {
   byte buf[URL_KEY_BUF_SIZE];
-  return fingerprint(url_key(url, buf), fp);
+  fingerprint(url_key(url, buf), fp);
 }
+
+#ifdef TEST
+
+int main(int argc, char **argv)
+{
+  cf_read(cfdeffile);
+  url_key_init();
+  for (int i=1; i<argc; i++)
+    {
+      byte buf[URL_KEY_BUF_SIZE];
+      struct fingerprint fp;
+      byte *key = url_key(argv[i], buf);
+      fingerprint(key, &fp);
+      for (int j=0; j<12; j++)
+       printf("%02x", fp.hash[j]);
+      printf(" %s\n", key);
+    }
+  return 0;
+}
+
+#endif