Merged silc_1_0_branch to trunk.
[silc.git] / lib / silcutil / silcprotocol.c
index 3703c30e0073233bc0953a0136067cc46c23db95..a0a34d238618315dd6337838232c720aedaa338c 100644 (file)
@@ -2,14 +2,13 @@
 
   silcprotocol.c
 
-  Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
+  Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2000 Pekka Riikonen
+  Copyright (C) 1997 - 2005 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.
+  the Free Software Foundation; version 2 of the License.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,7 +22,6 @@
 /* $Id$ */
 
 #include "silcincludes.h"
-#include "silcprotocol.h"
 
 /* Dynamically registered protocols */
 SilcProtocolObject *silc_protocol_list = NULL;
@@ -34,17 +32,17 @@ SilcProtocolObject *silc_protocol_list = NULL;
 void silc_protocol_register(SilcProtocolType type,
                            SilcProtocolCallback callback)
 {
-  SilcProtocolObject *new;
+  SilcProtocolObject *proto_new;
 
-  new = silc_calloc(1, sizeof(*new));
-  new->type = type;
-  new->callback = callback;
+  proto_new = silc_calloc(1, sizeof(*proto_new));
+  proto_new->type = type;
+  proto_new->callback = callback;
 
   if (!silc_protocol_list)
-    silc_protocol_list = new;
+    silc_protocol_list = proto_new;
   else {
-    new->next = silc_protocol_list;
-    silc_protocol_list = new;
+    proto_new->next = silc_protocol_list;
+    silc_protocol_list = proto_new;
   }
 }
 
@@ -124,14 +122,16 @@ void silc_protocol_execute(SilcProtocol protocol, SilcSchedule schedule,
                           SILC_TASK_TIMEOUT,
                           SILC_TASK_PRI_NORMAL);
   else
-    protocol->protocol->callback(schedule, 0, 0, (void *)protocol);
+    protocol->protocol->callback(schedule, silc_schedule_get_context(schedule),
+                                0, 0, (void *)protocol);
 }
 
 /* Executes the final callback of the protocol. */
 
 void silc_protocol_execute_final(SilcProtocol protocol, SilcSchedule schedule)
 {
-  protocol->final_callback(schedule, 0, 0, (void *)protocol);
+  protocol->final_callback(schedule, silc_schedule_get_context(schedule),
+                          0, 0, (void *)protocol);
 }
 
 /* Cancels the execution of the next state of the protocol. */