Commit 83517982 authored by David Byers's avatar David Byers

Extended Conf_type to eight bits.

Added get_uconf_stat server call.
Database can now store eight-bit Conf_type
Call to get Small_conf data in the cache added
UConference protocol data type added
parent 95743eb9
Tue Oct 31 12:14:15 1995 David Byers <byers@lysator.liu.se>
* prot-a-output.c: Added UConference and extended conf-type
* prot-a-parse.c: Conf-type parser accepts both extended and
original conf-type
* ram-parse.c: Parse extended conf-type
* ram-output.c: Output extended conf-type
* simple-cache.c: Access to small_conf_arr entries
* Added get-uconf-stat call
Let set-conf-type accept an extended conf-type.
Mon Oct 23 07:52:44 1995 Per Cederqvist (ceder@lysator.liu.se)
* tmp-limits.h (MAX_TEXT): Increased to 1500000.
......
/*
* $Id: cache.h,v 0.14 1994/04/05 08:00:21 ceder Exp $
* $Id: cache.h,v 0.15 1995/10/31 11:22:52 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -84,6 +84,7 @@ Text_no cached_create_text(const String message);
Person *cached_get_person_stat(Pers_no person);
Conference *cached_get_conf_stat(Conf_no conf);
Text_stat *cached_get_text_stat(Text_no text);
Small_conf *cached_get_small_conf_stat(Conf_no conf_no);
/* return text. String is to be freed by caller */
String cached_get_text(Text_no text);
......
/*
* $Id: conference.c,v 0.30 1995/01/01 19:31:43 ceder Exp $
* $Id: conference.c,v 0.31 1995/10/31 11:22:55 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* All atomic calls that deals with conferences.
*/
static char *rcsid = "$Id: conference.c,v 0.30 1995/01/01 19:31:43 ceder Exp $";
static char *rcsid = "$Id: conference.c,v 0.31 1995/10/31 11:22:55 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -686,6 +686,39 @@ get_conf_stat (Conf_no conf_no,
return OK;
}
/*
* Get small status for a conference
*
* This call should not result in reading the conference from disk, hence
* the use of fast_access_perm. Please keep it that way.
*/
extern Success
get_uconf_stat (Conf_no conf_no,
Small_conf * result)
{
Access acc;
Small_conf * conf_c;
conf_c = cached_get_small_conf_stat(conf_no);
if (conf_c != NULL)
acc = fast_access_perm (conf_no, ACTPERS, ACT_P);
else
acc = error;
switch (acc)
{
case error:
return FAILURE;
case none:
kom_errno = KOM_UNDEF_CONF;
return FAILURE;
default:
*result = *conf_c;
return OK;
}
}
extern Success
get_conf_stat_old (Conf_no conf_no,
int mask,
......
/*
* $Id: connections.h,v 0.18 1995/01/01 20:17:20 ceder Exp $
* $Id: connections.h,v 0.19 1995/10/31 11:22:59 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: connections.h,v 0.18 1995/01/01 20:17:20 ceder Exp $
* $Id: connections.h,v 0.19 1995/10/31 11:22:59 byers Exp $
*
* connections.h -- The top level of the communication packet.
*
......@@ -158,7 +158,8 @@ typedef enum {
rt_session_info_ident,
rt_who_info_ident_list,
rt_conf_z_info_list,
rt_version_info
rt_version_info,
rt_uconference,
} Res_type;
/*
......@@ -194,6 +195,7 @@ typedef union {
Session_info_ident session_info_ident;
Conf_z_info_list conf_z_info_list;
Version_info version_info;
Small_conf uconference;
} Result_holder;
......
#
# $Id: fncdef.txt,v 0.18 1995/10/31 09:12:31 kent Exp $
# $Id: fncdef.txt,v 0.19 1995/10/31 11:23:02 byers Exp $
# Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -22,7 +22,7 @@
#
# Please mail bug reports to bug-lyskom@lysator.liu.se.
#
# $Id: fncdef.txt,v 0.18 1995/10/31 09:12:31 kent Exp $
# $Id: fncdef.txt,v 0.19 1995/10/31 11:23:02 byers Exp $
#
# This file is used to describe the functions in services.c. All
# functions that are reachable from the clients are listed here, together
......@@ -113,3 +113,4 @@ success re_z_lookup c_string (param.regexp_len) num num : conf_z_info_list
success get_version_info : version_info
success lookup_z_name c_string (param.conf_name_len) num num : conf_z_info_list
success set_last_read num num
success get_uconf_stat num : uconference
/*
* $Id: prot-a-output.c,v 0.18 1995/01/01 20:17:24 ceder Exp $
* $Id: prot-a-output.c,v 0.19 1995/10/31 11:23:06 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Written by ceder 1990-07-13
*/
static char *rcsid = "$Id: prot-a-output.c,v 0.18 1995/01/01 20:17:24 ceder Exp $";
static char *rcsid = "$Id: prot-a-output.c,v 0.19 1995/10/31 11:23:06 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -195,6 +195,16 @@ prot_a_output_conference (Connection *fp,
(unsigned long) conf_c -> texts.no_of_texts);
}
void prot_a_output_uconference(Connection *fp,
Small_conf *conf_c)
{
prot_a_output_string(fp, conf_c -> name);
prot_a_output_extended_conf_type(fp, conf_c -> type);
mux_printf(fp, " %lu %lu",
(unsigned long) conf_c -> highest_local_no,
(unsigned long) conf_c -> nice);
}
void
prot_a_output_mark_list(Connection *fp,
......@@ -472,6 +482,20 @@ prot_a_output_conf_type(Connection *fp,
mux_putc(type.letter_box + '0', fp);
}
extern void
prot_a_output_extended_conf_type(Connection *fp,
Conf_type type)
{
mux_putc(' ', fp);
mux_putc(type.rd_prot + '0', fp);
mux_putc(type.original + '0', fp);
mux_putc(type.secret + '0', fp);
mux_putc(type.letter_box + '0', fp);
mux_putc(type.anarchy + '0', fp);
mux_putc(type.reserved1 + '0', fp);
mux_putc(type.reserved2 + '0', fp);
mux_putc(type.reserved3 + '0', fp);
}
extern void
prot_a_output_member_list(Connection *fp,
......
/*
* $Id: prot-a-output.h,v 0.10 1995/01/01 20:17:24 ceder Exp $
* $Id: prot-a-output.h,v 0.11 1995/10/31 11:23:10 byers Exp $
* Copyright (C) 1991, 1992, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: prot-a-output.h,v 0.10 1995/01/01 20:17:24 ceder Exp $
* $Id: prot-a-output.h,v 0.11 1995/10/31 11:23:10 byers Exp $
*
*/
extern void
......@@ -51,6 +51,10 @@ extern void
prot_a_output_conference(Connection *fp,
Conference *conf_c);
extern void
prot_a_output_uconference(Connection *fp,
Small_conf *conf_c);
extern void
prot_a_output_mark_list(Connection *fp,
Mark_list mark_list);
......@@ -108,6 +112,10 @@ extern void
prot_a_output_conf_type(Connection *fp,
Conf_type type);
extern void
prot_a_output_extended_conf_type(Connection *fp,
Conf_type type);
extern void
prot_a_output_member_list(Connection *fp,
Member_list m_list);
......
/*
* $Id: prot-a-parse.c,v 0.20 1995/10/23 06:55:44 ceder Exp $
* $Id: prot-a-parse.c,v 0.21 1995/10/31 11:23:12 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* BUG: Not all functions are used, I think. /ceder
*/
static char *rcsid = "$Id: prot-a-parse.c,v 0.20 1995/10/23 06:55:44 ceder Exp $";
static char *rcsid = "$Id: prot-a-parse.c,v 0.21 1995/10/31 11:23:12 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -137,13 +137,28 @@ prot_a_parse_conf_type(Connection *client,
token = prot_a_get_token(client);
if ( s_strlen(token) != 4 )
if ( s_strlen(token) != 4 &&
s_strlen(token) != 8)
longjmp(parse_env, ISC_PROTOCOL_ERR);
res->rd_prot = token.string[ 0 ] != '0';
res->original = token.string[ 1 ] != '0';
res->secret = token.string[ 2 ] != '0';
res->letter_box = token.string[ 3 ] != '0';
if (s_strlen(token) != 8)
{
res->anarchy = 0;
res->reserved1 = 0;
res->reserved2 = 0;
res->reserved3 = 0;
}
else
{
res->anarchy = token.string[ 4 ] != '0';
res->reserved1 = token.string[ 5 ] != '0';
res->reserved2 = token.string[ 6 ] != '0';
res->reserved3 = token.string[ 7 ] != '0';
}
}
/*
......
/*
* $Id: prot-a.c,v 0.31 1995/10/31 09:12:38 kent Exp $
* $Id: prot-a.c,v 0.32 1995/10/31 11:23:16 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -26,7 +26,7 @@
* Protocol A.
*/
static char *rcsid = "$Id: prot-a.c,v 0.31 1995/10/31 09:12:38 kent Exp $";
static char *rcsid = "$Id: prot-a.c,v 0.32 1995/10/31 11:23:16 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -203,6 +203,11 @@ prot_a_reply(Connection *client,
prot_a_output_version_info(client, &res->version_info);
BUG(("={Version_info not listed}\n"));
break;
case rt_uconference:
prot_a_output_uconference(client, &res->uconference);
BUG(("={UConference not listed}\n"));
break;
}
mux_putc('\n', client);
}
......@@ -353,6 +358,7 @@ prot_a_is_legal_fnc(Call_header fnc)
case call_fnc_get_version_info:
case call_fnc_lookup_z_name:
case call_fnc_set_last_read:
case call_fnc_get_uconf_stat:
return TRUE;
default:
......
/*
* $Id: ram-output.c,v 0.14 1995/01/01 20:17:26 ceder Exp $
* $Id: ram-output.c,v 0.15 1995/10/31 11:23:19 byers Exp $
* Copyright (C) 1991, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
* (It worked - now saving is twice as fast.)
*/
static char *rcsid = "$Id: ram-output.c,v 0.14 1995/01/01 20:17:26 ceder Exp $";
static char *rcsid = "$Id: ram-output.c,v 0.15 1995/10/31 11:23:19 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -326,6 +326,10 @@ foutput_conf_type(FILE *fp,
putc(type.original + '0', fp);
putc(type.secret + '0', fp);
putc(type.letter_box + '0', fp);
putc(type.anarchy + '0', fp);
putc(type.reserved1 + '0', fp);
putc(type.reserved2 + '0', fp);
putc(type.reserved3 + '0', fp);
}
......
/*
* $Id: ram-parse.c,v 0.20 1994/12/31 11:56:13 ceder Exp $
* $Id: ram-parse.c,v 0.21 1995/10/31 11:23:22 byers Exp $
* Copyright (C) 1991, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -29,7 +29,7 @@
* ram-parse.c -- parse objects from disk file.
*/
static char *rcsid = "$Id: ram-parse.c,v 0.20 1994/12/31 11:56:13 ceder Exp $";
static char *rcsid = "$Id: ram-parse.c,v 0.21 1995/10/31 11:23:22 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -1032,12 +1032,29 @@ extern Success
fparse_conf_type(FILE *fp,
Conf_type *result)
{
char c;
fskipwhite(fp);
result->rd_prot = getc(fp) != '0';
result->original = getc(fp) != '0';
result->secret = getc(fp) != '0';
result->letter_box = getc(fp) != '0';
c = getc(fp);
if (c != '0' && c != '1')
{
result->anarchy = 1;
result->reserved1 = 0;
result->reserved2 = 0;
result->reserved3 = 0;
ungetc(c, fp);
return(OK);
}
result->anarchy = ( c != '0' );
result->reserved1 = ( getc(fp) != '0' );
result->reserved2 = ( getc(fp) != '0' );
result->reserved3 = ( getc(fp) != '0' );
return OK;
}
......
/*
* $Id: simple-cache.c,v 0.50 1995/10/07 14:39:06 ceder Exp $
* $Id: simple-cache.c,v 0.51 1995/10/31 11:23:26 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
* New save algorithm by ceder.
*/
static char *rcsid = "$Id: simple-cache.c,v 0.50 1995/10/07 14:39:06 ceder Exp $";
static char *rcsid = "$Id: simple-cache.c,v 0.51 1995/10/31 11:23:26 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -1074,6 +1074,26 @@ cached_get_highest_local_no (Conf_no conf_no)
return small_conf_arr[ conf_no ]->highest_local_no;
}
extern Small_conf *
cached_get_small_conf_stat (Conf_no conf_no)
{
TRACE2("cached_get_small_conf_stat %d\n", conf_no);
if (conf_no == 0)
{
kom_errno = KOM_CONF_ZERO;
return NULL;
}
if (conf_no >= next_free_num ||
small_conf_arr[conf_no] == NULL)
{
kom_errno = KOM_UNDEF_CONF;
return NULL;
}
return small_conf_arr[conf_no];
}
/* Lock a person struct in memory. Increase a referenc count. */
void
cached_lock_person(Pers_no pers_no)
......
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