nitlog: oops, didn't deal properly with posts in months that haven't
[wvapps.git] / wvsync / tests / strsig.cc
blob23c04a9dd76c9a498aeb691a83b25c9f0930c070
1 /*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2004 Net Integration Technologies, Inc.
5 * Generates librsync signatures for strings given on the command line and
6 * hexdumps them.
8 */
10 #include <strutils.h>
12 #include "wvsyncstring.h"
14 int main()
16 char *line;
17 WvDynBuf buf;
19 wvcon->print("Type something. Ctrl-D to quit.\n");
21 while ((line = wvcon->blocking_getline(-1)))
23 WvSyncString rstr("foo", line);
25 buf.zap();
26 if (rstr.getsig(buf))
27 break;
29 size_t size = buf.used();
30 wvcon->print("Signature is %s bytes.\n", size);
31 wvcon->print(hexdump_buffer(buf.get(size), size));
34 return 0;