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
/* $Id$ */
#include "silcincludes.h"
-#include "silcprotocol.h"
/* Dynamically registered protocols */
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;
}
}
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. */