From b7f896437abbf80a76cc2be5cdfdb1ec7452a345 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 30 Nov 2013 13:05:47 -0500 Subject: [PATCH] change UUID implementation to use integers and serial counters --- jack.h | 2 +- types.h | 2 +- uuid.h | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/jack.h b/jack.h index 3905485..4a1fda9 100644 --- a/jack.h +++ b/jack.h @@ -652,7 +652,7 @@ const char *jack_port_name (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; * * @see jack_uuid_to_string() to convert into a string representation */ -void jack_port_uuid (const jack_port_t *port, jack_uuid_t) JACK_OPTIONAL_WEAK_EXPORT; +jack_uuid_t jack_port_uuid (const jack_port_t *port) JACK_OPTIONAL_WEAK_EXPORT; /** * @return the short name of the jack_port_t (not including the @a diff --git a/types.h b/types.h index ea7a6f2..c6f0905 100644 --- a/types.h +++ b/types.h @@ -25,7 +25,7 @@ #include #include -typedef uuid_t jack_uuid_t; +typedef uint64_t jack_uuid_t; typedef int32_t jack_shmsize_t; diff --git a/uuid.h b/uuid.h index 088e460..faa354b 100644 --- a/uuid.h +++ b/uuid.h @@ -28,14 +28,19 @@ extern "C" { #define JACK_UUID_SIZE 36 #define JACK_UUID_STRING_SIZE (JACK_UUID_SIZE+1) /* includes trailing null */ +#define JACK_UUID_EMPTY_INITIALIZER 0 -extern void jack_uuid_generate (jack_uuid_t); -extern int jack_uuid_compare (const jack_uuid_t, const jack_uuid_t); -extern void jack_uuid_copy (jack_uuid_t dst, const jack_uuid_t src); -extern void jack_uuid_clear (jack_uuid_t); -extern int jack_uuid_parse (const char *buf, jack_uuid_t); -extern void jack_uuid_unparse (const jack_uuid_t, char buf[JACK_UUID_STRING_SIZE]); -extern int jack_uuid_empty (const jack_uuid_t); +extern jack_uuid_t jack_client_uuid_generate (); +extern jack_uuid_t jack_port_uuid_generate (uint32_t port_id); + +extern uint32_t jack_uuid_to_index (jack_uuid_t); + +extern int jack_uuid_compare (jack_uuid_t, jack_uuid_t); +extern void jack_uuid_copy (jack_uuid_t* dst, jack_uuid_t src); +extern void jack_uuid_clear (jack_uuid_t*); +extern int jack_uuid_parse (const char *buf, jack_uuid_t*); +extern void jack_uuid_unparse (jack_uuid_t, char buf[JACK_UUID_STRING_SIZE]); +extern int jack_uuid_empty (jack_uuid_t); #ifdef __cplusplus } /* namespace */