diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-11-01 06:20:14 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-11-01 06:20:14 +0000 |
commit | 9b2f268fb58ab73cda42bed0e06a1c91ce50d74e (patch) | |
tree | 82ca3411862b9c5186f9611eacb2295edd7ef642 /usr.bin/uuidgen | |
parent | 14ffdae94d40ea8d6a663d27b42323d3816236f5 (diff) |
Notes
Diffstat (limited to 'usr.bin/uuidgen')
-rw-r--r-- | usr.bin/uuidgen/uuidgen.1 | 3 | ||||
-rw-r--r-- | usr.bin/uuidgen/uuidgen.c | 23 |
2 files changed, 8 insertions, 18 deletions
diff --git a/usr.bin/uuidgen/uuidgen.1 b/usr.bin/uuidgen/uuidgen.1 index 71206b791f058..58b4a595bcac1 100644 --- a/usr.bin/uuidgen/uuidgen.1 +++ b/usr.bin/uuidgen/uuidgen.1 @@ -65,7 +65,8 @@ reflected in the distance between two successive identifiers. .Sh DIAGNOSTICS .Ex -std .Sh SEE ALSO -.Xr uuidgen 2 +.Xr uuidgen 2 , +.Xr uuid 3 .Sh HISTORY The .Nm diff --git a/usr.bin/uuidgen/uuidgen.c b/usr.bin/uuidgen/uuidgen.c index 59fd44650d5db..0676e27d94425 100644 --- a/usr.bin/uuidgen/uuidgen.c +++ b/usr.bin/uuidgen/uuidgen.c @@ -23,20 +23,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id$ */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <sys/types.h> -#include <sys/endian.h> -#include <sys/uuid.h> - #include <err.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <uuid.h> static void usage(void) @@ -45,16 +41,6 @@ usage(void) exit(1); } -static void -uuid_print(uuid_t *uuid) -{ - printf("%08x-%04x-%04x-%02x%02x-", uuid->time_low, uuid->time_mid, - uuid->time_hi_and_version, uuid->clock_seq_hi_and_reserved, - uuid->clock_seq_low); - printf("%02x%02x%02x%02x%02x%02x\n", uuid->node[0], uuid->node[1], - uuid->node[2], uuid->node[3], uuid->node[4], uuid->node[5]); -} - int main(int argc, char *argv[]) { @@ -105,8 +91,11 @@ main(int argc, char *argv[]) } uuid = store; - while (count--) - uuid_print(uuid++); + while (count--) { + uuid_to_string(uuid++, &p, NULL); + printf("%s\n", p); + free(p); + } free(store); return (0); |