Commit 9aebc160 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(prot_a_output_person): Adjusted to the fact that the created_texts

	member of Person is now a l2g.
(prot_a_output_conference): Adjusted to the fact that the texts
 	member of Conference is now a l2g.
(prot_a_output_conference_old): Likewise.
(prot_a_output_l2g_iterator_as_text_list): New function which
	emulates a Text_list.
parent c58d9235
/*
* $Id: prot-a-output.c,v 0.29 1998/07/08 16:54:11 ceder Exp $
* $Id: prot-a-output.c,v 0.30 1998/07/26 16:44:34 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -29,7 +29,7 @@
*/
static const char *
rcsid = "$Id: prot-a-output.c,v 0.29 1998/07/08 16:54:11 ceder Exp $";
rcsid = "$Id: prot-a-output.c,v 0.30 1998/07/26 16:44:34 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -40,6 +40,7 @@ USE(rcsid);
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <assert.h>
#include "s-string.h"
#include "kom-types.h"
......@@ -51,11 +52,18 @@ USE(rcsid);
#include "prot-a-output.h"
#include "lyskomd.h"
#include "param.h"
#include "local-to-global.h"
void
prot_a_output_person (Connection *fp,
Person *person)
{
Local_text_no first_created = l2g_next_key(&person->created_texts, 0);
Local_text_no num_created;
num_created = (l2g_first_appendable_key(&person->created_texts)
- first_created);
prot_a_output_string (fp, person->username);
prot_a_output_priv_bits (fp, person->privileges);
prot_a_output_personal_flags (fp, person->flags);
......@@ -74,8 +82,8 @@ prot_a_output_person (Connection *fp,
(unsigned long) person -> no_of_text_fetches,
(unsigned long) person -> created_persons,
(unsigned long) person -> created_confs,
(unsigned long) person -> created_texts.first_local_no,
(unsigned long) person -> created_texts.no_of_texts,
(unsigned long) first_created,
(unsigned long) num_created,
(unsigned long) person -> marks.no_of_marks,
(unsigned long) person -> conferences.no_of_confs);
}
......@@ -219,6 +227,12 @@ void
prot_a_output_conference (Connection *fp,
Conference *conf_c)
{
Local_text_no first_local_no = l2g_next_key(&conf_c->texts, 0);
Local_text_no no_of_texts;
no_of_texts = (l2g_first_appendable_key(&conf_c->texts)
- first_local_no);
prot_a_output_string(fp, conf_c->name);
prot_a_output_extended_conf_type(fp, conf_c->type);
prot_a_output_time(fp, conf_c -> creation_time );
......@@ -232,8 +246,8 @@ prot_a_output_conference (Connection *fp,
(unsigned long) conf_c -> msg_of_day,
(unsigned long) conf_c -> nice,
(unsigned long) conf_c -> members.no_of_members,
(unsigned long) conf_c -> texts.first_local_no,
(unsigned long) conf_c -> texts.no_of_texts,
(unsigned long) first_local_no,
(unsigned long) no_of_texts,
(unsigned long) conf_c -> expire);
prot_a_output_aux_item_list (fp, &conf_c->aux_item_list);
}
......@@ -242,6 +256,12 @@ void
prot_a_output_conference_old (Connection *fp,
Conference *conf_c)
{
Local_text_no first_local_no = l2g_next_key(&conf_c->texts, 0);
Local_text_no no_of_texts;
no_of_texts = (l2g_first_appendable_key(&conf_c->texts)
- first_local_no);
prot_a_output_string(fp, conf_c->name);
prot_a_output_conf_type(fp, conf_c->type);
......@@ -258,8 +278,8 @@ prot_a_output_conference_old (Connection *fp,
(unsigned long) conf_c -> msg_of_day,
(unsigned long) conf_c -> nice,
(unsigned long) conf_c -> members.no_of_members,
(unsigned long) conf_c -> texts.first_local_no,
(unsigned long) conf_c -> texts.no_of_texts);
(unsigned long) first_local_no,
(unsigned long) no_of_texts);
}
void prot_a_output_uconference(Connection *fp,
......@@ -895,5 +915,32 @@ prot_a_output_dynamic_session_info_list (Connection *fp,
}
}
void
prot_a_output_l2g_iterator_as_text_list(Connection *fp,
L2g_iterator_as_text_list *iter)
{
Local_text_no lno = l2gi_begin(iter);
Local_text_no limit = l2gi_end(iter);
mux_printf(fp, " %lu %lu",
(unsigned long)lno,
(unsigned long)(limit - lno));
if (limit - lno > 0)
{
mux_printf(fp, " {");
for (; !iter->search_ended; l2gi_next(iter))
{
/* Write the correct number of zeroes. */
for (; lno < iter->lno; ++lno)
mux_printf(fp, " 0");
/* Write this piece of data. */
mux_printf(fp, " %lu", (unsigned long)iter->tno);
++lno;
}
assert(lno == limit);
mux_printf(fp, " }");
}
else
mux_printf(fp, " *");
}
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