diff --git a/Config b/Config index 0ed2b1b0964f28af8eaaf813c84638c6c52f5a62..5889b012c6cbe1ba0619b9392123f7fc4c9f3917 100755 --- a/Config +++ b/Config @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Config,v 1.10 1992/04/14 19:19:40 ceder Exp $ +# $Id: Config,v 1.11 1992/12/19 00:25:02 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: Config,v 1.10 1992/04/14 19:19:40 ceder Exp $ +# $Id: Config,v 1.11 1992/12/19 00:25:02 ceder Exp $ x= @@ -56,4 +56,5 @@ error) false;; ln -s ../config/${x}-defs.make scripts/import.make ( cd config; make SYSTEM=${x} config ) ( cd src/include/ansi/${x} ; make SYSTEM=${x} config ) + ( cd src/libraries/regex ; ./configure ) esac diff --git a/src/include/config.h b/src/include/config.h index b8a0be5909174448546d86963651aa09d200cbd0..a3b3dece2569d8ae6f2c8f3aa8658dc64cbda978 100644 --- a/src/include/config.h +++ b/src/include/config.h @@ -1,5 +1,5 @@ /* - * $Id: config.h,v 0.6 1992/11/22 15:14:15 ceder Exp $ + * $Id: config.h,v 0.7 1992/12/19 00:25:08 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -119,6 +119,7 @@ extern const int WHAT_DO_LEN; /* what_am_i_doing */ extern const int USERNAME_LEN; /* Max login-id from clients */ extern const int TEXT_LEN; /* Max len of a text. */ extern const int BROADCAST_LEN; /* Max len of a broadcast message */ +extern const int REGEXP_LEN; /* Max len of regexp. */ /* Text_stat limits */ diff --git a/src/include/kom-errno.h b/src/include/kom-errno.h index 986344dec3ceba27770f223ab5b26587d3fa5878..8fdf8965d63dadf56a65063ea3263b3c70640a98 100644 --- a/src/include/kom-errno.h +++ b/src/include/kom-errno.h @@ -1,5 +1,5 @@ /* - * $Id: kom-errno.h,v 0.2 1991/09/15 10:13:03 linus Exp $ + * $Id: kom-errno.h,v 0.3 1992/12/19 00:25:11 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -89,6 +89,7 @@ typedef enum KOM_CLIENT_IS_CRAZY = 41, /* Client thinks that server says it can't * understand client. */ KOM_UNDEF_SESSION = 42, /* No such session exists. */ + KOM_REGEX_ERROR = 43, /* Regexp compilation failed. */ not_used /* Det {r jobbigt att flytta kommatecknet hela tiden... :-) /ceder */ } Kom_err; diff --git a/src/include/services.h b/src/include/services.h index 900c39e84a036b2156c14d706129342e232d3768..630342d765dd5750372c317366cdc37d017d5929 100644 --- a/src/include/services.h +++ b/src/include/services.h @@ -1,5 +1,5 @@ /* - * $Id: services.h,v 0.8 1992/04/01 20:46:05 ceder Exp $ + * $Id: services.h,v 0.9 1992/12/19 00:25:14 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -216,6 +216,15 @@ KOM_( lookup_name (const String name, Conf_list *result)); #endif +/* Two functions for matching regexps. */ +extern Success +KOM_( re_lookup_person (const String regexp, + Conf_no_list *result)); + +extern Success +KOM_( re_lookup_conf (const String regexp, + Conf_no_list *result)); + extern Success KOM_( get_conf_stat_old (Conf_no conf_no, int mask, diff --git a/src/libraries/Makefile b/src/libraries/Makefile index ac6246569fc2f2abfcb68e550ee7423dc983713c..3aef192e3a9cc9606340abe6148a6be173a7b008 100644 --- a/src/libraries/Makefile +++ b/src/libraries/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 0.10 1992/04/15 23:06:07 ceder Exp $ +# $Id: Makefile,v 0.11 1992/12/19 00:25:19 ceder Exp $ # Copyright (C) 1991 Lysator Academic Computer Association. # # This file is part of the LysKOM server. @@ -30,7 +30,8 @@ include $(SCRIPTDIR)/import.make # All directories that make should traverse to when doing clean etc. # Note that client-support depends on libmisc. -SUBDIRS = libansi libmisc libisc libcommon client-support laclib libisc-new +SUBDIRS = libansi libmisc libisc libcommon client-support laclib libisc-new \ + regex all: includes libraries binaries diff --git a/src/libraries/regex/Makefile.in b/src/libraries/regex/Makefile.in index ed945788c63c1fe5940f5235fbf383e005ee1f75..3239d920dec6c7e925134e5bc9f46630660fb3d5 100644 --- a/src/libraries/regex/Makefile.in +++ b/src/libraries/regex/Makefile.in @@ -43,19 +43,43 @@ DEFS = @DEFS@ SHELL = /bin/sh +# Special support for LysKOM +include Topdir.make +SCRIPTDIR = $(TOPDIR)/scripts + +include $(SCRIPTDIR)/import.make + subdirs = doc test default all:: regex.o .PHONY: default all +LIBNAME = libregex$(PROFILE-LIB-SUFFIX).a +LIBOBJS = regex.o +INSTALL-HDRS = regex.h + +$(LIBNAME): $(LIBOBJS) + $(AR) $(ARFLAGS) $(LIBNAME) $? + $(RANLIB) $(LIBNAME) + +libraries: $(LIBNAME) + $(RM) $(LIBDIR)/$(LIBNAME) + cp $(LIBNAME) $(LIBDIR)/$(LIBNAME) + $(TOUCHLIB) $(LIBDIR)/$(LIBNAME) + +include $(SCRIPTDIR)/install-includes.make + +binaries:; + regex.o: regex.c regex.h $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $< clean mostlyclean:: - rm -f *.o + $(RM) ${OBJECTS} $(GENERIC-CLEAN) distclean:: clean rm -f Makefile config.status + $(RM) $(GENERIC-DIST-CLEAN) realclean:: distclean rm -f configure diff --git a/src/libraries/regex/Makefile.src b/src/libraries/regex/Makefile.src index ed945788c63c1fe5940f5235fbf383e005ee1f75..3239d920dec6c7e925134e5bc9f46630660fb3d5 100644 --- a/src/libraries/regex/Makefile.src +++ b/src/libraries/regex/Makefile.src @@ -43,19 +43,43 @@ DEFS = @DEFS@ SHELL = /bin/sh +# Special support for LysKOM +include Topdir.make +SCRIPTDIR = $(TOPDIR)/scripts + +include $(SCRIPTDIR)/import.make + subdirs = doc test default all:: regex.o .PHONY: default all +LIBNAME = libregex$(PROFILE-LIB-SUFFIX).a +LIBOBJS = regex.o +INSTALL-HDRS = regex.h + +$(LIBNAME): $(LIBOBJS) + $(AR) $(ARFLAGS) $(LIBNAME) $? + $(RANLIB) $(LIBNAME) + +libraries: $(LIBNAME) + $(RM) $(LIBDIR)/$(LIBNAME) + cp $(LIBNAME) $(LIBDIR)/$(LIBNAME) + $(TOUCHLIB) $(LIBDIR)/$(LIBNAME) + +include $(SCRIPTDIR)/install-includes.make + +binaries:; + regex.o: regex.c regex.h $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $< clean mostlyclean:: - rm -f *.o + $(RM) ${OBJECTS} $(GENERIC-CLEAN) distclean:: clean rm -f Makefile config.status + $(RM) $(GENERIC-DIST-CLEAN) realclean:: distclean rm -f configure diff --git a/src/server/cache.h b/src/server/cache.h index 624025315fc876ca70138447dbfcd63ffedd97a1..8c76b7fa92f180c1c66519fbb1ef3f82b092647f 100644 --- a/src/server/cache.h +++ b/src/server/cache.h @@ -1,5 +1,5 @@ /* - * $Id: cache.h,v 0.9 1992/11/22 15:14:37 ceder Exp $ + * $Id: cache.h,v 0.10 1992/12/19 00:25:32 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: cache.h,v 0.9 1992/11/22 15:14:37 ceder Exp $ + * $Id: cache.h,v 0.10 1992/12/19 00:25:32 ceder Exp $ * * This file contains the cached data that the server stores. * .h file created by ceder 1990-04-18 @@ -98,6 +98,13 @@ cached_conf_exists( Conf_no conf_no ); extern Conf_type cached_get_conf_type (Conf_no conf_no); +/* + * Return number of conferences present. (Actually, return a number + * at least as large as the number of conferences present). + */ +extern Conf_no +cached_no_of_existing_conferences(void); + /* * Get garb_nice for a certain conference. * It is set when mark_conference_as_changed is called. @@ -105,6 +112,9 @@ cached_get_conf_type (Conf_no conf_no); extern Garb_nice cached_get_garb_nice (Conf_no conf_no); +extern String +cached_get_name (Conf_no conf_no); + extern Local_text_no cached_get_highest_local_no (Conf_no conf_no); diff --git a/src/server/fncdef.txt b/src/server/fncdef.txt index c1116858d81b000cbc58ef9fea45eed1568f8fdc..61c95d7b36788fabb0f635f4e7ddfe159d513808 100644 --- a/src/server/fncdef.txt +++ b/src/server/fncdef.txt @@ -1,5 +1,5 @@ # -# $Id: fncdef.txt,v 0.9 1992/04/01 20:46:37 ceder Exp $ +# $Id: fncdef.txt,v 0.10 1992/12/19 00:25:35 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: fncdef.txt,v 0.9 1992/04/01 20:46:37 ceder Exp $ +# $Id: fncdef.txt,v 0.10 1992/12/19 00:25:35 ceder Exp $ # # This file is used to describe the functions in services.c. All # functions that are reachable from the clients are listed here, together @@ -100,3 +100,5 @@ success find_previous_text_no num : text_no success login num c_string (PWD_LEN) num success who_is_on_ident : who_info_ident_list success get_session_info_ident num : session_info_ident +success re_lookup_person c_string (REGEXP_LEN) : conf_no_list +success re_lookup_conf c_string (REGEXP_LEN) : conf_no_list diff --git a/src/server/prot-a.c b/src/server/prot-a.c index 0b4010398fdc87756cf5c2a940bbc9f05f5ac3b8..acd8cf26a5304648605c4f96f94ec26abd16909f 100644 --- a/src/server/prot-a.c +++ b/src/server/prot-a.c @@ -1,5 +1,5 @@ /* - * $Id: prot-a.c,v 0.15 1992/05/18 23:09:23 ceder Exp $ + * $Id: prot-a.c,v 0.16 1992/12/19 00:25:38 ceder Exp $ * Copyright (C) 1991 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.15 1992/05/18 23:09:23 ceder Exp $"; +static char *rcsid = "$Id: prot-a.c,v 0.16 1992/12/19 00:25:38 ceder Exp $"; #include <stdio.h> @@ -318,6 +318,8 @@ prot_a_is_legal_fnc(Call_header fnc) case call_fnc_who_is_on_ident: case call_fnc_get_session_info_ident: case call_fnc_login: + case call_fnc_re_lookup_person: + case call_fnc_re_lookup_conf: return TRUE; default: diff --git a/src/server/server-config.c b/src/server/server-config.c index dbe7ca3cce9af1c742ee6ade0ffd6f83c3de8d8a..1c7df86a6f6f326e9bdf9982c27c4eb510164d5f 100644 --- a/src/server/server-config.c +++ b/src/server/server-config.c @@ -1,5 +1,5 @@ /* - * $Id: server-config.c,v 0.18 1992/06/11 19:16:16 ceder Exp $ + * $Id: server-config.c,v 0.19 1992/12/19 00:25:41 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -32,7 +32,7 @@ #include <config.h> #include <m-config.h> -static char *rcsid = "$Id: server-config.c,v 0.18 1992/06/11 19:16:16 ceder Exp $"; +static char *rcsid = "$Id: server-config.c,v 0.19 1992/12/19 00:25:41 ceder Exp $"; @@ -90,6 +90,7 @@ const int WHAT_DO_LEN = 60; /* what_am_i_doing */ const int USERNAME_LEN = 128; /* Max login-id from clients */ const int TEXT_LEN =131072;/* Max len of a text. */ const int BROADCAST_LEN = 1024; /* Max len of a broadcast message */ +const int REGEXP_LEN = 1024; /* Max len of regexp. */ /* Text_stat limits */ diff --git a/src/server/simple-cache.c b/src/server/simple-cache.c index f53c611311254dd787259e1123688fc69f1547b2..d0c68fc06660ecff6cbfee908ff85917fd825c43 100644 --- a/src/server/simple-cache.c +++ b/src/server/simple-cache.c @@ -1,5 +1,5 @@ /* - * $Id: simple-cache.c,v 0.29 1992/11/30 23:29:16 linus Exp $ + * $Id: simple-cache.c,v 0.30 1992/12/19 00:25:47 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.29 1992/11/30 23:29:16 linus Exp $"; +static char *rcsid = "$Id: simple-cache.c,v 0.30 1992/12/19 00:25:47 ceder Exp $"; /* @@ -345,7 +345,15 @@ cached_get_conf_type (Conf_no conf_no) return small_conf_arr [ conf_no ]->type; } - +/* + * Return number of conferences present. (Actually, return a number + * at least as large as the number of conferences present). + */ +extern Conf_no +cached_no_of_existing_conferences(void) +{ + return next_free_num; /* This is too large, but who cares? */ +} /* * Various function calls to tell the cache that something is changed. @@ -990,6 +998,11 @@ cached_get_garb_nice (Conf_no conf_no) return small_conf_arr [ conf_no ]->nice; } +extern String +cached_get_name (Conf_no conf_no) +{ + return small_conf_arr [ conf_no ]->name; +} extern Local_text_no cached_get_highest_local_no (Conf_no conf_no)