updates.
[silc.git] / lib / silccore / silccommand.h
index 32ef4ba59dfaee6a5262690ef664598811a0a21c..65ed46a2f5b652de0bd14a45009de2e5aa71e1ea 100644 (file)
@@ -1,24 +1,24 @@
-/****h* silccore/silccommand.h
- *
- * NAME
- *
- * silccommand.h
- *
- * COPYRIGHT
- *
- * Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- *
- * Copyright (C) 1997 - 2000 Pekka Riikonen
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+/*
+  silccommand.h
+  Author: Pekka Riikonen <priikone@silcnet.org>
+  Copyright (C) 1997 - 2001 Pekka Riikonen
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+*/
+
+/****h* silccore/SilcCommandAPI
  *
  * DESCRIPTION
  *
  *
  * SYNOPSIS
  *
- *    SilcChannelPayload silc_channel_payload_parse(SilcBuffer buffer);
+ *    typedef void (*SilcCommandCb)(void *context, void *context2);
  *
  * DESCRIPTION
  *
  *    Command function callback. The actual command function pointer.
  *    This is generic command callback that the application may choose to
- *    use with its command routines.
+ *    use with its command routines.  However, none of the generic
+ *    routines depend on this callback so application may freely define
+ *    their own command callback if desired.
  *
  ***/
-typedef void (*SilcCommandCb)(void *context);
+typedef void (*SilcCommandCb)(void *context, void *context2);
 
 /****s* silccore/SilcCommandAPI/SilcCommandPayload
  *
@@ -220,7 +222,9 @@ typedef uint16 SilcCommandStatus;
  *
  * SYNOPSIS
  *
- *    SilcCommandPayload silc_command_payload_parse(SilcBuffer buffer);
+ *    SilcCommandPayload 
+ *    silc_command_payload_parse(const unsigned char *payload,
+ *                               uint32 payload_len);
  *
  * DESCRIPTION
  *
@@ -228,7 +232,8 @@ typedef uint16 SilcCommandStatus;
  *    `buffer' is the raw payload.
  *
  ***/
-SilcCommandPayload silc_command_payload_parse(SilcBuffer buffer);
+SilcCommandPayload silc_command_payload_parse(const unsigned char *payload,
+                                             uint32 payload_len);
 
 /****f* silccore/SilcCommandAPI/silc_command_payload_encode
  *
@@ -333,6 +338,28 @@ silc_command_reply_payload_encode_va(SilcCommand cmd,
                                     uint16 ident,
                                     uint32 argc, ...);
 
+/****f* silccore/SilcCommandAPI/silc_command_reply_payload_encode_vap
+ *
+ * SYNOPSIS
+ *
+ *    SilcBuffer 
+ *    silc_command_reply_payload_encode_vap(SilcCommand cmd, 
+ *                                          SilcCommandStatus status,
+ *                                          uint16 ident, uint32 argc,
+ *                                          va_list ap);
+ *
+ * DESCRIPTION
+ *
+ *    This is equivalent to the silc_command_reply_payload_encode_va except
+ *    takes the va_list as argument.
+ *
+ ***/
+SilcBuffer 
+silc_command_reply_payload_encode_vap(SilcCommand cmd, 
+                                     SilcCommandStatus status,
+                                     uint16 ident, uint32 argc, 
+                                     va_list ap);
+
 /****f* silccore/SilcCommandAPI/silc_command_free
  *
  * SYNOPSIS