From 9f58e46226c1d1b8772fd1fb9b7c137c1c8f12e0 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 29 Nov 2006 19:53:25 +0000 Subject: [PATCH] Added SILC_ID_GET_ID. --- lib/silccore/silcid.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 -- 2.24.0