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

Regular expression matching of conference and person names.

parent 2ce10794
#!/bin/sh #!/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. # Copyright (C) 1991 Lysator Academic Computer Association.
# #
# This file is part of the LysKOM server. # This file is part of the LysKOM server.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
# #
# Please mail bug reports to bug-lyskom@lysator.liu.se. # 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= x=
...@@ -56,4 +56,5 @@ error) false;; ...@@ -56,4 +56,5 @@ error) false;;
ln -s ../config/${x}-defs.make scripts/import.make ln -s ../config/${x}-defs.make scripts/import.make
( cd config; make SYSTEM=${x} config ) ( cd config; make SYSTEM=${x} config )
( cd src/include/ansi/${x} ; make SYSTEM=${x} config ) ( cd src/include/ansi/${x} ; make SYSTEM=${x} config )
( cd src/libraries/regex ; ./configure )
esac esac
/* /*
* $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. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -119,6 +119,7 @@ extern const int WHAT_DO_LEN; /* what_am_i_doing */ ...@@ -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 USERNAME_LEN; /* Max login-id from clients */
extern const int TEXT_LEN; /* Max len of a text. */ extern const int TEXT_LEN; /* Max len of a text. */
extern const int BROADCAST_LEN; /* Max len of a broadcast message */ extern const int BROADCAST_LEN; /* Max len of a broadcast message */
extern const int REGEXP_LEN; /* Max len of regexp. */
/* Text_stat limits */ /* Text_stat limits */
......
/* /*
* $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. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -89,6 +89,7 @@ typedef enum ...@@ -89,6 +89,7 @@ typedef enum
KOM_CLIENT_IS_CRAZY = 41, /* Client thinks that server says it can't KOM_CLIENT_IS_CRAZY = 41, /* Client thinks that server says it can't
* understand client. */ * understand client. */
KOM_UNDEF_SESSION = 42, /* No such session exists. */ KOM_UNDEF_SESSION = 42, /* No such session exists. */
KOM_REGEX_ERROR = 43, /* Regexp compilation failed. */
not_used /* Det {r jobbigt att flytta kommatecknet hela not_used /* Det {r jobbigt att flytta kommatecknet hela
tiden... :-) /ceder */ tiden... :-) /ceder */
} Kom_err; } Kom_err;
......
/* /*
* $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. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -216,6 +216,15 @@ KOM_( lookup_name (const String name, ...@@ -216,6 +216,15 @@ KOM_( lookup_name (const String name,
Conf_list *result)); Conf_list *result));
#endif #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 extern Success
KOM_( get_conf_stat_old (Conf_no conf_no, KOM_( get_conf_stat_old (Conf_no conf_no,
int mask, int mask,
......
# #
# $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. # Copyright (C) 1991 Lysator Academic Computer Association.
# #
# This file is part of the LysKOM server. # This file is part of the LysKOM server.
...@@ -30,7 +30,8 @@ include $(SCRIPTDIR)/import.make ...@@ -30,7 +30,8 @@ include $(SCRIPTDIR)/import.make
# All directories that make should traverse to when doing clean etc. # All directories that make should traverse to when doing clean etc.
# Note that client-support depends on libmisc. # 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 all: includes libraries binaries
......
...@@ -43,19 +43,43 @@ DEFS = @DEFS@ ...@@ -43,19 +43,43 @@ DEFS = @DEFS@
SHELL = /bin/sh SHELL = /bin/sh
# Special support for LysKOM
include Topdir.make
SCRIPTDIR = $(TOPDIR)/scripts
include $(SCRIPTDIR)/import.make
subdirs = doc test subdirs = doc test
default all:: regex.o default all:: regex.o
.PHONY: default all .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 regex.o: regex.c regex.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $< $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $<
clean mostlyclean:: clean mostlyclean::
rm -f *.o $(RM) ${OBJECTS} $(GENERIC-CLEAN)
distclean:: clean distclean:: clean
rm -f Makefile config.status rm -f Makefile config.status
$(RM) $(GENERIC-DIST-CLEAN)
realclean:: distclean realclean:: distclean
rm -f configure rm -f configure
......
...@@ -43,19 +43,43 @@ DEFS = @DEFS@ ...@@ -43,19 +43,43 @@ DEFS = @DEFS@
SHELL = /bin/sh SHELL = /bin/sh
# Special support for LysKOM
include Topdir.make
SCRIPTDIR = $(TOPDIR)/scripts
include $(SCRIPTDIR)/import.make
subdirs = doc test subdirs = doc test
default all:: regex.o default all:: regex.o
.PHONY: default all .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 regex.o: regex.c regex.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $< $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $<
clean mostlyclean:: clean mostlyclean::
rm -f *.o $(RM) ${OBJECTS} $(GENERIC-CLEAN)
distclean:: clean distclean:: clean
rm -f Makefile config.status rm -f Makefile config.status
$(RM) $(GENERIC-DIST-CLEAN)
realclean:: distclean realclean:: distclean
rm -f configure rm -f configure
......
/* /*
* $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. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se. * 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. * This file contains the cached data that the server stores.
* .h file created by ceder 1990-04-18 * .h file created by ceder 1990-04-18
...@@ -98,6 +98,13 @@ cached_conf_exists( Conf_no conf_no ); ...@@ -98,6 +98,13 @@ cached_conf_exists( Conf_no conf_no );
extern Conf_type extern Conf_type
cached_get_conf_type (Conf_no conf_no); 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. * Get garb_nice for a certain conference.
* It is set when mark_conference_as_changed is called. * It is set when mark_conference_as_changed is called.
...@@ -105,6 +112,9 @@ cached_get_conf_type (Conf_no conf_no); ...@@ -105,6 +112,9 @@ cached_get_conf_type (Conf_no conf_no);
extern Garb_nice extern Garb_nice
cached_get_garb_nice (Conf_no conf_no); cached_get_garb_nice (Conf_no conf_no);
extern String
cached_get_name (Conf_no conf_no);
extern Local_text_no extern Local_text_no
cached_get_highest_local_no (Conf_no conf_no); cached_get_highest_local_no (Conf_no conf_no);
......
# #
# $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. # Copyright (C) 1991 Lysator Academic Computer Association.
# #
# This file is part of the LysKOM server. # This file is part of the LysKOM server.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# #
# Please mail bug reports to bug-lyskom@lysator.liu.se. # 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 # This file is used to describe the functions in services.c. All
# functions that are reachable from the clients are listed here, together # functions that are reachable from the clients are listed here, together
...@@ -100,3 +100,5 @@ success find_previous_text_no num : text_no ...@@ -100,3 +100,5 @@ success find_previous_text_no num : text_no
success login num c_string (PWD_LEN) num success login num c_string (PWD_LEN) num
success who_is_on_ident : who_info_ident_list success who_is_on_ident : who_info_ident_list
success get_session_info_ident num : session_info_ident 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
/* /*
* $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. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* Protocol A. * 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> #include <stdio.h>
...@@ -318,6 +318,8 @@ prot_a_is_legal_fnc(Call_header fnc) ...@@ -318,6 +318,8 @@ prot_a_is_legal_fnc(Call_header fnc)
case call_fnc_who_is_on_ident: case call_fnc_who_is_on_ident:
case call_fnc_get_session_info_ident: case call_fnc_get_session_info_ident:
case call_fnc_login: case call_fnc_login:
case call_fnc_re_lookup_person:
case call_fnc_re_lookup_conf:
return TRUE; return TRUE;
default: default:
......
/* /*
* $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. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <config.h> #include <config.h>
#include <m-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 */ ...@@ -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 USERNAME_LEN = 128; /* Max login-id from clients */
const int TEXT_LEN =131072;/* Max len of a text. */ const int TEXT_LEN =131072;/* Max len of a text. */
const int BROADCAST_LEN = 1024; /* Max len of a broadcast message */ const int BROADCAST_LEN = 1024; /* Max len of a broadcast message */
const int REGEXP_LEN = 1024; /* Max len of regexp. */
/* Text_stat limits */ /* Text_stat limits */
......
/* /*
* $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. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* New save algorithm by ceder. * 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) ...@@ -345,7 +345,15 @@ cached_get_conf_type (Conf_no conf_no)
return small_conf_arr [ conf_no ]->type; 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. * Various function calls to tell the cache that something is changed.
...@@ -990,6 +998,11 @@ cached_get_garb_nice (Conf_no conf_no) ...@@ -990,6 +998,11 @@ cached_get_garb_nice (Conf_no conf_no)
return small_conf_arr [ conf_no ]->nice; 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 extern Local_text_no
cached_get_highest_local_no (Conf_no conf_no) cached_get_highest_local_no (Conf_no conf_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