Skip to content

Commit

Permalink
refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Apr 14, 2023
1 parent fb732ad commit 57971e9
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 253 deletions.
16 changes: 9 additions & 7 deletions logalert-x/Makefile.am
Expand Up @@ -2,7 +2,6 @@
ACLOCAL_AMFLAGS = -I m4
version=@VERSION@
COFLAGS=-z+05:30
DEFS = @DEFS@ -fno-strict-aliasing -Wno-implicit-function-declaration -Wno-unused-function -Wno-return-type
INSTALL_PROGRAM = ${INSTALL} -c
install_sh_PROGRAM = $(install_sh) -c
INSTALL_SCRIPT = ${INSTALL} -c
Expand Down Expand Up @@ -38,27 +37,30 @@ edit = sed \
-e 's,@DATE\@,$(DATE),g' \
-e 's,@prefix\@,$(prefix),g'

logalert_SOURCES = lex.c utils.c log.c parser.y process.c monitor.c action.c sig.c user.c main.c
logalert_SOURCES = lex.c utils.c log.c parser.y process.c monitor.c action.c log_sig.c user.c main.c
logalert_LDADD = @LEXLIB@ @LIBPCRE_LIBS@

logclient_SOURCES=logclient.c
logclient_CPPFLAGS=-DSERVER -Wno-empty-body -I/usr/include/qmail
logclient_CPPFLAGS=-DSERVER
logclient_LDADD = $(LIB_SSL) $(LIB_QMAIL)

logsrv_SOURCES=logsrv.c
logsrv_CPPFLAGS=-Wno-empty-body -I/usr/include/qmail
logsrv_LDADD = $(LIB_SSL) $(LIB_QMAIL) $(LIB_RPC)

rpclog_LDADD=$(LIB_RPC)
rpclog_CPPFLAGS=$(CPPFLAGS) $(CFLAGS)
rpclog_LDADD=$(LIB_RPC) $(LIB_QMAIL)

incrmesg_SOURCES=incrmesg.c
incrmesg_CPPFLAGS=-Wno-empty-body -I/usr/include/qmail
incrmesg_LDADD = $(LIB_QMAIL)

showbytes_SOURCES=showbytes.c
showbytes_CPPFLAGS=-Wno-empty-body -I/usr/include/qmail
showbytes_LDADD = $(LIB_QMAIL)

lex.o: lex.c
$(COMPILE) -Wno-implicit-function-declaration -Wno-unused-function -c lex.c -o lex.o
parser.o: parser.c
$(COMPILE) -Wno-implicit-function-declaration -Wno-unused-function -c parser.c -o parser.o

#$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- flex
lex.c: lex.l parser.h
$(LEX) $(LFLAGS) -o $@ lex.l parser.h
Expand Down
14 changes: 7 additions & 7 deletions logalert-x/configure.ac
Expand Up @@ -44,23 +44,23 @@ AC_TYPE_UID_T
case "$host" in

*-*-solaris*)
CPPFLAGS="$CPPFLAGS -DSOLARIS"
CFLAGS="$CFLAGS -O4 -Wall -fPIC"
CPPFLAGS="$CPPFLAGS -DSOLARIS -I/usr/include/qmail"
CFLAGS="$CFLAGS -O4 -Wall"
;;

*-*-sunos4.1.1*)
CPPFLAGS="$CPPFLAGS -DSUNOS4"
CFLAGS="$CFLAGS -O4 -Wall -fPIC"
CPPFLAGS="$CPPFLAGS -DSUNOS4 -I/usr/include/qmail"
CFLAGS="$CFLAGS -O4 -Wall"
;;

*-*-linux*)
CPPFLAGS="$CPPFLAGS -Dlint -DLINUX -Wall"
CFLAGS="$CFLAGS -O4 -fPIC -fpie -Wall -fno-strict-aliasing"
CPPFLAGS="$CPPFLAGS -Dlint -DLINUX -Wall -I/usr/include/qmail"
CFLAGS="$CFLAGS -O4 -Wall"
;;

*-*-freebsd*)
CPPFLAGS="$CPPFLAGS -DFREEBSD -I/usr/local/include -I/usr/local/include/qmail"
CFLAGS="$CFLAGS -O3 -Wall -fPIC"
CFLAGS="$CFLAGS -O3 -Wall"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
*-*-darwin*)
Expand Down
8 changes: 6 additions & 2 deletions logalert-x/incrmesg.c
@@ -1,5 +1,8 @@
/*
* $Log: incrmesg.c,v $
* Revision 1.11 2023-04-14 00:08:17+05:30 Cprogrammer
* refactored code
*
* Revision 1.10 2022-05-10 20:09:47+05:30 Cprogrammer
* use tcpopen from libqmail
*
Expand Down Expand Up @@ -31,7 +34,6 @@
* Initial revision
*
*/
#include <stdio.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -68,7 +70,7 @@
#define FATAL "incrmesg: fatal: "

#ifndef lint
static char rcsid[] = "$Id: incrmesg.c,v 1.10 2022-05-10 20:09:47+05:30 Cprogrammer Exp mbhangui $";
static char rcsid[] = "$Id: incrmesg.c,v 1.11 2023-04-14 00:08:17+05:30 Cprogrammer Exp mbhangui $";
#endif

struct msgtab
Expand Down Expand Up @@ -313,10 +315,12 @@ main(int argc, char **argv)
return (incrmesg(argv + optind));
}

#ifndef lint
void
getversion_incrmesg_c()
{
char *x;
x = rcsid;
x++;
}
#endif
2 changes: 1 addition & 1 deletion logalert-x/sig.c → logalert-x/log_sig.c
@@ -1,5 +1,5 @@
/*
* $Log: sig.c,v $
* $Log: log_sig.c,v $
* Revision 1.1 2013-05-15 00:34:35+05:30 Cprogrammer
* Initial revision
*
Expand Down
2 changes: 1 addition & 1 deletion logalert-x/sig.h → logalert-x/log_sig.h
@@ -1,5 +1,5 @@
/*
* $Log: sig.h,v $
* $Log: log_sig.h,v $
* Revision 1.1 2013-05-15 00:14:57+05:30 Cprogrammer
* Initial revision
*
Expand Down

0 comments on commit 57971e9

Please sign in to comment.