nitlog: oops, didn't deal properly with posts in months that haven't
[wvapps.git] / wvsync / tests / filesig.cc
blobb93be9779fc8c2a4692e5e42042fb5c72d7e2509
1 /*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2004 Net Integration Technologies, Inc.
5 * Generates a librsync signature for a file named on the command line
6 * and hexdumps it.
8 */
10 #include <strutils.h>
12 #include "wvsyncfile.h"
14 int main(int argc, char *argv[])
16 if (argc < 2)
18 wvcon->print("Usage: %s filename\n", argv[0]);
19 return -1;
22 WvSyncFile rfile(argv[1], "");
24 WvDynBuf buf;
25 rfile.getsig(buf);
27 if (!rfile.isok())
28 return -1;
30 size_t size = buf.used();
31 wvcon->print("Signature is %s bytes.\n", size);
32 wvcon->print(hexdump_buffer(buf.get(size), size));
34 return 0;