Commit 04d7e97a authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(do_delete_pers): Adjusted to the fact that the created_texts member

	of Person is now a l2g.
(get_created_texts): The return value is now an
	l2g_iterator_as_text_list, not a Text_list.  Adjusted to the
	fact that the created_texts member of Person is now a l2g.
parent 9aebc160
/*
* $Id: person.c,v 0.38 1998/07/08 13:41:53 ceder Exp $
* $Id: person.c,v 0.39 1998/07/26 16:45:00 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: person.c,v 0.38 1998/07/08 13:41:53 ceder Exp $";
rcsid = "$Id: person.c,v 0.39 1998/07/26 16:45:00 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -73,6 +73,7 @@ USE(rcsid);
#include "lyskomd.h"
#include "param.h"
#include "aux-items.h"
#include "local-to-global.h"
/*
* Static functions.
......@@ -389,12 +390,9 @@ do_delete_pers (Pers_no pers_no)
}
s_clear( &pers_p->username );
sfree( pers_p->created_texts.texts );
pers_p->created_texts.texts = NULL;
pers_p->created_texts.no_of_texts = 0;
l2g_clear(&pers_p->created_texts);
cached_delete_person(pers_no);
/* ??? Eller r{cker det med cached_delete_conf() ??? */
/* ASYNC */
return OK;
......@@ -789,11 +787,12 @@ extern Success
get_created_texts(Pers_no pers_no,
Local_text_no first,
u_long len,
Text_list * result)
L2g_iterator_as_text_list * result)
{
Person *pers_p;
Access acc;
Local_text_no new_first;
Local_text_no new_len;
CHK_LOGIN(FAILURE);
......@@ -811,20 +810,19 @@ get_created_texts(Pers_no pers_no,
return FAILURE;
}
*result = pers_p->created_texts;
new_first = max(result->first_local_no, first);
new_first = l2g_next_key(&pers_p->created_texts, 0);
new_first = max(new_first, first);
if ( new_first >= result->first_local_no + result->no_of_texts)
if (new_first >= l2g_first_appendable_key(&pers_p->created_texts))
{
err_stat = new_first;
kom_errno = KOM_NO_SUCH_LOCAL_TEXT;
return FAILURE;
}
result->texts += new_first - result->first_local_no;
result->no_of_texts = min(len, (result->no_of_texts
- (new_first - result->first_local_no)));
result->first_local_no = new_first;
new_len = l2g_first_appendable_key(&pers_p->created_texts) - new_first;
new_len = min(new_len, len);
l2gi_searchsome(result, &pers_p->created_texts, new_first, new_len);
return OK;
}
......
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