Commit f480679f authored by Per Cederqvist's avatar Per Cederqvist

(get_map): Fixed the type of the no_of_texts argument.

(local_to_global): New function.
parent 763b862c
/*
* $Id: text.c,v 0.51 1998/07/27 15:22:45 byers Exp $
* $Id: text.c,v 0.52 1998/08/05 16:14:06 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: text.c,v 0.51 1998/07/27 15:22:45 byers Exp $";
rcsid = "$Id: text.c,v 0.52 1998/08/05 16:14:06 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -2985,7 +2985,7 @@ sub_footnote( Text_no footnote, /* 'footnote' is no longer a */
extern Success
get_map (Conf_no conf_no,
Local_text_no first_local_no,
Local_text_no no_of_texts,
unsigned long no_of_texts,
L2g_iterator_as_text_list * result)
{
Conference * conf_c;
......@@ -3037,6 +3037,55 @@ get_map (Conf_no conf_no,
return OK;
}
extern Success
local_to_global (Conf_no conf_no,
Local_text_no first_local_no,
unsigned long no_of_texts,
Text_mapping *result)
{
Conference * conf_c;
Local_text_no highest_wanted_no, highest;
Local_text_no res_first;
int res_nr;
Access acc;
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, ACTPERS, ACT_P);
if ( acc <= none )
{
err_stat = conf_no;
kom_errno = KOM_UNDEF_CONF;
return FAILURE;
}
if ( acc == read_protected )
{
err_stat = conf_no;
kom_errno = KOM_ACCESS;
return FAILURE;
}
highest = l2g_first_appendable_key(&conf_c->texts) - 1;
if ( first_local_no >= highest )
{
err_stat = first_local_no;
kom_errno = KOM_NO_SUCH_LOCAL_TEXT;
return FAILURE;
}
res_first = l2g_next_key(&conf_c->texts, 0);
result->first = max(res_first, first_local_no);
result->no_of_texts = no_of_texts;
result->l2g = &conf_c->texts;
return OK;
}
extern Success
modify_text_info(Text_no text,
......
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