Commit b6f77729 authored by David Byers's avatar David Byers
Browse files

Support building with Gnu checker and gcov instrumentation. Minor bug fixes.

parent b936eb53
1999-01-15 David Byers <davby@ida.liu.se>
* configure.in: New argument --with-optimization
* src/server/conference.c (legal_name): Set err_stat when
returning KOM_LONG_STR.
* src/server/text.c (do_create_text): Set err_stat when returning
KOM_LONG_STR.
* src/server/aux-item-def.y: Never add disabled items to the
definition list.
* src/server/admin.c (send_message): Set err_stat to
param.broadcast_len.
1999-01-14 David Byers <davby@ida.liu.se>
* src/server/connections.h: Added Memory_info to Res_type and
Result_holder to be compiled if DEBUG_CALLS is defined.
* src/server/admin.c (debug_info): New function to get memory
usage stats.
* src/server/prot-a.c (prot_a_reply): Output memory_info
* configure.in: Check for mallinfo if we do debug calls.
Substitute EFENCE=1 if we use efence.
* src/server/session.c (who_is_on): Changed for loops to while
loops to deal with new semantics of session 0 and to make the code
clearer. (who_is_on_ident): Ditto. (who_is_on_dynamic): Ditto.
......
dnl $Id: configure.in,v 1.52 1999/01/14 11:49:07 byers Exp $
dnl $Id: configure.in,v 1.53 1999/01/15 11:16:02 byers Exp $
dnl Configuration for LysKOM
dnl Copyright (C) 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
dnl
......@@ -18,7 +18,7 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Please mail bug reports to bug-lyskom@lysator.liu.se.
dnl
AC_REVISION($Revision: 1.52 $)
AC_REVISION($Revision: 1.53 $)
AC_INIT(src/server/lyskomd.h)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(scripts)
......@@ -34,10 +34,26 @@ AC_ARG_WITH([efence],
[use_efence=$withval],
[use_efence=no])
AC_ARG_WITH([checker],
[ --with-checker compile with Gnu Checker],
[use_checker=$withval],
[use_checker=no])
AC_ARG_WITH([purify],
[ --with-purify link with Purify],
[ --with-purify link with Purify],
[use_purify=$withval],
[use_purify=no])
AC_ARG_WITH([gcov],
[ --with-gcov instrument for gcov (requires gcc)],
[use_gcov=$withval],
[use_gcov=no])
AC_ARG_WITH([optimization],
[ --with-optimization select level of optimization],
[opt_level=$withval],
[opt_level=""])
AC_PREFIX_DEFAULT(/usr/lyskom)
AC_PROG_CC
AC_AIX
......@@ -64,17 +80,32 @@ then
PURIFY=purify
fi]
AC_SUBST(EFENCE)
[if test "$use_efence" = "yes"
then]
AC_CHECK_LIB(efence,malloc)
EFENCE=1
[fi]
AC_SUBST(DEBUG_CALLS)
[if test "$use_debug_calls" = "yes"
then]
AC_DEFINE(DEBUG_CALLS)
AC_CHECK_FUNCS(mallinfo)
[fi]
[if test "$use_gcov" = "yes" -a -n "$GCC"; then]
CMOD_COMPILER_CC_ACCEPTS([-ftest-coverage])
CMOD_COMPILER_CC_ACCEPTS([-fprofile-arcs])
[fi]
[if test -n "$opt_level" -a "$opt_level" != "yes" ; then
CFLAGS=`echo "$CFLAGS" | sed "s/-O[0-9]*//"`
if test "$opt_level" != "no" ; then
CFLAGS="$CFLAGS -O$opt_level"
fi
fi]
# Do this test early since it may define _POSIX_SOURCE, which may
# affect future tests.
# FIXME: is this needed, now that we use AM_C_PROTOTYPES?
......@@ -193,6 +224,17 @@ AC_DEFINE(SERVER)
dnl
dnl Tests for GNU getopt (used in dbck)
AC_CHECK_HEADERS(alloca.h)
dnl
dnl Check for use of Gnu checker
dnl
[if test "$use_checker" = "yes"
then]
AC_CHECK_PROGS(CHECKER, checker)
[ CC="checker $CC"
LIBS="-lchkr_m $LIBS" ]
[fi]
dnl
dnl
dnl Force the configure script in isc to behave as if the
......
......@@ -2,7 +2,7 @@
@c
@c FIXME: Explain how the garb works with nice and keep-commented
@c
@c $Id: Protocol-A.texi,v 1.50 1999/01/14 11:47:32 byers Exp $
@c $Id: Protocol-A.texi,v 1.51 1999/01/15 11:16:04 byers Exp $
@c %**start of header
@setfilename protocol-a.info
@settitle LysKOM Protocol A
......@@ -78,12 +78,13 @@ publication.
* LysKOM Content Types::
* The User Area::
* Writing Clients::
* Importing and Exporting E-Mail::
* Type Index::
* Request Index::
@end menu
@end ifinfo
@node Overview, Document Revision History, Top, Top
@node Overview, Introduction, Top, Top
@chapter Overview
LysKOM is a conferencing system@footnote{Or in modern terms, enabling
......@@ -129,7 +130,7 @@ The LysKOM developers can be reached by email to @code{lyskom@@lysator.liu.se}.
* Notation::
@end menu
@node Document Revision History, Protocol Revision History, Overview, Overview
@node Document Revision History, Protocol Revision History,, Overview
@section Document Revision History
@table @asis
......@@ -426,7 +427,7 @@ literal strings. There is to be no whitespace before or after literal
strings unless there is whitespace in the literal itself.
@node Introduction, , , Top
@node Introduction, Data Types, Overview, Top
@chapter Introduction
This chapter introduces the concepts used in LysKOM, such as articles,
......@@ -1296,7 +1297,7 @@ the reply.
Error reporting is covered in more detail in chapter @ref{Error Codes}.
@node Data Types, , , Top
@node Data Types, Protocol Requests, Introduction, Top
@chapter Data Types
The data types in protocol A come in two flavors. The first (vanilla)
......@@ -2692,7 +2693,7 @@ equivalent according to swascii rules.
@node Protocol Requests, , , Top
@node Protocol Requests, Asynchronous Messages, Data Types, Top
@chapter Protocol Requests
This chapter documents all calls that can be made to the server. All
......@@ -7328,7 +7329,7 @@ complete the call anyway.
@node Asynchronous Messages, , , Top
@node Asynchronous Messages, Error Codes, Protocol Requests, Top
@chapter Asynchronous Messages
Asynchronous messages are information messages sent from the server to
......@@ -7654,7 +7655,7 @@ See also @pxref{async-leave-conf}.
@node Error Codes, , , Top
@node Error Codes, LysKOM Content Types, Asynchronous Messages, Top
@chapter Error Codes
......@@ -7932,7 +7933,7 @@ undefined.
@node LysKOM Content Types, , , Top
@node LysKOM Content Types, The User Area, Error Codes, Top
@chapter LysKOM Content Types
LysKOM defines a few special content types for texts. They are all
......@@ -7976,7 +7977,7 @@ paragraph.
@node Conference Lists (x-kom/conflist), , The User Area (x-kom/user-area), LysKOM Content Types
@section Conference Lists
@node The User Area, , , Top
@node The User Area, Writing Clients, LysKOM Content Types, Top
@chapter The User Area
The user area is a regular text that is used to store client-specific
......@@ -8093,7 +8094,7 @@ The default mark to set on marked texts.
@node Writing Clients, , , Top
@node Writing Clients, Importing and Exporting E-Mail, The User Area, Top
@chapter Writing Clients
This chapter is not really part of the protocol specification, but
......@@ -8181,7 +8182,8 @@ aux-items to specify content type instead.
@node Remote control, Importing and Exporting E-Mail, Content type specification, Client Conventions
@node Remote control, , Content type specification, Client Conventions
@
This convention is only implemented by the Emacs-Lisp client, but since
I work on that client, I'm free to write about it. This is a subprotocol
......@@ -8189,7 +8191,7 @@ between clients, transferred by messages sent using
@pxref{send-message}.
@node Importing and Exporting E-Mail, TypeIndes, Writing Clients, Top
@node Importing and Exporting E-Mail, Type Index, Writing Clients, Top
@chapter Importing and Exporting E-Mail
E-mail importing and exporting is not implemented. This chapter contains
......@@ -8289,7 +8291,7 @@ importer want it.
@subsection Threading
The importer should do its best to thread messages. When the importer
T<he importer should do its best to thread messages. When the importer
sees a new message it needs to look at the @code{In-Reply-To} header to
see what the message is a reply to. If a previously imported message or
a LysKOM text is in the @code{In-Reply-To} header, the new text should
......@@ -8309,7 +8311,7 @@ give the general idea of how things can work.
@example
function import-message (message)
{
@{
recipient_list = To header of message
cc_list = CC header of message
......@@ -8334,10 +8336,10 @@ function import-message (message)
if result is a failure, construct and send a bounce
put Message-ID and result into the imported database
}
@}
function exporter ()
{
@{
text_no = last_examined_text_no
while text_no = get-next-text
if (text text_no is not imported or
......@@ -8353,7 +8355,7 @@ function exporter ()
else
mx-from = e-mail of author in LysKOM
send the message
}
@}
@end example
......@@ -8361,7 +8363,7 @@ function exporter ()
@node Type Index, Request Index, Remote control, Top
@node Type Index, Request Index, Importing and Exporting E-Mail, Top
@chapter Type Index
@printindex tp
......
\input texinfo
@c $Id: hacking.texi,v 1.3 1999/01/14 11:47:35 byers Exp $
@c $Id: hacking.texi,v 1.4 1999/01/15 11:16:07 byers Exp $
@c %**start of header
@setfilename hacking.info
@settitle Hacking lyskomd
......@@ -650,10 +650,10 @@ return the session pointer for the current session.
@example
for (sess = 0; (sess = traverse_connections(sess)) != 0; )
{
@{
cptr = get_conn_by_number(sess);
...
}
@}
@end example
The canonical traversal code looks like this:
......@@ -661,10 +661,10 @@ The canonical traversal code looks like this:
@example
Session_no session = 0;
while ((session = traverse_connections(session)) != 0)
{
@{
cptr = get_conn_by_number(session);
...
}
@}
@end example
This code has @code{session} set to a session number before ever
......
/*
* $Id: kom-types.h,v 0.30 1999/01/13 12:08:20 byers Exp $
* $Id: kom-types.h,v 0.31 1999/01/15 11:16:08 byers Exp $
* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -639,6 +639,21 @@ typedef struct {
String server_version;
} Version_info;
#ifdef DEBUG_CALLS
typedef struct {
int arena;
int ordblks;
int smblks;
int hblks;
int hblkhd;
int usmblks;
int fsmblks;
int uordblks;
int fordblks;
int keepcost;
} Memory_info;
#endif
#ifdef SERVER
typedef struct {
unsigned long protocol_version;
......
/*
* $Id: services.h,v 0.40 1999/01/14 11:49:09 byers Exp $
* $Id: services.h,v 0.41 1999/01/15 11:16:09 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -716,8 +716,10 @@ extern Success
KOM_( query_predefined_aux_items(Number_list *result));
extern unsigned long
KOM_ ( debug_info(void));
#ifdef DEBUG_CALLS
extern Success
KOM_ ( get_memory_info(Memory_info *result));
#endif
/*
......
......@@ -18,13 +18,29 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Revision: 1.1 $)dnl
AC_REVISION($Revision: 1.2 $)dnl
AC_INIT(src/isc_master.c)
AM_INIT_AUTOMAKE(isc, 0.99)
AC_ARG_ENABLE([isc-printf],
[ --enable-isc-printf include isc_printf support (non-portable)])
AC_ARG_WITH([checker],
[ --with-checker compile with Gnu Checker],
[use_checker=$withval],
[use_checker=no])
AC_ARG_WITH([gcov],
[ --with-gcov instrument for gcov (requires gcc)],
[use_gcov=$withval],
[use_gcov=no])
AC_ARG_WITH([optimization],
[ --with-optimization select level of optimization],
[opt_level=$withval],
[opt_level=""])
[if test "$enable_isc_printf" = yes
then]
AC_DEFINE(ISC_PRINTF_SUPPORT)
......@@ -71,4 +87,27 @@ CMOD_C_ATTRIBUTE_UNUSED
CMOD_COMPILER_CC_ACCEPTS([-pipe])
[fi]
[if test "$use_gcov" = "yes" -a -n "$GCC"; then]
CMOD_COMPILER_CC_ACCEPTS([-ftest-coverage])
CMOD_COMPILER_CC_ACCEPTS([-fprofile-arcs])
[fi]
[if test -n "$opt_level" -a "$opt_level" != "yes" ; then
CFLAGS=`echo "$CFLAGS" | sed "s/-O[0-9]*//"`
if test "$opt_level" != "no" ; then
CFLAGS="$CFLAGS -O$opt_level"
fi
fi]
# Check for checker
[if test "$use_checker" = "yes"
then]
AC_CHECK_PROGS(CHECKER, checker)
[ CC="checker $CC"
LIBS="-lchkr_m $LIBS" ]
[fi]
AC_OUTPUT(Makefile src/Makefile man/Makefile doc/Makefile demo/Makefile)
# $Id: Makefile.am,v 1.9 1999/01/14 11:39:23 byers Exp $
# $Id: Makefile.am,v 1.10 1999/01/15 11:16:11 byers Exp $
# Copyright (C) 1998 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -34,7 +34,7 @@ EXTRA_DIST = .cvsignore ChangeLog.1 Magics To-do \
MOSTLYCLEANFILES = .gdbinit call-switch.incl com.h fnc-def-init.incl \
fncdef-no-str-limit.txt prot-a-parse-arg.h version.incl \
prot-a-is-legal-fnc.incl
prot-a-is-legal-fnc.incl *.da *.bb *.gcov *.bbg
MAINTAINERCLEANFILES = aux-item-def.tab.h
......
/*
* $Id: admin.c,v 0.30 1999/01/14 11:39:24 byers Exp $
* $Id: admin.c,v 0.31 1999/01/15 11:16:12 byers Exp $
* Copyright (C) 1991, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
#endif
static const char *
rcsid = "$Id: admin.c,v 0.30 1999/01/14 11:39:24 byers Exp $";
rcsid = "$Id: admin.c,v 0.31 1999/01/15 11:16:12 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -44,6 +44,7 @@ USE(rcsid);
#endif
#include <sys/types.h>
#include <time.h>
#include <malloc.h>
#include "misc-types.h"
#include "s-string.h"
......@@ -251,7 +252,7 @@ send_message (Conf_no recipient,
if (s_strlen(message) > param.broadcast_len)
{
err_stat = 0;
err_stat = param.broadcast_len;
kom_errno = KOM_LONG_STR;
return FAILURE;
}
......@@ -395,8 +396,37 @@ get_collate_table (String * result)
return OK;
}
extern unsigned long
debug_info (void)
#ifdef DEBUG_CALLS
extern Success
get_memory_info (Memory_info *result)
{
return 4711;
struct mallinfo info;
#ifdef HAVE_MALLINFO
info = mallinfo();
result->arena = info.arena;
result->ordblks = info.ordblks;
result->smblks = info.smblks;
result->hblks = info.hblks;
result->hblkhd = info.hblkhd;
result->usmblks = info.usmblks;
result->fsmblks = info.fsmblks;
result->uordblks = info.uordblks;
result->fordblks = info.fordblks;
result->keepcost = info.keepcost;
#else
result->arena = 0;
result->ordblks = 0;
result->smblks = 0;
result->hblks = 0;
result->hblkhd = 0;
result->usmblks = 0;
result->fsmblks = 0;
result->uordblks = 0;
result->fordblks = 0;
result->keepcost = 0;
#endif
return OK;
}
#endif
......@@ -31,7 +31,7 @@
#line 1 "./aux-item-def.y"
/*
* $Id: aux-item-def.tab.c,v 1.4 1998/12/26 22:40:25 byers Exp $
* $Id: aux-item-def.tab.c,v 1.5 1999/01/15 11:16:13 byers Exp $
* Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -243,9 +243,9 @@ static const short yyrhs[] = { 24,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
141, 142, 145, 152, 165, 175, 176, 179, 180, 181,
183, 184, 193, 194, 195, 197, 198, 199, 202, 277,
278, 279, 280, 281
141, 142, 145, 155, 168, 178, 179, 182, 183, 184,
186, 187, 196, 197, 198, 200, 201, 202, 205, 280,
281, 282, 283, 284
};
#endif
......@@ -811,12 +811,15 @@ yyreduce:
case 3:
#line 146 "./aux-item-def.y"
{
aux_item_definition_add(&def);
if (def.tag != 0)
{
aux_item_definition_add(&def);
}
def = empty_aux_item_definition;
;
break;}
case 4:
#line 153 "./aux-item-def.y"
#line 156 "./aux-item-def.y"
{
def.tag = yyvsp[-5].num;
def.name = s_crea_c_str(yyvsp[-3].str);
......@@ -831,7 +834,7 @@ case 4:
;
break;}
case 5:
#line 166 "./aux-item-def.y"
#line 169 "./aux-item-def.y"
{
def.tag = 0;
def.name = s_crea_c_str(yyvsp[-4].str);
......@@ -841,24 +844,24 @@ case 5:
;
break;}
case 8:
#line 179 "./aux-item-def.y"
#line 182 "./aux-item-def.y"
{ def.texts = TRUE; def.text_a = yyvsp[-1].num; ;
break;}
case 9:
#line 180 "./aux-item-def.y"
#line 183 "./aux-item-def.y"
{ def.confs = TRUE; def.conf_a = yyvsp[-1].num; ;
break;}
case 10:
#line 181 "./aux-item-def.y"
#line 184 "./aux-item-def.y"
{ def.letterboxes = TRUE;
def.conf_a = yyvsp[-1].num; ;
break;}
case 11:
#line 183 "./aux-item-def.y"
#line 186 "./aux-item-def.y"
{ def.system = TRUE; ;
break;}
case 12:
#line 185 "./aux-item-def.y"
#line 188 "./aux-item-def.y"
{
def.texts = TRUE; def.text_a = yyvsp[-1].num;
def.confs = TRUE; def.conf_a = yyvsp[-1].num;
......@@ -867,19 +870,19 @@ case 12:
;
break;}
case 13:
#line 193 "./aux-item-def.y"
#line 196 "./aux-item-def.y"
{ yyval.num = yyvsp[-1].num | AUX_ITEM_ADD_ON_CREATE; ;
break;}
case 14:
#line 194 "./aux-item-def.y"
#line 197 "./aux-item-def.y"
{ yyval.num = yyvsp[-1].num | AUX_ITEM_ADD_ON_MODIFY; ;
break;}
case 15:
#line 195 "./aux-item-def.y"
#line 198 "./aux-item-def.y"
{ yyval.num = 0; ;
break;}
case 19:
#line 203 "./aux-item-def.y"
#line 206 "./aux-item-def.y"
{
int found = 0;
......@@ -954,23 +957,23 @@ case 19:
;
break;}
case 20:
#line 277 "./aux-item-def.y"
#line 280 "./aux-item-def.y"
{ yyval.value.val.num = yyvsp[0].num; yyval.value.type = BOOLEAN; ;
break;}
case 21:
#line 278 "./aux-item-def.y"
#line 281 "./aux-item-def.y"
{ yyval.value.val.str = yyvsp[0].str; yyval.value.type = STRING; ;
break;}
case 22:
#line 279 "./aux-item-def.y"
#line 282 "./aux-item-def.y"
{ yyval.value.val.num = yyvsp[0].num; yyval.value.type = NUMBER; ;
break;}
case 23:
#line 280 "./aux-item-def.y"
#line 283 "./aux-item-def.y"
{ yyval.value.val.str = yyvsp[-2].str; yyval.value.type = ID;;
break;}
case 24:
#line 281 "./aux-item-def.y"
#line 284 "./aux-item-def.y"
{ YYERROR; ;
break;}
}
......@@ -1171,7 +1174,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;