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

Use "unsigned long" instead of "u_long".

parent 04939d27
/*
* $Id: kom-types.h,v 0.6 1992/04/04 17:22:49 ceder Exp $
* $Id: kom-types.h,v 0.7 1993/10/07 23:18:17 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -61,15 +61,15 @@
#include <limits.h>
#include <time.h>
#include <s-string.h>
#include "s-string.h"
#include "misc-types.h"
typedef u_short Pers_no;
typedef u_short Conf_no;
typedef u_long Text_no;
typedef u_long Local_text_no;
typedef u_long Session_no;
typedef unsigned short Pers_no;
typedef unsigned short Conf_no;
typedef unsigned long Text_no;
typedef unsigned long Local_text_no;
typedef unsigned long Session_no;
#ifdef PROT_a
......@@ -81,14 +81,14 @@ typedef u_long Session_no;
/*
* LysKOM, RFC-822, FidoNet, News are examples of universes.
*/
/*typedef u_long Universe;*/
/*typedef unsigned long Universe;*/
/*
* JAKOM, lysator.liu.se, 2:504/113, foo.bar.com are examples of sites
* in the above universes. (Note that comp.lang.c is _not_ a site in
* the News universe).
*/
/*typedef u_long Site;*/
/*typedef unsigned long Site;*/
/*
* Fritt Forum, ceder, Per Cederqvist, comp.lang.c are examples of
......@@ -100,10 +100,10 @@ typedef u_long Session_no;
* Global_x.
*/
typedef u_long System_id;
typedef u_long Global_recpt;
typedef u_long Global_person;
typedef u_long Global_text;
typedef unsigned long System_id;
typedef unsigned long Global_recpt;
typedef unsigned long Global_person;
typedef unsigned long Global_text;
#endif
......@@ -136,22 +136,22 @@ typedef u_long Global_text;
* to read. See file doc/security-levels.txt
*/
typedef struct {
u_int wheel : 1;
u_int admin : 1;
u_int statistic : 1;
u_int create_pers: 1;
u_int create_conf: 1;
u_int change_name: 1;
u_int extern_gw : 1;
u_int flg8 : 1; /* For future use. */
u_int flg9 : 1;
u_int flg10 : 1;
u_int flg11 : 1;
u_int flg12 : 1;
u_int flg13 : 1;
u_int flg14 : 1;
u_int flg15 : 1;
u_int flg16 : 1;
unsigned int wheel : 1;
unsigned int admin : 1;
unsigned int statistic : 1;
unsigned int create_pers: 1;
unsigned int create_conf: 1;
unsigned int change_name: 1;
unsigned int extern_gw : 1;
unsigned int flg8 : 1; /* For future use. */
unsigned int flg9 : 1;
unsigned int flg10 : 1;
unsigned int flg11 : 1;
unsigned int flg12 : 1;
unsigned int flg13 : 1;
unsigned int flg14 : 1;
unsigned int flg15 : 1;
unsigned int flg16 : 1;
} Priv_bits;
#ifdef SERVER
......@@ -175,15 +175,15 @@ extern const Priv_bits DEFAULT_PRIV_BITS;
* Flags in the Person struct.
*/
typedef struct {
u_int unread_is_secret : 1;/* FALSE if everyone is allowed to ask how */
unsigned int unread_is_secret : 1;/* FALSE if everyone is allowed to ask how */
/* many unread texts you have. */
u_int flg2 : 1;
u_int flg3 : 1;
u_int flg4 : 1;
u_int flg5 : 1;
u_int flg6 : 1;
u_int flg7 : 1;
u_int flg8 : 1;
unsigned int flg2 : 1;
unsigned int flg3 : 1;
unsigned int flg4 : 1;
unsigned int flg5 : 1;
unsigned int flg6 : 1;
unsigned int flg7 : 1;
unsigned int flg8 : 1;
} Personal_flags;
#define DEFAULT_PERSONAL_FLAGS_i ((Personal_flags) \
......@@ -257,7 +257,7 @@ typedef struct {
/* Fields of this type is supposed to tell the garbage collector
* which texts it should remove first.
*/
typedef u_long Garb_nice;
typedef unsigned long Garb_nice;
/* Struct for text status */
......@@ -267,10 +267,10 @@ typedef struct {
long file_pos; /* Start of the text in the text file. */
#endif
Pers_no author;
u_short no_of_lines;
unsigned short no_of_lines;
String_size no_of_chars;
u_short no_of_marks; /* Antal markeringar */
u_short no_of_misc; /* Recipients, times, comments, ... */
unsigned short no_of_marks; /* Antal markeringar */
unsigned short no_of_misc; /* Recipients, times, comments, ... */
Misc_info * misc_items; /* List of miscellaneous info. */
} Text_stat;
......@@ -287,9 +287,9 @@ extern const Text_stat EMPTY_TEXT_STAT;
typedef struct {
u_int rd_prot : 1; /* !(Can anyone become a member?) */
u_int original : 1; /* Comments forbidden? */
u_int secret : 1; /* Secret conference? */
unsigned int rd_prot : 1; /* !(Can anyone become a member?) */
unsigned int original : 1; /* Comments forbidden? */
unsigned int secret : 1; /* Secret conference? */
/* Note: if a letterbox is secret it
* will be very hard for that person
* to log in, since he can't map his
......@@ -297,7 +297,7 @@ typedef struct {
* know his pers_no, or have another
* identity which is his supervisor.
*/
u_int letter_box : 1; /* Is this a letter box? */
unsigned int letter_box : 1; /* Is this a letter box? */
} Conf_type;
#define NULL_CONF_TYPE_i ((Conf_type) { 0, 0, 0, 0 })
......@@ -314,7 +314,7 @@ typedef struct {
/* Struct for marks */
typedef struct {
Text_no text_no;
u_char mark_type; /* It's up to the clients to decide the
unsigned char mark_type; /* It's up to the clients to decide the
meaning of this field. */
} Mark;
......@@ -323,12 +323,12 @@ typedef struct {
/* Information about a person's membership in a conference */
typedef struct {
Conf_no conf_no;
u_char priority; /* Interrupt priority */
unsigned char priority; /* Interrupt priority */
Time last_time_read; /* Updated every time a text in this
conf. is marked as read. */
Local_text_no last_text_read; /* All texts before and inclusive this
are read */
u_short no_of_read;
unsigned short no_of_read;
Local_text_no * read_texts; /* Texts after last_text_read. Sorted
in ascending order */
} Membership;
......@@ -342,7 +342,7 @@ extern const Membership EMPTY_MEMBERSHIP;
/* Some structs to handle variable-sized arrays. */
typedef struct {
u_short no_of_marks;
unsigned short no_of_marks;
Mark * marks; /* Pointer to an array of marks. */
} Mark_list;
......@@ -351,7 +351,7 @@ extern const Mark_list EMPTY_MARK_LIST;
typedef struct {
u_short no_of_confs;
unsigned short no_of_confs;
Conf_no *conf_nos;
} Conf_no_list;
......@@ -360,7 +360,7 @@ extern const Conf_no_list EMPTY_CONF_NO_LIST;
typedef struct {
u_short no_of_members;
unsigned short no_of_members;
Member * members;
} Member_list;
......@@ -371,7 +371,7 @@ extern const Member_list EMPTY_MEMBER_LIST;
typedef struct {
Local_text_no first_local_no;
u_long no_of_texts;
unsigned long no_of_texts;
Text_no * texts;
} Text_list;
......@@ -384,7 +384,7 @@ extern const Text_list EMPTY_TEXT_LIST;
* mailbox (i e a person) or an ordinary conference. */
/* Delete this ugly variant as soon as possible! */
typedef struct {
u_long no_of_conf_nos;
unsigned long no_of_conf_nos;
Conf_no * conf_nos;
Conf_type * type_of_conf;
} Conf_list_old;
......@@ -395,7 +395,7 @@ typedef struct {
} Micro_conf;
typedef struct {
u_long no_of_confs;
unsigned long no_of_confs;
Micro_conf * confs;
} Conf_list;
......@@ -409,7 +409,7 @@ extern const Conf_list EMPTY_CONF_LIST;
/* A list of person numbers */
typedef struct {
u_long no_of_persons;
unsigned long no_of_persons;
Pers_no * persons;
} Pers_list;
......@@ -419,7 +419,7 @@ extern const Pers_list EMPTY_PERS_LIST;
typedef struct {
u_short no_of_confs;
unsigned short no_of_confs;
Membership * confs;
} Membership_list;
......@@ -460,9 +460,9 @@ typedef struct {
conf live? */
String name; /* Name of conference */
#ifdef CLIENT
u_short no_of_members;
unsigned short no_of_members;
Local_text_no first_local_no;
u_long no_of_texts;
unsigned long no_of_texts;
#else
Member_list members; /* List of members in conf */
Text_list texts; /* List of texts */
......@@ -507,21 +507,21 @@ typedef struct {
Priv_bits privileges;
Personal_flags flags;
Time last_login; /* Or logout */
u_long total_time_present; /* Number of seconds. */
u_long sessions; /* Number of sessions */
u_long created_lines; /* No. of created lines (statistics) */
u_long created_bytes; /* No. of created bytes (statistics) */
u_long read_texts; /* No. of read texts (statistics) */
u_long no_of_text_fetches; /* (statistics) */
u_short created_persons; /* (statistics) */
u_short created_confs; /* (statistics) */
unsigned long total_time_present; /* Number of seconds. */
unsigned long sessions; /* Number of sessions */
unsigned long created_lines; /* No. of created lines (statistics) */
unsigned long created_bytes; /* No. of created bytes (statistics) */
unsigned long read_texts; /* No. of read texts (statistics) */
unsigned long no_of_text_fetches; /* (statistics) */
unsigned short created_persons; /* (statistics) */
unsigned short created_confs; /* (statistics) */
String username; /* User-name & hostname */
#ifdef CLIENT
Local_text_no first_created_text; /* The first text that still
* exists. */
u_long no_of_created_texts;
u_short no_of_marks; /* This many marked texts */
u_short no_of_confs; /* Member in this many confs */
unsigned long no_of_created_texts;
unsigned short no_of_marks; /* This many marked texts */
unsigned short no_of_confs; /* Member in this many confs */
#else /* SERVER */
Text_list created_texts;
Mark_list marks; /* List of marked texts */
......@@ -591,7 +591,7 @@ typedef struct {
Conf_no working_conference;
Session_no session; /* Serial number of connection. */
Time connection_time; /* Not logintime. */
u_long idle_time; /* Seconds. */
unsigned long idle_time; /* Seconds. */
} Session_info;
#define EMPTY_SESSION_INFO_i ((Session_info) { 0, EMPTY_STRING_i, \
......@@ -610,7 +610,7 @@ typedef struct {
Conf_no working_conference;
Session_no session; /* Serial number of connection. */
Time connection_time; /* Not logintime. */
u_long idle_time; /* Seconds. */
unsigned long idle_time; /* Seconds. */
} Session_info_ident;
#define EMPTY_SESSION_INFO_IDENT_i ((Session_info_ident)\
......
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