Commit 460b7547 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(prot_a_async_text_aux_changed): New function.

parent 42afeb4e
/* /*
* $Id: prot-a-send-async.c,v 0.36 2003/08/16 11:28:58 ceder Exp $ * $Id: prot-a-send-async.c,v 0.37 2003/08/16 15:32:19 ceder Exp $
* Copyright (C) 1991, 1993-1999, 2001-2002 Lysator Academic Computer Association. * Copyright (C) 1991, 1993-1999, 2001-2002 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -284,6 +284,59 @@ prot_a_async_new_motd(Connection *cptr, ...@@ -284,6 +284,59 @@ prot_a_async_new_motd(Connection *cptr,
async_trailer(cptr); async_trailer(cptr);
} }
void
prot_a_async_text_aux_changed(Connection *cptr,
Text_no text_no,
Aux_item_list *aux_list,
unsigned long highest_old_aux)
{
unsigned short added = 0;
unsigned short deleted = 0;
unsigned short ix;
ASYNC_CHECK_ACCEPT(cptr, ay_text_aux_changed);
for (ix = 0; ix < aux_list->length; ix++)
{
if (aux_list->items[ix].flags.deleted)
deleted++;
if (aux_list->items[ix].aux_no > highest_old_aux)
added++;
}
if (deleted + added == 0)
return;
async_header(cptr, 5, ay_text_aux_changed);
prot_a_output_ul(cptr, text_no);
prot_a_output_ul(cptr, deleted);
if (deleted == 0)
isc_puts(" *", cptr->isc_session);
else
{
isc_puts(" {", cptr->isc_session);
for (ix = 0; ix < aux_list->length; ix++)
if (aux_list->items[ix].flags.deleted)
prot_a_output_aux_item(cptr, &aux_list->items[ix]);
isc_puts(" }", cptr->isc_session);
}
prot_a_output_ul(cptr, added);
if (added == 0)
isc_puts(" *", cptr->isc_session);
else
{
isc_puts(" {", cptr->isc_session);
for (ix = 0; ix < aux_list->length; ix++)
if (aux_list->items[ix].aux_no > highest_old_aux)
prot_a_output_aux_item(cptr, &aux_list->items[ix]);
isc_puts(" }", cptr->isc_session);
}
async_trailer(cptr);
}
#ifdef DEBUG_CALLS #ifdef DEBUG_CALLS
......
/* /*
* $Id: prot-a-send-async.h,v 0.21 2003/08/16 11:28:58 ceder Exp $ * $Id: prot-a-send-async.h,v 0.22 2003/08/16 15:32:19 ceder Exp $
* Copyright (C) 1991, 1994-1999, 2001-2002 Lysator Academic Computer Association. * Copyright (C) 1991, 1994-1999, 2001-2002 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* Please report bugs at http://bugzilla.lysator.liu.se/. * Please report bugs at http://bugzilla.lysator.liu.se/.
*/ */
/* /*
* $Id: prot-a-send-async.h,v 0.21 2003/08/16 11:28:58 ceder Exp $ * $Id: prot-a-send-async.h,v 0.22 2003/08/16 15:32:19 ceder Exp $
* *
* Asynchronous messages in protocol A. * Asynchronous messages in protocol A.
*/ */
...@@ -126,6 +126,13 @@ prot_a_async_new_motd(Connection *cptr, ...@@ -126,6 +126,13 @@ prot_a_async_new_motd(Connection *cptr,
Text_no old_motd, Text_no old_motd,
Text_no new_motd); Text_no new_motd);
void
prot_a_async_text_aux_changed(Connection *cptr,
Text_no text_no,
Aux_item_list *aux_list,
unsigned long highest_old_aux);
#ifdef DEBUG_CALLS #ifdef DEBUG_CALLS
void void
prot_a_async_garb_ended(Connection *cptr, prot_a_async_garb_ended(Connection *cptr,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment