From 46c537c70bc3f4103d670c7b18e01d65c8b48440 Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 1 Nov 2002 06:20:14 +0000 Subject: o Remove $Id$ from copyright; there's $FreeBSD$, o Remove static function uuid_print(); use uuid_to_string(3) in combination with printf(3) to achieve the same, o Remove unneeded includes, o Add a reference to uuid(3) to the manpage. --- bin/uuidgen/uuidgen.1 | 3 ++- bin/uuidgen/uuidgen.c | 23 ++++++----------------- usr.bin/uuidgen/uuidgen.1 | 3 ++- usr.bin/uuidgen/uuidgen.c | 23 ++++++----------------- 4 files changed, 16 insertions(+), 36 deletions(-) diff --git a/bin/uuidgen/uuidgen.1 b/bin/uuidgen/uuidgen.1 index 71206b7..58b4a59 100644 --- a/bin/uuidgen/uuidgen.1 +++ b/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/bin/uuidgen/uuidgen.c b/bin/uuidgen/uuidgen.c index 59fd446..0676e27 100644 --- a/bin/uuidgen/uuidgen.c +++ b/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 __FBSDID("$FreeBSD$"); -#include -#include -#include - #include #include #include #include +#include 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); diff --git a/usr.bin/uuidgen/uuidgen.1 b/usr.bin/uuidgen/uuidgen.1 index 71206b7..58b4a59 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 59fd446..0676e27 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 __FBSDID("$FreeBSD$"); -#include -#include -#include - #include #include #include #include +#include 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); -- cgit v1.1