Commit e5697ad3 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

kom-types.h no longer supports -DCLIENT. Only -DSERVER works.

lyskomd and the tty-client now have separate copies of this file.
(DEFAULT_PRIV_BITS, DEFAULT_PERSONAL_FLAGS, EMPTY_TEXT_STAT,
 NULL_CONF_TYPE, EMPTY_MEMBERSHIP, EMPTY_MARK_LIST,
 EMPTY_CONF_NO_LIST, EMPTY_MEMBER_LIST, EMPTY_TEXT_LIST,
 EMPTY_CONF_LIST_OLD, EMPTY_CONF_LIST, EMPTY_PERS_LIST,
 EMPTY_MEMBERSHIP_LIST, EMPTY_CONFERENCE, EMPTY_SMALL_CONF,
 EMPTY_PERSON, EMPTY_WHO_INFO_IDENT, EMPTY_SESSION_INFO,
 EMPTY_SESSION_INFO_IDENT, EMPTY_WHO_INFO_OLD, EMPTY_WHO_INFO,
 EMPTY_WHO_INFO_LIST_OLD, EMPTY_WHO_INFO_LIST,
 EMPTY_WHO_INFO_IDENT_LIST): Removed.
parent e2503e8e
/*
* $Id: kom-types.h,v 0.11 1994/01/12 01:25:57 ceder Exp $
* $Id: kom-types.h,v 0.12 1994/02/19 04:56:28 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -48,15 +48,12 @@
#define KOM_TYPES_H_ALREADY_INCLUDED__
#ifndef SERVER
# ifndef CLIENT
# error must define SERVER or CLIENT
# endif
#else
# ifdef CLIENT
# error must not define both SERVER and CLIENT
# endif
#endif /* !SERVER */
# error must define SERVER
#endif
#ifdef CLIENT
# error This file no longer supports CLIENT
#endif
typedef unsigned short Pers_no;
typedef unsigned short Conf_no;
......@@ -107,17 +104,10 @@ typedef unsigned long Global_text;
#define MAX_LOCAL_TEXT_NO ((Local_text_no) ULONG_MAX)
#ifdef SERVER
# define PASSWD_LEN 64
typedef char Password[PASSWD_LEN];
typedef off_t Text_index;
typedef time_t Time;
# define NULL_TIME_i 0
#else /* CLIENT */
typedef struct tm Time;
# define NULL_TIME_i {0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0}
#endif /* CLIENT */
#define PASSWD_LEN 64
typedef char Password[PASSWD_LEN];
typedef off_t Text_index;
typedef time_t Time;
/*
......@@ -144,23 +134,6 @@ typedef struct {
unsigned int flg16 : 1;
} Priv_bits;
#ifdef SERVER
# define DEFAULT_PRIV_BITS_i \
{ 0, 0, 0, ANYONE_CAN_CREATE_NEW_PERSONS, \
ANYONE_CAN_CREATE_NEW_CONFS, \
DEFAULT_CHANGE_NAME, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0 \
}
#else
# define DEFAULT_PRIV_BITS_i \
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0 \
}
#endif
extern const Priv_bits DEFAULT_PRIV_BITS;
/*
* Flags in the Person struct.
*/
......@@ -176,10 +149,6 @@ typedef struct {
unsigned int flg8 : 1;
} Personal_flags;
#define DEFAULT_PERSONAL_FLAGS_i { 0, 0, 0, 0, 0, 0, 0, 0 }
extern const Personal_flags DEFAULT_PERSONAL_FLAGS;
/* See file doc/misc_items */
typedef enum {
......@@ -263,14 +232,6 @@ typedef struct {
Misc_info * misc_items; /* List of miscellaneous info. */
} Text_stat;
#ifdef SERVER
# define EMPTY_TEXT_STAT_i { NULL_TIME_i, 0, 0, 0, 0, 0, 0, NULL }
#else
# define EMPTY_TEXT_STAT_i { NULL_TIME_i, 0, 0, 0, 0, 0, NULL }
#endif
extern const Text_stat EMPTY_TEXT_STAT;
typedef struct {
unsigned int rd_prot : 1; /* !(Can anyone become a member?) */
......@@ -286,10 +247,6 @@ typedef struct {
unsigned int letter_box : 1; /* Is this a letter box? */
} Conf_type;
#define NULL_CONF_TYPE_i { 0, 0, 0, 0 }
extern const Conf_type NULL_CONF_TYPE;
typedef struct {
Pers_no member;
......@@ -318,10 +275,6 @@ typedef struct {
in ascending order */
} Membership;
#define EMPTY_MEMBERSHIP_i { 0, 0, NULL_TIME_i, 0, 0, NULL }
extern const Membership EMPTY_MEMBERSHIP;
/* Some structs to handle variable-sized arrays. */
......@@ -330,28 +283,18 @@ typedef struct {
Mark * marks; /* Pointer to an array of marks. */
} Mark_list;
#define EMPTY_MARK_LIST_i { 0, NULL }
extern const Mark_list EMPTY_MARK_LIST;
typedef struct {
unsigned short no_of_confs;
Conf_no *conf_nos;
} Conf_no_list;
#define EMPTY_CONF_NO_LIST_i { 0, NULL }
extern const Conf_no_list EMPTY_CONF_NO_LIST;
typedef struct {
unsigned short no_of_members;
Member * members;
} Member_list;
#define EMPTY_MEMBER_LIST_i { 0, NULL }
extern const Member_list EMPTY_MEMBER_LIST;
typedef struct {
Local_text_no first_local_no;
......@@ -359,10 +302,6 @@ typedef struct {
Text_no * texts;
} Text_list;
#define EMPTY_TEXT_LIST_i { 1, 0, NULL }
extern const Text_list EMPTY_TEXT_LIST;
/* A list of conference numbers, also telling if it is a
* mailbox (i e a person) or an ordinary conference. */
......@@ -384,32 +323,18 @@ typedef struct {
} Conf_list;
#define EMPTY_CONF_LIST_OLD_i { 0, NULL, NULL }
extern const Conf_list_old EMPTY_CONF_LIST_OLD;
#define EMPTY_CONF_LIST_i { 0, NULL }
extern const Conf_list EMPTY_CONF_LIST;
/* A list of person numbers */
typedef struct {
unsigned long no_of_persons;
Pers_no * persons;
} Pers_list;
#define EMPTY_PERS_LIST_i { 0, NULL }
extern const Pers_list EMPTY_PERS_LIST;
typedef struct {
unsigned short no_of_confs;
Membership * confs;
} Membership_list;
#define EMPTY_MEMBERSHIP_LIST_i { 0, NULL }
extern const Membership_list EMPTY_MEMBERSHIP_LIST;
/* The Info struct */
typedef struct {
......@@ -459,22 +384,7 @@ typedef struct {
} Conference;
#ifdef CLIENT
# define EMPTY_CONFERENCE_i \
{ NULL_CONF_TYPE_i, 0, 0, 0, 0, NULL_TIME_i, 0, \
NULL_TIME_i, 0, 0, EMPTY_STRING_i, 0, 0, 0 \
}
#else /* SERVER */
# define EMPTY_CONFERENCE_i \
{ NULL_CONF_TYPE_i, 0, 0, 0, 0, NULL_TIME_i, 0, \
NULL_TIME_i, 0, 0, EMPTY_STRING_i, \
EMPTY_MEMBER_LIST_i, EMPTY_TEXT_LIST_i \
}
#endif /* SERVER */
extern const Conference EMPTY_CONFERENCE;
#ifdef SERVER
typedef struct {
String name; /* Name of conference */
Conf_type type; /* secret, rd_prot etc */
......@@ -482,10 +392,6 @@ typedef struct {
Garb_nice nice; /* Number of days to live */
} Small_conf;
#define EMPTY_SMALL_CONF_i {EMPTY_STRING_i, NULL_CONF_TYPE_i, 0, 0};
extern const Small_conf EMPTY_SMALL_CONF;
#endif /* SERVER */
/* Struct for persons */
typedef struct {
......@@ -518,23 +424,6 @@ typedef struct {
#endif
} Person;
#ifdef SERVER
# define EMPTY_PERSON_i \
{ 0, DEFAULT_PRIV_BITS_i, \
DEFAULT_PERSONAL_FLAGS_i, NULL_TIME_i, 0, 0, \
0, 0, 0, 0, 0, 0, EMPTY_STRING_i, \
EMPTY_TEXT_LIST_i, EMPTY_MARK_LIST_i, \
EMPTY_MEMBERSHIP_LIST_i, "\001password" \
}
#else
# define EMPTY_PERSON_i \
{ 0, DEFAULT_PRIV_BITS_i, \
DEFAULT_PERSONAL_FLAGS_i, NULL_TIME_i, 0, 0, \
0, 0, 0, 0, 0, 0, EMPTY_STRING_i, 0, 0, 0, 0 \
}
#endif
extern const Person EMPTY_PERSON;
/*
* This struct is returned from the 'who_is_on' call.
......@@ -563,10 +452,6 @@ typedef struct {
Session_no session_no; /* Serial number of connection. */
} Who_info_ident;
#define EMPTY_WHO_INFO_IDENT_i \
{ 0, EMPTY_STRING_i, EMPTY_STRING_i, EMPTY_STRING_i, EMPTY_STRING_i, 0, 0 }
extern const Who_info_ident EMPTY_WHO_INFO_IDENT;
typedef struct {
Pers_no person;
String what_am_i_doing;
......@@ -577,11 +462,6 @@ typedef struct {
unsigned long idle_time; /* Seconds. */
} Session_info;
#define EMPTY_SESSION_INFO_i { 0, EMPTY_STRING_i, \
EMPTY_STRING_i, 0, 0, \
NULL_TIME_i, 0 }
extern const Session_info EMPTY_SESSION_INFO;
typedef struct {
Pers_no person;
......@@ -596,46 +476,22 @@ typedef struct {
unsigned long idle_time; /* Seconds. */
} Session_info_ident;
#define EMPTY_SESSION_INFO_IDENT_i \
{ 0, EMPTY_STRING_i, EMPTY_STRING_i, EMPTY_STRING_i, \
EMPTY_STRING_i, 0, 0, \
NULL_TIME_i, 0 }
extern const Session_info_ident EMPTY_SESSION_INFO_IDENT;
#define EMPTY_WHO_INFO_OLD_i { 0, EMPTY_STRING_i, 0 }
#define EMPTY_WHO_INFO_i { 0, EMPTY_STRING_i, EMPTY_STRING_i, 0, 0 }
extern const Who_info_old EMPTY_WHO_INFO_OLD;
extern const Who_info EMPTY_WHO_INFO;
typedef struct {
int no_of_persons;
Who_info_old * info;
} Who_info_list_old;
#define EMPTY_WHO_INFO_LIST_OLD_i { 0, NULL }
extern const Who_info_list_old EMPTY_WHO_INFO_LIST_OLD;
typedef struct {
int no_of_persons;
Who_info * info;
} Who_info_list;
#define EMPTY_WHO_INFO_LIST_i { 0, NULL }
extern const Who_info_list EMPTY_WHO_INFO_LIST;
typedef struct {
int no_of_persons;
Who_info_ident * info;
} Who_info_ident_list;
#define EMPTY_WHO_INFO_IDENT_LIST_i { 0, NULL }
extern const Who_info_ident_list EMPTY_WHO_INFO_IDENT_LIST;
#define EMPTY_tm_i {0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0}
#endif /* ifndef KOM_TYPES_H_ALREADY_INCLUDED__ */
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