From: Pekka Riikonen Date: Wed, 29 Nov 2006 19:53:25 +0000 (+0000) Subject: Added SILC_ID_GET_ID. X-Git-Tag: silc.client.1.1.beta1~161 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=9f58e46226c1d1b8772fd1fb9b7c137c1c8f12e0 Added SILC_ID_GET_ID. --- diff --git a/lib/silccore/silcid.h b/lib/silccore/silcid.h index e6a595c6..216e29a1 100644 --- a/lib/silccore/silcid.h +++ b/lib/silccore/silcid.h @@ -184,6 +184,26 @@ typedef struct { /* Macros */ +/****d* silccore/SilcIDAPI/SILC_ID_GET_ID + * + * NAME + * + * #define SILC_ID_GET_ID ... + * + * DESCRIPTION + * + * Returns the ID type specific pointer from the SilcID structure. As + * the SilcID is able to house all types of IDs this macro can be used + * to get the specific ID from the structure by its type. + * + * SOURCE + */ +#define SILC_ID_GET_ID(id) \ + ((id).type == SILC_ID_CLIENT ? (void *)&(id).u.client_id : \ + (id).type == SILC_ID_SERVER ? (void *)&(id).u.server_id : \ + (void *)&(id).u.channel_id) +/***/ + /****d* silccore/SilcIDAPI/SILC_ID_COMPARE * * NAME