diff --git a/config/sun4os4-defs.make b/config/sun4os4-defs.make index cb364f081f2ffc8506f013b2c328c29c4229b015..3277ea363433ccc17d074777cc8135586250fb20 100644 --- a/config/sun4os4-defs.make +++ b/config/sun4os4-defs.make @@ -1,5 +1,5 @@ # -# $Id: sun4os4-defs.make,v 1.12 1992/02/10 02:44:23 linus Exp $ +# $Id: sun4os4-defs.make,v 1.13 1992/02/26 18:47:01 ceder Exp $ # Copyright (C) 1991 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: sun4os4-defs.make,v 1.12 1992/02/10 02:44:23 linus Exp $ +# $Id: sun4os4-defs.make,v 1.13 1992/02/26 18:47:01 ceder Exp $ # This file is included by all Makefiles in the LysKOM hierarchy. # It gives default values for all variables that is normally used. # TOPDIR and SCRIPTDIR must be set before this file is included. @@ -33,7 +33,8 @@ SHELL=/bin/sh AWK = gawk SED = /usr/bin/sed -CC = gcc -ansi +#CC = gcc -ansi +CC = gcc2 -ansi RM = /usr/gnu/bin/rm -vf RANLIB = ranlib TOUCHLIB = ranlib -t @@ -44,11 +45,14 @@ MKDIR=/bin/mkdir INCLUDEDIR = /usr/local/include/lyskom LIBDIR = /usr/local/lib/lyskom -ANSIDIR = $(INCLUDEDIR)/ansi - -INCLUDES = -I$(ANSIDIR) -I$(INCLUDEDIR) -OPTIMIZE-FLAGS = -O -MISC-CFLAGS = -g -Wall +#ANSIDIR = $(INCLUDEDIR)/ansi +ANSIDIR= + +#INCLUDES = -I$(ANSIDIR) -I$(INCLUDEDIR) +INCLUDES = -I$(INCLUDEDIR) -I/usr/gnu/lib/gcc/sun4-sunos4.1.1/2.0/proto-include +OPTIMIZE-FLAGS = -O3 +#MISC-CFLAGS = -g -Wall +MISC-CFLAGS = -g -Wall -Wstrict-prototypes -Wmissing-prototypes PIPE = -pipe # -h flag makes NULL pointer references generate runtime errors diff --git a/src/include/server/smalloc.h b/src/include/server/smalloc.h index 307d2590dfac7a0bf2039f4410fb7b1cebe9e230..47ff32a8790e7d9156e3d2130fd57e8cb095bfb1 100644 --- a/src/include/server/smalloc.h +++ b/src/include/server/smalloc.h @@ -1,5 +1,5 @@ /* - * $Id: smalloc.h,v 0.2 1991/09/15 10:17:50 linus Exp $ + * $Id: smalloc.h,v 0.3 1992/02/26 18:45:38 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -57,7 +57,7 @@ srealloc(void * ptr, size_t size); /* Never fails. It is legal to * atomic call. */ void * -tmp_alloc(u_long size); +tmp_alloc(unsigned long size); /* * Free all core which is allocated with tmp_alloc(). This is called from diff --git a/src/libraries/libansi/strerror.c b/src/libraries/libansi/strerror.c index 768713bf17121c675611719a2fab819a5b0eaeec..e9b6fcae87e2af121fda771895019184c86f5777 100644 --- a/src/libraries/libansi/strerror.c +++ b/src/libraries/libansi/strerror.c @@ -1,5 +1,5 @@ /* - * $Id: strerror.c,v 0.5 1991/09/15 10:19:51 linus Exp $ + * $Id: strerror.c,v 0.6 1992/02/26 18:46:01 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -26,8 +26,9 @@ ** strerror.c */ -static char *rcsid = "$Id: strerror.c,v 0.5 1991/09/15 10:19:51 linus Exp $"; +static char *rcsid = "$Id: strerror.c,v 0.6 1992/02/26 18:46:01 ceder Exp $"; +#include <string.h> #include <m-config.h> #ifndef HAVE_STRERROR diff --git a/src/libraries/libcommon/kom-errno.c b/src/libraries/libcommon/kom-errno.c index d4ee20d25a349d3131f951b29073bd4c3452cb32..19525e388d5a9c8c3eac8fa9d2790e662382b0c0 100644 --- a/src/libraries/libcommon/kom-errno.c +++ b/src/libraries/libcommon/kom-errno.c @@ -1,5 +1,5 @@ /* - * $Id: kom-errno.c,v 0.3 1991/09/15 10:22:58 linus Exp $ + * $Id: kom-errno.c,v 0.4 1992/02/26 18:46:19 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -30,7 +30,7 @@ */ -static char *rcsid = "$Id: kom-errno.c,v 0.3 1991/09/15 10:22:58 linus Exp $"; +static char *rcsid = "$Id: kom-errno.c,v 0.4 1992/02/26 18:46:19 ceder Exp $"; #include <stdio.h> @@ -39,10 +39,10 @@ static char *rcsid = "$Id: kom-errno.c,v 0.3 1991/09/15 10:22:58 linus Exp $"; #include <kom-errno.h> -Kom_err kom_errno; +Kom_err kom_errno = 0; /* Additional information about the error */ -u_long err_stat; +u_long err_stat = 0; /* Note that kom_errout is defined in config.h */ diff --git a/src/libraries/libmisc/s-string.c b/src/libraries/libmisc/s-string.c index 51d20defba893f62b405d8bc35255ee8e3302b2b..5f944cad3a6cb941c70d72b605ce72f4b18a4a11 100644 --- a/src/libraries/libmisc/s-string.c +++ b/src/libraries/libmisc/s-string.c @@ -1,5 +1,5 @@ /* - * $Id: s-string.c,v 1.6 1991/09/15 10:25:27 linus Exp $ + * $Id: s-string.c,v 1.7 1992/02/26 18:46:41 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -46,11 +46,12 @@ * even if so stated. */ -static char *rcsid = "$Id: s-string.c,v 1.6 1991/09/15 10:25:27 linus Exp $"; +static char *rcsid = "$Id: s-string.c,v 1.7 1992/02/26 18:46:41 ceder Exp $"; #include <sys/types.h> #include <stdio.h> #include <string.h> +#include <memory.h> #include <ctype.h> #include <stdlib.h> #include <assert.h> @@ -649,7 +650,7 @@ s_strip_trailing (String str, */ EXPORT String_size s_strchr (const String str, - char ch, + unsigned char ch, String_size start_pos) { @@ -673,7 +674,7 @@ s_strchr (const String str, */ EXPORT String_size s_strrchr (const String str, - char ch, + unsigned char ch, String_size start_pos) { diff --git a/src/libraries/libmisc/s-string.h b/src/libraries/libmisc/s-string.h index 628d803202638f4eeb14a51b08554e37b3a81879..7c99fab26a20fd4c381ef5d2093afa3cf52da2b4 100644 --- a/src/libraries/libmisc/s-string.h +++ b/src/libraries/libmisc/s-string.h @@ -1,5 +1,5 @@ /* - * $Id: s-string.h,v 1.4 1991/09/15 10:25:23 linus Exp $ + * $Id: s-string.h,v 1.5 1992/02/26 18:46:39 ceder Exp $ * Copyright (C) 1991 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: s-string.h,v 1.4 1991/09/15 10:25:23 linus Exp $ + * $Id: s-string.h,v 1.5 1992/02/26 18:46:39 ceder Exp $ * * s-string.h * Our own string type. Definition of string type, @@ -354,7 +354,7 @@ s_strip_trailing (String str, */ extern String_size s_strchr (const String str, - char ch, + unsigned char ch, String_size start_pos); @@ -365,7 +365,7 @@ s_strchr (const String str, */ extern String_size s_strrchr (const String str, - char ch, + unsigned char ch, String_size start_pos); diff --git a/src/libraries/libmisc/zmalloc.c b/src/libraries/libmisc/zmalloc.c index f29c1dfbcda263cae79f0fb892009742575522b8..73ed56ca176adb9a7c1d0311f9626375e0907f2c 100644 --- a/src/libraries/libmisc/zmalloc.c +++ b/src/libraries/libmisc/zmalloc.c @@ -1,5 +1,5 @@ /* - * $Id: zmalloc.c,v 1.2 1991/09/15 10:25:16 linus Exp $ + * $Id: zmalloc.c,v 1.3 1992/02/26 18:46:38 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -48,11 +48,12 @@ */ -static char *rcsid = "$Id: zmalloc.c,v 1.2 1991/09/15 10:25:16 linus Exp $"; +static char *rcsid = "$Id: zmalloc.c,v 1.3 1992/02/26 18:46:38 ceder Exp $"; #include <stddef.h> #include <malloc.h> #include <string.h> +#include <memory.h> #include <compiler.h> diff --git a/src/server/Makefile b/src/server/Makefile index 682362b798bd593d66f3331a40184c83d7b89344..4ba35502be8a86549ac1ac378be65c20d6aa3b5e 100755 --- a/src/server/Makefile +++ b/src/server/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 0.20 1992/01/05 18:21:54 ceder Exp $ +# $Id: Makefile,v 0.21 1992/02/26 18:45:23 ceder Exp $ # Copyright (C) 1991 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: Makefile,v 0.20 1992/01/05 18:21:54 ceder Exp $ +# $Id: Makefile,v 0.21 1992/02/26 18:45:23 ceder Exp $ include Topdir.make SCRIPTDIR = $(TOPDIR)/scripts @@ -39,7 +39,7 @@ HDRS = admin.h isc-parse.h prot-a-output.h async.h isc-interface.h \ # See config/sun4os4-defs.make about LIBRESOLV if you are running SunOS 4.1.1. -LIBS = -lisc -lmisc -llyskom-server -lansi -lresolv +LIBS = -lold-isc -lmisc -llyskom-server -lansi -lresolv TARGET = -DSERVER diff --git a/src/server/conference.c b/src/server/conference.c index cebfbc1228a169e624c40204db891dee15af46fd..4630eee447333a40d7d13955e11c991d79a049e8 100644 --- a/src/server/conference.c +++ b/src/server/conference.c @@ -1,5 +1,5 @@ /* - * $Id: conference.c,v 0.15 1991/12/16 23:56:38 ceder Exp $ + * $Id: conference.c,v 0.16 1992/02/26 18:45:21 ceder Exp $ * Copyright (C) 1991 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.15 1991/12/16 23:56:38 ceder Exp $"; +static char *rcsid = "$Id: conference.c,v 0.16 1992/02/26 18:45:21 ceder Exp $"; #include <time.h> @@ -49,6 +49,7 @@ static char *rcsid = "$Id: conference.c,v 0.15 1991/12/16 23:56:38 ceder Exp $"; #include <debug.h> #include <parser.h> #include "internal-connections.h" +#include "internal-services.h" /* From ram-cache.h. This will go away when we use regexp-matching. This is * only temporary. +++*** diff --git a/src/server/connections.c b/src/server/connections.c index 566fc7105286c0248aa61d3795add48917703235..31d3230c3684c06503ae4106b897fc0b83c5e72c 100644 --- a/src/server/connections.c +++ b/src/server/connections.c @@ -1,5 +1,5 @@ /* - * $Id: connections.c,v 0.11 1991/09/21 13:07:03 ceder Exp $ + * $Id: connections.c,v 0.12 1992/02/26 18:45:19 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -30,7 +30,7 @@ * Created by Willf|r 31/3-90. Mostly written by ceder. */ -static char *rcsid = "$Id: connections.c,v 0.11 1991/09/21 13:07:03 ceder Exp $"; +static char *rcsid = "$Id: connections.c,v 0.12 1992/02/26 18:45:19 ceder Exp $"; #include <errno.h> @@ -40,6 +40,7 @@ static char *rcsid = "$Id: connections.c,v 0.11 1991/09/21 13:07:03 ceder Exp $" #include <sys/stat.h> #include <time.h> #include <sys/time.h> +#include <string.h> #include "s-string.h" #include <kom-types.h> @@ -397,7 +398,7 @@ mux_handle_packet(Mux *mux) BUG(("\n[Client %d from %.*s via MUX %s", cp->session_no, - cp->hostname.len, + (int)cp->hostname.len, cp->hostname.string, mux->scb->info.tcp.hostname)); BUG((" is connecting]\n")); @@ -440,7 +441,7 @@ mux_handle_packet(Mux *mux) cp = mcp->conn; VBUG(("\n[Message client %d via MUX #%d]\n", - cp->session_no, mux->scb)); + cp->session_no, (int)mux->scb)); parse_message(cp, mux->parse.string); break; @@ -448,7 +449,7 @@ mux_handle_packet(Mux *mux) default: VBUG(("\nMUX Protocol error from MUX #%d]\n", - mux->scb)); + (int)mux->scb)); isc_printf(mux->scb, "5\n"); isc_flush(mux->scb); @@ -457,7 +458,7 @@ mux_handle_packet(Mux *mux) } } -void +static void mux_logout(Mux *mp) { int i; @@ -536,7 +537,7 @@ mux_parse_message(Mux *mp, String tmp_str) BUG(("mux_parse_message(): mp->parse.unparsed = { len = %d, " "string = %p }\n", mp->parse.unparsed.len, - mp->parse.unparsed.string)); + (void *)mp->parse.unparsed.string)); if ( s_strcat(&mp->parse.unparsed, tmp_str) != OK ) restart_kom("mux_parse_message(): s_strcat\n"); @@ -555,8 +556,8 @@ mux_parse_message(Mux *mp, String tmp_str) * is data that has not yet been taken care of. Return TRUE * if there was no data to take care of. */ -Bool -parse_forgotten() +static Bool +parse_forgotten(void) { Bool flg = FALSE; /* Was there anything? */ Connection *ci; @@ -582,9 +583,8 @@ parse_forgotten() /* Return 1 if the named file exists, 0 otherwise */ static int -fexists(char *filename) +fexists(const char *filename) { - extern int stat(char *filename, struct stat *bufp); struct stat buf; int code; @@ -697,7 +697,7 @@ login_request(ISCECB *event) event->session->udg = mux_create(MUX_TYPE_MUX, event->session); BUG(("MUX #%d at %s connecting.\n", - event->session, event->session->info.tcp.hostname)); + (int)event->session, event->session->info.tcp.hostname)); } else { @@ -728,7 +728,7 @@ logout_request(ISCECB *event) if (event->session->udg->type == MUX_TYPE_MUX) { - BUG(("\n[MUX #%d at %s", event->session, + BUG(("\n[MUX #%d at %s", (int)event->session, event->session->info.tcp.hostname)); BUG((" is logging out]\n")); diff --git a/src/server/connections.h b/src/server/connections.h index f4c47a8e188ade955d7caa9b8aa86bd0abffa0f2..2f4b7143ac500aed44e80e84df50fc16a5b2a91a 100644 --- a/src/server/connections.h +++ b/src/server/connections.h @@ -1,5 +1,5 @@ /* - * $Id: connections.h,v 0.6 1991/11/10 19:02:39 linus Exp $ + * $Id: connections.h,v 0.7 1992/02/26 18:45:18 ceder Exp $ * Copyright (C) 1991 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.6 1991/11/10 19:02:39 linus Exp $ + * $Id: connections.h,v 0.7 1992/02/26 18:45:18 ceder Exp $ * * connections.h -- The top level of the communication packet. * @@ -193,7 +193,7 @@ extern const Fnc_descriptor fnc_defs[]; extern u_long service_statistics[]; -#ifdef _SETJMP_ +#ifdef _JBLEN extern jmp_buf parse_env; #endif diff --git a/src/server/dbck-cache.c b/src/server/dbck-cache.c index 066b925c70f8cd94347f6723fb8c50f57e8acbc6..d05c9d4a6947f9b13f9cc102bac57c976dc08bbe 100644 --- a/src/server/dbck-cache.c +++ b/src/server/dbck-cache.c @@ -1,5 +1,5 @@ /* - * $Id: dbck-cache.c,v 0.8 1991/09/23 18:15:15 ceder Exp $ + * $Id: dbck-cache.c,v 0.9 1992/02/26 18:45:15 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -32,7 +32,7 @@ * Also save time as a time_t instead of a struct tm. */ -static char *rcsid = "$Id: dbck-cache.c,v 0.8 1991/09/23 18:15:15 ceder Exp $"; +static char *rcsid = "$Id: dbck-cache.c,v 0.9 1992/02/26 18:45:15 ceder Exp $"; /* @@ -44,6 +44,8 @@ static char *rcsid = "$Id: dbck-cache.c,v 0.8 1991/09/23 18:15:15 ceder Exp $"; #include <string.h> #include <stdlib.h> #include <sys/file.h> +#include <unistd.h> +#include <errno.h> #include <kom-errno.h> #include <kom-types.h> @@ -60,6 +62,7 @@ static char *rcsid = "$Id: dbck-cache.c,v 0.8 1991/09/23 18:15:15 ceder Exp $"; #include "connections.h" #include "send-async.h" #include "memory.h" +#include "dbck-cache.h" #ifdef TIME_SYNC # include <sys/resource.h> @@ -376,7 +379,7 @@ cached_create_text( String message) } #endif -extern void +void cached_flush_text(Text_no text_no, String message) { @@ -400,7 +403,6 @@ cached_flush_text(Text_no text_no, fflush(new_text_file); } - Text_no traverse_text(Text_no seed) { @@ -626,7 +628,7 @@ cache_sync(void) #endif } -extern void +void cache_open_new_text_file(void) { if ( ( new_text_file = fopen(textfilename, "w")) == NULL ) diff --git a/src/server/dbck.c b/src/server/dbck.c index c729b01f120c5864d3a3bbb191f0001b7ae17212..cb7ef22779a94e289e31c233cfba351364a77550 100644 --- a/src/server/dbck.c +++ b/src/server/dbck.c @@ -1,5 +1,5 @@ /* - * $Id: dbck.c,v 0.8 1992/02/21 00:51:37 ceder Exp $ + * $Id: dbck.c,v 0.9 1992/02/26 18:45:13 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,12 +28,13 @@ * Author: Per Cederqvist. */ -static char *rcsid = "$Id: dbck.c,v 0.8 1992/02/21 00:51:37 ceder Exp $"; +static char *rcsid = "$Id: dbck.c,v 0.9 1992/02/26 18:45:13 ceder Exp $"; #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <errno.h> #include <kom-types.h> #include <config.h> @@ -199,7 +200,7 @@ is_footnoted_in(Text_no parent, return FALSE; } -Member * +static Member * locate_member(Pers_no pers_no, Conference * conf_c) { @@ -950,7 +951,7 @@ check_texts_in_conf(Conf_no cc, return error; } -Membership * +static Membership * locate_membership(Conf_no conf_no, Person * pers_p) { @@ -1128,7 +1129,7 @@ init_data_base(void) restart_kom("Can't find database.\n"); } -void +static void garb_text_file(void) { Text_no tno = 0; @@ -1156,7 +1157,7 @@ garb_text_file(void) -void +static void print_statistics(void) { Text_stat *ts; @@ -1166,6 +1167,12 @@ print_statistics(void) hist = calloc(TEXT_LEN, sizeof(int)); + if (hist == NULL) + { + perror("dbck: print_statistics(): can't calloc()"); + return; + } + for (t=0; (t=traverse_text(t)) != 0;) { ts = cached_get_text_stat(t); @@ -1184,6 +1191,8 @@ print_statistics(void) log("%8d %d\n", i, hist[i]); } +/* Stop "no previous prototype" warning from gcc 2.0 */ +int main(int, char**); int main (int argc, diff --git a/src/server/disk-end-of-atomic.c b/src/server/disk-end-of-atomic.c index fded19a841b1b6bb4e3ec9b4e78c85144a3724b9..48b651ad931f4324c55591cc7a222f0945cd97e2 100644 --- a/src/server/disk-end-of-atomic.c +++ b/src/server/disk-end-of-atomic.c @@ -1,5 +1,5 @@ /* - * $Id: disk-end-of-atomic.c,v 0.5 1991/09/15 10:32:22 linus Exp $ + * $Id: disk-end-of-atomic.c,v 0.6 1992/02/26 18:45:11 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -36,7 +36,7 @@ * to forget old texts. */ -static char *rcsid = "$Id: disk-end-of-atomic.c,v 0.5 1991/09/15 10:32:22 linus Exp $"; +static char *rcsid = "$Id: disk-end-of-atomic.c,v 0.6 1992/02/26 18:45:11 ceder Exp $"; #include <kom-types.h> @@ -45,6 +45,7 @@ static char *rcsid = "$Id: disk-end-of-atomic.c,v 0.5 1991/09/15 10:32:22 linus #include "config.h" #include "disk-cache.h" #include "cache.h" +#include "end-of-atomic.h" long end_of_atomic( Bool idle ) diff --git a/src/server/internal-services.h b/src/server/internal-services.h index 84bd3120d1732479a17c3c4cb1cbcf9329d1e6b3..7d62cb8603b0c078edac634eb0f970331ca4272e 100644 --- a/src/server/internal-services.h +++ b/src/server/internal-services.h @@ -1,5 +1,5 @@ /* - * $Id: internal-services.h,v 0.3 1991/09/15 10:31:55 linus Exp $ + * $Id: internal-services.h,v 0.4 1992/02/26 18:45:10 ceder Exp $ * Copyright (C) 1991 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: internal-services.h,v 0.3 1991/09/15 10:31:55 linus Exp $ + * $Id: internal-services.h,v 0.4 1992/02/26 18:45:10 ceder Exp $ * * server/services.h * @@ -34,7 +34,7 @@ * en av{ndare kom p} att han inte ville ha texten kvar) * * Funktionerna i denna fil har kontrollerar inte att ACTPERS har r{tt att - * g|ra det som g|rs. + * g|ra det som g|rs. +++FIXME--translate to english */ diff --git a/src/server/manipulate.h b/src/server/manipulate.h index 24b05578d99f367b0126cca9552ba02abedc1ade..51e6a747810d92377ea5bf602193e1f899c1acea 100644 --- a/src/server/manipulate.h +++ b/src/server/manipulate.h @@ -1,5 +1,5 @@ /* - * $Id: manipulate.h,v 0.5 1991/12/16 23:56:36 ceder Exp $ + * $Id: manipulate.h,v 0.6 1992/02/26 18:45:08 ceder Exp $ * Copyright (C) 1991 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: manipulate.h,v 0.5 1991/12/16 23:56:36 ceder Exp $ + * $Id: manipulate.h,v 0.6 1992/02/26 18:45:08 ceder Exp $ * * manipulate.h * @@ -188,14 +188,6 @@ typedef enum { * Functions which manipulate the CONFERENCE struct. */ -extern Bool -legal_passwd(const String pwd); - -extern Success -do_set_passwd( Password pwd, - const String new_pwd); - - extern Success chk_passwd( Password pwd, const String s ); @@ -222,30 +214,6 @@ is_supervisor(Conf_no conf, -/* - * Add text_no to the list of texts in a conference. Return the local number - * the text gets in this conference. - */ - -extern Local_text_no -add_text_in_conf(Conference * conf_c, - Text_no text_no); - - -/* - * Set the global text_no of a certain local text_no if that local text_no - * exists in the conf. No action is taken if the local text_no doesn't exist. - * This function is probably only used to set the number to zero when a text - * is deleted. - */ - -extern void -set_loc_no (Conference * conf_c, - Local_text_no loc_no, - Text_no text_no); - - - /* * This function is called whenever a person leaves a conf, * i e when he pepsi():s or logout():s. @@ -278,14 +246,6 @@ do_set_etc_motd(Conf_no conf_no, -/* - * Delete a conference. Delete all references to this conf. - */ - -extern void -do_delete_conf (Conf_no conf_no, - Conference * conf_c); /* Not NULL */ - /* * Functions that manupulate the PERSON struct @@ -302,37 +262,6 @@ locate_membership(Conf_no conf_no, -/* - * Change user_area of a person. If text_no is 0, there will be - * no user_area. - */ - -extern Success -do_set_user_area(Pers_no pers_no, - Person * pers_p, - Text_no text_no); - -/* - * Mark a text. No check is done if pers_p is really allowed to mark it. - * Use mark_type==0 to unmark the text. - */ - -Success -do_mark_text(Pers_no pers_no, - Person *pers_p, /* May be NULL */ - Text_no text_no, - Text_stat *text_s, /* May be NULL */ - u_char mark_type); - -/* - * Return a pointer to a Mark if pers_no has marked the text text_no. - * Otherwise, return NULL. - */ -Mark * -locate_mark(Pers_no pers_no, - Person *pers_p, /* May be NULL. */ - Text_no text_no); - /* * Delete a person. (The mailbox is not deleted);. */ @@ -418,16 +347,6 @@ unique_name( const String name, Conf_no conf_no ); -/* - * Change the priority of a certain conference in a person. - */ -extern void -do_change_priority (Membership * mship, - u_char priority, - u_short where, - Pers_no pers_no, - Person * pers_p); - /* * Delete a member from a conference. @@ -451,30 +370,6 @@ do_sub_member(Conf_no conf_no, /* Conf to delete member from. */ * Functions which deal with TEXTS */ -/* - * Count how many recipients and cc_recipients a text has. - */ - -extern int -count_recipients( Text_stat *t_stat ); - - -/* - * Count how many footnotes a text has. - */ - -extern int -count_footn( Text_stat *t_stat ); - - -/* - * Count how many commments a text has. - */ - -extern int -count_comment( Text_stat *t_stat ); - - /* * Check if ACTPERS is allowed to read this text. * Returns TRUE if he is allowed to read it. @@ -486,163 +381,6 @@ text_read_access(Text_no text_no, -/* - * Check if CONF_NO is a recipient of the text whose text_stat is given. - */ - -extern Bool -is_recipient(Conf_no conf_no, - Text_stat * t_stat); - - - -/* - * Check if comment is a comment to parent. - */ -Bool -is_comment_to(Text_no comment, - Text_stat *parent); - - -/* - * Check if footnote is a footnote to parent. - */ -Bool -is_footnote_to(Text_no footnote, - Text_stat *parent); - - -/* - * Return the conference which the text goes to. This is normally conf_no, but - * it may be a super_conf. If ACTPERS is not allowed to submit a text to - * conf_no or a super_conf, return 0. - */ - -extern Conf_no -submit_to(Conf_no conf_no, /* The conference the user is trying to */ - /* submit a text to. */ - Conference * conf_c); /* May be NULL */ - - -/* - * Insert a rec_time misc item to a text_status. - * The item is put at position POS on the list. (0 == first) - * Take no action if the misc_item at POS is a rec_time. - * This function is only used when a person marks his letters as read. - * - * Text_stat * text_stat_pointer Textstatus to modify - * int pos Where to insert rec_time - */ - -extern void -do_add_rec_time (Text_stat * text_stat_ptr, - int pos); - - -/* - * Say that FOOTNOTE is a footnote to TEXT. - */ - -extern Success -do_add_footnote(Text_no footnote, - Text_no text); - - - -/* - * Say that COMMENT is a comment to TEXT. - */ - -extern Success -do_add_comment(Text_no comment, - Text_no text); - - - -/* - * Say that RECEIVER is a recipient of TEXT. - */ -extern Success -do_add_recpt(Text_no text, - Text_stat * text_s, /* May be NULL */ - Conf_no receiver); - - - -extern Success -do_add_cc_recpt(Text_no new_text, - Text_stat *text_s, /* May be NULL */ - Conf_no receiver); - - - -/* - * Return number of lines in a text - */ - -extern u_short -count_lines( String str ); - - - -/* - * Delete misc_info at location loc. - * If it is a recpt, cc_recpt, comm_to or footn_to delete any - * loc_no, rec_time, sent_by or sent_at that might follow it. - * - * Note that the Misc_info is not reallocated. - */ - -extern void -do_delete_misc (u_short * no_of_misc, - Misc_info * misc, - int loc); - - -/* - * Delete a recipient from a text - */ -extern Success -do_sub_recpt (Text_no text_no, - Text_stat * text_s, - Conf_no conf_no, - Conference * conf_s ); - - -/* - * Delete the link between comment and comment_to. - */ -void -do_sub_comment (Text_no comment, - Text_stat * text_s, - Text_no comment_to, - Text_stat * parent_s ); - -/* - * Delete the link between footnote and footnote_to. - */ -void -do_sub_footnote (Text_no footnote, - Text_stat * text_s, - Text_no footnote_to, - Text_stat * parent_s ); - - -/* - * Check if ACTPERS has sent this text to conference CONF_NO - */ -extern Bool -is_sender(Text_stat * text_s, - Conf_no conf_no); - - -/* - * Check if ACTPERS has sent this text as a comment to parent. - */ -Bool -is_comm_sender(Text_stat * text_s, - Text_no parent); - /* * Check if ACTPERS has sent this text as a footnote to parent. @@ -651,33 +389,7 @@ extern Bool is_footn_sender(Text_stat * text_s, Text_no parent); - -/* - * Check if ACTPERS is allowed to add a footnote to a text. Sets errno if - * there is an error. - */ - -extern Success -check_footn(Text_stat * t_stat); - -/* - * Check if ACTPERS is allowed to add a comment to a text. Sets errno if - * there is an error. Note that it is allowed to comment a text even if - * you are not allowed to read it. - */ - -extern Success -check_comm(Text_stat * t_stat); - - -/* - * Check if pers_no is a member in any of the recipients or cc_recipients - * of text_s - */ -extern Bool -is_member_in_recpt(Person * person, - Text_stat * text_s); extern void forced_leave_conf(Pers_no pers_no, Conf_no conf_no); diff --git a/src/server/memory.c b/src/server/memory.c index 9fc0e93f50c42aaca9661d83608d85f6bd6c8df8..c82e7153c8b19204344f7fbd96f6487780be0774 100644 --- a/src/server/memory.c +++ b/src/server/memory.c @@ -1,5 +1,5 @@ /* - * $Id: memory.c,v 0.7 1991/09/15 10:31:11 linus Exp $ + * $Id: memory.c,v 0.8 1992/02/26 18:45:07 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,7 +28,7 @@ * These functions should be used instead of smalloc/srealloc. */ -static char *rcsid = "$Id: memory.c,v 0.7 1991/09/15 10:31:11 linus Exp $"; +static char *rcsid = "$Id: memory.c,v 0.8 1992/02/26 18:45:07 ceder Exp $"; #include <kom-types.h> @@ -123,7 +123,7 @@ clear_membership(Membership *mship) *mship = EMPTY_MEMBERSHIP; } -EXPORT void +static void clear_membership_list(Membership_list *mlist) { int i; @@ -166,7 +166,7 @@ free_person(Person *person) } -EXPORT void +static void clear_member_list(Member_list *m) { if ( m == NULL ) diff --git a/src/server/missing-ansi.c b/src/server/missing-ansi.c index d0eba68e9b294360d602686ea5f67c8932eb3f7b..8b89faed58e6de0346c8345868c56d6cc571f795 100644 --- a/src/server/missing-ansi.c +++ b/src/server/missing-ansi.c @@ -1,5 +1,5 @@ /* - * $Id: missing-ansi.c,v 0.4 1991/09/15 10:30:58 linus Exp $ + * $Id: missing-ansi.c,v 0.5 1992/02/26 18:45:05 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,7 +28,7 @@ * Written by ceder. */ -static char *rcsid = "$Id: missing-ansi.c,v 0.4 1991/09/15 10:30:58 linus Exp $"; +static char *rcsid = "$Id: missing-ansi.c,v 0.5 1992/02/26 18:45:05 ceder Exp $"; #include <string.h> @@ -94,7 +94,7 @@ mktime (const struct tm * temeptr ) extern char *sys_errlist[]; extern int sys_nerr; -const char *strerror(int eno) +char *strerror(int eno) { static char buf[200]; diff --git a/src/server/mux-parse.h b/src/server/mux-parse.h index 4390df3e88fe33d81cc457f8e724b86bddfb94bc..6d4ab0ab6b242a6ec368a735a5a6a47635fb1c0c 100644 --- a/src/server/mux-parse.h +++ b/src/server/mux-parse.h @@ -1,5 +1,5 @@ /* - * $Id: mux-parse.h,v 0.3 1991/09/15 10:30:50 linus Exp $ + * $Id: mux-parse.h,v 0.4 1992/02/26 18:45:04 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -23,13 +23,13 @@ * Please mail bug reports to bug-lyskom@lysator.liu.se. */ /* - * $Id: mux-parse.h,v 0.3 1991/09/15 10:30:50 linus Exp $ + * $Id: mux-parse.h,v 0.4 1992/02/26 18:45:04 ceder Exp $ * ** mux-parse.c Handle the MUX protocol * This is a hack. */ -#ifdef _SETJMP_ +#ifdef _JBLEN extern jmp_buf mux_parse_env; #endif diff --git a/src/server/person.c b/src/server/person.c index 8269a58061a97eaef57fa316bec3090f7c1091fa..da302e753de05cbd7050ef992eb582256d2e97ce 100644 --- a/src/server/person.c +++ b/src/server/person.c @@ -1,5 +1,5 @@ /* - * $Id: person.c,v 0.14 1991/12/16 23:56:30 ceder Exp $ + * $Id: person.c,v 0.15 1992/02/26 18:45:02 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,16 +28,17 @@ * All atomic calls that deals with persons. */ -static char *rcsid = "$Id: person.c,v 0.14 1991/12/16 23:56:30 ceder Exp $"; +static char *rcsid = "$Id: person.c,v 0.15 1992/02/26 18:45:02 ceder Exp $"; #include <m-config.h> #include <time.h> #include <string.h> #include <stdlib.h> +#include <crypt.h> + #include "lyskomd.h" #include <kom-types.h> #include <services.h> -#include <misc.h> #include "manipulate.h" #include <kom-errno.h> #include <server/smalloc.h> diff --git a/src/server/ramkomd.c b/src/server/ramkomd.c index 6b9ca3a177a16fa566375236d5f4b74f8bdeac15..aff75cfaeb988c4131ec991f007e926e84f3f417 100644 --- a/src/server/ramkomd.c +++ b/src/server/ramkomd.c @@ -1,5 +1,5 @@ /* - * $Id: ramkomd.c,v 0.25 1992/01/05 18:46:55 ceder Exp $ + * $Id: ramkomd.c,v 0.26 1992/02/26 18:45:01 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -31,7 +31,7 @@ * It has grown! /ceder */ -static char *rcsid = "$Id: ramkomd.c,v 0.25 1992/01/05 18:46:55 ceder Exp $"; +static char *rcsid = "$Id: ramkomd.c,v 0.26 1992/02/26 18:45:01 ceder Exp $"; #include <m-config.h> @@ -49,10 +49,12 @@ static char *rcsid = "$Id: ramkomd.c,v 0.25 1992/01/05 18:46:55 ceder Exp $"; #include <sys/types.h> #include <sys/wait.h> #include <sys/param.h> +#include <time.h> +#include <sys/resource.h> #include <netinet/in.h> #include <unistd.h> -#include <misc.h> -#include <time.h> +#include <errno.h> + #include "s-string.h" #include <kom-types.h> #include "string-malloc.h" @@ -178,14 +180,14 @@ init_data_base(const char *dbase_dir) } } -void +static void sighandler_hup (int sig) { log ("Signal HUP received. Shutting down server.\n"); go_and_die = TRUE; } -void +static void sighandler_quit (int sig) { log ("Signal QUIT received - syncing...\n"); @@ -194,13 +196,13 @@ sighandler_quit (int sig) abort(); } -void +static void sighandler_usr1 (int sig) { do_sync_db = TRUE; } -void +static void sighandler_usr2 (int sig) { int child; @@ -223,7 +225,7 @@ sighandler_usr2 (int sig) } } -void +static void save_pid(void) { FILE *fp; @@ -235,7 +237,9 @@ save_pid(void) fclose(fp); } - +/* Stop complaint from gcc 2.0 about "no previous prototype for `main'". */ +int main(int argc, char **argv); + int main (int argc, char **argv) diff --git a/src/server/simple-cache.c b/src/server/simple-cache.c index 5f319c3d4c9196da20fd404cb44605026a128e61..f13208ead988cea7f39d3cc41dcb5c4b30655a52 100644 --- a/src/server/simple-cache.c +++ b/src/server/simple-cache.c @@ -1,5 +1,5 @@ /* - * $Id: simple-cache.c,v 0.19 1992/01/05 18:23:07 ceder Exp $ + * $Id: simple-cache.c,v 0.20 1992/02/26 18:44:58 ceder Exp $ * Copyright (C) 1991 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.19 1992/01/05 18:23:07 ceder Exp $"; +static char *rcsid = "$Id: simple-cache.c,v 0.20 1992/02/26 18:44:58 ceder Exp $"; @@ -54,6 +54,8 @@ static char *rcsid = "$Id: simple-cache.c,v 0.19 1992/01/05 18:23:07 ceder Exp $ #include <string.h> #include <stdlib.h> #include <sys/file.h> +#include <unistd.h> +#include <errno.h> #include <kom-errno.h> #include <kom-types.h> @@ -76,7 +78,7 @@ static char *rcsid = "$Id: simple-cache.c,v 0.19 1992/01/05 18:23:07 ceder Exp $ #include "tmp-limits.h" #include "cache-node.h" - +#include "disk-cache.h" static Small_conf * small_conf_arr[ MAX_CONF ]; static Cache_node_mcb * pers_mcb; static Cache_node_mcb * conf_mcb; @@ -1155,7 +1157,7 @@ is_clean(const char *fn) } -extern void +static void pre_sync(void) { long i; @@ -1592,7 +1594,7 @@ save_one_text(void) * TRUE (because sync() checks to see if it is time to start yet * another save.) */ -EXPORT Bool +Bool sync_part(void) { static time_t last_sync_start = NO_TIME; @@ -1907,7 +1909,7 @@ free_all_cache (void) static void -limit_pers() +limit_pers(void) { Cache_node *node; int i; @@ -1944,7 +1946,7 @@ limit_pers() } static void -limit_conf() +limit_conf(void) { Cache_node *node; int i; @@ -1982,7 +1984,7 @@ limit_conf() static void -limit_text_stat() +limit_text_stat(void) { Cache_node *node; int i; diff --git a/src/server/text-garb.c b/src/server/text-garb.c index 8a7da0e10d3c0249a4fee47dedbee93b0a79e615..fbcdc1c9a9beb50fe3c389958090c419d3840618 100644 --- a/src/server/text-garb.c +++ b/src/server/text-garb.c @@ -1,5 +1,5 @@ /* - * $Id: text-garb.c,v 0.5 1991/09/15 10:28:47 linus Exp $ + * $Id: text-garb.c,v 0.6 1992/02/26 18:44:57 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,7 +28,7 @@ * Author: Per Cederqvist. */ -static char *rcsid = "$Id: text-garb.c,v 0.5 1991/09/15 10:28:47 linus Exp $"; +static char *rcsid = "$Id: text-garb.c,v 0.6 1992/02/26 18:44:57 ceder Exp $"; #include <time.h> @@ -37,6 +37,7 @@ static char *rcsid = "$Id: text-garb.c,v 0.5 1991/09/15 10:28:47 linus Exp $"; #include "log.h" #include "internal-services.h" #include "lyskomd.h" +#include "text-garb.h" #include <debug.h> diff --git a/src/server/text.c b/src/server/text.c index 174846a6de1aa54e7dad6c25771580f787ba2974..0d079070721300f97f1c143252c8f9871db4f4ae 100644 --- a/src/server/text.c +++ b/src/server/text.c @@ -1,5 +1,5 @@ /* - * $Id: text.c,v 0.15 1991/12/17 23:07:38 ceder Exp $ + * $Id: text.c,v 0.16 1992/02/26 18:44:55 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,7 +28,7 @@ * All atomic calls that deals with texts. */ -static char *rcsid = "$Id: text.c,v 0.15 1991/12/17 23:07:38 ceder Exp $"; +static char *rcsid = "$Id: text.c,v 0.16 1992/02/26 18:44:55 ceder Exp $"; #include <time.h> #include <stdlib.h> @@ -48,6 +48,7 @@ static char *rcsid = "$Id: text.c,v 0.15 1991/12/17 23:07:38 ceder Exp $"; #include "send-async.h" #include "admin.h" #include "internal-connections.h" +#include "internal-services.h" /* * Static functions