From: Michal Sojka Date: Mon, 20 Oct 2008 15:46:13 +0000 (+0200) Subject: Server ID function prototypes moved to a separate header X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/forb.git/commitdiff_plain/73b3d9641bd17901e0eebf60cc8b82f3a961ce2d Server ID function prototypes moved to a separate header --- diff --git a/src/Makefile.omk b/src/Makefile.omk index 1853c88..d9d49fe 100644 --- a/src/Makefile.omk +++ b/src/Makefile.omk @@ -31,6 +31,7 @@ renamed_include_HEADERS += \ $(call to_forb_subdir, refcnt.h) \ $(call to_forb_subdir, request.h) \ $(call to_forb_subdir, syncobj.h) \ + $(call to_forb_subdir, server_id.h) \ $(call to_forb_subdir, uuid.h) renamed_include_GEN_HEADERS = \ diff --git a/src/forb-internal.h b/src/forb-internal.h index ec9a84d..b4fea90 100644 --- a/src/forb-internal.h +++ b/src/forb-internal.h @@ -65,6 +65,7 @@ #include #include #include +#include /** @@ -119,49 +120,4 @@ typedef void (*forb_skel_func)(CDR_Codec *cin, int forb_init_tmp_dir(void); -void -forb_server_id_init(forb_server_id *serer); - -/** - * Compares to server IDs. - * - * @param id1 - * @param id2 - * - * @return -1, 0 or 1 if the @a id1 is less, equal on greated to @a id2 respectively. - */ -static inline int forb_server_id_cmp(const forb_server_id *id1, const forb_server_id *id2) -{ - return memcmp(id1, id2, sizeof(forb_server_id)); -} - -/** - * Converts a server ID to string. - * - * @param dest Where to store the converted string. - * @param server_id Server ID to convert. - * @param n The size of @a dest memory buffer. - * - * @return Same value as @a dest. - */ -static inline char * -forb_server_id_to_string(char *dest, const forb_server_id *server_id, size_t n) -{ - return forb_uuid_to_string(dest, (forb_uuid_t*)server_id->uuid, n); -} - -/** - * Initializes server ID from string. - * - * @param server_id Initialized server ID. - * @param string String form of server ID. - * - * @return Same value as @a server_id. - */ -static inline forb_server_id * -forb_server_id_from_string(forb_server_id *server_id, const char *string) -{ - return (forb_server_id *)forb_uuid_from_string((forb_uuid_t*)&server_id->uuid, string); -} - #endif diff --git a/src/forb.c b/src/forb.c index 94e7786..b067b3e 100644 --- a/src/forb.c +++ b/src/forb.c @@ -246,6 +246,7 @@ void forb_destroy(forb_orb orb) /* { */ /* gavl_insert(&type_registry, &interface->node); */ /* } */ + /** * Initializes server ID variable. * diff --git a/src/server_id.h b/src/server_id.h new file mode 100644 index 0000000..f179b28 --- /dev/null +++ b/src/server_id.h @@ -0,0 +1,54 @@ +#ifndef FORB_SERVER_ID_H +#define FORB_SERVER_ID_H + +#include +#include + +void +forb_server_id_init(forb_server_id *serer); + +/** + * Compares to server IDs. + * + * @param id1 + * @param id2 + * + * @return -1, 0 or 1 if the @a id1 is less, equal on greated to @a id2 respectively. + */ +static inline int forb_server_id_cmp(const forb_server_id *id1, const forb_server_id *id2) +{ + return memcmp(id1, id2, sizeof(forb_server_id)); +} + +/** + * Converts a server ID to string. + * + * @param dest Where to store the converted string. + * @param server_id Server ID to convert. + * @param n The size of @a dest memory buffer. + * + * @return Same value as @a dest. + */ +static inline char * +forb_server_id_to_string(char *dest, const forb_server_id *server_id, size_t n) +{ + return forb_uuid_to_string(dest, (forb_uuid_t*)server_id->uuid, n); +} + +/** + * Initializes server ID from string. + * + * @param server_id Initialized server ID. + * @param string String form of server ID. + * + * @return Same value as @a server_id. + */ +static inline forb_server_id * +forb_server_id_from_string(forb_server_id *server_id, const char *string) +{ + return (forb_server_id *)forb_uuid_from_string((forb_uuid_t*)&server_id->uuid, string); +} + + + +#endif