Commit 51fb2132 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(clear_membership): Handle new range-based representation of memberships.

(copy_membership): Ditto.
(init_membership): Ditto.
parent 03937004
/*
* $Id: memory.c,v 0.42 2002/10/27 13:56:07 ceder Exp $
* $Id: memory.c,v 0.43 2002/11/06 18:40:34 ceder Exp $
* Copyright (C) 1991-1994, 1996-1999, 2001-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -275,7 +275,7 @@ clear_membership(Membership *mship)
return;
}
sfree(mship->read_texts);
sfree(mship->read_ranges);
init_membership(mship);
}
......@@ -285,8 +285,9 @@ copy_membership(Membership m)
Membership res;
res = m;
res.read_texts = smalloc(m.no_of_read * sizeof(Local_text_no));
memcpy(res.read_texts, m.read_texts, m.no_of_read * sizeof(Local_text_no));
res.read_ranges = smalloc(m.no_of_read_ranges*sizeof(res.read_ranges[0]));
memcpy(res.read_ranges, m.read_ranges,
m.no_of_read_ranges * sizeof(res.read_ranges[0]));
return res;
}
......@@ -308,14 +309,14 @@ init_membership(Membership *m)
{
m->conf_no = 0;
m->priority = 0;
m->last_text_read = 0;
m->no_of_read = 0;
m->read_texts = NULL;
m->no_of_read_ranges = 0;
m->read_ranges = NULL;
m->last_time_read = NO_TIME;
m->added_by = 0;
m->position = 0;
m->added_at = NO_TIME;
init_membership_type(&m->type);
m->skip_read_texts = FALSE;
}
/* Membership_list */
......
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