2
* gen_uuid.c --- generate a DCE-compatible uuid
4
* Copyright (C) 1999, Andreas Dilger and Theodore Ts'o
7
* This file may be redistributed under the terms of the GNU Public
19
extern int getopt(int argc, char * const argv[], const char *optstring);
27
#define DO_TYPE_TIME 1
28
#define DO_TYPE_RANDOM 2
30
static void usage(const char *progname)
32
fprintf(stderr, _("Usage: %s [-r] [-t]\n"), progname);
37
main (int argc, char *argv[])
44
setlocale(LC_ALL, "");
45
bindtextdomain(PACKAGE, LOCALEDIR);
48
while ((c = getopt (argc, argv, "tr")) != EOF)
51
do_type = DO_TYPE_TIME;
54
do_type = DO_TYPE_RANDOM;
62
uuid_generate_time(uu);
65
uuid_generate_random(uu);
72
uuid_unparse(uu, str);