head 1.27; access; symbols UUID_1_6_2:1.26 UUID_1_6_1:1.26 UUID_1_6_0:1.25 UUID_1_5_1:1.22 UUID_1_5_0:1.22 UUID_1_4_2:1.21 UUID_1_4_1:1.21 UUID_1_4_0:1.20 UUID_1_3_2:1.19 UUID_1_3_1:1.19 UUID_1_3_0:1.19 UUID_1_2_1:1.19 UUID_1_2_0:1.18 UUID_1_1_2:1.17 UUID_1_1_1:1.16 UUID_1_1_0:1.16 UUID_1_0_4:1.16 UUID_1_0_3:1.16 UUID_1_0_2:1.16 UUID_1_0_1:1.16 UUID_1_0_0:1.16 UUID_0_9_7:1.16 UUID_0_9_6:1.14 UUID_0_9_5:1.14 UUID_0_9_4:1.14 UUID_0_9_3:1.10 UUID_0_9_2:1.10 UUID_0_9_1:1.9 UUID_0_9_0:1.7; locks; strict; comment @ * @; 1.27 date 2008.07.05.12.58.16; author rse; state dead; branches; next 1.26; commitid XLXN7vUmABwPcC9t; 1.26 date 2008.01.10.14.18.47; author rse; state Exp; branches; next 1.25; commitid LqMgFGBgTR7clSMs; 1.25 date 2007.01.01.18.14.54; author rse; state Exp; branches; next 1.24; commitid jOXiIO8S8v7xFP0s; 1.24 date 2006.08.02.13.11.09; author rse; state Exp; branches; next 1.23; commitid fwUmuuaIDS3gSgHr; 1.23 date 2006.08.02.11.59.08; author rse; state Exp; branches; next 1.22; commitid YijM0y8Y7mFytgHr; 1.22 date 2006.05.11.09.37.28; author rse; state Exp; branches; next 1.21; commitid u4EPMISJDipjmAwr; 1.21 date 2006.02.07.08.19.15; author rse; state Exp; branches; next 1.20; commitid ysd3ZoQahbomUCkr; 1.20 date 2006.01.13.06.44.30; author rse; state Exp; branches; next 1.19; commitid hYfQc9JIMh4bcphr; 1.19 date 2005.03.29.19.01.41; author rse; state Exp; branches; next 1.18; 1.18 date 2005.01.23.11.28.51; author rse; state Exp; branches; next 1.17; 1.17 date 2004.12.31.19.20.34; author rse; state Exp; branches; next 1.16; 1.16 date 2004.02.13.16.17.07; author rse; state Exp; branches; next 1.15; 1.15 date 2004.02.13.14.29.32; author rse; state Exp; branches; next 1.14; 1.14 date 2004.01.19.14.11.50; author rse; state Exp; branches; next 1.13; 1.13 date 2004.01.19.12.15.05; author rse; state Exp; branches; next 1.12; 1.12 date 2004.01.19.09.11.00; author rse; state Exp; branches; next 1.11; 1.11 date 2004.01.18.19.59.13; author rse; state Exp; branches; next 1.10; 1.10 date 2004.01.15.13.45.18; author rse; state Exp; branches; next 1.9; 1.9 date 2004.01.13.19.43.14; author rse; state Exp; branches; next 1.8; 1.8 date 2004.01.13.09.29.48; author rse; state Exp; branches; next 1.7; 1.7 date 2004.01.10.10.49.00; author rse; state Exp; branches; next 1.6; 1.6 date 2004.01.09.21.01.04; author rse; state Exp; branches; next 1.5; 1.5 date 2004.01.09.16.11.40; author rse; state Exp; branches; next 1.4; 1.4 date 2004.01.09.11.28.56; author rse; state Exp; branches; next 1.3; 1.3 date 2004.01.08.21.31.47; author rse; state Exp; branches; next 1.2; 1.2 date 2004.01.06.20.29.51; author rse; state Exp; branches; next 1.1; 1.1 date 2004.01.06.20.14.28; author rse; state Exp; branches; next ; desc @@ 1.27 log @remove OSSP uuid from CVS -- it is now versioned controlled in a Monotone repository @ text @/* ** OSSP uuid - Universally Unique Identifier ** Copyright (c) 2004-2008 Ralf S. Engelschall ** Copyright (c) 2004-2008 The OSSP Project ** ** This file is part of OSSP uuid, a library for the generation ** of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/ ** ** Permission to use, copy, modify, and distribute this software for ** any purpose with or without fee is hereby granted, provided that ** the above copyright notice and this permission notice appear in all ** copies. ** ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ** SUCH DAMAGE. ** ** uuid_cli.c: command line tool */ /* own headers */ #include "uuid.h" #include "uuid_ac.h" /* system headers */ #include #include #include #include #include #include /* error handler */ static void error(int ec, const char *str, ...) { va_list ap; va_start(ap, str); fprintf(stderr, "uuid:ERROR: "); vfprintf(stderr, str, ap); fprintf(stderr, "\n"); va_end(ap); exit(ec); } /* usage handler */ static void usage(const char *str, ...) { va_list ap; va_start(ap, str); if (str != NULL) { fprintf(stderr, "uuid:ERROR: "); vfprintf(stderr, str, ap); fprintf(stderr, "\n"); } fprintf(stderr, "usage: uuid [-v version] [-m] [-n count] [-1] [-F format] [-o filename] [namespace name]\n"); fprintf(stderr, "usage: uuid -d [-F format] [-o filename] [uuid]\n"); va_end(ap); exit(1); } /* main procedure */ int main(int argc, char *argv[]) { char uuid_buf_bin[UUID_LEN_BIN]; char uuid_buf_str[UUID_LEN_STR+1]; char uuid_buf_siv[UUID_LEN_SIV+1]; uuid_t *uuid; uuid_t *uuid_ns; uuid_rc_t rc; FILE *fp; char *p; int ch; int count; int i; int iterate; uuid_fmt_t fmt; int decode; void *vp; size_t n; unsigned int version; /* command line parsing */ count = -1; /* no count yet */ fp = stdout; /* default output file */ iterate = 0; /* not one at a time */ fmt = UUID_FMT_STR; /* default is ASCII output */ decode = 0; /* default is to encode */ version = UUID_MAKE_V1; while ((ch = getopt(argc, argv, "1n:rF:dmo:v:h")) != -1) { switch (ch) { case '1': iterate = 1; break; case 'n': if (count > 0) usage("option 'n' specified multiple times"); count = strtol(optarg, &p, 10); if (*p != '\0' || count < 1) usage("invalid argument to option 'n'"); break; case 'r': fmt = UUID_FMT_BIN; break; case 'F': if (strcasecmp(optarg, "bin") == 0) fmt = UUID_FMT_BIN; else if (strcasecmp(optarg, "str") == 0) fmt = UUID_FMT_STR; else if (strcasecmp(optarg, "siv") == 0) fmt = UUID_FMT_SIV; else error(1, "invalid format \"%s\" (has to be \"bin\", \"str\" or \"siv\")", optarg); break; case 'd': decode = 1; break; case 'o': if (fp != stdout) error(1, "multiple output files are not allowed"); if ((fp = fopen(optarg, "w")) == NULL) error(1, "fopen: %s", strerror(errno)); break; case 'm': version |= UUID_MAKE_MC; break; case 'v': i = strtol(optarg, &p, 10); if (*p != '\0') usage("invalid argument to option 'v'"); switch (i) { case 1: version = UUID_MAKE_V1; break; case 3: version = UUID_MAKE_V3; break; case 4: version = UUID_MAKE_V4; break; case 5: version = UUID_MAKE_V5; break; default: usage("invalid version on option 'v'"); break; } break; case 'h': usage(NULL); break; default: usage("invalid option '%c'", optopt); } } argv += optind; argc -= optind; if (count == -1) count = 1; if (decode) { /* decoding */ if ((rc = uuid_create(&uuid)) != UUID_RC_OK) error(1, "uuid_create: %s", uuid_error(rc)); if (argc != 1) usage("invalid number of arguments"); if (strcmp(argv[0], "-") == 0) { if (fmt == UUID_FMT_BIN) { if (fread(uuid_buf_bin, UUID_LEN_BIN, 1, stdin) != 1) error(1, "fread: failed to read %d (UUID_LEN_BIN) bytes from stdin", UUID_LEN_BIN); if ((rc = uuid_import(uuid, UUID_FMT_BIN, uuid_buf_bin, UUID_LEN_BIN)) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); } else if (fmt == UUID_FMT_STR) { if (fread(uuid_buf_str, UUID_LEN_STR, 1, stdin) != 1) error(1, "fread: failed to read %d (UUID_LEN_STR) bytes from stdin", UUID_LEN_STR); uuid_buf_str[UUID_LEN_STR] = '\0'; if ((rc = uuid_import(uuid, UUID_FMT_STR, uuid_buf_str, UUID_LEN_STR)) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); } else if (fmt == UUID_FMT_SIV) { if (fread(uuid_buf_siv, UUID_LEN_SIV, 1, stdin) != 1) error(1, "fread: failed to read %d (UUID_LEN_SIV) bytes from stdin", UUID_LEN_SIV); uuid_buf_siv[UUID_LEN_SIV] = '\0'; if ((rc = uuid_import(uuid, UUID_FMT_SIV, uuid_buf_siv, UUID_LEN_SIV)) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); } } else { if (fmt == UUID_FMT_BIN) { error(1, "binary input mode only possible if reading from stdin"); } else if (fmt == UUID_FMT_STR) { if ((rc = uuid_import(uuid, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); } else if (fmt == UUID_FMT_SIV) { if ((rc = uuid_import(uuid, UUID_FMT_SIV, argv[0], strlen(argv[0]))) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); } } vp = NULL; if ((rc = uuid_export(uuid, UUID_FMT_TXT, &vp, NULL)) != UUID_RC_OK) error(1, "uuid_export: %s", uuid_error(rc)); fprintf(stdout, "%s", (char *)vp); free(vp); if ((rc = uuid_destroy(uuid)) != UUID_RC_OK) error(1, "uuid_destroy: %s", uuid_error(rc)); } else { /* encoding */ if ( (version == UUID_MAKE_V1 && argc != 0) || (version == UUID_MAKE_V3 && argc != 2) || (version == UUID_MAKE_V4 && argc != 0) || (version == UUID_MAKE_V5 && argc != 2)) usage("invalid number of arguments"); if ((rc = uuid_create(&uuid)) != UUID_RC_OK) error(1, "uuid_create: %s", uuid_error(rc)); if (argc == 1) { /* load initial UUID for setting old generator state */ if (strlen(argv[0]) != UUID_LEN_STR) error(1, "invalid length of UUID string representation"); if ((rc = uuid_import(uuid, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); } for (i = 0; i < count; i++) { if (iterate) { if ((rc = uuid_load(uuid, "nil")) != UUID_RC_OK) error(1, "uuid_load: %s", uuid_error(rc)); } if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) { if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK) error(1, "uuid_create: %s", uuid_error(rc)); if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) { if ((rc = uuid_import(uuid_ns, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); } if ((rc = uuid_make(uuid, version, uuid_ns, argv[1])) != UUID_RC_OK) error(1, "uuid_make: %s", uuid_error(rc)); if ((rc = uuid_destroy(uuid_ns)) != UUID_RC_OK) error(1, "uuid_destroy: %s", uuid_error(rc)); } else { if ((rc = uuid_make(uuid, version)) != UUID_RC_OK) error(1, "uuid_make: %s", uuid_error(rc)); } if (fmt == UUID_FMT_BIN) { vp = NULL; if ((rc = uuid_export(uuid, UUID_FMT_BIN, &vp, &n)) != UUID_RC_OK) error(1, "uuid_export: %s", uuid_error(rc)); fwrite(vp, n, 1, fp); free(vp); } else if (fmt == UUID_FMT_STR) { vp = NULL; if ((rc = uuid_export(uuid, UUID_FMT_STR, &vp, &n)) != UUID_RC_OK) error(1, "uuid_export: %s", uuid_error(rc)); fprintf(fp, "%s\n", (char *)vp); free(vp); } else if (fmt == UUID_FMT_SIV) { vp = NULL; if ((rc = uuid_export(uuid, UUID_FMT_SIV, &vp, &n)) != UUID_RC_OK) error(1, "uuid_export: %s", uuid_error(rc)); fprintf(fp, "%s\n", (char *)vp); free(vp); } } if ((rc = uuid_destroy(uuid)) != UUID_RC_OK) error(1, "uuid_destroy: %s", uuid_error(rc)); } /* close output channel */ if (fp != stdout) fclose(fp); return 0; } @ 1.26 log @adjust copyright messages for 2008 and bump version in advance @ text @@ 1.25 log @Adjust copyright messages for new year 2007. @ text @d3 2 a4 2 ** Copyright (c) 2004-2007 Ralf S. Engelschall ** Copyright (c) 2004-2007 The OSSP Project @ 1.24 log @Optional DMALLOC based memory debugging support. @ text @d3 2 a4 2 ** Copyright (c) 2004-2006 Ralf S. Engelschall ** Copyright (c) 2004-2006 The OSSP Project @ 1.23 log @Consistently include "config.h" in all source files. @ text @d30 1 a30 1 #include "config.h" d32 1 d34 1 @ 1.22 log @Add full support for Single Integer Value (SIV) UUID representation for both importing and exporting in C/C++/Perl/PHP APIs. @ text @d30 1 @ 1.21 log @Apply workaround to uuid.h to avoid conflicts with vendor UUID implementations where uuid_t (Darwin / MacOS X) or uuid_create/uuid_compare (POSIX) might exist. Supported by: SpaceNet (MacOS X platform) @ text @d65 2 a66 2 fprintf(stderr, "usage: uuid [-v version] [-m] [-n count] [-1] [-r] [-o filename] [namespace name]\n"); fprintf(stderr, "usage: uuid -d [-r] [-o filename] [uuid]\n"); d76 1 d86 1 a86 1 int raw; d93 5 a97 5 count = -1; /* no count yet */ fp = stdout; /* default output file */ iterate = 0; /* not one at a time */ raw = 0; /* default is ASCII output */ decode = 0; /* default is to encode */ d99 1 a99 1 while ((ch = getopt(argc, argv, "1n:rdmo:v:h")) != -1) { d112 11 a122 1 raw = 1; d169 1 a169 1 if (raw) { d175 1 a175 1 else { d182 7 d191 11 a201 6 if (raw) error(1, "raw input mode only possible if reading from stdin"); if (strlen(argv[0]) != UUID_LEN_STR) error(1, "invalid length of UUID string representation"); if ((rc = uuid_import(uuid, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); d248 1 a248 1 if (raw) { d255 1 a255 1 else { d262 7 @ 1.20 log @Adjust copyright messages for new year 2006. @ text @d30 2 a38 2 #include "uuid.h" @ 1.19 log @Cleanup the source code even more by following a large set of FlexeLint's suggestions. @ text @d3 2 a4 2 ** Copyright (c) 2004-2005 Ralf S. Engelschall ** Copyright (c) 2004-2005 The OSSP Project @ 1.18 log @Added support for new version 5 UUIDs (name-based, SHA-1) according to latest draft-mealling-uuid-urn-05.txt. @ text @d130 4 a133 4 case 1: version = UUID_MAKE_V1; break;; case 3: version = UUID_MAKE_V3; break;; case 4: version = UUID_MAKE_V4; break;; case 5: version = UUID_MAKE_V5; break;; @ 1.17 log @Adjust copyright messages for new year 2005. @ text @d65 1 a65 1 fprintf(stderr, "usage: uuid [-v version] [-m] [-n count] [-1] [-r] [-o filename] [namespace-name]\n"); d133 1 d192 2 a193 1 || (version == UUID_MAKE_V4 && argc != 0)) d209 1 a209 1 if (version == UUID_MAKE_V3) { @ 1.16 log @Add support to uuid(1) CLI for decoding from stdin for both binary and string representations. @ text @d3 2 a4 2 ** Copyright (c) 2004 Ralf S. Engelschall ** Copyright (c) 2004 The OSSP Project @ 1.15 log @Fixed "uuid -h" command. Submitted by: fuyuki@@nigredo.org @ text @d74 2 d152 2 d156 23 a178 6 if ((rc = uuid_create(&uuid)) != UUID_RC_OK) error(1, "uuid_create: %s", uuid_error(rc)); if (strlen(argv[0]) != UUID_LEN_STR) error(1, "invalid length of UUID string representation"); if ((rc = uuid_import(uuid, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK) error(1, "uuid_import: %s", uuid_error(rc)); @ 1.14 log @flush more pending cleanups @ text @d65 2 a66 1 fprintf(stderr, "usage: uuid [-1] [-n count] [-a] [-d] [-o filename] [UUID]\n"); d96 1 a96 1 while ((ch = getopt(argc, argv, "1n:rdmo:v:")) != -1) { d135 3 @ 1.13 log @o Include in uuid.h because of size_t usage. o INCOMPATIBILITY: Refactor the API and rename uuid_generate() to uuid_make() and use a "uuid_t" pointer for the namespace on UUID_VERSION3 generation. To allow access to the internal pre-defined namespace UUIDs, provide a new uuid_load() function. Because uuid_load() now also allows the loading of the "nil" UUID, remove uuid_nil() from the API. After this second refactoring the API is now the one we originally wished for the forthcoming version 1.0 of OSSP uuid. @ text @d94 1 a94 1 version = UUID_VERSION1; d120 1 a120 1 version |= UUID_MCASTRND; d127 3 a129 3 case 1: version = UUID_VERSION1; break;; case 3: version = UUID_VERSION3; break;; case 4: version = UUID_VERSION4; break;; d164 3 a166 3 if ( (version == UUID_VERSION1 && argc != 0) || (version == UUID_VERSION3 && argc != 2) || (version == UUID_VERSION4 && argc != 0)) d182 1 a182 1 if (version == UUID_VERSION3) { @ 1.12 log @cleanup pointer casting by using a void pointer @ text @d74 1 d153 1 a153 1 error(1, "uuid_parse: %s", uuid_error(rc)); d156 1 a156 1 error(1, "uuid_dump: %s", uuid_error(rc)); d175 1 a175 1 error(1, "uuid_parse: %s", uuid_error(rc)); d179 18 a196 2 if ((rc = uuid_nil(uuid)) != UUID_RC_OK) error(1, "uuid_nil: %s", uuid_error(rc)); a197 6 if (version == UUID_VERSION3) rc = uuid_generate(uuid, version, argv[0], argv[1]); else rc = uuid_generate(uuid, version); if (rc != UUID_RC_OK) error(1, "uuid_generate: %s", uuid_error(rc)); d208 1 a208 1 error(1, "uuid_format: %s", uuid_error(rc)); @ 1.11 log @- Refactor the API by merging uuid_{unpack,pack,parse,format,dump}() functions into unified uuid_{import,export}() functions. This allows us to easily add support for other formats (e.g. XML) in the future without having the change the API in principle. - Document what DCE 1.1 UUID versions exist and what they are intended for. @ text @a82 1 char *cp; d153 2 a154 2 cp = NULL; if ((rc = uuid_export(uuid, UUID_FMT_TXT, (void **)&cp, NULL)) != UUID_RC_OK) d156 2 a157 2 fprintf(stdout, "%s", cp); free(cp); d195 2 a196 2 cp = NULL; if ((rc = uuid_export(uuid, UUID_FMT_STR, (void **)&cp, &n)) != UUID_RC_OK) d198 2 a199 2 fprintf(fp, "%s\n", cp); free(cp); @ 1.10 log @Use BM_XXX() and str_xxx() APIs throughout internal implementation. @ text @d85 1 d152 1 a152 1 if ((rc = uuid_parse(uuid, argv[0])) != UUID_RC_OK) d154 2 a155 1 if ((rc = uuid_dump(uuid, &cp)) != UUID_RC_OK) d174 1 a174 1 if ((rc = uuid_parse(uuid, argv[0])) != UUID_RC_OK) d190 3 a192 3 if ((rc = uuid_pack(uuid, &vp)) != UUID_RC_OK) error(1, "uuid_pack: %s", uuid_error(rc)); fwrite(vp, UUID_LEN_BIN, 1, fp); d197 1 a197 1 if ((rc = uuid_format(uuid, &cp)) != UUID_RC_OK) @ 1.9 log @Implement uuid_dump() and corresponding uuid CLI "-d" option for dumping a given UUID into clear text. For convinience reasons add uuid_bm.h (bit mask API) and uuid_str (string formatting API) sub-modules. @ text @d149 2 d170 2 @ 1.8 log @Print involved option character (instead of '?') on invalid option for uuid(1) CLI. Submitted by: Matthias Andree PR: 29 @ text @d94 1 a94 1 while ((ch = getopt(argc, argv, "1n:rdo:v:")) != -1) { d118 3 d147 10 a156 1 /* FIXME */ @ 1.7 log @add UUID version 3 (name based) generation support (verified to be correct against Data::UUID, the only name supporting UUID implementation available for comparison) @ text @d132 1 a132 1 usage("invalid option '%c'", ch); @ 1.6 log @fix framework and print ASCII output by default @ text @d148 3 a150 1 if (argc < 0 || ((version == UUID_VERSION3 && argc > 2) || argc > 1)) d165 1 a165 1 rc = uuid_generate(uuid, version, argv[0]); @ 1.5 log @use format instead of unparse and fix pack/unpack usage @ text @d81 1 a81 1 int ascii; d91 1 a91 1 ascii = 0; /* default is binary output */ d94 1 a94 1 while ((ch = getopt(argc, argv, "1n:ado:v:")) != -1) { d106 2 a107 2 case 'a': ascii = 1; d168 8 a175 1 if (ascii) { d178 1 a178 1 error(1, "uuid_unparse: %s", uuid_error(rc)); a180 7 } else { vp = NULL; if ((rc = uuid_pack(uuid, &vp)) != UUID_RC_OK) error(1, "uuid_unpack: %s", uuid_error(rc)); fwrite(vp, UUID_LEN_BIN, 1, vp); free(vp); @ 1.4 log @flush work of this forenoon @ text @d170 1 a170 1 if ((rc = uuid_unparse(uuid, &cp)) != UUID_RC_OK) d177 1 a177 1 if ((rc = uuid_unpack(uuid, &vp)) != UUID_RC_OK) d179 1 a179 1 fwrite(vp, UUID_LEN_BIN, 1, fp); @ 1.3 log @introduce UUID versioning into API @ text @d159 2 a160 2 if ((rc = uuid_null(uuid)) != UUID_RC_OK) error(1, "uuid_null: %s", uuid_error(rc)); d170 2 a171 2 if ((rc = uuid_format(uuid, &cp)) != UUID_RC_OK) error(1, "uuid_format: %s", uuid_error(rc)); d177 2 a178 2 if ((rc = uuid_write(uuid, &vp)) != UUID_RC_OK) error(1, "uuid_format: %s", uuid_error(rc)); @ 1.2 log @simplify API @ text @d55 1 a55 1 usage(void) d57 8 d66 1 d85 1 d93 2 a94 1 while ((ch = getopt(argc, argv, "1n:ado:")) != -1) { d101 1 a101 1 usage(); d103 2 a104 2 if (*p != 0 || count < 1) usage(); d118 13 d132 1 a132 1 usage(); d143 1 a143 1 usage(); d148 2 a149 2 if (argc < 0 || argc > 1) usage(); d162 5 a166 1 if ((rc = uuid_generate(uuid)) != UUID_RC_OK) @ 1.1 log @import the first cut for our forthcoming OSSP uuid library @ text @d151 1 a151 1 fwrite(vp, UUID_LEN_BIN_CHR, 1, fp); @