X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fserver.h;h=41379eab36342905ccee30bce80c8503f9dbf17a;hb=4d35af3be05cacf69ca4bd634973cdcd25118e98;hp=0e2457cfee655a66f08524206763188a4ecbe115;hpb=e14cef8f772a6f73f05254ae220a3a83981ea753;p=silc.git diff --git a/apps/silcd/server.h b/apps/silcd/server.h index 0e2457cf..41379eab 100644 --- a/apps/silcd/server.h +++ b/apps/silcd/server.h @@ -33,6 +33,18 @@ typedef struct SilcServerObjectStruct *SilcServer; #define SILC_SERVER 0 #define SILC_ROUTER 1 +/* Macros */ + +/* This macro is used to send notify messages with formatted string. The + string is formatted with arguments and the formatted string is sent as + argument. */ +#define SILC_SERVER_SEND_NOTIFY(server, sock, type, fmt) \ +do { \ + char *__fmt__ = silc_format fmt; \ + silc_server_send_notify(server, sock, type, 1, __fmt__, strlen(__fmt__)); \ + silc_free(__fmt__); \ +} while(0); + /* Prototypes */ int silc_server_alloc(SilcServer *new_server); void silc_server_free(SilcServer server); @@ -121,23 +133,21 @@ void silc_server_send_error(SilcServer server, void silc_server_send_notify(SilcServer server, SilcSocketConnection sock, SilcNotifyType type, - unsigned int argc, - unsigned int format, - const char *fmt, ...); + unsigned int argc, ...); void silc_server_send_notify_dest(SilcServer server, SilcSocketConnection sock, void *dest_id, SilcIdType dest_id_type, SilcNotifyType type, - unsigned int argc, - unsigned int format, - const char *fmt, ...); + unsigned int argc, ...); void silc_server_send_notify_to_channel(SilcServer server, SilcChannelEntry channel, SilcNotifyType type, - unsigned int argc, - unsigned int format, - const char *fmt, ...); + unsigned int argc, ...); +void silc_server_send_notify_on_channels(SilcServer server, + SilcClientEntry client, + SilcNotifyType type, + unsigned int argc, ...); void silc_server_send_new_id(SilcServer server, SilcSocketConnection sock, int broadcast,