Commit 6645a66a authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(clear_text_list): Removed.

(copy_text_list): Removed.
(clear_conference): Adjusted to the fact that the texts member of
	Conference is now a l2g.
(init_conference): Likewise.
(copy_conference): Likewise.  Added const qualifier to the argument.
(clear_person): Adjusted to the fact that the created_texts member
	of Person is now a l2g.
(copy_person): Likewise.
(init_person): Likewise.
(init_text_list): Removed.
(copy_aux_item_list): Added const qualifier to the src argument.
parent 04d7e97a
/*
* $Id: memory.c,v 0.23 1998/07/08 13:41:50 ceder Exp $
* $Id: memory.c,v 0.24 1998/07/26 16:45:28 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -29,7 +29,7 @@
*/
static const char *
rcsid = "$Id: memory.c,v 0.23 1998/07/08 13:41:50 ceder Exp $";
rcsid = "$Id: memory.c,v 0.24 1998/07/26 16:45:28 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -49,6 +49,7 @@ USE(rcsid);
#include "server/smalloc.h"
#include "log.h"
#include "lyskomd.h"
#include "local-to-global.h"
static int person_cnt = 0;
static int conference_cnt = 0;
......@@ -64,9 +65,6 @@ static void clear_membership (Membership *mship);
static Membership copy_membership (Membership m);
static void clear_membership_list (Membership_list *mlist);
static Membership_list copy_membership_list (Membership_list ml);
static void clear_text_list (Text_list *text_list);
static Text_list copy_text_list (Text_list tl);
/* Conf_type */
......@@ -109,13 +107,13 @@ clear_conference(Conference *confp)
{
s_clear(&confp->name);
clear_member_list(&confp->members);
clear_text_list(&confp->texts);
l2g_clear(&confp->texts);
free_aux_item_list(&confp->aux_item_list);
init_conference(confp);
}
Conference *
copy_conference (Conference *o)
copy_conference (const Conference *o)
{
Conference *c;
......@@ -124,7 +122,7 @@ copy_conference (Conference *o)
c->name = EMPTY_STRING;
s_strcpy(&c->name, o->name);
c->members = copy_member_list(o->members);
c->texts = copy_text_list(o->texts);
l2g_copy(&c->texts, &o->texts);
copy_aux_item_list(&c->aux_item_list,
&o->aux_item_list);
return c;
......@@ -145,7 +143,7 @@ init_conference (Conference *c)
c->nice = 0;
c->name = EMPTY_STRING;
init_member_list(&c->members);
init_text_list(&c->texts);
l2g_init(&c->texts);
init_aux_item_list(&c->aux_item_list);
}
......@@ -365,7 +363,7 @@ void
clear_person(Person *person)
{
s_clear(&person->username);
clear_text_list(&person->created_texts);
l2g_clear(&person->created_texts);
clear_mark_list(&person->marks);
clear_membership_list(&person->conferences);
init_person(person);
......@@ -381,7 +379,7 @@ copy_person(Person *p)
c->username = EMPTY_STRING;
s_strcpy(&c->username, p->username);
c->created_texts = copy_text_list(p->created_texts);
l2g_copy(&c->created_texts, &p->created_texts);
c->marks = copy_mark_list(p->marks);
c->conferences = copy_membership_list(p->conferences);
return c;
......@@ -404,7 +402,7 @@ init_person (Person *p)
init_priv_bits(&p->privileges);
init_personal_flags(&p->flags);
init_text_list(&p->created_texts);
l2g_init(&p->created_texts);
init_mark_list(&p->marks);
init_membership_list(&p->conferences);
......@@ -479,41 +477,6 @@ init_session_info_ident (Session_info_ident *s)
s->idle_time = 0;
}
/* Text_list */
static void
clear_text_list(Text_list *text_list)
{
if ( text_list == NULL )
{
log("clear_text_list(): text_list == NULL.\n");
return;
}
sfree(text_list->texts);
init_text_list(text_list);
}
static Text_list
copy_text_list(Text_list tl)
{
Text_list r;
r = tl;
r.texts = smalloc(r.no_of_texts * sizeof(Text_no));
memcpy(r.texts, tl.texts, r.no_of_texts * sizeof(Text_no));
return r;
}
void
init_text_list (Text_list *tl)
{
tl->first_local_no = 1; /* sic */
tl->no_of_texts = 0;
tl->texts = NULL;
}
/* Text_stat */
Text_stat *
......@@ -672,7 +635,8 @@ free_aux_item_list(Aux_item_list *list)
}
void
copy_aux_item_list(Aux_item_list *dest, Aux_item_list *src)
copy_aux_item_list(Aux_item_list *dest,
const Aux_item_list *src)
{
unsigned long i;
......
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