Commit 2d32079e authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(prot_a_output_membership): New function.

(prot_a_output_membership_list): New function.
parent 620763bf
/*
* $Id: prot-a-output.c,v 0.56 2002/11/12 17:41:33 ceder Exp $
* $Id: prot-a-output.c,v 0.57 2002/11/13 00:40:52 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -110,6 +110,37 @@ void prot_a_output_membership_type(Connection *fp,
isc_putc(type.reserved5 + '0', fp->isc_session);
}
void
prot_a_output_membership(Connection *fp,
const Membership *mship)
{
unsigned int i;
prot_a_output_ul(fp, mship->position);
prot_a_output_time(fp, mship->last_time_read);
prot_a_output_ul(fp, mship->conf_no);
prot_a_output_ul(fp, mship->priority);
prot_a_output_ul(fp, mship->no_of_read_ranges);
if (mship->read_ranges != NULL && mship->no_of_read_ranges > 0)
{
isc_puts(" {", fp->isc_session);
for (i = 0; i < mship->no_of_read_ranges; i++)
{
prot_a_output_ul(fp, mship->read_ranges[i].first_read);
prot_a_output_ul(fp, mship->read_ranges[i].last_read);
}
isc_puts(" }", fp->isc_session);
}
else
isc_puts(" *", fp->isc_session);
prot_a_output_ul(fp, mship->added_by);
prot_a_output_time(fp, mship->added_at);
prot_a_output_membership_type(fp, mship->type);
}
void prot_a_output_membership_10(Connection *fp,
const Membership *mship)
{
......@@ -187,6 +218,25 @@ prot_a_output_membership_old(Connection *fp,
}
void
prot_a_output_membership_list(Connection *fp,
Membership_list mlist)
{
int i;
prot_a_output_ul(fp, mlist.no_of_confs);
if ( mlist.confs != NULL && mlist.no_of_confs > 0 )
{
isc_puts(" {", fp->isc_session);
for ( i = 0; i < mlist.no_of_confs; i++)
prot_a_output_membership(fp, mlist.confs + i);
isc_puts(" }", fp->isc_session);
}
else
isc_puts(" *", fp->isc_session);
}
void
prot_a_output_membership_list_old (Connection * fp,
Membership_list mlist)
......
/*
* $Id: prot-a-output.h,v 0.27 2002/11/12 17:41:14 ceder Exp $
* $Id: prot-a-output.h,v 0.28 2002/11/13 00:40:48 ceder Exp $
* Copyright (C) 1991-1992, 1994-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: prot-a-output.h,v 0.27 2002/11/12 17:41:14 ceder Exp $
* $Id: prot-a-output.h,v 0.28 2002/11/13 00:40:48 ceder Exp $
*
*/
extern void
......@@ -39,6 +39,10 @@ prot_a_output_person_old(Connection *fp,
Person *person);
extern void
prot_a_output_membership(Connection *fp,
const Membership *mship);
extern void
prot_a_output_membership_10(Connection *fp,
const Membership *mship);
......@@ -47,6 +51,10 @@ extern void
prot_a_output_membership_old(Connection *fp,
const Membership *mship);
extern void
prot_a_output_membership_list(Connection *fp,
Membership_list mlist);
extern void
prot_a_output_membership_list_10(Connection *fp,
Membership_list mlist);
......
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