diff --git a/ChangeLog b/ChangeLog index 0458f507..b89f542f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ $Id$ v0.37.6 10-Aug-2003 + general: + Changed all Linux references into GNU/Linux. + Changed the address of the FSF in all sources. + Removed memwatch debugger. + v0.37.5 12-Jul-2003 - 10-Aug-2003 diff --git a/config.h.in b/config.h.in index 3c9e84a3..02af0c3f 100644 --- a/config.h.in +++ b/config.h.in @@ -8,9 +8,6 @@ #undef VERSION_REVISION #undef VERSION -/* Memory debugging */ -#undef MEMWATCH - /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF diff --git a/configure b/configure index 8c4fc6c5..684575a1 100755 --- a/configure +++ b/configure @@ -837,11 +837,6 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-memwatch MEMWATCH debugging - Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) @@ -1781,21 +1776,6 @@ fi CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes" -# Check whether --enable-memwatch or --disable-memwatch was given. -if test "${enable_memwatch+set}" = set; then - enableval="$enable_memwatch" - memwatch=$enableval -else - memwatch=no -fi; - -if test "$memwatch" = "yes"; then - cat >>confdefs.h <<\_ACEOF -#define MEMWATCH 1 -_ACEOF - -fi - cat >>confdefs.h <<_ACEOF #define RESTAMP_OLD_POSTINGS 21 _ACEOF diff --git a/configure.in b/configure.in index b13c526e..ad655251 100644 --- a/configure.in +++ b/configure.in @@ -52,13 +52,6 @@ AC_CHECK_PROG(ZIP, zip, zip) AC_PATH_PROG(CHOWN, chown, chown, /bin:/sbin:/usr/bin:/usr/sbin:) CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes" -dnl Additional commandline switches -AC_ARG_ENABLE(memwatch, [ --enable-memwatch MEMWATCH debugging], [ memwatch=$enableval ], [ memwatch=no ]) - -if test "$memwatch" = "yes"; then - AC_DEFINE(MEMWATCH) -fi - dnl Defines for MBSE BBS (must use tests or --enable-stuff later) AC_DEFINE_UNQUOTED(RESTAMP_OLD_POSTINGS, 21) AC_DEFINE(RESTAMP_FUTURE_POSTINGS) diff --git a/lib/FAQ b/lib/FAQ deleted file mode 100644 index a585c759..00000000 --- a/lib/FAQ +++ /dev/null @@ -1,106 +0,0 @@ -Frequently Asked Questions for memwatch - -Q. I'm not getting any log file! What's wrong?? - -A. Did you define MEMWATCH when compiling all files? - Did you include memwatch.h in all the files? - If you did, then...: - - Memwatch creates the file when it initializes. If you're not - getting the log file, it's because a) memwatch is not - initializing or b) it's initializing, but can't create the - file. - - Memwatch has two functions, mwInit() and mwTerm(), that - initialize and terminate memwatch, respectively. They are - nestable. You USUALLY don't need to call mwInit() and - mwTerm(), since memwatch will auto-initialize on the first - call to a memory function, and then add mwTerm() to the - atexit() list. - - You can call mwInit() and mwTerm() manually, if it's not - initializing properly or if your system doesn't support - atexit(). Call mwInit() as soon as you can, and mwTerm() at - the logical no-error ending of your program. Call mwAbort() - if the program is stopping due to an error; this will - terminate memwatch even if more than one call to mwTerm() is - outstanding. - - If you are using C++, remember that global and static C++ - objects constructors execute before main() when considering - where to put mwInit(). Also, their destructors execute after - main(). You may want to create a global object very early - with mwInit() in the constructor and mwTerm() in the - destructor. Too bad C++ does not guarantee initialization - order for global objects. - - If this didn't help, try adding a call to mwDoFlush(1) after - mwInit(). If THAT didn't help, then memwatch is unable to - create the log file. Check write permissions. - - If you can't use a log file, you can still use memwatch by - redirecting the output to a function of your choice. See the - next question. - -Q. I'd like memwatch's output to pipe to my fave debugger! How? - -A. Call mwSetOutFunc() with the addres of a "void func(int c)" - function. You should also consider doing something about - the ARI handler, see memwatch.h for more details about that. - -Q. Why isn't there any C++ support? - -A. Because C++ is for sissies! =) Just kidding. - C++ comes with overridable allocation/deallocation - built-in. You can define your own new/delete operators - for any class, and thus circumvent memwatch, or confuse - it to no end. Also, the keywords "new" and "delete" may - appear in declarations in C++, making the preprocessor - replacement approach shaky. You can do it, but it's not - very stable. - - If someone were to write a rock solid new/delete checker - for C++, there is no conflict with memwatch; use them both. - -Q. I'm getting "WILD free" errors, but the code is bug-free! - -A. If memwatch's free() recieves a pointer that wasn't allocated - by memwatch, a "WILD free" message appears. If the source of - the memory buffer is outside of memwatch (a non-standard - library function, for instance), you can use mwFree_() to - release it. mwFree_() calls free() on the pointer given if - memwatch can't recognize it, instead of blocking it. - - Another source of "WILD free" messages is that if memwatch - is terminated before all memory allocated is freed, memwatch - will have forgotten about it, and thus generate the errors. - This is commonly caused by having memwatch auto-initialize, - and then using atexit() to clean up. When auto-initializing, - memwatch registers mwTerm() with atexit(), but if mwTerm() - runs before all memory is freed, then you will get "unfreed" - and "WILD free" messages when your own atexit()-registered - cleanup code runs, and frees the memory. - -Q. I'm getting "unfreed" errors, but the code is bug-free! - -A. You can get erroneous "unfreed" messages if memwatch - terminates before all memory has been freed. Try using - mwInit() and mwTerm() instead of auto-initialization. - - If you _are_ using mwInit() and mwTerm(), it may be that - some code in your program executes before mwInit() or - after mwTerm(). Make sure that mwInit() is the first thing - executed, and mwTerm() the last. - -Q. When compiling memwatch I get these 'might get clobbered' - errors, and something about a longjmp() inside memwatch. - -A. You are using a non-Win32 platform, and most likely using - gcc or egcs, and is probably running with the highest - possible warning levels. This is a Good Thing. - - Unfortunately, it seems some compilers get a bit too - paranoid at those levels. There is nothing wrong with - memwatch's code. Nothing that matters will get - clobbered, if the compiler adheres to the ANSI C - standard. Just ignore the warnings. diff --git a/lib/Makefile b/lib/Makefile index f181cb7b..78228558 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,20 +33,17 @@ MBINET_HDRS = mbinet.h DIESEL_SRCS = diesel.c mbdiesel.c DIESEL_HDRS = diesel.h DIESEL_OBJS = diesel.o mbdiesel.o -MEMWATCH_SRCS = memwatch.c -MEMWATCH_OBJS = memwatch.o -MEMWATCH_HDRS = memwatch.h OTHER_HDRS = ansi.h bluewave.h libs.h mbse.h records.h structs.h users.h mberrors.h SRCS = ${CLCOMM_SRCS} ${COMMON_SRCS} ${DBASE_SRCS} ${MSGBASE_SRCS} ${MBINET_SRCS} \ - ${DIESEL_SRCS} ${MEMWATCH_SRCS} ${NODELIST_SRCS} + ${DIESEL_SRCS} ${NODELIST_SRCS} OBJS = ${CLCOMM_OBJS} ${COMMON_OBJS} ${DBASE_OBJS} ${MSGBASE_OBJS} ${MBINET_OBJS} \ - ${DIESEL_OBJS} ${MEMWATCH_OBJS} ${NODELIST_OBJS} + ${DIESEL_OBJS} ${NODELIST_OBJS} HDRS = ${CLCOMM_HDRS} ${COMMON_HDRS} ${DBASE_HDRS} ${MSGBASE_HDRS} ${MBINET_HDRS} \ - ${DIESEL_HDRS} ${MEMWATCH_HDRS} ${NODELIST_HDRS} ${OTHER_HDRS} -OTHER = Makefile README ftscprod.006 mkprod.awk FAQ README.memwatch USING test.c \ - memwatch.c.org README.diesel README.macro Diesel.doc nodelist.conf + ${DIESEL_HDRS} ${NODELIST_HDRS} ${OTHER_HDRS} +OTHER = Makefile README ftscprod.006 mkprod.awk \ + README.diesel README.macro Diesel.doc nodelist.conf TARGET = libclcomm.a libcommon.a libdbase.a libmsgbase.a libmbinet.a libdiesel.a \ - libmemwatch.a libnodelist.a + libnodelist.a ############################################################################# @@ -82,10 +79,6 @@ libdiesel.a: ${DIESEL_OBJS} ar r $@ $? ${RANLIB} $@ -libmemwatch.a: ${MEMWATCH_OBJS} - ar r $@ $? - ${RANLIB} $@ - libnodelist.a: ${NODELIST_OBJS} ar r $@ $? ${RANLIB} $@ @@ -124,56 +117,56 @@ depend: ftscprod.c # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -clcomm.o: ../config.h libs.h memwatch.h mberrors.h clcomm.h -client.o: ../config.h libs.h memwatch.h clcomm.h -crc.o: ../config.h libs.h memwatch.h clcomm.h -semafore.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h -signame.o: ../config.h libs.h memwatch.h clcomm.h -attach.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h -falists.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h -hdr.o: ../config.h libs.h memwatch.h structs.h common.h -parsedate.o: ../config.h libs.h memwatch.h structs.h common.h -rfcmsg.o: ../config.h libs.h memwatch.h structs.h users.h records.h common.h clcomm.h -unpacker.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h -batchrd.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h -ftn.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h dbftn.h common.h -pktname.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h -mangle.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h +clcomm.o: ../config.h libs.h mberrors.h clcomm.h +client.o: ../config.h libs.h clcomm.h +crc.o: ../config.h libs.h clcomm.h +semafore.o: ../config.h libs.h structs.h clcomm.h common.h +signame.o: ../config.h libs.h clcomm.h +attach.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h +falists.o: ../config.h libs.h structs.h clcomm.h common.h +hdr.o: ../config.h libs.h structs.h common.h +parsedate.o: ../config.h libs.h structs.h common.h +rfcmsg.o: ../config.h libs.h structs.h users.h records.h common.h clcomm.h +unpacker.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h +batchrd.o: ../config.h libs.h structs.h clcomm.h common.h +ftn.o: ../config.h libs.h structs.h users.h records.h clcomm.h dbftn.h common.h +pktname.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h +mangle.o: ../config.h libs.h structs.h clcomm.h common.h sectest.o: ../config.h libs.h structs.h common.h clcomm.h -dostran.o: ../config.h libs.h memwatch.h structs.h users.h records.h common.h -ftnmsg.o: ../config.h libs.h memwatch.h structs.h common.h clcomm.h -mbfile.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h -nodelock.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h -rawio.o: ../config.h libs.h memwatch.h structs.h common.h mberrors.h -strcasestr.o: ../config.h libs.h memwatch.h -execute.o: ../config.h libs.h memwatch.h structs.h clcomm.h mberrors.h common.h -expipe.o: ../config.h libs.h memwatch.h structs.h clcomm.h mberrors.h common.h -getheader.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h -noderecord.o: ../config.h libs.h memwatch.h structs.h common.h users.h records.h dbnode.h common.h -rfcaddr.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h -strutil.o: ../config.h libs.h memwatch.h structs.h common.h -faddr.o: ../config.h libs.h memwatch.h structs.h common.h -gmtoffset.o: ../config.h libs.h memwatch.h structs.h common.h -packet.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h dbnode.h -rfcdate.o: ../config.h libs.h memwatch.h structs.h common.h clcomm.h -term.o: ../config.h libs.h memwatch.h structs.h users.h ansi.h records.h common.h -endian.o: ../config.h libs.h memwatch.h structs.h common.h -dbcfg.o: ../config.h libs.h memwatch.h mbse.h structs.h users.h records.h mberrors.h dbcfg.h -dbdupe.o: ../config.h libs.h memwatch.h structs.h clcomm.h mberrors.h dbdupe.h -dbftn.o: ../config.h libs.h memwatch.h structs.h users.h records.h dbcfg.h dbftn.h -dbmsgs.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h dbcfg.h dbmsgs.h -dbnode.o: ../config.h libs.h memwatch.h structs.h common.h users.h records.h clcomm.h dbcfg.h dbnode.h -dbtic.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h dbcfg.h dbtic.h -dbuser.o: ../config.h libs.h memwatch.h structs.h users.h records.h dbcfg.h dbuser.h -jammsg.o: ../config.h libs.h memwatch.h clcomm.h msgtext.h msg.h jam.h jammsg.h -msg.o: ../config.h libs.h memwatch.h msgtext.h msg.h jammsg.h -msgtext.o: ../config.h libs.h memwatch.h msgtext.h msg.h -nntp.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h mbinet.h -pop3.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h mbinet.h -smtp.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h mbinet.h -diesel.o: ../config.h libs.h memwatch.h diesel.h -mbdiesel.o: ../config.h libs.h memwatch.h structs.h users.h records.h common.h clcomm.h diesel.h -memwatch.o: ../config.h libs.h memwatch.h +proglock.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h +dostran.o: ../config.h libs.h structs.h users.h records.h common.h +ftnmsg.o: ../config.h libs.h structs.h common.h clcomm.h +mbfile.o: ../config.h libs.h structs.h clcomm.h common.h +nodelock.o: ../config.h libs.h structs.h clcomm.h common.h +rawio.o: ../config.h libs.h structs.h common.h mberrors.h +strcasestr.o: ../config.h libs.h +execute.o: ../config.h libs.h structs.h clcomm.h mberrors.h common.h +expipe.o: ../config.h libs.h structs.h clcomm.h mberrors.h common.h +getheader.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h +noderecord.o: ../config.h libs.h structs.h common.h users.h records.h dbnode.h common.h +rfcaddr.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h +strutil.o: ../config.h libs.h structs.h common.h +faddr.o: ../config.h libs.h structs.h common.h +gmtoffset.o: ../config.h libs.h structs.h common.h +packet.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h dbnode.h +rfcdate.o: ../config.h libs.h structs.h common.h clcomm.h +term.o: ../config.h libs.h structs.h users.h ansi.h records.h common.h +endian.o: ../config.h libs.h structs.h common.h +dbcfg.o: ../config.h libs.h mbse.h structs.h users.h records.h mberrors.h dbcfg.h +dbdupe.o: ../config.h libs.h structs.h clcomm.h mberrors.h dbdupe.h +dbftn.o: ../config.h libs.h structs.h users.h records.h dbcfg.h dbftn.h +dbmsgs.o: ../config.h libs.h structs.h users.h records.h clcomm.h dbcfg.h dbmsgs.h +dbnode.o: ../config.h libs.h structs.h common.h users.h records.h clcomm.h dbcfg.h dbnode.h +dbtic.o: ../config.h libs.h structs.h users.h records.h clcomm.h dbcfg.h dbtic.h +dbuser.o: ../config.h libs.h structs.h users.h records.h dbcfg.h dbuser.h +jammsg.o: ../config.h libs.h clcomm.h msgtext.h msg.h jam.h jammsg.h +msg.o: ../config.h libs.h msgtext.h msg.h jammsg.h +msgtext.o: ../config.h libs.h msgtext.h msg.h +nntp.o: ../config.h libs.h structs.h users.h records.h clcomm.h mbinet.h +pop3.o: ../config.h libs.h structs.h users.h records.h clcomm.h mbinet.h +smtp.o: ../config.h libs.h structs.h users.h records.h clcomm.h mbinet.h +diesel.o: ../config.h libs.h diesel.h +mbdiesel.o: ../config.h libs.h structs.h users.h records.h common.h clcomm.h diesel.h nodelist.o: ../config.h libs.h structs.h users.h records.h clcomm.h common.h mberrors.h nodelist.h -ftscprod.o: ../config.h libs.h memwatch.h structs.h common.h +ftscprod.o: ../config.h libs.h structs.h common.h # End of generated dependencies diff --git a/lib/README.memwatch b/lib/README.memwatch deleted file mode 100644 index a15ca538..00000000 --- a/lib/README.memwatch +++ /dev/null @@ -1,98 +0,0 @@ -README for MEMWATCH 2.62 - - This file should be enough to get you started, and should be - enough for small projects. For more info, see the files USING - and the FAQ. If this is not enough, see memwatch.h, which is - well documented. - - If you choose to use memwatch to validate your projects, I - would love to hear about it. Please drop me a line at - johan@link-data.com about the project itself, the hardware, - operating system, compiler and any URL(s) you feel is - appropriate. I will then post it at: - - http://www.link-data.com/memwatchusers.html - -***** To run the test program: - - Look at the source code for test.c first. It does some really - nasty things, and I want you to be aware of that. If memwatch - can't capture SIGSEGV (General Protection Fault for Windoze), - your program will dump core (crash for Windoze). - - Once you've done that, you can build the test program. - - Linux and other *nixes with gcc: - - gcc -o test -DMEMWATCH -DMEMWATCH_STDIO test.c memwatch.c - - Windows 95, Windows NT with MS Visual C++: - - cl -DMEMWATCH -DMEMWATCH_STDIO test.c memwatch.c - - Then simply run the test program. - - ./test - - -***** Quick-start instructions: - - 1. Make sure that memwatch.h is included in all of the - source code files. If you have an include file that - all of the source code uses, you might be able to include - memwatch.h from there. - - 2. Recompile the program with MEMWATCH defined. See your - compiler's documentation if you don't know how to do this. - The usual switch looks like "-DMEMWATCH". To have MEMWATCH - use stderr for some output (like, "Abort, Retry, Ignore?"), - please also define MW_STDIO (or MEMWATCH_STDIO, same thing). - - 3. Run the program and examine the output in the - log file "memwatch.log". If you didn't get a log file, - you probably didn't do step 1 and 2 correctly, or your - program crashed before memwatch flushed the file buffer. - To have memwatch _always_ flush the buffer, add a call - to "mwDoFlush(1)" at the top of your main function. - - 4. There is no fourth step... but remember that there - are limits to what memwatch can do, and that you need - to be aware of them: - -***** Limits to memwatch: - - Memwatch cannot catch all wild pointer writes. It can catch - those it could make itself due to your program trashing - memwatch's internal data structures. It can catch, sort of, - wild writes into No Mans Land buffers (see the header file for - more info). Anything else and you're going to get core dumped, - or data corruption if you're lucky. - - There are other limits of course, but that one is the most - serious one, and the one that you're likely to be suffering - from. - -***** Can use memwatch with XXXXX? - - Probably the answer is yes. It's been tested with several - different platforms and compilers. It may not work on yours - though... but there's only one way to find out. - -***** Need more assistance? - - I don't want e-mail on "how to program in C", or "I've got a - bug, help me". I _do_ want you to send email to me if you - find a bug in memwatch, or if it won't compile cleanly on your - system (assuming it's an ANSI-C compiler of course). - - If you need help with using memwatch, read the header file. - If, after reading the header file, you still can't resolve the - problem, please mail me with the details. - - I can be reached at "johan@link-data.com". - - The latest version of memwatch should be found at - "http://www.link-data.com/". - - Johan Lindh - diff --git a/lib/USING b/lib/USING deleted file mode 100644 index 571fde7b..00000000 --- a/lib/USING +++ /dev/null @@ -1,169 +0,0 @@ -Using memwatch -============== - -What is it? - - Memwatch is primarily a memory leak detector for C. Besides - detecting leaks, it can do a bunch of other stuff, but lets - stay to the basics. If you _really_ want to know all the - gory details, you should check out the header file, - memwatch.h, and the source code. It's actually got some - comments! (Whoa, what a concept!) - -How do I get the latest version? - - http://www.link-data.com/sourcecode.html - ftp://ftp.link-data.com/pub/memwatch/ - -How does it work? - - Using the C preprocessor, memwatch replaces all your - programs calls to ANSI C memory allocation functions with - calls to it's own functions, which keeps a record of all - allocations. - - Memwatch is very unobtrusive; unless the define MEMWATCH is - defined, memwatch removes all traces of itself from the - code (using the preprocessor). - - Memwatch normally writes it's data to the file - memwatch.log, but this can be overridden; see the section - on I/O, later. - -Initialization and cleanup - - In order to do it's work in a timely fashion, memwatch - needs to do some startup and cleanup work. mwInit() - initializes memwatch and mwTerm() terminates it. Memwatch - can auto-initialize, and will do so if you don't call - mwInit() yourself. If this is the case, memwatch will use - atexit() to register mwTerm() to the atexit-queue. - - The auto-init technique has a caveat; if you are using - atexit() yourself to do cleanup work, memwatch may - terminate before your program is done. To be on the safe - side, use mwInit() and mwTerm(). - - mwInit() and mwTerm() is nestable, so you can call mwInit() - several times, requiring mwTerm() to be called an equal - number of times to terminate memwatch. - - In case of the program aborting in a controlled way, you - may want to call mwAbort() instead of mwTerm(). mwAbort() - will terminate memwatch even if there are outstanding calls - to mwTerm(). - -I/O operations - - During normal operations, memwatch creates a file named - memwatch.log. Sometimes, memwatch.log can't be created; - then memwatch tries to create files name memwatNN.log, - where NN is between 01 and 99. If that fails, no log will - be produced. - - If you can't use a file log, or don't want to, no worry. - Just call mwSetOutFunc() with the address of a "void - func(int c)" function, and all output will be directed - there, character by character. - - Memwatch also has an Abort/Retry/Ignore handler that is - used when an ASSERT or VERIFY fails. The default handler - does no I/O, but automatically aborts the program. You can - use any handler you want; just send the address of a "int - func(const char*)" to mwSetAriFunc(). For more details on - that, see memwatch.h. - -TRACE/ASSERT/VERIFY macros - - Memwatch defines (if not already defined) the macros TRACE, - ASSERT and VERIFY. If you are already using macros with - these names, memwatch 2.61 and later will not override - them. Memwatch 2.61 and later will also always define the - macros mwTRACE, mwASSERT and mwVERIFY, so you can use these - to make sure you're talking to memwatch. Versions previous - to 2.61 will OVERRIDE TRACE, ASSERT and VERIFY. - - To make sure that existing TRACE, ASSERT and VERIFY macros - are preserved, you can define MW_NOTRACE, MW_NOASSERT and - MW_NOVERIFY. All versions of memwatch will abide by these. - -Stress-testing the application - - You can simulate low-memory conditions using mwLimit(). - mwLimit() takes the maximum number of bytes to be - allocated; when the limit is hit, allocation requests will - fail, and a "limit" message will be logged. - - If you hit a real low-memory situation, memwatch logs that - too. Memwatch itself has some reserve memory tucked away so - it should continue running even in the worst conditions. - -Hunting down wild writes and other Nasty Things - - Wild writes are usually caused by using pointers that arent - initialized, or that were initialized, but then the memory - they points to is moved or freed. The best way to avoid - these kind of problems is to ALWAYS initialize pointers to - NULL, and after freeing a memory buffer, setting all - pointers that pointed to it to NULL. - - To aid in tracking down uninitialized pointers memwatch - zaps all memory with certain values. Recently allocated - memory (unless calloc'd, of course), contains 0xFE. - Recently freed memory contains 0xFD. So if your program - crashes when using memwatch and not without memwatch, it's - most likely because you are not initializing your allocated - buffers, or using the buffers after they've been freed. - - In the event that a wild pointer should damage memwatch's - internal data structures, memwatch employs checksums, - multiple copies of some values, and can also repair it's - own data structures. - - If you are a paranoid person, and as programmer you should - be, you can use memwatch's mwIsReadAddr() and - mwIsSafeAddr() functions to check the accessibility of - memory. These are implemented for both ANSI C systems and - Win32 systems. Just put an mwASSERT() around the check and - forget about it. - -Can I help? - - Well, sure. For instance, I like memwatch to compile - without any warnings or errors. If you are using an ANSI C - compliant compiler, and are getting warnings or errors, - please mail me the details and instructions on how to fix - them, if you can. - - Another thing you can do if you decide to use memwatch is - to mail me the name of the project(s) (and URL, if any), - hardware and operating system, compiler and what user - (organization). I will then post this info on the list of - memwatch users. - (http://www.link-data.com/memwatchusers.html) - -Top five problems using memwatch - - 5. Passed a non-memwatch allocated pointer to memwatch's - free(). Symtom: Causes an erroneous "WILD free" log - entry to appear. Cure: Either include memwatch.h for - the file that allocates, or use mwFree_() to free it. - - 4. Relied on auto-initialization when using atexit(). - Symptom: Causes incorrect "unfreed" and "WILD free" - messages. Cure: Use mwInit() and mwTerm(). - - 3. Forgot to include memwatch.h in all files. Symptom: - Tends to generate "WILD free" and "unfreed" messages. - Cure: Make sure to include memwatch.h! - - 2. No write permissions in currect directory. Symptom: - Seems like memwatch 'just aint working'. Cure: Use - mwSetOutFunc() to redirect output. - - ...and the number one problem is... - - 1. Didn't define MEMWATCH when compiling. Symptom: - Memwatch dutifully disables itself. Cure: Try adding - -DMEMWATCH to the command line. - diff --git a/lib/attach.c b/lib/attach.c index 73653a53..d28eb53e 100644 --- a/lib/attach.c +++ b/lib/attach.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/batchrd.c b/lib/batchrd.c index 495d5aac..58cdf3ef 100644 --- a/lib/batchrd.c +++ b/lib/batchrd.c @@ -31,7 +31,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "common.h" diff --git a/lib/clcomm.c b/lib/clcomm.c index e7c794c7..a3de49f4 100644 --- a/lib/clcomm.c +++ b/lib/clcomm.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "mberrors.h" #include "clcomm.h" @@ -143,9 +142,6 @@ void ExitClient(int errcode) if (pbuff) free(pbuff); -#ifdef MEMWATCH - mwTerm(); -#endif exit(errcode); } diff --git a/lib/client.c b/lib/client.c index e3572731..9e52987b 100644 --- a/lib/client.c +++ b/lib/client.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "clcomm.h" static int sock = -1; /* Unix Datagram socket */ diff --git a/lib/crc.c b/lib/crc.c index a87b70f9..46698cfb 100644 --- a/lib/crc.c +++ b/lib/crc.c @@ -31,7 +31,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "clcomm.h" diff --git a/lib/dbcfg.c b/lib/dbcfg.c index 991058f6..9a6fdb41 100644 --- a/lib/dbcfg.c +++ b/lib/dbcfg.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "mbse.h" #include "structs.h" #include "users.h" @@ -67,9 +66,6 @@ void LoadConfig(void) printf("Please run mbsetup to create configuration file.\n"); printf("Or check that your MBSE_ROOT variable is set to the BBS path!\n\n"); free(FileName); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_CONFIG_ERROR); } diff --git a/lib/dbdupe.c b/lib/dbdupe.c index 606379d2..065686c2 100644 --- a/lib/dbdupe.c +++ b/lib/dbdupe.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "mberrors.h" diff --git a/lib/dbftn.c b/lib/dbftn.c index 301560a7..27907722 100644 --- a/lib/dbftn.c +++ b/lib/dbftn.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/dbmsgs.c b/lib/dbmsgs.c index 5286f96b..ab243ba2 100644 --- a/lib/dbmsgs.c +++ b/lib/dbmsgs.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/dbnode.c b/lib/dbnode.c index c8b4e126..931655ca 100644 --- a/lib/dbnode.c +++ b/lib/dbnode.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" #include "users.h" diff --git a/lib/dbtic.c b/lib/dbtic.c index 1a3b0a96..3ff8e54a 100644 --- a/lib/dbtic.c +++ b/lib/dbtic.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/dbuser.c b/lib/dbuser.c index 8eb8e2a5..9e5e7761 100644 --- a/lib/dbuser.c +++ b/lib/dbuser.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/diesel.c b/lib/diesel.c index 68878ad5..65561b79 100644 --- a/lib/diesel.c +++ b/lib/diesel.c @@ -328,7 +328,6 @@ documented above, in outstring. #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "diesel.h" /* Get(, ) allocates a new and diff --git a/lib/dostran.c b/lib/dostran.c index 1ebfe2bc..581a3433 100644 --- a/lib/dostran.c +++ b/lib/dostran.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/endian.c b/lib/endian.c index 3a1a56b2..43193021 100644 --- a/lib/endian.c +++ b/lib/endian.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" diff --git a/lib/execute.c b/lib/execute.c index 4859cb6b..a6fc9f7b 100644 --- a/lib/execute.c +++ b/lib/execute.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "mberrors.h" diff --git a/lib/expipe.c b/lib/expipe.c index 763625eb..c5bcf287 100644 --- a/lib/expipe.c +++ b/lib/expipe.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "mberrors.h" diff --git a/lib/faddr.c b/lib/faddr.c index e6eecc0f..2776bc4a 100644 --- a/lib/faddr.c +++ b/lib/faddr.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" diff --git a/lib/falists.c b/lib/falists.c index c57efd20..c54db28f 100644 --- a/lib/falists.c +++ b/lib/falists.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "common.h" diff --git a/lib/ftn.c b/lib/ftn.c index aa4d7d25..ba17fb76 100644 --- a/lib/ftn.c +++ b/lib/ftn.c @@ -33,7 +33,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/ftnmsg.c b/lib/ftnmsg.c index df07f4f4..4b7d83c0 100644 --- a/lib/ftnmsg.c +++ b/lib/ftnmsg.c @@ -31,7 +31,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" #include "clcomm.h" diff --git a/lib/getheader.c b/lib/getheader.c index 88db43c1..02ead182 100644 --- a/lib/getheader.c +++ b/lib/getheader.c @@ -32,7 +32,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/gmtoffset.c b/lib/gmtoffset.c index 4240176a..bb58f034 100644 --- a/lib/gmtoffset.c +++ b/lib/gmtoffset.c @@ -31,7 +31,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" diff --git a/lib/hdr.c b/lib/hdr.c index df6e3ca9..4cee5848 100644 --- a/lib/hdr.c +++ b/lib/hdr.c @@ -31,7 +31,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" diff --git a/lib/jammsg.c b/lib/jammsg.c index e09ecb30..872308e5 100644 --- a/lib/jammsg.c +++ b/lib/jammsg.c @@ -36,7 +36,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "clcomm.h" #include "msgtext.h" #include "msg.h" diff --git a/lib/mangle.c b/lib/mangle.c index 00865c0f..5b557758 100644 --- a/lib/mangle.c +++ b/lib/mangle.c @@ -32,7 +32,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "common.h" diff --git a/lib/mbdiesel.c b/lib/mbdiesel.c index 3d19e73e..da55e919 100644 --- a/lib/mbdiesel.c +++ b/lib/mbdiesel.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/mberrors.h b/lib/mberrors.h index e41fd47e..51757d98 100644 --- a/lib/mberrors.h +++ b/lib/mberrors.h @@ -41,7 +41,6 @@ #define MBERR_GENERAL 131 /* General error */ #define MBERR_TIMEOUT 132 /* Timeout error */ #define MBERR_TTYIO 200 /* Base for ttyio errors */ -#define MBERR_MEMWATCH 255 /* Memwatch error */ #define MBERR_EXTERNAL 256 /* Status external prog + 256 */ #endif diff --git a/lib/mbfile.c b/lib/mbfile.c index c3e1e0c0..edfa2dc4 100644 --- a/lib/mbfile.c +++ b/lib/mbfile.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "common.h" diff --git a/lib/memwatch.c b/lib/memwatch.c deleted file mode 100644 index fb5f55d7..00000000 --- a/lib/memwatch.c +++ /dev/null @@ -1,2355 +0,0 @@ -/* -** MEMWATCH.C -** Nonintrusive ANSI C memory leak / overwrite detection -** Copyright (C) 1992-99 Johan Lindh -** All rights reserved. -** Version 2.62 -** -** 920810 JLI [1.00] -** 920830 JLI [1.10 double-free detection] -** 920912 JLI [1.15 mwPuts, mwGrab/Drop, mwLimit] -** 921022 JLI [1.20 ASSERT and VERIFY] -** 921105 JLI [1.30 C++ support and TRACE] -** 921116 JLI [1.40 mwSetOutFunc] -** 930215 JLI [1.50 modified ASSERT/VERIFY] -** 930327 JLI [1.51 better auto-init & PC-lint support] -** 930506 JLI [1.55 MemWatch class, improved C++ support] -** 930507 JLI [1.60 mwTest & CHECK()] -** 930809 JLI [1.65 Abort/Retry/Ignore] -** 930820 JLI [1.70 data dump when unfreed] -** 931016 JLI [1.72 modified C++ new/delete handling] -** 931108 JLI [1.77 mwSetAssertAction() & some small changes] -** 940110 JLI [1.80 no-mans-land alloc/checking] -** 940328 JLI [2.00 version 2.0 rewrite] -** Improved NML (no-mans-land) support. -** Improved performance (especially for free()ing!). -** Support for 'read-only' buffers (checksums) -** ^^ NOTE: I never did this... maybe I should? -** FBI (free'd block info) tagged before freed blocks -** Exporting of the mwCounter variable -** mwBreakOut() localizes debugger support -** Allocation statistics (global, per-module, per-line) -** Self-repair ability with relinking -** 950913 JLI [2.10 improved garbage handling] -** 951201 JLI [2.11 improved auto-free in emergencies] -** 960125 JLI [X.01 implemented auto-checking using mwAutoCheck()] -** 960514 JLI [2.12 undefining of existing macros] -** 960515 JLI [2.13 possibility to use default new() & delete()] -** 960516 JLI [2.20 suppression of file flushing on unfreed msgs] -** 960516 JLI [2.21 better support for using MEMWATCH with DLL's] -** 960710 JLI [X.02 multiple logs and mwFlushNow()] -** 960801 JLI [2.22 merged X.01 version with current] -** 960805 JLI [2.30 mwIsXXXXAddr() to avoid unneeded GP's] -** 960805 JLI [2.31 merged X.02 version with current] -** 961002 JLI [2.32 support for realloc() + fixed STDERR bug] -** 961222 JLI [2.40 added mwMark() & mwUnmark()] -** 970101 JLI [2.41 added over/underflow checking after failed ASSERT/VERIFY] -** 970113 JLI [2.42 added support for PC-Lint 7.00g] -** 970207 JLI [2.43 added support for strdup()] -** 970209 JLI [2.44 changed default filename to lowercase] -** 970405 JLI [2.45 fixed bug related with atexit() and some C++ compilers] -** 970723 JLI [2.46 added MW_ARI_NULLREAD flag] -** 970813 JLI [2.47 stabilized marker handling] -** 980317 JLI [2.48 ripped out C++ support; wasn't working good anyway] -** 980318 JLI [2.50 improved self-repair facilities & SIGSEGV support] -** 980417 JLI [2.51 more checks for invalid addresses] -** 980512 JLI [2.52 moved MW_ARI_NULLREAD to occur before aborting] -** 990112 JLI [2.53 added check for empty heap to mwIsOwned] -** 990217 JLI [2.55 improved the emergency repairs diagnostics and NML] -** 990224 JLI [2.56 changed ordering of members in structures] -** 990303 JLI [2.57 first maybe-fixit-for-hpux test] -** 990516 JLI [2.58 added 'static' to the definition of mwAutoInit] -** 990517 JLI [2.59 fixed some high-sensitivity warnings] -** 990610 JLI [2.60 fixed some more high-sensitivity warnings] -** 990715 JLI [2.61 changed TRACE/ASSERT/VERIFY macro names] -** 991001 JLI [2.62 added CHECK_BUFFER() and mwTestBuffer()] -*/ - -#include "../config.h" - -#ifdef MEMWATCH - -#define __MEMWATCH_C 1 - -#ifdef MW_NOCPP -#define MEMWATCH_NOCPP -#endif -#ifdef MW_STDIO -#define MEMWATCH_STDIO -#endif - -/*********************************************************************** -** Include files -***********************************************************************/ - -#include "libs.h" -#include "memwatch.h" - - -/*********************************************************************** -** Defines & other weird stuff -***********************************************************************/ - -/*lint -save -e767 */ -#define MW_VERSION "2.62" /* the current version number */ -#define CHKVAL(mw) (0xFE0180L^(long)mw->count^(long)mw->size^(long)mw->line) -#define FLUSH() mwFlush() -#define TESTS(f,l) if(mwTestAlways) (void)mwTestNow(f,l,1) -#define PRECHK 0x01234567L -#define POSTCHK 0x76543210L -/*lint -restore */ - -#define MW_NML 0x0001 - -#ifdef _MSC_VER -#define COMMIT "c" /* Microsoft C requires the 'c' to perform as desired */ -#else -#define COMMIT "" /* Normal ANSI */ -#endif /* _MSC_VER */ - -#ifdef __cplusplus -#define CPPTEXT "++" -#else -#define CPPTEXT "" -#endif /* __cplusplus */ - -#ifdef MEMWATCH_STDIO -#define mwSTDERR stderr -#else -#define mwSTDERR mwLog -#endif - -/*********************************************************************** -** Defines to read/write 32 bit words in a portable way -** Note: Assumes that a 'long int' is 32 bits, and a 'char' is 8 bits. -***********************************************************************/ - -typedef unsigned char mwBYTE; -typedef unsigned long mwDWORD; - -#define GETDWORD(l, cp) { \ - register mwBYTE *t_cp = (mwBYTE *)(cp); \ - (l) = ((mwDWORD)t_cp[0] << 24) \ - | ((mwDWORD)t_cp[1] << 16) \ - | ((mwDWORD)t_cp[2] << 8) \ - | ((mwDWORD)t_cp[3]) \ - ; \ -} - -#define PUTDWORD(l, cp) { \ - register mwDWORD t_l = (mwDWORD)(l); \ - register mwBYTE *t_cp = (mwBYTE *)(cp); \ - *t_cp++ = (mwBYTE)(t_l >> 24); \ - *t_cp++ = (mwBYTE)(t_l >> 16); \ - *t_cp++ = (mwBYTE)(t_l >> 8); \ - *t_cp = (mwBYTE)t_l; \ -} - -/*********************************************************************** -** Typedefs & structures -***********************************************************************/ - -/* main data holding area, precedes actual allocation */ -typedef struct mwData_ mwData; -struct mwData_ { - mwData* prev; /* previous allocation in chain */ - mwData* next; /* next allocation in chain */ - const char* file; /* file name where allocated */ - long count; /* action count */ - long check; /* integrity check value */ -#if 0 - long crc; /* data crc value */ -#endif - size_t size; /* size of allocation */ - int line; /* line number where allocated */ - unsigned flag; /* flag word */ - }; - -/* statistics structure */ -typedef struct mwStat_ mwStat; -struct mwStat_ { - mwStat* next; /* next statistic buffer */ - const char* file; - long total; /* total bytes allocated */ - long num; /* total number of allocations */ - long max; /* max allocated at one time */ - long curr; /* current allocations */ - int line; - }; - -/* grabbing structure, 1K in size */ -typedef struct mwGrabData_ mwGrabData; -struct mwGrabData_ { - mwGrabData* next; - int type; - char blob[ 1024 - sizeof(mwGrabData*) - sizeof(int) ]; - }; - -typedef struct mwMarker_ mwMarker; -struct mwMarker_ { - void *host; - char *text; - mwMarker *next; - int level; - }; - -/*********************************************************************** -** Static variables -***********************************************************************/ - -static int mwInited = 0; -static int mwInfoWritten = 0; -static int mwUseAtexit = 0; -static FILE* mwLog = NULL; -static int mwFlushing = 0; -static int mwStatLevel = MW_STAT_DEFAULT; -static int mwNML = MW_NML_DEFAULT; -static int mwFBI = 0; -static long mwAllocLimit = 0L; -static int mwUseLimit = 0; - -static long mwNumCurAlloc = 0L; -static mwData* mwHead = NULL; -static mwData* mwTail = NULL; - -static void (*mwOutFunction)(int) = NULL; -static int (*mwAriFunction)(const char*) = NULL; -static int mwAriAction = MW_ARI_ABORT; - -static char mwPrintBuf[MW_TRACE_BUFFER+8]; - -static unsigned long mwCounter = 0L; -static long mwErrors = 0L; - -static int mwTestFlags = 0; -static int mwTestAlways = 0; - -static FILE* mwLogB1 = NULL; -static int mwFlushingB1 = 0; - -static mwStat* mwStatList = NULL; -static long mwStatTotAlloc = 0L; -static long mwStatMaxAlloc = 0L; -static long mwStatNumAlloc = 0L; -static long mwStatCurAlloc = 0L; -static long mwNmlNumAlloc = 0L; -static long mwNmlCurAlloc = 0L; - -static mwGrabData* mwGrabList = NULL; -static long mwGrabSize = 0L; - -static void * mwLastFree[MW_FREE_LIST]; -static const char *mwLFfile[MW_FREE_LIST]; -static int mwLFline[MW_FREE_LIST]; -static int mwLFcur = 0; - -static mwMarker* mwFirstMark = NULL; - -static FILE* mwLogB2 = NULL; -static int mwFlushingB2 = 0; - -/*********************************************************************** -** Static function declarations -***********************************************************************/ - -static void mwAutoInit( void ); -static FILE* mwLogR( void ); -static void mwLogW( FILE* ); -static int mwFlushR( void ); -static void mwFlushW( int ); -static void mwFlush( void ); -static void mwIncErr( void ); -static void mwUnlink( mwData*, const char* file, int line ); -static int mwRelink( mwData*, const char* file, int line ); -static int mwIsHeapOK( mwData *mw ); -static int mwIsOwned( mwData* mw, const char* file, int line ); -static int mwTestBuf( mwData* mw, const char* file, int line ); -static void mwDefaultOutFunc( int ); -static void mwWrite( const char* format, ... ); -static void mwLogFile( const char* name ); -static size_t mwFreeUp( size_t, int ); -static const void *mwTestMem( const void *, unsigned, int ); -static int mwStrCmpI( const char *s1, const char *s2 ); -static int mwTestNow( const char *file, int line, int always_invoked ); -static void mwDropAll( void ); -static const char *mwGrabType( int type ); -static unsigned mwGrab_( unsigned kb, int type, int silent ); -static unsigned mwDrop_( unsigned kb, int type, int silent ); -static int mwARI( const char* text ); -static void mwStatReport( void ); -static mwStat* mwStatGet( const char*, int, int ); -static void mwStatAlloc( size_t, const char*, int ); -static void mwStatFree( size_t, const char*, int ); - -/*********************************************************************** -** System functions -***********************************************************************/ - -void mwInit( void ) { - time_t tid; - - if( mwInited++ > 0 ) return; - - /* start a log if none is running */ - if( mwLogR() == NULL ) mwLogFile( "/opt/mbse/log/memwatch.log" ); - if( mwLogR() == NULL ) { - int i; - char buf[32]; - /* oops, could not open it! */ - /* probably because it's already open */ - /* so we try some other names */ - for( i=1; i<100; i++ ) { - sprintf( buf, "memwat%02d.log", i ); - mwLogFile( buf ); - if( mwLogR() != NULL ) break; - } - } - - /* initialize the statistics */ - mwStatList = NULL; - mwStatTotAlloc = 0L; - mwStatCurAlloc = 0L; - mwStatMaxAlloc = 0L; - mwStatNumAlloc = 0L; - mwNmlCurAlloc = 0L; - mwNmlNumAlloc = 0L; - - /* write informational header if needed */ - if( !mwInfoWritten ) { - mwInfoWritten = 1; - (void) time( &tid ); - mwWrite( - "\n=============" - " MEMWATCH " MW_VERSION " Copyright (C) 1992-1999 Johan Lindh " - "=============\n"); - mwWrite( "\nStarted at %s\n", ctime( &tid ) ); - -/**************************************************************** Generic */ -#ifdef mwNew - mwWrite( "C++ new/delete tracking enabled\n" ); -#endif /* mwNew */ -#ifdef __STDC__ - mwWrite( "Compiled as standard ANSI C\n" ); -#endif /* __STDC__ */ -/**************************************************************** Generic */ - -/************************************************************ Microsoft C */ -#ifdef _MSC_VER - mwWrite( "Compiled using Microsoft C" CPPTEXT - " %d.%02d\n", _MSC_VER / 100, _MSC_VER % 100 ); -#endif /* _MSC_VER */ -/************************************************************ Microsoft C */ - -/************************************************************** Borland C */ -#ifdef __BORLANDC__ - mwWrite( "Compiled using Borland C" -#ifdef __cplusplus - "++ %d.%01d\n", __BCPLUSPLUS__/0x100, (__BCPLUSPLUS__%0x100)/0x10 ); -#else - " %d.%01d\n", __BORLANDC__/0x100, (__BORLANDC__%0x100)/0x10 ); -#endif /* __cplusplus */ -#endif /* __BORLANDC__ */ -/************************************************************** Borland C */ - -/************************************************************** Watcom C */ -#ifdef __WATCOMC__ - mwWrite( "Compiled using Watcom C %d.%02d ", - __WATCOMC__/100, __WATCOMC__%100 ); -#ifdef __FLAT__ - mwWrite( "(32-bit flat model)" ); -#endif /* __FLAT__ */ - mwWrite( "\n" ); -#endif /* __WATCOMC__ */ -/************************************************************** Watcom C */ - - mwWrite( "\n" ); - FLUSH(); - } - - if( mwUseAtexit ) (void) atexit( mwAbort ); - return; - } - -void mwAbort( void ) { - mwData *mw; - mwMarker *mrk; - char *data; - time_t tid; - int c, i, j; - int errors; - long chk; - - tid = time( NULL ); - mwWrite( "\nStopped at %s\n", ctime( &tid) ); - - if( !mwInited ) - mwWrite( "internal: mwAbort(): MEMWATCH not initialized!\n" ); - - /* release the grab list */ - mwDropAll(); - - /* report mwMarked items */ - while( mwFirstMark ) { - mrk = mwFirstMark->next; - mwWrite( "mark: %p: %s\n", mwFirstMark->host, mwFirstMark->text ); - free( mwFirstMark->text ); - free( mwFirstMark ); - mwFirstMark = mrk; - mwErrors ++; - } - - /* release all still allocated memory */ - errors = 0; - while( mwHead != NULL && errors < 3 ) { - if( !mwIsOwned(mwHead, __FILE__, __LINE__ ) ) { - if( errors < 3 ) - { - errors ++; - mwWrite( "internal: NML/unfreed scan restarting\n" ); - FLUSH(); - mwHead = mwHead; - continue; - } - mwWrite( "internal: NML/unfreed scan aborted, heap too damaged\n" ); - FLUSH(); - break; - } - mwFlushW(0); - if( !(mwHead->flag & MW_NML) ) { - mwErrors++; - data = ((char*)(mwHead+1)); - mwWrite( "unfreed: <%ld> %s(%d), %ld bytes at %p ", - mwHead->count, mwHead->file, mwHead->line, (long)mwHead->size, data+sizeof(long) ); - GETDWORD( chk, data ); - if( chk != PRECHK ) { - mwWrite( "[underflowed] "); - FLUSH(); - } - GETDWORD( chk, (data+sizeof(long)+mwHead->size) ); - if( chk != POSTCHK ) { - mwWrite( "[overflowed] "); - FLUSH(); - } - mwWrite( " \t{" ); - j = 16; if( mwHead->size < 16 ) j = (int) mwHead->size; - for( i=0;i<16;i++ ) { - if( i 126 ) c = '.'; - mwWrite( "%c", c ); - } - mwWrite( "}\n" ); - mw = mwHead; - mwUnlink( mw, __FILE__, __LINE__ ); - free( mw ); - } - else { - data = ((char*)(mwHead+1)) + sizeof(long); - if( mwTestMem( data, mwHead->size, MW_VAL_NML ) ) { - mwErrors++; - mwWrite( "wild pointer: <%ld> NoMansLand %p alloc'd at %s(%d)\n", - mwHead->count, data + sizeof(long), mwHead->file, mwHead->line ); - FLUSH(); - } - mwNmlNumAlloc --; - mwNmlCurAlloc -= mwHead->size; - mw = mwHead; - mwUnlink( mw, __FILE__, __LINE__ ); - free( mw ); - } - } - - if( mwNmlNumAlloc ) mwWrite("internal: NoMansLand block counter %ld, not zero\n", mwNmlNumAlloc ); - if( mwNmlCurAlloc ) mwWrite("internal: NoMansLand byte counter %ld, not zero\n", mwNmlCurAlloc ); - - /* report statistics */ - mwStatReport(); - FLUSH(); - - mwInited = 0; - mwHead = mwTail = NULL; - if( mwErrors ) - fprintf(mwSTDERR,"MEMWATCH detected %ld anomalies\n",mwErrors); - mwLogFile( NULL ); - mwErrors = 0; - } - -void mwTerm( void ) { - if( mwInited == 1 ) - { - mwAbort(); - return; - } - if( !mwInited ) - mwWrite("internal: mwTerm(): MEMWATCH has not been started!\n"); - else - mwInited --; - } - -void mwStatistics( int level ) -{ - mwAutoInit(); - if( level<0 ) level=0; - if( mwStatLevel != level ) - { - mwWrite( "statistics: now collecting on a %s basis\n", - level<1?"global":(level<2?"module":"line") ); - mwStatLevel = level; - } -} - -void mwAutoCheck( int onoff ) { - mwAutoInit(); - mwTestAlways = onoff; - if( onoff ) mwTestFlags = MW_TEST_ALL; - } - -void mwSetOutFunc( void (*func)(int) ) { - mwAutoInit(); - mwOutFunction = func; - } - -int mwTest( const char *file, int line, int items ) { - mwAutoInit(); - mwTestFlags = items; - return mwTestNow( file, line, 0 ); - } - -/* -** Returns zero if there are no errors. -** Returns nonzero if there are errors. -*/ -int mwTestBuffer( const char *file, int line, void *p ) { - mwData* mw; - - mwAutoInit(); - - /* do the quick ownership test */ - mw = (mwData*) ( ((char*)p)-sizeof(long)-sizeof(mwData) ); - - if( mwIsOwned( mw, file, line ) ) { - return mwTestBuf( mw, file, line ); - } - return 1; - } - -void mwBreakOut( const char* cause ) { - fprintf(mwSTDERR, "breakout: %s\n", cause); - mwWrite("breakout: %s\n", cause ); - return; - } - -/* -** 981217 JLI: is it possible that ->next is not always set? -*/ -void * mwMark( void *p, const char *desc, const char *file, unsigned line ) { - mwMarker *mrk; - unsigned n, isnew; - char *buf; - int tot, oflow = 0; - char wherebuf[128]; - - mwAutoInit(); - TESTS(NULL,0); - - if( desc == NULL ) desc = "unknown"; - if( file == NULL ) file = "unknown"; - - tot = sprintf( wherebuf, "%.48s called from %s(%d)", desc, file, line ); - if( tot >= (int)sizeof(wherebuf) ) { wherebuf[sizeof(wherebuf)-1] = 0; oflow = 1; } - - if( p == NULL ) { - mwWrite("mark: %s(%d), no mark for NULL:'%s' may be set\n", file, line, desc ); - return p; - } - - if( mwFirstMark != NULL && !mwIsReadAddr( mwFirstMark, sizeof( mwMarker ) ) ) - { - mwWrite("mark: %s(%d), mwFirstMark (%p) is trashed, can't mark for %s\n", - file, line, mwFirstMark, desc ); - return p; - } - - for( mrk=mwFirstMark; mrk; mrk=mrk->next ) - { - if( mrk->next != NULL && !mwIsReadAddr( mrk->next, sizeof( mwMarker ) ) ) - { - mwWrite("mark: %s(%d), mark(%p)->next(%p) is trashed, can't mark for %s\n", - file, line, mrk, mrk->next, desc ); - return p; - } - if( mrk->host == p ) break; - } - - if( mrk == NULL ) { - isnew = 1; - mrk = (mwMarker*) malloc( sizeof( mwMarker ) ); - if( mrk == NULL ) { - mwWrite("mark: %s(%d), no mark for %p:'%s', out of memory\n", file, line, p, desc ); - return p; - } - mrk->next = NULL; - n = 0; - } - else { - isnew = 0; - n = strlen( mrk->text ); - } - - n += strlen( wherebuf ); - buf = (char*) malloc( n+3 ); - if( buf == NULL ) { - if( isnew ) free( mrk ); - mwWrite("mark: %s(%d), no mark for %p:'%s', out of memory\n", file, line, p, desc ); - return p; - } - - if( isnew ) { - memcpy( buf, wherebuf, n+1 ); - mrk->next = mwFirstMark; - mrk->host = p; - mrk->text = buf; - mrk->level = 1; - mwFirstMark = mrk; - } - else { - strcpy( buf, mrk->text ); - strcat( buf, ", " ); - strcat( buf, wherebuf ); - free( mrk->text ); - mrk->text = buf; - mrk->level ++; - } - - if( oflow ) { - mwIncErr(); - mwTrace( " [WARNING: OUTPUT BUFFER OVERFLOW - SYSTEM UNSTABLE]\n" ); - } - return p; - } - -void* mwUnmark( void *p, const char *file, unsigned line ) { - mwMarker *mrk, *prv; - mrk = mwFirstMark; - prv = NULL; - while( mrk ) { - if( mrk->host == p ) { - if( mrk->level < 2 ) { - if( prv ) prv->next = mrk->next; - else mwFirstMark = mrk->next; - free( mrk->text ); - free( mrk ); - return p; - } - mrk->level --; - return p; - } - prv = mrk; - mrk = mrk->next; - } - mwWrite("mark: %s(%d), no mark found for %p\n", file, line, p ); - return p; - } - -/*********************************************************************** -** Safe memory checkers -** -** Using ifdefs, implement the operating-system specific mechanism -** of identifying a piece of memory as legal to access with read -** and write priviliges. Default: return nonzero for non-NULL pointers. -***********************************************************************/ - -static char mwDummy( char c ) -{ - return c; -} - -#ifndef MW_SAFEADDR -#ifdef WIN32 -#define MW_SAFEADDR -#define WIN32_LEAN_AND_MEAN -#include -int mwIsReadAddr( const void *p, unsigned len ) -{ - if( p == NULL ) return 0; - if( IsBadReadPtr(p,len) ) return 0; - return 1; -} -int mwIsSafeAddr( void *p, unsigned len ) -{ - /* NOTE: For some reason, under Win95 the IsBad... */ - /* can return false for invalid pointers. */ - if( p == NULL ) return 0; - if( IsBadReadPtr(p,len) || IsBadWritePtr(p,len) ) return 0; - return 1; -} -#endif /* WIN32 */ -#endif /* MW_SAFEADDR */ - -#ifndef MW_SAFEADDR -#ifdef SIGSEGV -#define MW_SAFEADDR - -typedef void (*mwSignalHandlerPtr)( int ); -mwSignalHandlerPtr mwOldSIGSEGV = (mwSignalHandlerPtr) 0; -jmp_buf mwSIGSEGVjump; -static void mwSIGSEGV( int n ); - -static void mwSIGSEGV( int n ) -{ - longjmp( mwSIGSEGVjump, 1 ); -} - -int mwIsReadAddr( const void *p, unsigned len ) -{ - const char *ptr; - - if( p == NULL ) return 0; - if( !len ) return 1; - - /* set up to catch the SIGSEGV signal */ - mwOldSIGSEGV = signal( SIGSEGV, mwSIGSEGV ); - - if( setjmp( mwSIGSEGVjump ) ) - { - signal( SIGSEGV, mwOldSIGSEGV ); - return 0; - } - - /* read all the bytes in the range */ - ptr = (const char *)p; - ptr += len; - - /* the reason for this rather strange construct is that */ - /* we want to keep the number of used parameters and locals */ - /* to a minimum. if we use len for a counter gcc will complain */ - /* it may get clobbered by longjmp() at high warning levels. */ - /* it's a harmless warning, but this way we don't have to see it. */ - do - { - ptr --; - if( *ptr == 0x7C ) (void) mwDummy( (char)0 ); - } while( ptr != p ); - - /* remove the handler */ - signal( SIGSEGV, mwOldSIGSEGV ); - - return 1; -} -int mwIsSafeAddr( void *p, unsigned len ) -{ - char *ptr; - - if( p == NULL ) return 0; - if( !len ) return 1; - - /* set up to catch the SIGSEGV signal */ - mwOldSIGSEGV = signal( SIGSEGV, mwSIGSEGV ); - - if( setjmp( mwSIGSEGVjump ) ) - { - signal( SIGSEGV, mwOldSIGSEGV ); - return 0; - } - - /* read and write-back all the bytes in the range */ - ptr = (char *)p; - ptr += len; - - /* the reason for this rather strange construct is that */ - /* we want to keep the number of used parameters and locals */ - /* to a minimum. if we use len for a counter gcc will complain */ - /* it may get clobbered by longjmp() at high warning levels. */ - /* it's a harmless warning, but this way we don't have to see it. */ - do - { - ptr --; - *ptr = mwDummy( *ptr ); - } while( ptr != p ); - - /* remove the handler */ - signal( SIGSEGV, mwOldSIGSEGV ); - - return 1; -} -#endif /* SIGSEGV */ -#endif /* MW_SAFEADDR */ - -#ifndef MW_SAFEADDR -int mwIsReadAddr( const void *p, unsigned len ) -{ - if( p == NULL ) return 0; - if( len == 0 ) return 1; - return 1; -} -int mwIsSafeAddr( void *p, unsigned len ) -{ - if( p == NULL ) return 0; - if( len == 0 ) return 1; - return 1; -} -#endif - -/*********************************************************************** -** Abort/Retry/Ignore handlers -***********************************************************************/ - -static int mwARI( const char *estr ) { - char inbuf[81]; - int c; - fprintf(mwSTDERR, "\n%s\nMEMWATCH: Abort, Retry or Ignore? ", estr); - (void) fgets(inbuf,sizeof(inbuf),stdin); - for( c=0; inbuf[c] && inbuf[c] <= ' '; c++ ) ; - c = inbuf[c]; - if( c == 'R' || c == 'r' ) { - mwBreakOut( estr ); - return MW_ARI_RETRY; - } - if( c == 'I' || c == 'i' ) return MW_ARI_IGNORE; - return MW_ARI_ABORT; - } - -/* standard ARI handler (exported) */ -int mwAriHandler( const char *estr ) { - mwAutoInit(); - return mwARI( estr ); - } - -/* used to set the ARI function */ -void mwSetAriFunc( int (*func)(const char *) ) { - mwAutoInit(); - mwAriFunction = func; - } - -/*********************************************************************** -** Allocation handlers -***********************************************************************/ - -void* mwMalloc( size_t size, const char* file, int line) { - size_t needed; - mwData *mw; - char *ptr; - void *p; - - mwAutoInit(); - - TESTS(file,line); - - mwCounter ++; - needed = sizeof(mwData) + sizeof(long) + sizeof(long) + size; - - /* if this allocation would violate the limit, fail it */ - if( mwUseLimit && ((long)size + mwStatCurAlloc > mwAllocLimit) ) { - mwWrite( "limit fail: <%ld> %s(%d), %ld wanted %ld available\n", - mwCounter, file, line, (long)size, mwAllocLimit - mwStatCurAlloc ); - mwIncErr(); - FLUSH(); - return NULL; - } - - mw = (mwData*) malloc( needed ); - if( mw == NULL ) { - if( mwFreeUp(needed,0) >= needed ) { - mw = (mwData*) malloc(needed); - if( mw == NULL ) { - mwWrite( "internal: mwFreeUp(%u) reported success, but malloc() fails\n", needed ); - mwIncErr(); - FLUSH(); - } - } - if( mw == NULL ) { - mwWrite( "fail: <%ld> %s(%d), %ld wanted %ld allocated\n", - mwCounter, file, line, (long)size, mwStatCurAlloc ); - mwIncErr(); - FLUSH(); - return NULL; - } - } - - mw->count = mwCounter; - mw->prev = NULL; - mw->next = mwHead; - mw->file = file; - mw->size = size; - mw->line = line; - mw->flag = 0; - mw->check = CHKVAL(mw); - - if( mwHead ) mwHead->prev = mw; - mwHead = mw; - if( mwTail == NULL ) mwTail = mw; - - ptr = (char*)(void*)(mw+1); - PUTDWORD( PRECHK, ptr ); /* '*(long*)ptr = PRECHK;' */ - ptr += sizeof(long); - p = ptr; - memset( ptr, MW_VAL_NEW, size ); - ptr += size; - PUTDWORD( POSTCHK, ptr ); /* '*(long*)ptr = POSTCHK;' */ - - mwNumCurAlloc ++; - mwStatCurAlloc += (long) size; - mwStatTotAlloc += (long) size; - if( mwStatCurAlloc > mwStatMaxAlloc ) - mwStatMaxAlloc = mwStatCurAlloc; - mwStatNumAlloc ++; - - if( mwStatLevel ) mwStatAlloc( size, file, line ); - - return p; - } - -void* mwRealloc( void *p, size_t size, const char* file, int line) { - int oldUseLimit, i; - mwData *mw; - char *ptr; - - mwAutoInit(); - - if( p == NULL ) return mwMalloc( size, file, line ); - if( size == 0 ) { mwFree( p, file, line ); return NULL; } - - /* do the quick ownership test */ - mw = (mwData*) ( ((char*)p)-sizeof(long)-sizeof(mwData) ); - if( mwIsOwned( mw, file, line ) ) { - - /* if the buffer is an NML, treat this as a double-free */ - if( mw->flag & MW_NML ) - { - mwIncErr(); - if( *((unsigned char*)(mw+1)+sizeof(long)) != MW_VAL_NML ) - { - mwWrite( "internal: <%ld> %s(%d), no-mans-land MW-%p is corrupted\n", - mwCounter, file, line, mw ); - } - goto check_dbl_free; - } - - /* if this allocation would violate the limit, fail it */ - if( mwUseLimit && ((long)size + mwStatCurAlloc - (long)mw->size > mwAllocLimit) ) { - TESTS(file,line); - mwCounter ++; - mwWrite( "limit fail: <%ld> %s(%d), %ld wanted %ld available\n", - mwCounter, file, line, (unsigned long)size - mw->size, mwAllocLimit - mwStatCurAlloc ); - mwIncErr(); - FLUSH(); - return NULL; - } - - /* fake realloc operation */ - oldUseLimit = mwUseLimit; - mwUseLimit = 0; - ptr = (char*) mwMalloc( size, file, line ); - if( ptr != NULL ) { - if( size < mw->size ) - memcpy( ptr, p, size ); - else - memcpy( ptr, p, mw->size ); - mwFree( p, file, line ); - } - mwUseLimit = oldUseLimit; - return (void*) ptr; - } - - /* Unknown pointer! */ - - /* using free'd pointer? */ -check_dbl_free: - for(i=0;i %s(%d), %p was" - " freed from %s(%d)\n", - mwCounter, file, line, p, - mwLFfile[i], mwLFline[i] ); - FLUSH(); - return NULL; - } - } - - /* some weird pointer */ - mwIncErr(); - mwWrite( "realloc: <%ld> %s(%d), unknown pointer %p\n", - mwCounter, file, line, p ); - FLUSH(); - return NULL; - } - -char *mwStrdup( char* str, const char* file, int line ) { - size_t len; - char *newstring; - if( str == NULL ) { - mwIncErr(); - mwWrite( "strdup: <%ld> %s(%d), strdup(NULL) called\n", - mwCounter, file, line ); - FLUSH(); - return NULL; - } - len = strlen( str ) + 1; - newstring = (char*) mwMalloc( len, file, line ); - if( newstring != NULL ) memcpy( newstring, str, len ); - return newstring; - } - -void mwFree( void* p, const char* file, int line ) { - int i; - mwData* mw; - char buffer[ sizeof(mwData) + sizeof(long) + 64 ]; - - TESTS(file,line); - - /* this code is in support of C++ delete */ - if( file == NULL ) { - mwFree_( p ); - return; - } - - mwAutoInit(); - mwCounter ++; - - /* on NULL free, write a warning and return */ - if( p == NULL ) { - mwWrite( "NULL free: <%ld> %s(%d), NULL pointer free'd\n", - mwCounter, file, line ); - FLUSH(); - return; - } - - /* do the quick ownership test */ - mw = (mwData*) ( ((char*)p)-sizeof(long)-sizeof(mwData) ); - - if( mwIsOwned( mw, file, line ) ) { - (void) mwTestBuf( mw, file, line ); - - /* if the buffer is an NML, treat this as a double-free */ - if( mw->flag & MW_NML ) - { - if( *((unsigned char*)(mw+1)+sizeof(long)) != MW_VAL_NML ) - { - mwWrite( "internal: <%ld> %s(%d), no-mans-land MW-%p is corrupted\n", - mwCounter, file, line, mw ); - } - goto check_dbl_free; - } - - /* update the statistics */ - mwNumCurAlloc --; - mwStatCurAlloc -= (long) mw->size; - if( mwStatLevel ) mwStatFree( mw->size, mw->file, mw->line ); - - /* we should either free the allocation or keep it as NML */ - if( mwNML ) { - mw->flag |= MW_NML; - mwNmlNumAlloc ++; - mwNmlCurAlloc += (long) mw->size; - memset( (char*)(mw+1)+sizeof(long), MW_VAL_NML, mw->size ); - } - else { - /* unlink the allocation, and enter the post-free data */ - mwUnlink( mw, file, line ); - memset( mw, MW_VAL_DEL, - mw->size + sizeof(mwData)+sizeof(long)+sizeof(long) ); - if( mwFBI ) { - memset( mw, '.', sizeof(mwData) + sizeof(long) ); - sprintf( buffer, "FBI<%ld>%s(%d)", mwCounter, file, line ); - strncpy( (char*)(void*)mw, buffer, sizeof(mwData) + sizeof(long) ); - } - free( mw ); - } - - /* add the pointer to the last-free track */ - mwLFfile[ mwLFcur ] = file; - mwLFline[ mwLFcur ] = line; - mwLastFree[ mwLFcur++ ] = p; - if( mwLFcur == MW_FREE_LIST ) mwLFcur = 0; - - return; - } - - /* check for double-freeing */ -check_dbl_free: - for(i=0;i %s(%d), %p was" - " freed from %s(%d)\n", - mwCounter, file, line, p, - mwLFfile[i], mwLFline[i] ); - FLUSH(); - return; - } - } - - /* some weird pointer... block the free */ - mwIncErr(); - mwWrite( "WILD free: <%ld> %s(%d), unknown pointer %p\n", - mwCounter, file, line, p ); - FLUSH(); - return; - } - -void* mwCalloc( size_t a, size_t b, const char *file, int line ) { - void *p; - size_t size = a * b; - p = mwMalloc( size, file, line ); - if( p == NULL ) return NULL; - memset( p, 0, size ); - return p; - } - -void mwFree_( void *p ) { - TESTS(NULL,0); - free(p); - } - -void* mwMalloc_( size_t size ) { - TESTS(NULL,0); - return malloc( size ); - } - -void* mwRealloc_( void *p, size_t size ) { - TESTS(NULL,0); - return realloc( p, size ); - } - -void* mwCalloc_( size_t a, size_t b ) { - TESTS(NULL,0); - return calloc( a, b ); - } - -void mwFlushNow( void ) { - if( mwLogR() ) fflush( mwLogR() ); - return; - } - -void mwDoFlush( int onoff ) { - mwFlushW( onoff<1?0:onoff ); - if( onoff ) if( mwLogR() ) fflush( mwLogR() ); - return; - } - -void mwLimit( long lim ) { - TESTS(NULL,0); - mwWrite("limit: old limit = "); - if( !mwAllocLimit ) mwWrite( "none" ); - else mwWrite( "%ld bytes", mwAllocLimit ); - mwWrite( ", new limit = "); - if( !lim ) { - mwWrite( "none\n" ); - mwUseLimit = 0; - } - else { - mwWrite( "%ld bytes\n", lim ); - mwUseLimit = 1; - } - mwAllocLimit = lim; - FLUSH(); - } - -void mwSetAriAction( int action ) { - TESTS(NULL,0); - mwAriAction = action; - return; - } - -int mwAssert( int exp, const char *exps, const char *fn, int ln ) { - int i; - char buffer[MW_TRACE_BUFFER+8]; - TESTS(fn,ln); - if( exp ) return 0; - mwAutoInit(); - mwIncErr(); - mwCounter++; - mwWrite( "assert trap: <%ld> %s(%d), %s\n", mwCounter, fn, ln, exps ); - if( mwAriFunction != NULL ) { - sprintf( buffer, "MEMWATCH: assert trap: %s(%d), %s", fn, ln, exps ); - i = (*mwAriFunction)(buffer); - switch( i ) { - case MW_ARI_IGNORE: - mwWrite( "assert trap: <%ld> IGNORED - execution continues\n", mwCounter ); - return 0; - case MW_ARI_RETRY: - mwWrite( "assert trap: <%ld> RETRY - executing again\n", mwCounter ); - return 1; - } - } - else { - if( mwAriAction & MW_ARI_IGNORE ) { - mwWrite( "assert trap: <%ld> AUTO IGNORED - execution continues\n", mwCounter ); - return 0; - } - fprintf(mwSTDERR,"\nMEMWATCH: assert trap: %s(%d), %s\n", fn, ln, exps ); - } - - FLUSH(); - (void) mwTestNow( fn, ln, 1 ); - FLUSH(); - - if( mwAriAction & MW_ARI_NULLREAD ) { - /* This is made in an attempt to kick in */ - /* any debuggers or OS stack traces */ - FLUSH(); - /*lint -save -e413 */ - i = *((int*)NULL); - mwDummy( (char)i ); - /*lint -restore */ - } - - exit(255); - /* NOT REACHED - the return statement is in to keep */ - /* stupid compilers from squeaking about differing return modes. */ - /* Smart compilers instead say 'code unreachable...' */ - /*lint -save -e527 */ - return 0; - /*lint -restore */ - } - -int mwVerify( int exp, const char *exps, const char *fn, int ln ) { - int i; - char buffer[MW_TRACE_BUFFER+8]; - TESTS(fn,ln); - if( exp ) return 0; - mwAutoInit(); - mwIncErr(); - mwCounter++; - mwWrite( "verify trap: <%ld> %s(%d), %s\n", mwCounter, fn, ln, exps ); - if( mwAriFunction != NULL ) { - sprintf( buffer, "MEMWATCH: verify trap: %s(%d), %s", fn, ln, exps ); - i = (*mwAriFunction)(buffer); - if( i == 0 ) { - mwWrite( "verify trap: <%ld> IGNORED - execution continues\n", mwCounter ); - return 0; - } - if( i == 1 ) { - mwWrite( "verify trap: <%ld> RETRY - executing again\n", mwCounter ); - return 1; - } - } - else { - if( mwAriAction & MW_ARI_NULLREAD ) { - /* This is made in an attempt to kick in */ - /* any debuggers or OS stack traces */ - FLUSH(); - /*lint -save -e413 */ - i = *((int*)NULL); - mwDummy( (char)i ); - /*lint -restore */ - } - if( mwAriAction & MW_ARI_IGNORE ) { - mwWrite( "verify trap: <%ld> AUTO IGNORED - execution continues\n", mwCounter ); - return 0; - } - fprintf(mwSTDERR,"\nMEMWATCH: verify trap: %s(%d), %s\n", fn, ln, exps ); - } - FLUSH(); - (void) mwTestNow( fn, ln, 1 ); - FLUSH(); - exit(255); - /* NOT REACHED - the return statement is in to keep */ - /* stupid compilers from squeaking about differing return modes. */ - /* Smart compilers instead say 'code unreachable...' */ - /*lint -save -e527 */ - return 0; - /*lint -restore */ - } - -void mwTrace( const char *format, ... ) { - int tot, oflow = 0; - va_list mark; - - mwAutoInit(); - TESTS(NULL,0); - if( mwOutFunction == NULL ) mwOutFunction = mwDefaultOutFunc; - - va_start( mark, format ); - tot = vsprintf( mwPrintBuf, format, mark ); - va_end( mark ); - if( tot >= MW_TRACE_BUFFER ) { mwPrintBuf[MW_TRACE_BUFFER] = 0; oflow = 1; } - for(tot=0;mwPrintBuf[tot];tot++) - (*mwOutFunction)( mwPrintBuf[tot] ); - if( oflow ) { - mwIncErr(); - mwTrace( " [WARNING: OUTPUT BUFFER OVERFLOW - SYSTEM UNSTABLE]\n" ); - } - - FLUSH(); - } - - -/*********************************************************************** -** Grab & Drop -***********************************************************************/ - -unsigned mwGrab( unsigned kb ) { - TESTS(NULL,0); - return mwGrab_( kb, MW_VAL_GRB, 0 ); - } - -unsigned mwDrop( unsigned kb ) { - TESTS(NULL,0); - return mwDrop_( kb, MW_VAL_GRB, 0 ); - } - -static void mwDropAll() { - TESTS(NULL,0); - (void) mwDrop_( 0, MW_VAL_GRB, 0 ); - (void) mwDrop_( 0, MW_VAL_NML, 0 ); - if( mwGrabList != NULL ) - mwWrite( "internal: the grab list is not empty after mwDropAll()\n"); - } - -static const char *mwGrabType( int type ) { - switch( type ) { - case MW_VAL_GRB: - return "grabbed"; - case MW_VAL_NML: - return "no-mans-land"; - default: - /* do nothing */ - ; - } - return ""; - } - -static unsigned mwGrab_( unsigned kb, int type, int silent ) { - unsigned i = kb; - mwGrabData *gd; - if( !kb ) i = kb = 65000U; - - for(;kb;kb--) { - if( mwUseLimit && - (mwStatCurAlloc + mwGrabSize + (long)sizeof(mwGrabData) > mwAllocLimit) ) { - if( !silent ) { - mwWrite("grabbed: all allowed memory to %s (%u kb)\n", - mwGrabType(type), i-kb); - FLUSH(); - } - return i-kb; - } - gd = (mwGrabData*) malloc( sizeof(mwGrabData) ); - if( gd == NULL ) { - if( !silent ) { - mwWrite("grabbed: all available memory to %s (%u kb)\n", - mwGrabType(type), i-kb); - FLUSH(); - } - return i-kb; - } - mwGrabSize += (long) sizeof(mwGrabData); - gd->next = mwGrabList; - memset( gd->blob, type, sizeof(gd->blob) ); - gd->type = type; - mwGrabList = gd; - } - if( !silent ) { - mwWrite("grabbed: %u kilobytes of %s memory\n", i, mwGrabType(type) ); - FLUSH(); - } - return i; - } - -static unsigned mwDrop_( unsigned kb, int type, int silent ) { - unsigned i = kb; - mwGrabData *gd,*tmp,*pr; - const void *p; - - if( mwGrabList == NULL && kb == 0 ) return 0; - if( !kb ) i = kb = 60000U; - - pr = NULL; - gd = mwGrabList; - for(;kb;) { - if( gd == NULL ) { - if( i-kb > 0 && !silent ) { - mwWrite("dropped: all %s memory (%u kb)\n", mwGrabType(type), i-kb); - FLUSH(); - } - return i-kb; - } - if( gd->type == type ) { - if( pr ) pr->next = gd->next; - kb --; - tmp = gd; - if( mwGrabList == gd ) mwGrabList = gd->next; - gd = gd->next; - p = mwTestMem( tmp->blob, sizeof( tmp->blob ), type ); - if( p != NULL ) { - mwWrite( "wild pointer: <%ld> %s memory hit at %p\n", - mwCounter, mwGrabType(type), p ); - FLUSH(); - } - mwGrabSize -= (long) sizeof(mwGrabData); - free( tmp ); - } - else { - pr = gd; - gd = gd->next; - } - } - if( !silent ) { - mwWrite("dropped: %u kilobytes of %s memory\n", i, mwGrabType(type) ); - FLUSH(); - } - return i; - } - -/*********************************************************************** -** No-Mans-Land -***********************************************************************/ - -void mwNoMansLand( int level ) { - mwAutoInit(); - TESTS(NULL,0); - switch( level ) { - case MW_NML_NONE: - (void) mwDrop_( 0, MW_VAL_NML, 0 ); - break; - case MW_NML_FREE: - break; - case MW_NML_ALL: - (void) mwGrab_( 0, MW_VAL_NML, 0 ); - break; - default: - return; - } - mwNML = level; - } - -/*********************************************************************** -** Static functions -***********************************************************************/ - -static void mwAutoInit( void ) -{ - if( mwInited ) return; - mwUseAtexit = 1; - mwInit(); - return; -} - -static FILE *mwLogR() { - if( (mwLog == mwLogB1) && (mwLog == mwLogB2) ) return mwLog; - if( mwLog == mwLogB1 ) mwLogB2 = mwLog; - if( mwLog == mwLogB2 ) mwLogB1 = mwLog; - if( mwLogB1 == mwLogB2 ) mwLog = mwLogB1; - if( (mwLog == mwLogB1) && (mwLog == mwLogB2) ) { - mwWrite("internal: log file handle damaged and recovered\n"); - FLUSH(); - return mwLog; - } - fprintf(mwSTDERR,"\nMEMWATCH: log file handle destroyed, using mwSTDERR\n" ); - mwLog = mwLogB1 = mwLogB2 = mwSTDERR; - return mwSTDERR; - } - -static void mwLogW( FILE *p ) { - mwLog = mwLogB1 = mwLogB2 = p; - } - -static int mwFlushR() { - if( (mwFlushing == mwFlushingB1) && (mwFlushing == mwFlushingB2) ) return mwFlushing; - if( mwFlushing == mwFlushingB1 ) mwFlushingB2 = mwFlushing; - if( mwFlushing == mwFlushingB2 ) mwFlushingB1 = mwFlushing; - if( mwFlushingB1 == mwFlushingB2 ) mwFlushing = mwFlushingB1; - if( (mwFlushing == mwFlushingB1) && (mwFlushing == mwFlushingB2) ) { - mwWrite("internal: flushing flag damaged and recovered\n"); - FLUSH(); - return mwFlushing; - } - mwWrite("internal: flushing flag destroyed, so set to true\n"); - mwFlushing = mwFlushingB1 = mwFlushingB2 = 1; - return 1; - } - -static void mwFlushW( int n ) { - mwFlushing = mwFlushingB1 = mwFlushingB2 = n; - } - -static void mwIncErr() { - mwErrors++; - mwFlushW( mwFlushR()+1 ); - FLUSH(); - } - -static void mwFlush() { - if( mwLogR() == NULL ) return; -#ifdef MW_FLUSH - fflush( mwLogR() ); -#else - if( mwFlushR() ) fflush( mwLogR() ); -#endif - return; - } - -static void mwUnlink( mwData* mw, const char* file, int line ) { - if( mw->prev == NULL ) { - if( mwHead != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link1 NULL, but not head\n", - mwCounter, file, line, mw ); - mwHead = mw->next; - } - else { - if( mw->prev->next != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link1 failure\n", - mwCounter, file, line, mw ); - else mw->prev->next = mw->next; - } - if( mw->next == NULL ) { - if( mwTail != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link2 NULL, but not tail\n", - mwCounter, file, line, mw ); - mwTail = mw->prev; - } - else { - if( mw->next->prev != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link2 failure\n", - mwCounter, file, line, mw ); - else mw->next->prev = mw->prev; - } - } - -/* -** Relinking tries to repair a damaged mw block. -** Returns nonzero if it thinks it successfully -** repaired the heap chain. -*/ -static int mwRelink( mwData* mw, const char* file, int line ) { - int fails; - mwData *mw1, *mw2; - long count, size; - mwStat *ms; - - if( file == NULL ) file = "unknown"; - - if( mw == NULL ) { - mwWrite("relink: cannot repair MW at NULL\n"); - FLUSH(); - goto emergency; - } - - if( !mwIsSafeAddr(mw, sizeof(mwData)) ) { - mwWrite("relink: MW-%p is a garbage pointer\n"); - FLUSH(); - goto emergency; - } - - mwWrite("relink: <%ld> %s(%d) attempting to repair MW-%p...\n", mwCounter, file, line, mw ); - FLUSH(); - fails = 0; - - /* Repair from head */ - if( mwHead != mw ) { - if( !mwIsSafeAddr( mwHead, sizeof(mwData) ) ) { - mwWrite("relink: failed for MW-%p; head pointer destroyed\n", mw ); - FLUSH(); - goto emergency; - } - for( mw1=mwHead; mw1; mw1=mw1->next ) { - if( mw1->next == mw ) { - mw->prev = mw1; - break; - } - if( mw1->next && - ( !mwIsSafeAddr(mw1->next, sizeof(mwData)) || mw1->next->prev != mw1) ) { - mwWrite("relink: failed for MW-%p; forward chain fragmented at MW-%p: 'next' is %p\n", mw, mw1, mw1->next ); - FLUSH(); - goto emergency; - } - } - if( mw1 == NULL ) { - mwWrite("relink: MW-%p not found in forward chain search\n", mw ); - FLUSH(); - fails ++; - } - } - else - { - mwWrite( "relink: MW-%p is the head (first) allocation\n", mw ); - if( mw->prev != NULL ) - { - mwWrite( "relink: MW-%p prev pointer is non-NULL, you have a wild pointer\n", mw ); - mw->prev = NULL; - } - } - - /* Repair from tail */ - if( mwTail != mw ) { - if( !mwIsSafeAddr( mwTail, sizeof(mwData) ) ) { - mwWrite("relink: failed for MW-%p; tail pointer destroyed\n", mw ); - FLUSH(); - goto emergency; - } - for( mw1=mwTail; mw1; mw1=mw1->prev ) { - if( mw1->prev == mw ) { - mw->next = mw1; - break; - } - if( mw1->prev && (!mwIsSafeAddr(mw1->prev, sizeof(mwData)) || mw1->prev->next != mw1) ) { - mwWrite("relink: failed for MW-%p; reverse chain fragmented at MW-%p, 'prev' is %p\n", mw, mw1, mw1->prev ); - FLUSH(); - goto emergency; - } - } - if( mw1 == NULL ) { - mwWrite("relink: MW-%p not found in reverse chain search\n", mw ); - FLUSH(); - fails ++; - } - } - else - { - mwWrite( "relink: MW-%p is the tail (last) allocation\n", mw ); - if( mw->next != NULL ) - { - mwWrite( "relink: MW-%p next pointer is non-NULL, you have a wild pointer\n", mw ); - mw->next = NULL; - } - } - - if( fails > 1 ) { - mwWrite("relink: heap appears intact, MW-%p probably garbage pointer\n", mw ); - FLUSH(); - goto verifyok; - } - - /* restore MW info where possible */ - if( mwIsReadAddr( mw->file, 1 ) ) { - ms = mwStatGet( mw->file, -1, 0 ); - if( ms == NULL ) mw->file = ""; - } - mw->check = CHKVAL(mw); - goto verifyok; - - /* Emergency repair */ - emergency: - - if( mwHead == NULL && mwTail == NULL ) - { - if( mwStatCurAlloc == 0 ) - mwWrite("relink: <%ld> %s(%d) heap is empty, nothing to repair\n", mwCounter, file, line ); - else - mwWrite("relink: <%ld> %s(%d) heap damaged beyond repair\n", mwCounter, file, line ); - FLUSH(); - return 0; - } - - mwWrite("relink: <%ld> %s(%d) attempting emergency repairs...\n", mwCounter, file, line ); - FLUSH(); - - if( mwHead == NULL || mwTail == NULL ) - { - if( mwHead == NULL ) mwWrite("relink: mwHead is NULL, but mwTail is %p\n", mwTail ); - else mwWrite("relink: mwTail is NULL, but mwHead is %p\n", mwHead ); - } - - mw1=NULL; - if( mwHead != NULL ) - { - if( !mwIsReadAddr(mwHead,sizeof(mwData)) || mwHead->check != CHKVAL(mwHead) ) - { - mwWrite("relink: mwHead (MW-%p) is damaged, skipping forward scan\n", mwHead ); - mwHead = NULL; - goto scan_reverse; - } - if( mwHead->prev != NULL ) - { - mwWrite("relink: the mwHead pointer's 'prev' member is %p, not NULL\n", mwHead->prev ); - } - for( mw1=mwHead; mw1; mw1=mw1->next ) - { - if( mw1->next ) - { - if( !mwIsReadAddr(mw1->next,sizeof(mwData)) || - !mw1->next->check != CHKVAL(mw1) || - mw1->next->prev != mw1 ) - { - mwWrite("relink: forward chain's last intact MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw1, mw1->size, (mw->flag & MW_NML)?"NoMansLand ":"", mw1->file, mw1->line ); - if( mwIsReadAddr(mw1->next,sizeof(mwData) ) ) - { - mwWrite("relink: forward chain's first damaged MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw1->next, mw1->size, (mw->flag & MW_NML)?"NoMansLand ":"", - mwIsReadAddr(mw1->file,16)?mw1->file:"", mw1->line ); - } - else - { - mwWrite("relink: the 'next' pointer of this MW points to %p, which is out-of-legal-access\n", - mw1->next ); - } - break; - } - } - } - } - - -scan_reverse: - mw2=NULL; - if( mwTail != NULL ) - { - if( !mwIsReadAddr(mwTail,sizeof(mwData)) || mwTail->check != CHKVAL(mwTail) ) - { - mwWrite("relink: mwTail (%p) is damaged, skipping reverse scan\n", mwTail ); - mwTail = NULL; - goto analyze; - } - if( mwTail->next != NULL ) - { - mwWrite("relink: the mwTail pointer's 'next' member is %p, not NULL\n", mwTail->next ); - } - for( mw2=mwTail; mw2; mw2=mw2->prev ) - { - if( mw2->prev ) - { - if( !mwIsReadAddr(mw2->prev,sizeof(mwData)) || - !mw2->prev->check != CHKVAL(mw2) || - mw2->prev->next != mw2 ) - { - mwWrite("relink: reverse chain's last intact MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw2, mw2->size, (mw->flag & MW_NML)?"NoMansLand ":"", mw2->file, mw2->line ); - if( mwIsReadAddr(mw2->prev,sizeof(mwData) ) ) - { - mwWrite("relink: reverse chain's first damaged MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw2->prev, mw2->size, (mw->flag & MW_NML)?"NoMansLand ":"", - mwIsReadAddr(mw2->file,16)?mw2->file:"", mw2->line ); - } - else - { - mwWrite("relink: the 'prev' pointer of this MW points to %p, which is out-of-legal-access\n", - mw2->prev ); - } - break; - } - } - } - } - -analyze: - if( mwHead == NULL && mwTail == NULL ) - { - mwWrite("relink: both head and tail pointers damaged, aborting program\n"); - mwFlushW(1); - FLUSH(); - abort(); - } - if( mwHead == NULL ) - { - mwHead = mw2; - mwWrite("relink: heap truncated, MW-%p designated as new mwHead\n", mw2 ); - mw2->prev = NULL; - mw1 = mw2 = NULL; - } - if( mwTail == NULL ) - { - mwTail = mw1; - mwWrite("relink: heap truncated, MW-%p designated as new mwTail\n", mw1 ); - mw1->next = NULL; - mw1 = mw2 = NULL; - } - if( mw1 == NULL && mw2 == NULL && - mwHead->prev == NULL && mwTail->next == NULL ) { - mwWrite("relink: verifying heap integrity...\n" ); - FLUSH(); - goto verifyok; - } - if( mw1 && mw2 && mw1 != mw2 ) { - mw1->next = mw2; - mw2->prev = mw1; - mwWrite("relink: emergency repairs successful, assessing damage...\n"); - FLUSH(); - } - else { - mwWrite("relink: heap totally destroyed, aborting program\n"); - mwFlushW(1); - FLUSH(); - abort(); - } - - /* Verify by checking that the number of active allocations */ - /* match the number of entries in the chain */ -verifyok: - if( !mwIsHeapOK( NULL ) ) { - mwWrite("relink: heap verification FAILS - aborting program\n"); - mwFlushW(1); - FLUSH(); - abort(); - } - for( size=count=0, mw1=mwHead; mw1; mw1=mw1->next ) { - count ++; - size += (long) mw1->size; - } - if( count == mwNumCurAlloc ) { - mwWrite("relink: successful, "); - if( size == mwStatCurAlloc ) { - mwWrite("no allocations lost\n"); - } - else { - if( mw != NULL ) { - mwWrite("size information lost for MW-%p\n", mw); - mw->size = 0; - } - } - } - else { - mwWrite("relink: partial, %ld MW-blocks of %ld bytes lost\n", - mwNmlNumAlloc+mwNumCurAlloc-count, mwNmlCurAlloc+mwStatCurAlloc-size ); - return 0; - } - - return 1; - } - -/* -** If mwData* is NULL: -** Returns 0 if heap chain is broken. -** Returns 1 if heap chain is intact. -** If mwData* is not NULL: -** Returns 0 if mwData* is missing or if chain is broken. -** Returns 1 if chain is intact and mwData* is found. -*/ -static int mwIsHeapOK( mwData *includes_mw ) { - int found = 0; - mwData *mw; - - for( mw = mwHead; mw; mw=mw->next ) { - if( includes_mw == mw ) found++; - if( !mwIsSafeAddr( mw, sizeof(mwData) ) ) return 0; - if( mw->prev ) { - if( !mwIsSafeAddr( mw->prev, sizeof(mwData) ) ) return 0; - if( mw==mwHead || mw->prev->next != mw ) return 0; - } - if( mw->next ) { - if( !mwIsSafeAddr( mw->next, sizeof(mwData) ) ) return 0; - if( mw==mwTail || mw->next->prev != mw ) return 0; - } - else if( mw!=mwTail ) return 0; - } - - if( includes_mw != NULL && !found ) return 0; - - return 1; - } - -static int mwIsOwned( mwData* mw, const char *file, int line ) { - int retv; - mwStat *ms; - - /* see if the address is legal according to OS */ - if( !mwIsSafeAddr( mw, sizeof(mwData) ) ) return 0; - - /* make sure we have _anything_ allocated */ - if( mwHead == NULL && mwTail == NULL && mwStatCurAlloc == 0 ) - return 0; - - /* calculate checksum */ - if( mw->check != CHKVAL(mw) ) { - /* may be damaged checksum, see if block is in heap */ - if( mwIsHeapOK( mw ) ) { - /* damaged checksum, repair it */ - mwWrite( "internal: <%ld> %s(%d), checksum for MW-%p is incorrect\n", - mwCounter, file, line, mw ); - mwIncErr(); - if( mwIsReadAddr( mw->file, 1 ) ) { - ms = mwStatGet( mw->file, -1, 0 ); - if( ms == NULL ) mw->file = ""; - } - else mw->file = ""; - mw->check = CHKVAL(mw); - return 1; - } - /* no, it's just some garbage data */ - return 0; - } - - /* check that the non-NULL pointers are safe */ - if( mw->prev && !mwIsSafeAddr( mw->prev, sizeof(mwData) ) ) mwRelink( mw, file, line ); - if( mw->next && !mwIsSafeAddr( mw->next, sizeof(mwData) ) ) mwRelink( mw, file, line ); - - /* safe address, checksum OK, proceed with heap checks */ - - /* see if the block is in the heap */ - retv = 0; - if( mw->prev ) { if( mw->prev->next == mw ) retv ++; } - else { if( mwHead == mw ) retv++; } - if( mw->next ) { if( mw->next->prev == mw ) retv ++; } - else { if( mwTail == mw ) retv++; } - if( mw->check == CHKVAL(mw) ) retv ++; - if( retv > 2 ) return 1; - - /* block not in heap, check heap for corruption */ - - if( !mwIsHeapOK( mw ) ) { - if( mwRelink( mw, file, line ) ) - return 1; - } - - /* unable to repair */ - mwWrite( "internal: <%ld> %s(%d), mwIsOwned fails for MW-%p\n", - mwCounter, file, line, mw ); - mwIncErr(); - - return 0; - } - -/* -** mwTestBuf: -** Checks a buffers links and pre/postfixes. -** Writes errors found to the log. -** Returns zero if no errors found. -*/ -static int mwTestBuf( mwData* mw, const char* file, int line ) { - int retv = 0; - char *p; - long chk; - - if( file == NULL ) file = "unknown"; - - if( !mwIsSafeAddr( mw, sizeof(mwData) ) ) { - mwWrite( "internal: <%ld> %s(%d): pointer MW-%p is invalid\n", - mwCounter, file, line, mw ); - mwIncErr(); - return 2; - } - - if( mw->check != CHKVAL(mw) ) { - mwWrite( "internal: <%ld> %s(%d), info trashed; relinking\n", - mwCounter, file, line ); - mwIncErr(); - if( !mwRelink( mw, file, line ) ) return 2; - } - - if( mw->prev && mw->prev->next != mw ) { - mwWrite( "internal: <%ld> %s(%d), buffer <%ld> %s(%d) link1 broken\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - if( !mwRelink( mw, file, line ) ) retv = 2; - } - if( mw->next && mw->next->prev != mw ) { - mwWrite( "internal: <%ld> %s(%d), buffer <%ld> %s(%d) link2 broken\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - if( !mwRelink( mw, file, line ) ) retv = 2; - } - - p = (char*)(mw+1); - GETDWORD( chk, p ); - if( chk != PRECHK ) { - mwWrite( "underflow: <%ld> %s(%d), %ld bytes alloc'd at <%ld> %s(%d)\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - retv = 1; - } - p += mw->size + sizeof(long); - GETDWORD( chk, p ); - if( chk != POSTCHK ) { - mwWrite( "overflow: <%ld> %s(%d), %ld bytes alloc'd at <%ld> %s(%d)\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - retv = 1; - } - - return retv; - } - -static void mwDefaultOutFunc( int c ) { - if( mwLogR() ) fputc( c, mwLogR() ); - } - -static void mwWrite( const char *format, ... ) { - int tot, oflow = 0; - va_list mark; - mwAutoInit(); - if( mwOutFunction == NULL ) mwOutFunction = mwDefaultOutFunc; - va_start( mark, format ); - tot = vsprintf( mwPrintBuf, format, mark ); - va_end( mark ); - if( tot >= MW_TRACE_BUFFER ) { mwPrintBuf[MW_TRACE_BUFFER] = 0; oflow = 1; } - for(tot=0;mwPrintBuf[tot];tot++) - (*mwOutFunction)( mwPrintBuf[tot] ); - if( oflow ) { - mwWrite( "\ninternal: mwWrite(): WARNING! OUTPUT EXCEEDED %u CHARS: SYSTEM UNSTABLE\n", MW_TRACE_BUFFER-1 ); - FLUSH(); - } - return; - } - -static void mwLogFile( const char *name ) { - time_t tid; - (void) time( &tid ); - if( mwLogR() != NULL ) { - fclose( mwLogR() ); - mwLogW( NULL ); - } - if( name == NULL ) return; - mwLogW( fopen( name, "a" COMMIT ) ); - if( mwLogR() == NULL ) - mwWrite( "logfile: failed to open/create file '%s'\n", name ); - } - -/* -** Try to free NML memory until a contiguous allocation of -** 'needed' bytes can be satisfied. If this is not enough -** and the 'urgent' parameter is nonzero, grabbed memory is -** also freed. -*/ -static size_t mwFreeUp( size_t needed, int urgent ) { - void *p; - mwData *mw, *mw2; - char *data; - - /* free grabbed NML memory */ - for(;;) { - if( mwDrop_( 1, MW_VAL_NML, 1 ) == 0 ) break; - p = malloc( needed ); - if( p == NULL ) continue; - free( p ); - return needed; - } - - /* free normal NML memory */ - mw = mwHead; - while( mw != NULL ) { - if( !(mw->flag & MW_NML) ) mw = mw->next; - else { - data = ((char*)(mw+1)) + sizeof(long); - if( mwTestMem( data, mw->size, MW_VAL_NML ) ) { - mwIncErr(); - mwWrite( "wild pointer: <%ld> NoMansLand %p alloc'd at %s(%d)\n", - mw->count, data + sizeof(long), mw->file, mw->line ); - } - mw2 = mw->next; - mwUnlink( mw, "mwFreeUp", 0 ); - free( mw ); - mw = mw2; - p = malloc( needed ); - if( p == NULL ) continue; - free( p ); - return needed; - } - } - - /* if not urgent (for internal purposes), fail */ - if( !urgent ) return 0; - - /* free grabbed memory */ - for(;;) { - if( mwDrop_( 1, MW_VAL_GRB, 1 ) == 0 ) break; - p = malloc( needed ); - if( p == NULL ) continue; - free( p ); - return needed; - } - - return 0; - } - -static const void * mwTestMem( const void *p, unsigned len, int c ) { - const unsigned char *ptr; - ptr = (const unsigned char *) p; - while( len-- ) { - if( *ptr != (unsigned char)c ) return (const void*)ptr; - ptr ++; - } - return NULL; - } - -static int mwStrCmpI( const char *s1, const char *s2 ) { - if( s1 == NULL || s2 == NULL ) return 0; - while( *s1 ) { - if( toupper(*s2) == toupper(*s1) ) { s1++; s2++; continue; } - return 1; - } - return 0; - } - -#define AIPH() if( always_invoked ) { mwWrite("autocheck: <%ld> %s(%d) ", mwCounter, file, line ); always_invoked = 0; } - -static int mwTestNow( const char *file, int line, int always_invoked ) { - int retv = 0; - mwData *mw; - char *data; - - if( file && !always_invoked ) - mwWrite("check: <%ld> %s(%d), checking %s%s%s\n", - mwCounter, file, line, - (mwTestFlags & MW_TEST_CHAIN) ? "chain ": "", - (mwTestFlags & MW_TEST_ALLOC) ? "alloc ": "", - (mwTestFlags & MW_TEST_NML) ? "nomansland ": "" - ); - - if( mwTestFlags & MW_TEST_CHAIN ) { - for( mw = mwHead; mw; mw=mw->next ) { - if( !mwIsSafeAddr(mw, sizeof(mwData)) ) { - AIPH(); - mwWrite("check: heap corruption detected\n"); - mwIncErr(); - return retv + 1; - } - if( mw->prev ) { - if( !mwIsSafeAddr(mw->prev, sizeof(mwData)) ) { - AIPH(); - mwWrite("check: heap corruption detected\n"); - mwIncErr(); - return retv + 1; - } - if( mw==mwHead || mw->prev->next != mw ) { - AIPH(); - mwWrite("check: heap chain broken, prev link incorrect\n"); - mwIncErr(); - retv ++; - } - } - if( mw->next ) { - if( !mwIsSafeAddr(mw->next, sizeof(mwData)) ) { - AIPH(); - mwWrite("check: heap corruption detected\n"); - mwIncErr(); - return retv + 1; - } - if( mw==mwTail || mw->next->prev != mw ) { - AIPH(); - mwWrite("check: heap chain broken, next link incorrect\n"); - mwIncErr(); - retv ++; - } - } - else if( mw!=mwTail ) { - AIPH(); - mwWrite("check: heap chain broken, tail incorrect\n"); - mwIncErr(); - retv ++; - } - } - } - if( mwTestFlags & MW_TEST_ALLOC ) { - for( mw = mwHead; mw; mw=mw->next ) { - if( mwTestBuf( mw, file, line ) ) retv ++; - } - } - if( mwTestFlags & MW_TEST_NML ) { - for( mw = mwHead; mw; mw=mw->next ) { - if( (mw->flag & MW_NML) ) { - data = ((char*)(mw+1)) + sizeof(long); - if( mwTestMem( data, mw->size, MW_VAL_NML ) ) { - mwIncErr(); - mwWrite( "wild pointer: <%ld> NoMansLand %p alloc'd at %s(%d)\n", - mw->count, data + sizeof(long), mw->file, mw->line ); - } - } - } - } - - - if( file && !always_invoked && !retv ) - mwWrite("check: <%ld> %s(%d), complete; no errors\n", - mwCounter, file, line ); - return retv; - } - -/********************************************************************** -** Statistics -**********************************************************************/ - -static void mwStatReport() -{ - mwStat* ms, *ms2; - const char *modname; - int modnamelen; - - /* global statistics report */ - mwWrite( "\nMemory usage statistics (global):\n" ); - mwWrite( " N)umber of allocations made: %ld\n", mwStatNumAlloc ); - mwWrite( " L)argest memory usage : %ld\n", mwStatMaxAlloc ); - mwWrite( " T)otal of all alloc() calls: %ld\n", mwStatTotAlloc ); - mwWrite( " U)nfreed bytes totals : %ld\n", mwStatCurAlloc ); - FLUSH(); - - if( mwStatLevel < 1 ) return; - - /* on a per-module basis */ - mwWrite( "\nMemory usage statistics (detailed):\n"); - mwWrite( " Module/Line Number Largest Total Unfreed \n"); - for( ms=mwStatList; ms; ms=ms->next ) - { - if( ms->line == -1 ) - { - if( ms->file == NULL || !mwIsReadAddr(ms->file,22) ) modname = ""; - else modname = ms->file; - modnamelen = strlen(modname); - if( modnamelen > 42 ) - { - modname = modname + modnamelen - 42; - } - - mwWrite(" %-42s %-8ld %-8ld %-8ld %-8ld\n", - modname, ms->num, ms->max, ms->total, ms->curr ); - if( ms->file && mwStatLevel > 1 ) - { - for( ms2=mwStatList; ms2; ms2=ms2->next ) - { - if( ms2->line!=-1 && ms2->file!=NULL && !mwStrCmpI( ms2->file, ms->file ) ) - { - mwWrite( " %-8d %-8ld %-8ld %-8ld %-8ld\n", - ms2->line, ms2->num, ms2->max, ms2->total, ms2->curr ); - } - } - } - } - } -} - -static mwStat* mwStatGet( const char *file, int line, int makenew ) { - mwStat* ms; - - if( mwStatLevel < 2 ) line = -1; - - for( ms=mwStatList; ms!=NULL; ms=ms->next ) { - if( line != ms->line ) continue; - if( file==NULL ) { - if( ms->file == NULL ) break; - continue; - } - if( ms->file == NULL ) continue; - if( !strcmp( ms->file, file ) ) break; - } - - if( ms != NULL ) return ms; - - if( !makenew ) return NULL; - - ms = (mwStat*) malloc( sizeof(mwStat) ); - if( ms == NULL ) { - if( mwFreeUp( sizeof(mwStat), 0 ) < sizeof(mwStat) || - (ms=(mwStat*)malloc(sizeof(mwStat))) == NULL ) { - mwWrite("internal: memory low, statistics incomplete for '%s'\n", file ); - return NULL; - } - } - ms->file = file; - ms->line = line; - ms->total = 0L; - ms->max = 0L; - ms->num = 0L; - ms->curr = 0L; - ms->next = mwStatList; - mwStatList = ms; - return ms; - } - -static void mwStatAlloc( size_t size, const char* file, int line ) { - mwStat* ms; - - /* update the module statistics */ - ms = mwStatGet( file, -1, 1 ); - if( ms != NULL ) { - ms->total += (long) size; - ms->curr += (long) size; - ms->num ++; - if( ms->curr > ms->max ) ms->max = ms->curr; - } - - /* update the line statistics */ - if( mwStatLevel > 1 && line != -1 && file ) { - ms = mwStatGet( file, line, 1 ); - if( ms != NULL ) { - ms->total += (long) size; - ms->curr += (long) size; - ms->num ++; - if( ms->curr > ms->max ) ms->max = ms->curr; - } - } - - } - -static void mwStatFree( size_t size, const char* file, int line ) { - mwStat* ms; - - /* update the module statistics */ - ms = mwStatGet( file, -1, 1 ); - if( ms != NULL ) ms->curr -= (long) size; - - /* update the line statistics */ - if( mwStatLevel > 1 && line != -1 && file ) { - ms = mwStatGet( file, line, 1 ); - if( ms != NULL ) ms->curr -= (long) size; - } - } - -#if 0 /* 980317: disabled C++ */ - -/********************************************************************** -** C++ new & delete -**********************************************************************/ - -#ifdef __cplusplus -#ifndef MEMWATCH_NOCPP - -int mwNCur = 0; -const char *mwNFile = NULL; -int mwNLine = 0; - -class MemWatch { -public: - MemWatch(); - ~MemWatch(); - }; - -MemWatch::MemWatch() { - if( mwInited ) return; - mwUseAtexit = 0; - mwInit(); - } - -MemWatch::~MemWatch() { - if( mwUseAtexit ) return; - mwTerm(); - } - -/* -** This global new will catch all 'new' calls where MEMWATCH is -** not active. -*/ -void* operator new( unsigned size ) { - mwNCur = 0; - return mwMalloc( size, "", 0 ); - } - -/* -** This is the new operator that's called when a module uses mwNew. -*/ -void* operator new( unsigned size, const char *file, int line ) { - mwNCur = 0; - return mwMalloc( size, file, line ); - } - -/* -** Since this delete operator will recieve ALL delete's -** even those from within libraries, we must accept -** delete's before we've been initialized. Nor can we -** reliably check for wild free's if the mwNCur variable -** is not set. -*/ -void operator delete( void *p ) { - if( p == NULL ) return; - if( !mwInited ) { - free( p ); - return; - } - if( mwNCur ) { - mwFree( p, mwNFile, mwNLine ); - mwNCur = 0; - return; - } - mwFree_( p ); - } - -#endif /* MEMWATCH_NOCPP */ -#endif /* __cplusplus */ - -#endif /* 980317: disabled C++ */ - -#endif /* MEMWATCH.C */ diff --git a/lib/memwatch.c.org b/lib/memwatch.c.org deleted file mode 100644 index 4540127e..00000000 --- a/lib/memwatch.c.org +++ /dev/null @@ -1,2360 +0,0 @@ -/* -** MEMWATCH.C -** Nonintrusive ANSI C memory leak / overwrite detection -** Copyright (C) 1992-99 Johan Lindh -** All rights reserved. -** Version 2.62 -** -** 920810 JLI [1.00] -** 920830 JLI [1.10 double-free detection] -** 920912 JLI [1.15 mwPuts, mwGrab/Drop, mwLimit] -** 921022 JLI [1.20 ASSERT and VERIFY] -** 921105 JLI [1.30 C++ support and TRACE] -** 921116 JLI [1.40 mwSetOutFunc] -** 930215 JLI [1.50 modified ASSERT/VERIFY] -** 930327 JLI [1.51 better auto-init & PC-lint support] -** 930506 JLI [1.55 MemWatch class, improved C++ support] -** 930507 JLI [1.60 mwTest & CHECK()] -** 930809 JLI [1.65 Abort/Retry/Ignore] -** 930820 JLI [1.70 data dump when unfreed] -** 931016 JLI [1.72 modified C++ new/delete handling] -** 931108 JLI [1.77 mwSetAssertAction() & some small changes] -** 940110 JLI [1.80 no-mans-land alloc/checking] -** 940328 JLI [2.00 version 2.0 rewrite] -** Improved NML (no-mans-land) support. -** Improved performance (especially for free()ing!). -** Support for 'read-only' buffers (checksums) -** ^^ NOTE: I never did this... maybe I should? -** FBI (free'd block info) tagged before freed blocks -** Exporting of the mwCounter variable -** mwBreakOut() localizes debugger support -** Allocation statistics (global, per-module, per-line) -** Self-repair ability with relinking -** 950913 JLI [2.10 improved garbage handling] -** 951201 JLI [2.11 improved auto-free in emergencies] -** 960125 JLI [X.01 implemented auto-checking using mwAutoCheck()] -** 960514 JLI [2.12 undefining of existing macros] -** 960515 JLI [2.13 possibility to use default new() & delete()] -** 960516 JLI [2.20 suppression of file flushing on unfreed msgs] -** 960516 JLI [2.21 better support for using MEMWATCH with DLL's] -** 960710 JLI [X.02 multiple logs and mwFlushNow()] -** 960801 JLI [2.22 merged X.01 version with current] -** 960805 JLI [2.30 mwIsXXXXAddr() to avoid unneeded GP's] -** 960805 JLI [2.31 merged X.02 version with current] -** 961002 JLI [2.32 support for realloc() + fixed STDERR bug] -** 961222 JLI [2.40 added mwMark() & mwUnmark()] -** 970101 JLI [2.41 added over/underflow checking after failed ASSERT/VERIFY] -** 970113 JLI [2.42 added support for PC-Lint 7.00g] -** 970207 JLI [2.43 added support for strdup()] -** 970209 JLI [2.44 changed default filename to lowercase] -** 970405 JLI [2.45 fixed bug related with atexit() and some C++ compilers] -** 970723 JLI [2.46 added MW_ARI_NULLREAD flag] -** 970813 JLI [2.47 stabilized marker handling] -** 980317 JLI [2.48 ripped out C++ support; wasn't working good anyway] -** 980318 JLI [2.50 improved self-repair facilities & SIGSEGV support] -** 980417 JLI [2.51 more checks for invalid addresses] -** 980512 JLI [2.52 moved MW_ARI_NULLREAD to occur before aborting] -** 990112 JLI [2.53 added check for empty heap to mwIsOwned] -** 990217 JLI [2.55 improved the emergency repairs diagnostics and NML] -** 990224 JLI [2.56 changed ordering of members in structures] -** 990303 JLI [2.57 first maybe-fixit-for-hpux test] -** 990516 JLI [2.58 added 'static' to the definition of mwAutoInit] -** 990517 JLI [2.59 fixed some high-sensitivity warnings] -** 990610 JLI [2.60 fixed some more high-sensitivity warnings] -** 990715 JLI [2.61 changed TRACE/ASSERT/VERIFY macro names] -** 991001 JLI [2.62 added CHECK_BUFFER() and mwTestBuffer()] -*/ - -#define __MEMWATCH_C 1 - -#ifdef MW_NOCPP -#define MEMWATCH_NOCPP -#endif -#ifdef MW_STDIO -#define MEMWATCH_STDIO -#endif - -/*********************************************************************** -** Include files -***********************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include "memwatch.h" - -#ifndef toupper -#include -#endif - -/*********************************************************************** -** Defines & other weird stuff -***********************************************************************/ - -/*lint -save -e767 */ -#define VERSION "2.62" /* the current version number */ -#define CHKVAL(mw) (0xFE0180L^(long)mw->count^(long)mw->size^(long)mw->line) -#define FLUSH() mwFlush() -#define TESTS(f,l) if(mwTestAlways) (void)mwTestNow(f,l,1) -#define PRECHK 0x01234567L -#define POSTCHK 0x76543210L -/*lint -restore */ - -#define MW_NML 0x0001 - -#ifdef _MSC_VER -#define COMMIT "c" /* Microsoft C requires the 'c' to perform as desired */ -#else -#define COMMIT "" /* Normal ANSI */ -#endif /* _MSC_VER */ - -#ifdef __cplusplus -#define CPPTEXT "++" -#else -#define CPPTEXT "" -#endif /* __cplusplus */ - -#ifdef MEMWATCH_STDIO -#define mwSTDERR stderr -#else -#define mwSTDERR mwLog -#endif - -/*********************************************************************** -** Defines to read/write 32 bit words in a portable way -** Note: Assumes that a 'long int' is 32 bits, and a 'char' is 8 bits. -***********************************************************************/ - -typedef unsigned char mwBYTE; -typedef unsigned long mwDWORD; - -#define GETDWORD(l, cp) { \ - register mwBYTE *t_cp = (mwBYTE *)(cp); \ - (l) = ((mwDWORD)t_cp[0] << 24) \ - | ((mwDWORD)t_cp[1] << 16) \ - | ((mwDWORD)t_cp[2] << 8) \ - | ((mwDWORD)t_cp[3]) \ - ; \ -} - -#define PUTDWORD(l, cp) { \ - register mwDWORD t_l = (mwDWORD)(l); \ - register mwBYTE *t_cp = (mwBYTE *)(cp); \ - *t_cp++ = (mwBYTE)(t_l >> 24); \ - *t_cp++ = (mwBYTE)(t_l >> 16); \ - *t_cp++ = (mwBYTE)(t_l >> 8); \ - *t_cp = (mwBYTE)t_l; \ -} - -/*********************************************************************** -** Typedefs & structures -***********************************************************************/ - -/* main data holding area, precedes actual allocation */ -typedef struct mwData_ mwData; -struct mwData_ { - mwData* prev; /* previous allocation in chain */ - mwData* next; /* next allocation in chain */ - const char* file; /* file name where allocated */ - long count; /* action count */ - long check; /* integrity check value */ -#if 0 - long crc; /* data crc value */ -#endif - size_t size; /* size of allocation */ - int line; /* line number where allocated */ - unsigned flag; /* flag word */ - }; - -/* statistics structure */ -typedef struct mwStat_ mwStat; -struct mwStat_ { - mwStat* next; /* next statistic buffer */ - const char* file; - long total; /* total bytes allocated */ - long num; /* total number of allocations */ - long max; /* max allocated at one time */ - long curr; /* current allocations */ - int line; - }; - -/* grabbing structure, 1K in size */ -typedef struct mwGrabData_ mwGrabData; -struct mwGrabData_ { - mwGrabData* next; - int type; - char blob[ 1024 - sizeof(mwGrabData*) - sizeof(int) ]; - }; - -typedef struct mwMarker_ mwMarker; -struct mwMarker_ { - void *host; - char *text; - mwMarker *next; - int level; - }; - -/*********************************************************************** -** Static variables -***********************************************************************/ - -static int mwInited = 0; -static int mwInfoWritten = 0; -static int mwUseAtexit = 0; -static FILE* mwLog = NULL; -static int mwFlushing = 0; -static int mwStatLevel = MW_STAT_DEFAULT; -static int mwNML = MW_NML_DEFAULT; -static int mwFBI = 0; -static long mwAllocLimit = 0L; -static int mwUseLimit = 0; - -static long mwNumCurAlloc = 0L; -static mwData* mwHead = NULL; -static mwData* mwTail = NULL; - -static void (*mwOutFunction)(int) = NULL; -static int (*mwAriFunction)(const char*) = NULL; -static int mwAriAction = MW_ARI_ABORT; - -static char mwPrintBuf[MW_TRACE_BUFFER+8]; - -static unsigned long mwCounter = 0L; -static long mwErrors = 0L; - -static int mwTestFlags = 0; -static int mwTestAlways = 0; - -static FILE* mwLogB1 = NULL; -static int mwFlushingB1 = 0; - -static mwStat* mwStatList = NULL; -static long mwStatTotAlloc = 0L; -static long mwStatMaxAlloc = 0L; -static long mwStatNumAlloc = 0L; -static long mwStatCurAlloc = 0L; -static long mwNmlNumAlloc = 0L; -static long mwNmlCurAlloc = 0L; - -static mwGrabData* mwGrabList = NULL; -static long mwGrabSize = 0L; - -static void * mwLastFree[MW_FREE_LIST]; -static const char *mwLFfile[MW_FREE_LIST]; -static int mwLFline[MW_FREE_LIST]; -static int mwLFcur = 0; - -static mwMarker* mwFirstMark = NULL; - -static FILE* mwLogB2 = NULL; -static int mwFlushingB2 = 0; - -/*********************************************************************** -** Static function declarations -***********************************************************************/ - -static void mwAutoInit( void ); -static FILE* mwLogR( void ); -static void mwLogW( FILE* ); -static int mwFlushR( void ); -static void mwFlushW( int ); -static void mwFlush( void ); -static void mwIncErr( void ); -static void mwUnlink( mwData*, const char* file, int line ); -static int mwRelink( mwData*, const char* file, int line ); -static int mwIsHeapOK( mwData *mw ); -static int mwIsOwned( mwData* mw, const char* file, int line ); -static int mwTestBuf( mwData* mw, const char* file, int line ); -static void mwDefaultOutFunc( int ); -static void mwWrite( const char* format, ... ); -static void mwLogFile( const char* name ); -static size_t mwFreeUp( size_t, int ); -static const void *mwTestMem( const void *, unsigned, int ); -static int mwStrCmpI( const char *s1, const char *s2 ); -static int mwTestNow( const char *file, int line, int always_invoked ); -static void mwDropAll( void ); -static const char *mwGrabType( int type ); -static unsigned mwGrab_( unsigned kb, int type, int silent ); -static unsigned mwDrop_( unsigned kb, int type, int silent ); -static int mwARI( const char* text ); -static void mwStatReport( void ); -static mwStat* mwStatGet( const char*, int, int ); -static void mwStatAlloc( size_t, const char*, int ); -static void mwStatFree( size_t, const char*, int ); - -/*********************************************************************** -** System functions -***********************************************************************/ - -void mwInit( void ) { - time_t tid; - - if( mwInited++ > 0 ) return; - - /* start a log if none is running */ - if( mwLogR() == NULL ) mwLogFile( "memwatch.log" ); - if( mwLogR() == NULL ) { - int i; - char buf[32]; - /* oops, could not open it! */ - /* probably because it's already open */ - /* so we try some other names */ - for( i=1; i<100; i++ ) { - sprintf( buf, "memwat%02d.log", i ); - mwLogFile( buf ); - if( mwLogR() != NULL ) break; - } - } - - /* initialize the statistics */ - mwStatList = NULL; - mwStatTotAlloc = 0L; - mwStatCurAlloc = 0L; - mwStatMaxAlloc = 0L; - mwStatNumAlloc = 0L; - mwNmlCurAlloc = 0L; - mwNmlNumAlloc = 0L; - - /* write informational header if needed */ - if( !mwInfoWritten ) { - mwInfoWritten = 1; - (void) time( &tid ); - mwWrite( - "\n=============" - " MEMWATCH " VERSION " Copyright (C) 1992-1999 Johan Lindh " - "=============\n"); - mwWrite( "\nStarted at %s\n", ctime( &tid ) ); - -/**************************************************************** Generic */ -#ifdef mwNew - mwWrite( "C++ new/delete tracking enabled\n" ); -#endif /* mwNew */ -#ifdef __STDC__ - mwWrite( "Compiled as standard ANSI C\n" ); -#endif /* __STDC__ */ -/**************************************************************** Generic */ - -/************************************************************ Microsoft C */ -#ifdef _MSC_VER - mwWrite( "Compiled using Microsoft C" CPPTEXT - " %d.%02d\n", _MSC_VER / 100, _MSC_VER % 100 ); -#endif /* _MSC_VER */ -/************************************************************ Microsoft C */ - -/************************************************************** Borland C */ -#ifdef __BORLANDC__ - mwWrite( "Compiled using Borland C" -#ifdef __cplusplus - "++ %d.%01d\n", __BCPLUSPLUS__/0x100, (__BCPLUSPLUS__%0x100)/0x10 ); -#else - " %d.%01d\n", __BORLANDC__/0x100, (__BORLANDC__%0x100)/0x10 ); -#endif /* __cplusplus */ -#endif /* __BORLANDC__ */ -/************************************************************** Borland C */ - -/************************************************************** Watcom C */ -#ifdef __WATCOMC__ - mwWrite( "Compiled using Watcom C %d.%02d ", - __WATCOMC__/100, __WATCOMC__%100 ); -#ifdef __FLAT__ - mwWrite( "(32-bit flat model)" ); -#endif /* __FLAT__ */ - mwWrite( "\n" ); -#endif /* __WATCOMC__ */ -/************************************************************** Watcom C */ - - mwWrite( "\n" ); - FLUSH(); - } - - if( mwUseAtexit ) (void) atexit( mwAbort ); - return; - } - -void mwAbort( void ) { - mwData *mw; - mwMarker *mrk; - char *data; - time_t tid; - int c, i, j; - int errors; - long chk; - - tid = time( NULL ); - mwWrite( "\nStopped at %s\n", ctime( &tid) ); - - if( !mwInited ) - mwWrite( "internal: mwAbort(): MEMWATCH not initialized!\n" ); - - /* release the grab list */ - mwDropAll(); - - /* report mwMarked items */ - while( mwFirstMark ) { - mrk = mwFirstMark->next; - mwWrite( "mark: %p: %s\n", mwFirstMark->host, mwFirstMark->text ); - free( mwFirstMark->text ); - free( mwFirstMark ); - mwFirstMark = mrk; - mwErrors ++; - } - - /* release all still allocated memory */ - errors = 0; - while( mwHead != NULL && errors < 3 ) { - if( !mwIsOwned(mwHead, __FILE__, __LINE__ ) ) { - if( errors < 3 ) - { - errors ++; - mwWrite( "internal: NML/unfreed scan restarting\n" ); - FLUSH(); - mwHead = mwHead; - continue; - } - mwWrite( "internal: NML/unfreed scan aborted, heap too damaged\n" ); - FLUSH(); - break; - } - mwFlushW(0); - if( !(mwHead->flag & MW_NML) ) { - mwErrors++; - data = ((char*)(mwHead+1)); - mwWrite( "unfreed: <%ld> %s(%d), %ld bytes at %p ", - mwHead->count, mwHead->file, mwHead->line, (long)mwHead->size, data+sizeof(long) ); - GETDWORD( chk, data ); - if( chk != PRECHK ) { - mwWrite( "[underflowed] "); - FLUSH(); - } - GETDWORD( chk, (data+sizeof(long)+mwHead->size) ); - if( chk != POSTCHK ) { - mwWrite( "[overflowed] "); - FLUSH(); - } - mwWrite( " \t{" ); - j = 16; if( mwHead->size < 16 ) j = (int) mwHead->size; - for( i=0;i<16;i++ ) { - if( i 126 ) c = '.'; - mwWrite( "%c", c ); - } - mwWrite( "}\n" ); - mw = mwHead; - mwUnlink( mw, __FILE__, __LINE__ ); - free( mw ); - } - else { - data = ((char*)(mwHead+1)) + sizeof(long); - if( mwTestMem( data, mwHead->size, MW_VAL_NML ) ) { - mwErrors++; - mwWrite( "wild pointer: <%ld> NoMansLand %p alloc'd at %s(%d)\n", - mwHead->count, data + sizeof(long), mwHead->file, mwHead->line ); - FLUSH(); - } - mwNmlNumAlloc --; - mwNmlCurAlloc -= mwHead->size; - mw = mwHead; - mwUnlink( mw, __FILE__, __LINE__ ); - free( mw ); - } - } - - if( mwNmlNumAlloc ) mwWrite("internal: NoMansLand block counter %ld, not zero\n", mwNmlNumAlloc ); - if( mwNmlCurAlloc ) mwWrite("internal: NoMansLand byte counter %ld, not zero\n", mwNmlCurAlloc ); - - /* report statistics */ - mwStatReport(); - FLUSH(); - - mwInited = 0; - mwHead = mwTail = NULL; - if( mwErrors ) - fprintf(mwSTDERR,"MEMWATCH detected %ld anomalies\n",mwErrors); - mwLogFile( NULL ); - mwErrors = 0; - } - -void mwTerm( void ) { - if( mwInited == 1 ) - { - mwAbort(); - return; - } - if( !mwInited ) - mwWrite("internal: mwTerm(): MEMWATCH has not been started!\n"); - else - mwInited --; - } - -void mwStatistics( int level ) -{ - mwAutoInit(); - if( level<0 ) level=0; - if( mwStatLevel != level ) - { - mwWrite( "statistics: now collecting on a %s basis\n", - level<1?"global":(level<2?"module":"line") ); - mwStatLevel = level; - } -} - -void mwAutoCheck( int onoff ) { - mwAutoInit(); - mwTestAlways = onoff; - if( onoff ) mwTestFlags = MW_TEST_ALL; - } - -void mwSetOutFunc( void (*func)(int) ) { - mwAutoInit(); - mwOutFunction = func; - } - -int mwTest( const char *file, int line, int items ) { - mwAutoInit(); - mwTestFlags = items; - return mwTestNow( file, line, 0 ); - } - -/* -** Returns zero if there are no errors. -** Returns nonzero if there are errors. -*/ -int mwTestBuffer( const char *file, int line, void *p ) { - mwData* mw; - - mwAutoInit(); - - /* do the quick ownership test */ - mw = (mwData*) ( ((char*)p)-sizeof(long)-sizeof(mwData) ); - - if( mwIsOwned( mw, file, line ) ) { - return mwTestBuf( mw, file, line ); - } - return 1; - } - -void mwBreakOut( const char* cause ) { - fprintf(mwSTDERR, "breakout: %s\n", cause); - mwWrite("breakout: %s\n", cause ); - return; - } - -/* -** 981217 JLI: is it possible that ->next is not always set? -*/ -void * mwMark( void *p, const char *desc, const char *file, unsigned line ) { - mwMarker *mrk; - unsigned n, isnew; - char *buf; - int tot, oflow = 0; - char wherebuf[128]; - - mwAutoInit(); - TESTS(NULL,0); - - if( desc == NULL ) desc = "unknown"; - if( file == NULL ) file = "unknown"; - - tot = sprintf( wherebuf, "%.48s called from %s(%d)", desc, file, line ); - if( tot >= (int)sizeof(wherebuf) ) { wherebuf[sizeof(wherebuf)-1] = 0; oflow = 1; } - - if( p == NULL ) { - mwWrite("mark: %s(%d), no mark for NULL:'%s' may be set\n", file, line, desc ); - return p; - } - - if( mwFirstMark != NULL && !mwIsReadAddr( mwFirstMark, sizeof( mwMarker ) ) ) - { - mwWrite("mark: %s(%d), mwFirstMark (%p) is trashed, can't mark for %s\n", - file, line, mwFirstMark, desc ); - return p; - } - - for( mrk=mwFirstMark; mrk; mrk=mrk->next ) - { - if( mrk->next != NULL && !mwIsReadAddr( mrk->next, sizeof( mwMarker ) ) ) - { - mwWrite("mark: %s(%d), mark(%p)->next(%p) is trashed, can't mark for %s\n", - file, line, mrk, mrk->next, desc ); - return p; - } - if( mrk->host == p ) break; - } - - if( mrk == NULL ) { - isnew = 1; - mrk = (mwMarker*) malloc( sizeof( mwMarker ) ); - if( mrk == NULL ) { - mwWrite("mark: %s(%d), no mark for %p:'%s', out of memory\n", file, line, p, desc ); - return p; - } - mrk->next = NULL; - n = 0; - } - else { - isnew = 0; - n = strlen( mrk->text ); - } - - n += strlen( wherebuf ); - buf = (char*) malloc( n+3 ); - if( buf == NULL ) { - if( isnew ) free( mrk ); - mwWrite("mark: %s(%d), no mark for %p:'%s', out of memory\n", file, line, p, desc ); - return p; - } - - if( isnew ) { - memcpy( buf, wherebuf, n+1 ); - mrk->next = mwFirstMark; - mrk->host = p; - mrk->text = buf; - mrk->level = 1; - mwFirstMark = mrk; - } - else { - strcpy( buf, mrk->text ); - strcat( buf, ", " ); - strcat( buf, wherebuf ); - free( mrk->text ); - mrk->text = buf; - mrk->level ++; - } - - if( oflow ) { - mwIncErr(); - mwTrace( " [WARNING: OUTPUT BUFFER OVERFLOW - SYSTEM UNSTABLE]\n" ); - } - return p; - } - -void* mwUnmark( void *p, const char *file, unsigned line ) { - mwMarker *mrk, *prv; - mrk = mwFirstMark; - prv = NULL; - while( mrk ) { - if( mrk->host == p ) { - if( mrk->level < 2 ) { - if( prv ) prv->next = mrk->next; - else mwFirstMark = mrk->next; - free( mrk->text ); - free( mrk ); - return p; - } - mrk->level --; - return p; - } - prv = mrk; - mrk = mrk->next; - } - mwWrite("mark: %s(%d), no mark found for %p\n", file, line, p ); - return p; - } - -/*********************************************************************** -** Safe memory checkers -** -** Using ifdefs, implement the operating-system specific mechanism -** of identifying a piece of memory as legal to access with read -** and write priviliges. Default: return nonzero for non-NULL pointers. -***********************************************************************/ - -static char mwDummy( char c ) -{ - return c; -} - -#ifndef MW_SAFEADDR -#ifdef WIN32 -#define MW_SAFEADDR -#define WIN32_LEAN_AND_MEAN -#include -int mwIsReadAddr( const void *p, unsigned len ) -{ - if( p == NULL ) return 0; - if( IsBadReadPtr(p,len) ) return 0; - return 1; -} -int mwIsSafeAddr( void *p, unsigned len ) -{ - /* NOTE: For some reason, under Win95 the IsBad... */ - /* can return false for invalid pointers. */ - if( p == NULL ) return 0; - if( IsBadReadPtr(p,len) || IsBadWritePtr(p,len) ) return 0; - return 1; -} -#endif /* WIN32 */ -#endif /* MW_SAFEADDR */ - -#ifndef MW_SAFEADDR -#ifdef SIGSEGV -#define MW_SAFEADDR - -typedef void (*mwSignalHandlerPtr)( int ); -mwSignalHandlerPtr mwOldSIGSEGV = (mwSignalHandlerPtr) 0; -jmp_buf mwSIGSEGVjump; -static void mwSIGSEGV( int n ); - -static void mwSIGSEGV( int n ) -{ - longjmp( mwSIGSEGVjump, 1 ); -} - -int mwIsReadAddr( const void *p, unsigned len ) -{ - const char *ptr; - - if( p == NULL ) return 0; - if( !len ) return 1; - - /* set up to catch the SIGSEGV signal */ - mwOldSIGSEGV = signal( SIGSEGV, mwSIGSEGV ); - - if( setjmp( mwSIGSEGVjump ) ) - { - signal( SIGSEGV, mwOldSIGSEGV ); - return 0; - } - - /* read all the bytes in the range */ - ptr = (const char *)p; - ptr += len; - - /* the reason for this rather strange construct is that */ - /* we want to keep the number of used parameters and locals */ - /* to a minimum. if we use len for a counter gcc will complain */ - /* it may get clobbered by longjmp() at high warning levels. */ - /* it's a harmless warning, but this way we don't have to see it. */ - do - { - ptr --; - if( *ptr == 0x7C ) (void) mwDummy( (char)0 ); - } while( ptr != p ); - - /* remove the handler */ - signal( SIGSEGV, mwOldSIGSEGV ); - - return 1; -} -int mwIsSafeAddr( void *p, unsigned len ) -{ - char *ptr; - - if( p == NULL ) return 0; - if( !len ) return 1; - - /* set up to catch the SIGSEGV signal */ - mwOldSIGSEGV = signal( SIGSEGV, mwSIGSEGV ); - - if( setjmp( mwSIGSEGVjump ) ) - { - signal( SIGSEGV, mwOldSIGSEGV ); - return 0; - } - - /* read and write-back all the bytes in the range */ - ptr = (char *)p; - ptr += len; - - /* the reason for this rather strange construct is that */ - /* we want to keep the number of used parameters and locals */ - /* to a minimum. if we use len for a counter gcc will complain */ - /* it may get clobbered by longjmp() at high warning levels. */ - /* it's a harmless warning, but this way we don't have to see it. */ - do - { - ptr --; - *ptr = mwDummy( *ptr ); - } while( ptr != p ); - - /* remove the handler */ - signal( SIGSEGV, mwOldSIGSEGV ); - - return 1; -} -#endif /* SIGSEGV */ -#endif /* MW_SAFEADDR */ - -#ifndef MW_SAFEADDR -int mwIsReadAddr( const void *p, unsigned len ) -{ - if( p == NULL ) return 0; - if( len == 0 ) return 1; - return 1; -} -int mwIsSafeAddr( void *p, unsigned len ) -{ - if( p == NULL ) return 0; - if( len == 0 ) return 1; - return 1; -} -#endif - -/*********************************************************************** -** Abort/Retry/Ignore handlers -***********************************************************************/ - -static int mwARI( const char *estr ) { - char inbuf[81]; - int c; - fprintf(mwSTDERR, "\n%s\nMEMWATCH: Abort, Retry or Ignore? ", estr); - (void) fgets(inbuf,sizeof(inbuf),stdin); - for( c=0; inbuf[c] && inbuf[c] <= ' '; c++ ) ; - c = inbuf[c]; - if( c == 'R' || c == 'r' ) { - mwBreakOut( estr ); - return MW_ARI_RETRY; - } - if( c == 'I' || c == 'i' ) return MW_ARI_IGNORE; - return MW_ARI_ABORT; - } - -/* standard ARI handler (exported) */ -int mwAriHandler( const char *estr ) { - mwAutoInit(); - return mwARI( estr ); - } - -/* used to set the ARI function */ -void mwSetAriFunc( int (*func)(const char *) ) { - mwAutoInit(); - mwAriFunction = func; - } - -/*********************************************************************** -** Allocation handlers -***********************************************************************/ - -void* mwMalloc( size_t size, const char* file, int line) { - size_t needed; - mwData *mw; - char *ptr; - void *p; - - mwAutoInit(); - - TESTS(file,line); - - mwCounter ++; - needed = sizeof(mwData) + sizeof(long) + sizeof(long) + size; - - /* if this allocation would violate the limit, fail it */ - if( mwUseLimit && ((long)size + mwStatCurAlloc > mwAllocLimit) ) { - mwWrite( "limit fail: <%ld> %s(%d), %ld wanted %ld available\n", - mwCounter, file, line, (long)size, mwAllocLimit - mwStatCurAlloc ); - mwIncErr(); - FLUSH(); - return NULL; - } - - mw = (mwData*) malloc( needed ); - if( mw == NULL ) { - if( mwFreeUp(needed,0) >= needed ) { - mw = (mwData*) malloc(needed); - if( mw == NULL ) { - mwWrite( "internal: mwFreeUp(%u) reported success, but malloc() fails\n", needed ); - mwIncErr(); - FLUSH(); - } - } - if( mw == NULL ) { - mwWrite( "fail: <%ld> %s(%d), %ld wanted %ld allocated\n", - mwCounter, file, line, (long)size, mwStatCurAlloc ); - mwIncErr(); - FLUSH(); - return NULL; - } - } - - mw->count = mwCounter; - mw->prev = NULL; - mw->next = mwHead; - mw->file = file; - mw->size = size; - mw->line = line; - mw->flag = 0; - mw->check = CHKVAL(mw); - - if( mwHead ) mwHead->prev = mw; - mwHead = mw; - if( mwTail == NULL ) mwTail = mw; - - ptr = (char*)(void*)(mw+1); - PUTDWORD( PRECHK, ptr ); /* '*(long*)ptr = PRECHK;' */ - ptr += sizeof(long); - p = ptr; - memset( ptr, MW_VAL_NEW, size ); - ptr += size; - PUTDWORD( POSTCHK, ptr ); /* '*(long*)ptr = POSTCHK;' */ - - mwNumCurAlloc ++; - mwStatCurAlloc += (long) size; - mwStatTotAlloc += (long) size; - if( mwStatCurAlloc > mwStatMaxAlloc ) - mwStatMaxAlloc = mwStatCurAlloc; - mwStatNumAlloc ++; - - if( mwStatLevel ) mwStatAlloc( size, file, line ); - - return p; - } - -void* mwRealloc( void *p, size_t size, const char* file, int line) { - int oldUseLimit, i; - mwData *mw; - char *ptr; - - mwAutoInit(); - - if( p == NULL ) return mwMalloc( size, file, line ); - if( size == 0 ) { mwFree( p, file, line ); return NULL; } - - /* do the quick ownership test */ - mw = (mwData*) ( ((char*)p)-sizeof(long)-sizeof(mwData) ); - if( mwIsOwned( mw, file, line ) ) { - - /* if the buffer is an NML, treat this as a double-free */ - if( mw->flag & MW_NML ) - { - mwIncErr(); - if( *((unsigned char*)(mw+1)+sizeof(long)) != MW_VAL_NML ) - { - mwWrite( "internal: <%ld> %s(%d), no-mans-land MW-%p is corrupted\n", - mwCounter, file, line, mw ); - } - goto check_dbl_free; - } - - /* if this allocation would violate the limit, fail it */ - if( mwUseLimit && ((long)size + mwStatCurAlloc - (long)mw->size > mwAllocLimit) ) { - TESTS(file,line); - mwCounter ++; - mwWrite( "limit fail: <%ld> %s(%d), %ld wanted %ld available\n", - mwCounter, file, line, (unsigned long)size - mw->size, mwAllocLimit - mwStatCurAlloc ); - mwIncErr(); - FLUSH(); - return NULL; - } - - /* fake realloc operation */ - oldUseLimit = mwUseLimit; - mwUseLimit = 0; - ptr = (char*) mwMalloc( size, file, line ); - if( ptr != NULL ) { - if( size < mw->size ) - memcpy( ptr, p, size ); - else - memcpy( ptr, p, mw->size ); - mwFree( p, file, line ); - } - mwUseLimit = oldUseLimit; - return (void*) ptr; - } - - /* Unknown pointer! */ - - /* using free'd pointer? */ -check_dbl_free: - for(i=0;i %s(%d), %p was" - " freed from %s(%d)\n", - mwCounter, file, line, p, - mwLFfile[i], mwLFline[i] ); - FLUSH(); - return NULL; - } - } - - /* some weird pointer */ - mwIncErr(); - mwWrite( "realloc: <%ld> %s(%d), unknown pointer %p\n", - mwCounter, file, line, p ); - FLUSH(); - return NULL; - } - -char *mwStrdup( char* str, const char* file, int line ) { - size_t len; - char *newstring; - if( str == NULL ) { - mwIncErr(); - mwWrite( "strdup: <%ld> %s(%d), strdup(NULL) called\n", - mwCounter, file, line ); - FLUSH(); - return NULL; - } - len = strlen( str ) + 1; - newstring = (char*) mwMalloc( len, file, line ); - if( newstring != NULL ) memcpy( newstring, str, len ); - return newstring; - } - -void mwFree( void* p, const char* file, int line ) { - int i; - mwData* mw; - char buffer[ sizeof(mwData) + sizeof(long) + 64 ]; - - TESTS(file,line); - - /* this code is in support of C++ delete */ - if( file == NULL ) { - mwFree_( p ); - return; - } - - mwAutoInit(); - mwCounter ++; - - /* on NULL free, write a warning and return */ - if( p == NULL ) { - mwWrite( "NULL free: <%ld> %s(%d), NULL pointer free'd\n", - mwCounter, file, line ); - FLUSH(); - return; - } - - /* do the quick ownership test */ - mw = (mwData*) ( ((char*)p)-sizeof(long)-sizeof(mwData) ); - - if( mwIsOwned( mw, file, line ) ) { - (void) mwTestBuf( mw, file, line ); - - /* if the buffer is an NML, treat this as a double-free */ - if( mw->flag & MW_NML ) - { - if( *((unsigned char*)(mw+1)+sizeof(long)) != MW_VAL_NML ) - { - mwWrite( "internal: <%ld> %s(%d), no-mans-land MW-%p is corrupted\n", - mwCounter, file, line, mw ); - } - goto check_dbl_free; - } - - /* update the statistics */ - mwNumCurAlloc --; - mwStatCurAlloc -= (long) mw->size; - if( mwStatLevel ) mwStatFree( mw->size, mw->file, mw->line ); - - /* we should either free the allocation or keep it as NML */ - if( mwNML ) { - mw->flag |= MW_NML; - mwNmlNumAlloc ++; - mwNmlCurAlloc += (long) mw->size; - memset( (char*)(mw+1)+sizeof(long), MW_VAL_NML, mw->size ); - } - else { - /* unlink the allocation, and enter the post-free data */ - mwUnlink( mw, file, line ); - memset( mw, MW_VAL_DEL, - mw->size + sizeof(mwData)+sizeof(long)+sizeof(long) ); - if( mwFBI ) { - memset( mw, '.', sizeof(mwData) + sizeof(long) ); - sprintf( buffer, "FBI<%ld>%s(%d)", mwCounter, file, line ); - strncpy( (char*)(void*)mw, buffer, sizeof(mwData) + sizeof(long) ); - } - free( mw ); - } - - /* add the pointer to the last-free track */ - mwLFfile[ mwLFcur ] = file; - mwLFline[ mwLFcur ] = line; - mwLastFree[ mwLFcur++ ] = p; - if( mwLFcur == MW_FREE_LIST ) mwLFcur = 0; - - return; - } - - /* check for double-freeing */ -check_dbl_free: - for(i=0;i %s(%d), %p was" - " freed from %s(%d)\n", - mwCounter, file, line, p, - mwLFfile[i], mwLFline[i] ); - FLUSH(); - return; - } - } - - /* some weird pointer... block the free */ - mwIncErr(); - mwWrite( "WILD free: <%ld> %s(%d), unknown pointer %p\n", - mwCounter, file, line, p ); - FLUSH(); - return; - } - -void* mwCalloc( size_t a, size_t b, const char *file, int line ) { - void *p; - size_t size = a * b; - p = mwMalloc( size, file, line ); - if( p == NULL ) return NULL; - memset( p, 0, size ); - return p; - } - -void mwFree_( void *p ) { - TESTS(NULL,0); - free(p); - } - -void* mwMalloc_( size_t size ) { - TESTS(NULL,0); - return malloc( size ); - } - -void* mwRealloc_( void *p, size_t size ) { - TESTS(NULL,0); - return realloc( p, size ); - } - -void* mwCalloc_( size_t a, size_t b ) { - TESTS(NULL,0); - return calloc( a, b ); - } - -void mwFlushNow( void ) { - if( mwLogR() ) fflush( mwLogR() ); - return; - } - -void mwDoFlush( int onoff ) { - mwFlushW( onoff<1?0:onoff ); - if( onoff ) if( mwLogR() ) fflush( mwLogR() ); - return; - } - -void mwLimit( long lim ) { - TESTS(NULL,0); - mwWrite("limit: old limit = "); - if( !mwAllocLimit ) mwWrite( "none" ); - else mwWrite( "%ld bytes", mwAllocLimit ); - mwWrite( ", new limit = "); - if( !lim ) { - mwWrite( "none\n" ); - mwUseLimit = 0; - } - else { - mwWrite( "%ld bytes\n", lim ); - mwUseLimit = 1; - } - mwAllocLimit = lim; - FLUSH(); - } - -void mwSetAriAction( int action ) { - TESTS(NULL,0); - mwAriAction = action; - return; - } - -int mwAssert( int exp, const char *exps, const char *fn, int ln ) { - int i; - char buffer[MW_TRACE_BUFFER+8]; - TESTS(fn,ln); - if( exp ) return 0; - mwAutoInit(); - mwIncErr(); - mwCounter++; - mwWrite( "assert trap: <%ld> %s(%d), %s\n", mwCounter, fn, ln, exps ); - if( mwAriFunction != NULL ) { - sprintf( buffer, "MEMWATCH: assert trap: %s(%d), %s", fn, ln, exps ); - i = (*mwAriFunction)(buffer); - switch( i ) { - case MW_ARI_IGNORE: - mwWrite( "assert trap: <%ld> IGNORED - execution continues\n", mwCounter ); - return 0; - case MW_ARI_RETRY: - mwWrite( "assert trap: <%ld> RETRY - executing again\n", mwCounter ); - return 1; - } - } - else { - if( mwAriAction & MW_ARI_IGNORE ) { - mwWrite( "assert trap: <%ld> AUTO IGNORED - execution continues\n", mwCounter ); - return 0; - } - fprintf(mwSTDERR,"\nMEMWATCH: assert trap: %s(%d), %s\n", fn, ln, exps ); - } - - FLUSH(); - (void) mwTestNow( fn, ln, 1 ); - FLUSH(); - - if( mwAriAction & MW_ARI_NULLREAD ) { - /* This is made in an attempt to kick in */ - /* any debuggers or OS stack traces */ - FLUSH(); - /*lint -save -e413 */ - i = *((int*)NULL); - mwDummy( (char)i ); - /*lint -restore */ - } - - exit(255); - /* NOT REACHED - the return statement is in to keep */ - /* stupid compilers from squeaking about differing return modes. */ - /* Smart compilers instead say 'code unreachable...' */ - /*lint -save -e527 */ - return 0; - /*lint -restore */ - } - -int mwVerify( int exp, const char *exps, const char *fn, int ln ) { - int i; - char buffer[MW_TRACE_BUFFER+8]; - TESTS(fn,ln); - if( exp ) return 0; - mwAutoInit(); - mwIncErr(); - mwCounter++; - mwWrite( "verify trap: <%ld> %s(%d), %s\n", mwCounter, fn, ln, exps ); - if( mwAriFunction != NULL ) { - sprintf( buffer, "MEMWATCH: verify trap: %s(%d), %s", fn, ln, exps ); - i = (*mwAriFunction)(buffer); - if( i == 0 ) { - mwWrite( "verify trap: <%ld> IGNORED - execution continues\n", mwCounter ); - return 0; - } - if( i == 1 ) { - mwWrite( "verify trap: <%ld> RETRY - executing again\n", mwCounter ); - return 1; - } - } - else { - if( mwAriAction & MW_ARI_NULLREAD ) { - /* This is made in an attempt to kick in */ - /* any debuggers or OS stack traces */ - FLUSH(); - /*lint -save -e413 */ - i = *((int*)NULL); - mwDummy( (char)i ); - /*lint -restore */ - } - if( mwAriAction & MW_ARI_IGNORE ) { - mwWrite( "verify trap: <%ld> AUTO IGNORED - execution continues\n", mwCounter ); - return 0; - } - fprintf(mwSTDERR,"\nMEMWATCH: verify trap: %s(%d), %s\n", fn, ln, exps ); - } - FLUSH(); - (void) mwTestNow( fn, ln, 1 ); - FLUSH(); - exit(255); - /* NOT REACHED - the return statement is in to keep */ - /* stupid compilers from squeaking about differing return modes. */ - /* Smart compilers instead say 'code unreachable...' */ - /*lint -save -e527 */ - return 0; - /*lint -restore */ - } - -void mwTrace( const char *format, ... ) { - int tot, oflow = 0; - va_list mark; - - mwAutoInit(); - TESTS(NULL,0); - if( mwOutFunction == NULL ) mwOutFunction = mwDefaultOutFunc; - - va_start( mark, format ); - tot = vsprintf( mwPrintBuf, format, mark ); - va_end( mark ); - if( tot >= MW_TRACE_BUFFER ) { mwPrintBuf[MW_TRACE_BUFFER] = 0; oflow = 1; } - for(tot=0;mwPrintBuf[tot];tot++) - (*mwOutFunction)( mwPrintBuf[tot] ); - if( oflow ) { - mwIncErr(); - mwTrace( " [WARNING: OUTPUT BUFFER OVERFLOW - SYSTEM UNSTABLE]\n" ); - } - - FLUSH(); - } - - -/*********************************************************************** -** Grab & Drop -***********************************************************************/ - -unsigned mwGrab( unsigned kb ) { - TESTS(NULL,0); - return mwGrab_( kb, MW_VAL_GRB, 0 ); - } - -unsigned mwDrop( unsigned kb ) { - TESTS(NULL,0); - return mwDrop_( kb, MW_VAL_GRB, 0 ); - } - -static void mwDropAll() { - TESTS(NULL,0); - (void) mwDrop_( 0, MW_VAL_GRB, 0 ); - (void) mwDrop_( 0, MW_VAL_NML, 0 ); - if( mwGrabList != NULL ) - mwWrite( "internal: the grab list is not empty after mwDropAll()\n"); - } - -static const char *mwGrabType( int type ) { - switch( type ) { - case MW_VAL_GRB: - return "grabbed"; - case MW_VAL_NML: - return "no-mans-land"; - default: - /* do nothing */ - ; - } - return ""; - } - -static unsigned mwGrab_( unsigned kb, int type, int silent ) { - unsigned i = kb; - mwGrabData *gd; - if( !kb ) i = kb = 65000U; - - for(;kb;kb--) { - if( mwUseLimit && - (mwStatCurAlloc + mwGrabSize + (long)sizeof(mwGrabData) > mwAllocLimit) ) { - if( !silent ) { - mwWrite("grabbed: all allowed memory to %s (%u kb)\n", - mwGrabType(type), i-kb); - FLUSH(); - } - return i-kb; - } - gd = (mwGrabData*) malloc( sizeof(mwGrabData) ); - if( gd == NULL ) { - if( !silent ) { - mwWrite("grabbed: all available memory to %s (%u kb)\n", - mwGrabType(type), i-kb); - FLUSH(); - } - return i-kb; - } - mwGrabSize += (long) sizeof(mwGrabData); - gd->next = mwGrabList; - memset( gd->blob, type, sizeof(gd->blob) ); - gd->type = type; - mwGrabList = gd; - } - if( !silent ) { - mwWrite("grabbed: %u kilobytes of %s memory\n", i, mwGrabType(type) ); - FLUSH(); - } - return i; - } - -static unsigned mwDrop_( unsigned kb, int type, int silent ) { - unsigned i = kb; - mwGrabData *gd,*tmp,*pr; - const void *p; - - if( mwGrabList == NULL && kb == 0 ) return 0; - if( !kb ) i = kb = 60000U; - - pr = NULL; - gd = mwGrabList; - for(;kb;) { - if( gd == NULL ) { - if( i-kb > 0 && !silent ) { - mwWrite("dropped: all %s memory (%u kb)\n", mwGrabType(type), i-kb); - FLUSH(); - } - return i-kb; - } - if( gd->type == type ) { - if( pr ) pr->next = gd->next; - kb --; - tmp = gd; - if( mwGrabList == gd ) mwGrabList = gd->next; - gd = gd->next; - p = mwTestMem( tmp->blob, sizeof( tmp->blob ), type ); - if( p != NULL ) { - mwWrite( "wild pointer: <%ld> %s memory hit at %p\n", - mwCounter, mwGrabType(type), p ); - FLUSH(); - } - mwGrabSize -= (long) sizeof(mwGrabData); - free( tmp ); - } - else { - pr = gd; - gd = gd->next; - } - } - if( !silent ) { - mwWrite("dropped: %u kilobytes of %s memory\n", i, mwGrabType(type) ); - FLUSH(); - } - return i; - } - -/*********************************************************************** -** No-Mans-Land -***********************************************************************/ - -void mwNoMansLand( int level ) { - mwAutoInit(); - TESTS(NULL,0); - switch( level ) { - case MW_NML_NONE: - (void) mwDrop_( 0, MW_VAL_NML, 0 ); - break; - case MW_NML_FREE: - break; - case MW_NML_ALL: - (void) mwGrab_( 0, MW_VAL_NML, 0 ); - break; - default: - return; - } - mwNML = level; - } - -/*********************************************************************** -** Static functions -***********************************************************************/ - -static void mwAutoInit( void ) -{ - if( mwInited ) return; - mwUseAtexit = 1; - mwInit(); - return; -} - -static FILE *mwLogR() { - if( (mwLog == mwLogB1) && (mwLog == mwLogB2) ) return mwLog; - if( mwLog == mwLogB1 ) mwLogB2 = mwLog; - if( mwLog == mwLogB2 ) mwLogB1 = mwLog; - if( mwLogB1 == mwLogB2 ) mwLog = mwLogB1; - if( (mwLog == mwLogB1) && (mwLog == mwLogB2) ) { - mwWrite("internal: log file handle damaged and recovered\n"); - FLUSH(); - return mwLog; - } - fprintf(mwSTDERR,"\nMEMWATCH: log file handle destroyed, using mwSTDERR\n" ); - mwLog = mwLogB1 = mwLogB2 = mwSTDERR; - return mwSTDERR; - } - -static void mwLogW( FILE *p ) { - mwLog = mwLogB1 = mwLogB2 = p; - } - -static int mwFlushR() { - if( (mwFlushing == mwFlushingB1) && (mwFlushing == mwFlushingB2) ) return mwFlushing; - if( mwFlushing == mwFlushingB1 ) mwFlushingB2 = mwFlushing; - if( mwFlushing == mwFlushingB2 ) mwFlushingB1 = mwFlushing; - if( mwFlushingB1 == mwFlushingB2 ) mwFlushing = mwFlushingB1; - if( (mwFlushing == mwFlushingB1) && (mwFlushing == mwFlushingB2) ) { - mwWrite("internal: flushing flag damaged and recovered\n"); - FLUSH(); - return mwFlushing; - } - mwWrite("internal: flushing flag destroyed, so set to true\n"); - mwFlushing = mwFlushingB1 = mwFlushingB2 = 1; - return 1; - } - -static void mwFlushW( int n ) { - mwFlushing = mwFlushingB1 = mwFlushingB2 = n; - } - -static void mwIncErr() { - mwErrors++; - mwFlushW( mwFlushR()+1 ); - FLUSH(); - } - -static void mwFlush() { - if( mwLogR() == NULL ) return; -#ifdef MW_FLUSH - fflush( mwLogR() ); -#else - if( mwFlushR() ) fflush( mwLogR() ); -#endif - return; - } - -static void mwUnlink( mwData* mw, const char* file, int line ) { - if( mw->prev == NULL ) { - if( mwHead != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link1 NULL, but not head\n", - mwCounter, file, line, mw ); - mwHead = mw->next; - } - else { - if( mw->prev->next != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link1 failure\n", - mwCounter, file, line, mw ); - else mw->prev->next = mw->next; - } - if( mw->next == NULL ) { - if( mwTail != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link2 NULL, but not tail\n", - mwCounter, file, line, mw ); - mwTail = mw->prev; - } - else { - if( mw->next->prev != mw ) - mwWrite( "internal: <%ld> %s(%d), MW-%p: link2 failure\n", - mwCounter, file, line, mw ); - else mw->next->prev = mw->prev; - } - } - -/* -** Relinking tries to repair a damaged mw block. -** Returns nonzero if it thinks it successfully -** repaired the heap chain. -*/ -static int mwRelink( mwData* mw, const char* file, int line ) { - int fails; - mwData *mw1, *mw2; - long count, size; - mwStat *ms; - - if( file == NULL ) file = "unknown"; - - if( mw == NULL ) { - mwWrite("relink: cannot repair MW at NULL\n"); - FLUSH(); - goto emergency; - } - - if( !mwIsSafeAddr(mw, sizeof(mwData)) ) { - mwWrite("relink: MW-%p is a garbage pointer\n"); - FLUSH(); - goto emergency; - } - - mwWrite("relink: <%ld> %s(%d) attempting to repair MW-%p...\n", mwCounter, file, line, mw ); - FLUSH(); - fails = 0; - - /* Repair from head */ - if( mwHead != mw ) { - if( !mwIsSafeAddr( mwHead, sizeof(mwData) ) ) { - mwWrite("relink: failed for MW-%p; head pointer destroyed\n", mw ); - FLUSH(); - goto emergency; - } - for( mw1=mwHead; mw1; mw1=mw1->next ) { - if( mw1->next == mw ) { - mw->prev = mw1; - break; - } - if( mw1->next && - ( !mwIsSafeAddr(mw1->next, sizeof(mwData)) || mw1->next->prev != mw1) ) { - mwWrite("relink: failed for MW-%p; forward chain fragmented at MW-%p: 'next' is %p\n", mw, mw1, mw1->next ); - FLUSH(); - goto emergency; - } - } - if( mw1 == NULL ) { - mwWrite("relink: MW-%p not found in forward chain search\n", mw ); - FLUSH(); - fails ++; - } - } - else - { - mwWrite( "relink: MW-%p is the head (first) allocation\n", mw ); - if( mw->prev != NULL ) - { - mwWrite( "relink: MW-%p prev pointer is non-NULL, you have a wild pointer\n", mw ); - mw->prev = NULL; - } - } - - /* Repair from tail */ - if( mwTail != mw ) { - if( !mwIsSafeAddr( mwTail, sizeof(mwData) ) ) { - mwWrite("relink: failed for MW-%p; tail pointer destroyed\n", mw ); - FLUSH(); - goto emergency; - } - for( mw1=mwTail; mw1; mw1=mw1->prev ) { - if( mw1->prev == mw ) { - mw->next = mw1; - break; - } - if( mw1->prev && (!mwIsSafeAddr(mw1->prev, sizeof(mwData)) || mw1->prev->next != mw1) ) { - mwWrite("relink: failed for MW-%p; reverse chain fragmented at MW-%p, 'prev' is %p\n", mw, mw1, mw1->prev ); - FLUSH(); - goto emergency; - } - } - if( mw1 == NULL ) { - mwWrite("relink: MW-%p not found in reverse chain search\n", mw ); - FLUSH(); - fails ++; - } - } - else - { - mwWrite( "relink: MW-%p is the tail (last) allocation\n", mw ); - if( mw->next != NULL ) - { - mwWrite( "relink: MW-%p next pointer is non-NULL, you have a wild pointer\n", mw ); - mw->next = NULL; - } - } - - if( fails > 1 ) { - mwWrite("relink: heap appears intact, MW-%p probably garbage pointer\n", mw ); - FLUSH(); - goto verifyok; - } - - /* restore MW info where possible */ - if( mwIsReadAddr( mw->file, 1 ) ) { - ms = mwStatGet( mw->file, -1, 0 ); - if( ms == NULL ) mw->file = ""; - } - mw->check = CHKVAL(mw); - goto verifyok; - - /* Emergency repair */ - emergency: - - if( mwHead == NULL && mwTail == NULL ) - { - if( mwStatCurAlloc == 0 ) - mwWrite("relink: <%ld> %s(%d) heap is empty, nothing to repair\n", mwCounter, file, line ); - else - mwWrite("relink: <%ld> %s(%d) heap damaged beyond repair\n", mwCounter, file, line ); - FLUSH(); - return 0; - } - - mwWrite("relink: <%ld> %s(%d) attempting emergency repairs...\n", mwCounter, file, line ); - FLUSH(); - - if( mwHead == NULL || mwTail == NULL ) - { - if( mwHead == NULL ) mwWrite("relink: mwHead is NULL, but mwTail is %p\n", mwTail ); - else mwWrite("relink: mwTail is NULL, but mwHead is %p\n", mwHead ); - } - - mw1=NULL; - if( mwHead != NULL ) - { - if( !mwIsReadAddr(mwHead,sizeof(mwData)) || mwHead->check != CHKVAL(mwHead) ) - { - mwWrite("relink: mwHead (MW-%p) is damaged, skipping forward scan\n", mwHead ); - mwHead = NULL; - goto scan_reverse; - } - if( mwHead->prev != NULL ) - { - mwWrite("relink: the mwHead pointer's 'prev' member is %p, not NULL\n", mwHead->prev ); - } - for( mw1=mwHead; mw1; mw1=mw1->next ) - { - if( mw1->next ) - { - if( !mwIsReadAddr(mw1->next,sizeof(mwData)) || - !mw1->next->check != CHKVAL(mw1) || - mw1->next->prev != mw1 ) - { - mwWrite("relink: forward chain's last intact MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw1, mw1->size, (mw->flag & MW_NML)?"NoMansLand ":"", mw1->file, mw1->line ); - if( mwIsReadAddr(mw1->next,sizeof(mwData) ) ) - { - mwWrite("relink: forward chain's first damaged MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw1->next, mw1->size, (mw->flag & MW_NML)?"NoMansLand ":"", - mwIsReadAddr(mw1->file,16)?mw1->file:"", mw1->line ); - } - else - { - mwWrite("relink: the 'next' pointer of this MW points to %p, which is out-of-legal-access\n", - mw1->next ); - } - break; - } - } - } - } - - -scan_reverse: - mw2=NULL; - if( mwTail != NULL ) - { - if( !mwIsReadAddr(mwTail,sizeof(mwData)) || mwTail->check != CHKVAL(mwTail) ) - { - mwWrite("relink: mwTail (%p) is damaged, skipping reverse scan\n", mwTail ); - mwTail = NULL; - goto analyze; - } - if( mwTail->next != NULL ) - { - mwWrite("relink: the mwTail pointer's 'next' member is %p, not NULL\n", mwTail->next ); - } - for( mw2=mwTail; mw2; mw2=mw2->prev ) - { - if( mw2->prev ) - { - if( !mwIsReadAddr(mw2->prev,sizeof(mwData)) || - !mw2->prev->check != CHKVAL(mw2) || - mw2->prev->next != mw2 ) - { - mwWrite("relink: reverse chain's last intact MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw2, mw2->size, (mw->flag & MW_NML)?"NoMansLand ":"", mw2->file, mw2->line ); - if( mwIsReadAddr(mw2->prev,sizeof(mwData) ) ) - { - mwWrite("relink: reverse chain's first damaged MW is MW-%p, %ld %sbytes at %s(%d)\n", - mw2->prev, mw2->size, (mw->flag & MW_NML)?"NoMansLand ":"", - mwIsReadAddr(mw2->file,16)?mw2->file:"", mw2->line ); - } - else - { - mwWrite("relink: the 'prev' pointer of this MW points to %p, which is out-of-legal-access\n", - mw2->prev ); - } - break; - } - } - } - } - -analyze: - if( mwHead == NULL && mwTail == NULL ) - { - mwWrite("relink: both head and tail pointers damaged, aborting program\n"); - mwFlushW(1); - FLUSH(); - abort(); - } - if( mwHead == NULL ) - { - mwHead = mw2; - mwWrite("relink: heap truncated, MW-%p designated as new mwHead\n", mw2 ); - mw2->prev = NULL; - mw1 = mw2 = NULL; - } - if( mwTail == NULL ) - { - mwTail = mw1; - mwWrite("relink: heap truncated, MW-%p designated as new mwTail\n", mw1 ); - mw1->next = NULL; - mw1 = mw2 = NULL; - } - if( mw1 == NULL && mw2 == NULL && - mwHead->prev == NULL && mwTail->next == NULL ) { - mwWrite("relink: verifying heap integrity...\n" ); - FLUSH(); - goto verifyok; - } - if( mw1 && mw2 && mw1 != mw2 ) { - mw1->next = mw2; - mw2->prev = mw1; - mwWrite("relink: emergency repairs successful, assessing damage...\n"); - FLUSH(); - } - else { - mwWrite("relink: heap totally destroyed, aborting program\n"); - mwFlushW(1); - FLUSH(); - abort(); - } - - /* Verify by checking that the number of active allocations */ - /* match the number of entries in the chain */ -verifyok: - if( !mwIsHeapOK( NULL ) ) { - mwWrite("relink: heap verification FAILS - aborting program\n"); - mwFlushW(1); - FLUSH(); - abort(); - } - for( size=count=0, mw1=mwHead; mw1; mw1=mw1->next ) { - count ++; - size += (long) mw1->size; - } - if( count == mwNumCurAlloc ) { - mwWrite("relink: successful, "); - if( size == mwStatCurAlloc ) { - mwWrite("no allocations lost\n"); - } - else { - if( mw != NULL ) { - mwWrite("size information lost for MW-%p\n", mw); - mw->size = 0; - } - } - } - else { - mwWrite("relink: partial, %ld MW-blocks of %ld bytes lost\n", - mwNmlNumAlloc+mwNumCurAlloc-count, mwNmlCurAlloc+mwStatCurAlloc-size ); - return 0; - } - - return 1; - } - -/* -** If mwData* is NULL: -** Returns 0 if heap chain is broken. -** Returns 1 if heap chain is intact. -** If mwData* is not NULL: -** Returns 0 if mwData* is missing or if chain is broken. -** Returns 1 if chain is intact and mwData* is found. -*/ -static int mwIsHeapOK( mwData *includes_mw ) { - int found = 0; - mwData *mw; - - for( mw = mwHead; mw; mw=mw->next ) { - if( includes_mw == mw ) found++; - if( !mwIsSafeAddr( mw, sizeof(mwData) ) ) return 0; - if( mw->prev ) { - if( !mwIsSafeAddr( mw->prev, sizeof(mwData) ) ) return 0; - if( mw==mwHead || mw->prev->next != mw ) return 0; - } - if( mw->next ) { - if( !mwIsSafeAddr( mw->next, sizeof(mwData) ) ) return 0; - if( mw==mwTail || mw->next->prev != mw ) return 0; - } - else if( mw!=mwTail ) return 0; - } - - if( includes_mw != NULL && !found ) return 0; - - return 1; - } - -static int mwIsOwned( mwData* mw, const char *file, int line ) { - int retv; - mwStat *ms; - - /* see if the address is legal according to OS */ - if( !mwIsSafeAddr( mw, sizeof(mwData) ) ) return 0; - - /* make sure we have _anything_ allocated */ - if( mwHead == NULL && mwTail == NULL && mwStatCurAlloc == 0 ) - return 0; - - /* calculate checksum */ - if( mw->check != CHKVAL(mw) ) { - /* may be damaged checksum, see if block is in heap */ - if( mwIsHeapOK( mw ) ) { - /* damaged checksum, repair it */ - mwWrite( "internal: <%ld> %s(%d), checksum for MW-%p is incorrect\n", - mwCounter, file, line, mw ); - mwIncErr(); - if( mwIsReadAddr( mw->file, 1 ) ) { - ms = mwStatGet( mw->file, -1, 0 ); - if( ms == NULL ) mw->file = ""; - } - else mw->file = ""; - mw->check = CHKVAL(mw); - return 1; - } - /* no, it's just some garbage data */ - return 0; - } - - /* check that the non-NULL pointers are safe */ - if( mw->prev && !mwIsSafeAddr( mw->prev, sizeof(mwData) ) ) mwRelink( mw, file, line ); - if( mw->next && !mwIsSafeAddr( mw->next, sizeof(mwData) ) ) mwRelink( mw, file, line ); - - /* safe address, checksum OK, proceed with heap checks */ - - /* see if the block is in the heap */ - retv = 0; - if( mw->prev ) { if( mw->prev->next == mw ) retv ++; } - else { if( mwHead == mw ) retv++; } - if( mw->next ) { if( mw->next->prev == mw ) retv ++; } - else { if( mwTail == mw ) retv++; } - if( mw->check == CHKVAL(mw) ) retv ++; - if( retv > 2 ) return 1; - - /* block not in heap, check heap for corruption */ - - if( !mwIsHeapOK( mw ) ) { - if( mwRelink( mw, file, line ) ) - return 1; - } - - /* unable to repair */ - mwWrite( "internal: <%ld> %s(%d), mwIsOwned fails for MW-%p\n", - mwCounter, file, line, mw ); - mwIncErr(); - - return 0; - } - -/* -** mwTestBuf: -** Checks a buffers links and pre/postfixes. -** Writes errors found to the log. -** Returns zero if no errors found. -*/ -static int mwTestBuf( mwData* mw, const char* file, int line ) { - int retv = 0; - char *p; - long chk; - - if( file == NULL ) file = "unknown"; - - if( !mwIsSafeAddr( mw, sizeof(mwData) ) ) { - mwWrite( "internal: <%ld> %s(%d): pointer MW-%p is invalid\n", - mwCounter, file, line, mw ); - mwIncErr(); - return 2; - } - - if( mw->check != CHKVAL(mw) ) { - mwWrite( "internal: <%ld> %s(%d), info trashed; relinking\n", - mwCounter, file, line ); - mwIncErr(); - if( !mwRelink( mw, file, line ) ) return 2; - } - - if( mw->prev && mw->prev->next != mw ) { - mwWrite( "internal: <%ld> %s(%d), buffer <%ld> %s(%d) link1 broken\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - if( !mwRelink( mw, file, line ) ) retv = 2; - } - if( mw->next && mw->next->prev != mw ) { - mwWrite( "internal: <%ld> %s(%d), buffer <%ld> %s(%d) link2 broken\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - if( !mwRelink( mw, file, line ) ) retv = 2; - } - - p = (char*)(mw+1); - GETDWORD( chk, p ); - if( chk != PRECHK ) { - mwWrite( "underflow: <%ld> %s(%d), %ld bytes alloc'd at <%ld> %s(%d)\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - retv = 1; - } - p += mw->size + sizeof(long); - GETDWORD( chk, p ); - if( chk != POSTCHK ) { - mwWrite( "overflow: <%ld> %s(%d), %ld bytes alloc'd at <%ld> %s(%d)\n", - mwCounter,file,line, (long)mw->size, mw->count, mw->file, mw->line ); - mwIncErr(); - retv = 1; - } - - return retv; - } - -static void mwDefaultOutFunc( int c ) { - if( mwLogR() ) fputc( c, mwLogR() ); - } - -static void mwWrite( const char *format, ... ) { - int tot, oflow = 0; - va_list mark; - mwAutoInit(); - if( mwOutFunction == NULL ) mwOutFunction = mwDefaultOutFunc; - va_start( mark, format ); - tot = vsprintf( mwPrintBuf, format, mark ); - va_end( mark ); - if( tot >= MW_TRACE_BUFFER ) { mwPrintBuf[MW_TRACE_BUFFER] = 0; oflow = 1; } - for(tot=0;mwPrintBuf[tot];tot++) - (*mwOutFunction)( mwPrintBuf[tot] ); - if( oflow ) { - mwWrite( "\ninternal: mwWrite(): WARNING! OUTPUT EXCEEDED %u CHARS: SYSTEM UNSTABLE\n", MW_TRACE_BUFFER-1 ); - FLUSH(); - } - return; - } - -static void mwLogFile( const char *name ) { - time_t tid; - (void) time( &tid ); - if( mwLogR() != NULL ) { - fclose( mwLogR() ); - mwLogW( NULL ); - } - if( name == NULL ) return; - mwLogW( fopen( name, "a" COMMIT ) ); - if( mwLogR() == NULL ) - mwWrite( "logfile: failed to open/create file '%s'\n", name ); - } - -/* -** Try to free NML memory until a contiguous allocation of -** 'needed' bytes can be satisfied. If this is not enough -** and the 'urgent' parameter is nonzero, grabbed memory is -** also freed. -*/ -static size_t mwFreeUp( size_t needed, int urgent ) { - void *p; - mwData *mw, *mw2; - char *data; - - /* free grabbed NML memory */ - for(;;) { - if( mwDrop_( 1, MW_VAL_NML, 1 ) == 0 ) break; - p = malloc( needed ); - if( p == NULL ) continue; - free( p ); - return needed; - } - - /* free normal NML memory */ - mw = mwHead; - while( mw != NULL ) { - if( !(mw->flag & MW_NML) ) mw = mw->next; - else { - data = ((char*)(mw+1)) + sizeof(long); - if( mwTestMem( data, mw->size, MW_VAL_NML ) ) { - mwIncErr(); - mwWrite( "wild pointer: <%ld> NoMansLand %p alloc'd at %s(%d)\n", - mw->count, data + sizeof(long), mw->file, mw->line ); - } - mw2 = mw->next; - mwUnlink( mw, "mwFreeUp", 0 ); - free( mw ); - mw = mw2; - p = malloc( needed ); - if( p == NULL ) continue; - free( p ); - return needed; - } - } - - /* if not urgent (for internal purposes), fail */ - if( !urgent ) return 0; - - /* free grabbed memory */ - for(;;) { - if( mwDrop_( 1, MW_VAL_GRB, 1 ) == 0 ) break; - p = malloc( needed ); - if( p == NULL ) continue; - free( p ); - return needed; - } - - return 0; - } - -static const void * mwTestMem( const void *p, unsigned len, int c ) { - const unsigned char *ptr; - ptr = (const unsigned char *) p; - while( len-- ) { - if( *ptr != (unsigned char)c ) return (const void*)ptr; - ptr ++; - } - return NULL; - } - -static int mwStrCmpI( const char *s1, const char *s2 ) { - if( s1 == NULL || s2 == NULL ) return 0; - while( *s1 ) { - if( toupper(*s2) == toupper(*s1) ) { s1++; s2++; continue; } - return 1; - } - return 0; - } - -#define AIPH() if( always_invoked ) { mwWrite("autocheck: <%ld> %s(%d) ", mwCounter, file, line ); always_invoked = 0; } - -static int mwTestNow( const char *file, int line, int always_invoked ) { - int retv = 0; - mwData *mw; - char *data; - - if( file && !always_invoked ) - mwWrite("check: <%ld> %s(%d), checking %s%s%s\n", - mwCounter, file, line, - (mwTestFlags & MW_TEST_CHAIN) ? "chain ": "", - (mwTestFlags & MW_TEST_ALLOC) ? "alloc ": "", - (mwTestFlags & MW_TEST_NML) ? "nomansland ": "" - ); - - if( mwTestFlags & MW_TEST_CHAIN ) { - for( mw = mwHead; mw; mw=mw->next ) { - if( !mwIsSafeAddr(mw, sizeof(mwData)) ) { - AIPH(); - mwWrite("check: heap corruption detected\n"); - mwIncErr(); - return retv + 1; - } - if( mw->prev ) { - if( !mwIsSafeAddr(mw->prev, sizeof(mwData)) ) { - AIPH(); - mwWrite("check: heap corruption detected\n"); - mwIncErr(); - return retv + 1; - } - if( mw==mwHead || mw->prev->next != mw ) { - AIPH(); - mwWrite("check: heap chain broken, prev link incorrect\n"); - mwIncErr(); - retv ++; - } - } - if( mw->next ) { - if( !mwIsSafeAddr(mw->next, sizeof(mwData)) ) { - AIPH(); - mwWrite("check: heap corruption detected\n"); - mwIncErr(); - return retv + 1; - } - if( mw==mwTail || mw->next->prev != mw ) { - AIPH(); - mwWrite("check: heap chain broken, next link incorrect\n"); - mwIncErr(); - retv ++; - } - } - else if( mw!=mwTail ) { - AIPH(); - mwWrite("check: heap chain broken, tail incorrect\n"); - mwIncErr(); - retv ++; - } - } - } - if( mwTestFlags & MW_TEST_ALLOC ) { - for( mw = mwHead; mw; mw=mw->next ) { - if( mwTestBuf( mw, file, line ) ) retv ++; - } - } - if( mwTestFlags & MW_TEST_NML ) { - for( mw = mwHead; mw; mw=mw->next ) { - if( (mw->flag & MW_NML) ) { - data = ((char*)(mw+1)) + sizeof(long); - if( mwTestMem( data, mw->size, MW_VAL_NML ) ) { - mwIncErr(); - mwWrite( "wild pointer: <%ld> NoMansLand %p alloc'd at %s(%d)\n", - mw->count, data + sizeof(long), mw->file, mw->line ); - } - } - } - } - - - if( file && !always_invoked && !retv ) - mwWrite("check: <%ld> %s(%d), complete; no errors\n", - mwCounter, file, line ); - return retv; - } - -/********************************************************************** -** Statistics -**********************************************************************/ - -static void mwStatReport() -{ - mwStat* ms, *ms2; - const char *modname; - int modnamelen; - - /* global statistics report */ - mwWrite( "\nMemory usage statistics (global):\n" ); - mwWrite( " N)umber of allocations made: %ld\n", mwStatNumAlloc ); - mwWrite( " L)argest memory usage : %ld\n", mwStatMaxAlloc ); - mwWrite( " T)otal of all alloc() calls: %ld\n", mwStatTotAlloc ); - mwWrite( " U)nfreed bytes totals : %ld\n", mwStatCurAlloc ); - FLUSH(); - - if( mwStatLevel < 1 ) return; - - /* on a per-module basis */ - mwWrite( "\nMemory usage statistics (detailed):\n"); - mwWrite( " Module/Line Number Largest Total Unfreed \n"); - for( ms=mwStatList; ms; ms=ms->next ) - { - if( ms->line == -1 ) - { - if( ms->file == NULL || !mwIsReadAddr(ms->file,22) ) modname = ""; - else modname = ms->file; - modnamelen = strlen(modname); - if( modnamelen > 42 ) - { - modname = modname + modnamelen - 42; - } - - mwWrite(" %-42s %-8ld %-8ld %-8ld %-8ld\n", - modname, ms->num, ms->max, ms->total, ms->curr ); - if( ms->file && mwStatLevel > 1 ) - { - for( ms2=mwStatList; ms2; ms2=ms2->next ) - { - if( ms2->line!=-1 && ms2->file!=NULL && !mwStrCmpI( ms2->file, ms->file ) ) - { - mwWrite( " %-8d %-8ld %-8ld %-8ld %-8ld\n", - ms2->line, ms2->num, ms2->max, ms2->total, ms2->curr ); - } - } - } - } - } -} - -static mwStat* mwStatGet( const char *file, int line, int makenew ) { - mwStat* ms; - - if( mwStatLevel < 2 ) line = -1; - - for( ms=mwStatList; ms!=NULL; ms=ms->next ) { - if( line != ms->line ) continue; - if( file==NULL ) { - if( ms->file == NULL ) break; - continue; - } - if( ms->file == NULL ) continue; - if( !strcmp( ms->file, file ) ) break; - } - - if( ms != NULL ) return ms; - - if( !makenew ) return NULL; - - ms = (mwStat*) malloc( sizeof(mwStat) ); - if( ms == NULL ) { - if( mwFreeUp( sizeof(mwStat), 0 ) < sizeof(mwStat) || - (ms=(mwStat*)malloc(sizeof(mwStat))) == NULL ) { - mwWrite("internal: memory low, statistics incomplete for '%s'\n", file ); - return NULL; - } - } - ms->file = file; - ms->line = line; - ms->total = 0L; - ms->max = 0L; - ms->num = 0L; - ms->curr = 0L; - ms->next = mwStatList; - mwStatList = ms; - return ms; - } - -static void mwStatAlloc( size_t size, const char* file, int line ) { - mwStat* ms; - - /* update the module statistics */ - ms = mwStatGet( file, -1, 1 ); - if( ms != NULL ) { - ms->total += (long) size; - ms->curr += (long) size; - ms->num ++; - if( ms->curr > ms->max ) ms->max = ms->curr; - } - - /* update the line statistics */ - if( mwStatLevel > 1 && line != -1 && file ) { - ms = mwStatGet( file, line, 1 ); - if( ms != NULL ) { - ms->total += (long) size; - ms->curr += (long) size; - ms->num ++; - if( ms->curr > ms->max ) ms->max = ms->curr; - } - } - - } - -static void mwStatFree( size_t size, const char* file, int line ) { - mwStat* ms; - - /* update the module statistics */ - ms = mwStatGet( file, -1, 1 ); - if( ms != NULL ) ms->curr -= (long) size; - - /* update the line statistics */ - if( mwStatLevel > 1 && line != -1 && file ) { - ms = mwStatGet( file, line, 1 ); - if( ms != NULL ) ms->curr -= (long) size; - } - } - -#if 0 /* 980317: disabled C++ */ - -/********************************************************************** -** C++ new & delete -**********************************************************************/ - -#ifdef __cplusplus -#ifndef MEMWATCH_NOCPP - -int mwNCur = 0; -const char *mwNFile = NULL; -int mwNLine = 0; - -class MemWatch { -public: - MemWatch(); - ~MemWatch(); - }; - -MemWatch::MemWatch() { - if( mwInited ) return; - mwUseAtexit = 0; - mwInit(); - } - -MemWatch::~MemWatch() { - if( mwUseAtexit ) return; - mwTerm(); - } - -/* -** This global new will catch all 'new' calls where MEMWATCH is -** not active. -*/ -void* operator new( unsigned size ) { - mwNCur = 0; - return mwMalloc( size, "", 0 ); - } - -/* -** This is the new operator that's called when a module uses mwNew. -*/ -void* operator new( unsigned size, const char *file, int line ) { - mwNCur = 0; - return mwMalloc( size, file, line ); - } - -/* -** Since this delete operator will recieve ALL delete's -** even those from within libraries, we must accept -** delete's before we've been initialized. Nor can we -** reliably check for wild free's if the mwNCur variable -** is not set. -*/ -void operator delete( void *p ) { - if( p == NULL ) return; - if( !mwInited ) { - free( p ); - return; - } - if( mwNCur ) { - mwFree( p, mwNFile, mwNLine ); - mwNCur = 0; - return; - } - mwFree_( p ); - } - -#endif /* MEMWATCH_NOCPP */ -#endif /* __cplusplus */ - -#endif /* 980317: disabled C++ */ - -/* MEMWATCH.C */ \ No newline at end of file diff --git a/lib/memwatch.h b/lib/memwatch.h deleted file mode 100644 index 4ef003fa..00000000 --- a/lib/memwatch.h +++ /dev/null @@ -1,701 +0,0 @@ -/* -** MEMWATCH.H -** Nonintrusive ANSI C memory leak / overwrite detection -** Copyright (C) 1992-99 Johan Lindh -** All rights reserved. -** Version 2.62 -** -************************************************************************ -** -** PURPOSE: -** -** MEMWATCH has been written to allow guys and gals that like to -** program in C a public-domain memory error control product. -** I hope you'll find it's as advanced as most commercial packages. -** The idea is that you use it during the development phase and -** then remove the MEMWATCH define to produce your final product. -** MEMWATCH is distributed in source code form in order to allow -** you to compile it for your platform with your own compiler. -** It's aim is to be 100% ANSI C, but some compilers are more stingy -** than others. If it doesn't compile without warnings, please mail -** me the configuration of operating system and compiler you are using -** along with a description of how to modify the source, and the version -** number of MEMWATCH that you are using. -** -************************************************************************ -** -** And now for some legalese... -** -** LICENSE: -** -** You are granted a non-exclusive right to use MEMWATCH in your -** programs, provided that you agree to the following terms: -** -** 1. Johan Lindh retains the full copyright of MEMWATCH, and owns -** all rights to it. This means you can't sell it yourself, or -** ship it as part of another product, or as part of a package. -** 2. If you modify any of the files, you must not give them to -** anyone else. But please send me a copy of the changes, -** along with a text as to why they should be implemented. -** 3. You read and agree to the DISCLAIMER, below. -** -** DISCLAIMER: -** -** THIS SOFTWARE IS PROVIDED FREE OF CHARGE 'AS IS' AND JOHAN LINDH MAKES -** NO EXPRESS OR IMPLIED WARRANTIES WITH RESPECT TO IT. JOHAN LINDH WILL -** NOT BE LIABLE FOR ANY DAMAGES, DIRECT OR INDIRECT, ARISING FROM THE -** USAGE OR HANDLING OF THIS SOFTWARE. -** -************************************************************************ -** -** REVISION HISTORY: -** -** 920810 JLI [1.00] -** 920830 JLI [1.10 double-free detection] -** 920912 JLI [1.15 mwPuts, mwGrab/Drop, mwLimit] -** 921022 JLI [1.20 ASSERT and VERIFY] -** 921105 JLI [1.30 C++ support and TRACE] -** 921116 JLI [1.40 mwSetOutFunc] -** 930215 JLI [1.50 modified ASSERT/VERIFY] -** 930327 JLI [1.51 better auto-init & PC-lint support] -** 930506 JLI [1.55 MemWatch class, improved C++ support] -** 930507 JLI [1.60 mwTest & CHECK()] -** 930809 JLI [1.65 Abort/Retry/Ignore] -** 930820 JLI [1.70 data dump when unfreed] -** 931016 JLI [1.72 modified C++ new/delete handling] -** 931108 JLI [1.77 mwSetAssertAction() & some small changes] -** 940110 JLI [1.80 no-mans-land alloc/checking] -** 940328 JLI [2.00 version 2.0 rewrite] -** Improved NML (no-mans-land) support. -** Improved performance (especially for free()ing!). -** Support for 'read-only' buffers (checksums) -** ^^ NOTE: I never did this... maybe I should? -** FBI (free'd block info) tagged before freed blocks -** Exporting of the mwCounter variable -** mwBreakOut() localizes debugger support -** Allocation statistics (global, per-module, per-line) -** Self-repair ability with relinking -** 950913 JLI [2.10 improved garbage handling] -** 951201 JLI [2.11 improved auto-free in emergencies] -** 960125 JLI [X.01 implemented auto-checking using mwAutoCheck()] -** 960514 JLI [2.12 undefining of existing macros] -** 960515 JLI [2.13 possibility to use default new() & delete()] -** 960516 JLI [2.20 suppression of file flushing on unfreed msgs] -** 960516 JLI [2.21 better support for using MEMWATCH with DLL's] -** 960710 JLI [X.02 multiple logs and mwFlushNow()] -** 960801 JLI [2.22 merged X.01 version with current] -** 960805 JLI [2.30 mwIsXXXXAddr() to avoid unneeded GP's] -** 960805 JLI [2.31 merged X.02 version with current] -** 961002 JLI [2.32 support for realloc() + fixed STDERR bug] -** 961222 JLI [2.40 added mwMark() & mwUnmark()] -** 970101 JLI [2.41 added over/underflow checking after failed ASSERT/VERIFY] -** 970113 JLI [2.42 added support for PC-Lint 7.00g] -** 970207 JLI [2.43 added support for strdup()] -** 970209 JLI [2.44 changed default filename to lowercase] -** 970405 JLI [2.45 fixed bug related with atexit() and some C++ compilers] -** 970723 JLI [2.46 added MW_ARI_NULLREAD flag] -** 970813 JLI [2.47 stabilized marker handling] -** 980317 JLI [2.48 ripped out C++ support; wasn't working good anyway] -** 980318 JLI [2.50 improved self-repair facilities & SIGSEGV support] -** 980417 JLI [2.51 more checks for invalid addresses] -** 980512 JLI [2.52 moved MW_ARI_NULLREAD to occur before aborting] -** 990112 JLI [2.53 added check for empty heap to mwIsOwned] -** 990217 JLI [2.55 improved the emergency repairs diagnostics and NML] -** 990224 JLI [2.56 changed ordering of members in structures] -** 990303 JLI [2.57 first maybe-fixit-for-hpux test] -** 990516 JLI [2.58 added 'static' to the definition of mwAutoInit] -** 990517 JLI [2.59 fixed some high-sensitivity warnings] -** 990610 JLI [2.60 fixed some more high-sensitivity warnings] -** 990715 JLI [2.61 changed TRACE/ASSERT/VERIFY macro names] -** 991001 JLI [2.62 added CHECK_BUFFER() and mwTestBuffer()] -** -** To use, simply include 'MEMWATCH.H' as a header file, -** and add MEMWATCH.C to your list of files, and define the macro -** 'MEMWATCH'. If this is not defined, MEMWATCH will disable itself. -** -** To call the standard C malloc / realloc / calloc / free; use mwMalloc_(), -** mwCalloc_() and mwFree_(). Note that mwFree_() will correctly -** free both malloc()'d memory as well as mwMalloc()'d. -** -** 980317: C++ support has been disabled. -** The code remains, but is not compiled. -** -** For use with C++, which allows use of inlining in header files -** and class specific new/delete, you must also define 'new' as -** 'mwNew' and 'delete' as 'mwDelete'. Do this *after* you include -** C++ header files from libraries, otherwise you can mess up their -** class definitions. If you don't define these, the C++ allocations -** will not have source file and line number information. Also note, -** most C++ class libraries implement their own C++ memory management, -** and don't allow anyone to override them. MFC belongs to this crew. -** In these cases, the only thing to do is to use MEMWATCH_NOCPP. -** -** You can capture output from MEMWATCH using mwSetOutFunc(). -** Just give it the adress of a "void myOutFunc(int c)" function, -** and all characters to be output will be redirected there. -** -** A failing ASSERT() or VERIFY() will normally always abort your -** program. This can be changed using mwSetAriFunc(). Give it a -** pointer to a "int myAriFunc(const char *)" function. Your function -** must ask the user whether to Abort, Retry or Ignore the trap. -** Return 2 to Abort, 1 to Retry or 0 to Ignore. Beware retry; it -** causes the expression to be evaluated again! MEMWATCH has a -** default ARI handler. It's disabled by default, but you can enable -** it by calling 'mwDefaultAri()'. Note that this will STILL abort -** your program unless you define MEMWATCH_STDIO to allow MEMWATCH -** to use the standard C I/O streams. Also, setting the ARI function -** will cause MEMWATCH *NOT* to write the ARI error to stderr. The -** error string is passed to the ARI function instead, as the -** 'const char *' parameter. -** -** You can disable MEMWATCH's ASSERT/VERIFY and/or TRACE implementations. -** This can be useful if you're using a debug terminal or smart debugger. -** Disable them by defining MW_NOASSERT, MW_NOVERIFY or MW_NOTRACE. -** -** MEMWATCH fills all allocated memory with the byte 0xFE, so if -** you're looking at erroneous data which are all 0xFE:s, the -** data probably was not initialized by you. The exception is -** calloc(), which will fill with zero's. All freed buffers are -** zapped with 0xFD. If this is what you look at, you're using -** data that has been freed. If this is the case, be aware that -** MEMWATCH places a 'free'd block info' structure immediately -** before the freed data. This block contains info about where -** the block was freed. The information is in readable text, -** in the format "FBIfilename(line)", for example: -** "FBI<267>test.c(12)". Using FBI's slows down free(), so it's -** disabled by default. Use mwFreeBufferInfo(1) to enable it. -** -** To aid in tracking down wild pointer writes, MEMWATCH can perform -** no-mans-land allocations. No-mans-land will contain the byte 0xFC. -** MEMWATCH will, when this is enabled, convert recently free'd memory -** into NML allocations. -** -** MEMWATCH protects it's own data buffers with checksums. If you -** get an internal error, it means you're overwriting wildly, -** or using an uninitialized pointer. -** -************************************************************************ -** -** Note when compiling with Microsoft C: -** - MSC ignores fflush() by default. This is overridden, so that -** the disk log will always be current. -** -** This utility has been tested with: -** PC-lint 7.0k, passed as 100% ANSI C compatible -** Microsoft Visual C++ on Win16 and Win32 -** Microsoft C on DOS -** SAS C on an Amiga 500 -** Gnu C on a PC running Red Hat Linux -** ...and using an (to me) unknown compiler on an Atari machine. -** -************************************************************************ -** -** Format of error messages in MEMWATCH.LOG: -** message: filename(linenumber), information -** -** Errors caught by MemWatch, when they are detected, and any -** actions taken besides writing to the log file MEMWATCH.LOG: -** -** Double-freeing: -** A pointer that was recently freed and has not since been -** reused was freed again. The place where the previous free() -** was executed is displayed. -** Detect: delete or free() using the offending pointer. -** Action: The delete or free() is cancelled, execution continues. -** Underflow: -** You have written just ahead of the allocated memory. -** The size and place of the allocation is displayed. -** Detect: delete or free() of the damaged buffer. -** Action: The buffer is freed, but there may be secondary damage. -** Overflow: -** Like underflow, but you've written after the end of the buffer. -** Detect: see Underflow. -** Action: see Underflow. -** WILD free: -** An unrecognized pointer was passed to delete or free(). -** The pointer may have been returned from a library function; -** in that case, use mwFree_() to force free() of it. -** Also, this may be a double-free, but the previous free was -** too long ago, causing MEMWATCH to 'forget' it. -** Detect: delete or free() of the offending pointer. -** Action: The delete or free() is cancelled, execution continues. -** NULL free: -** It's unclear to me whether or not freeing of NULL pointers -** is legal in ANSI C, therefore a warning is written to the log file, -** but the error counter remains the same. This is legal using C++, -** so the warning does not appear with delete. -** Detect: When you free(NULL). -** Action: The free() is cancelled. -** Failed: -** A request to allocate memory failed. If the allocation is -** small, this may be due to memory depletion, but is more likely -** to be memory fragmentation problems. The amount of memory -** allocated so far is displayed also. -** Detect: When you new, malloc(), realloc() or calloc() memory. -** Action: NULL is returned. -** Realloc: -** A request to re-allocate a memory buffer failed for reasons -** other than out-of-memory. The specific reason is shown. -** Detect: When you realloc() -** Action: realloc() is cancelled, NULL is returned -** Limit fail: -** A request to allocate memory failed since it would violate -** the limit set using mwLimit(). mwLimit() is used to stress-test -** your code under simulated low memory conditions. -** Detect: At new, malloc(), realloc() or calloc(). -** Action: NULL is returned. -** Assert trap: -** An ASSERT() failed. The ASSERT() macro works like C's assert() -** macro/function, except that it's interactive. See your C manual. -** Detect: On the ASSERT(). -** Action: Program ends with an advisory message to stderr, OR -** Program writes the ASSERT to the log and continues, OR -** Program asks Abort/Retry/Ignore? and takes that action. -** Verify trap: -** A VERIFY() failed. The VERIFY() macro works like ASSERT(), -** but if MEMWATCH is not defined, it still evaluates the -** expression, but it does not act upon the result. -** Detect: On the VERIFY(). -** Action: Program ends with an advisory message to stderr, OR -** Program writes the VERIFY to the log and continues, OR -** Program asks Abort/Retry/Ignore? and takes that action. -** Wild pointer: -** A no-mans-land buffer has been written into. MEMWATCH can -** allocate and distribute chunks of memory solely for the -** purpose of trying to catch random writes into memory. -** Detect: Always on CHECK(), but can be detected in several places. -** Action: The error is logged, and if an ARI handler is installed, -** it is executed, otherwise, execution continues. -** Unfreed: -** A memory buffer you allocated has not been freed. -** You are informed where it was allocated, and whether any -** over or underflow has occured. MemWatch also displays up to -** 16 bytes of the data, as much as it can, in hex and text. -** Detect: When MemWatch terminates. -** Action: The buffer is freed. -** Check: -** An error was detected during a CHECK() operation. -** The associated pointer is displayed along with -** the file and line where the CHECK() was executed. -** Followed immediately by a normal error message. -** Detect: When you CHECK() -** Action: Depends on the error -** Relink: -** After a MEMWATCH internal control block has been trashed, -** MEMWATCH tries to repair the damage. If successful, program -** execution will continue instead of aborting. Some information -** about the block may be gone permanently, though. -** Detect: N/A -** Action: Relink successful: program continues. -** Relink fails: program aborts. -** Internal: -** An internal error is flagged by MEMWATCH when it's control -** structures have been damaged. You are likely using an uninitialized -** pointer somewhere in your program, or are zapping memory all over. -** The message may give you additional diagnostic information. -** If possible, MEMWATCH will recover and continue execution. -** Detect: Various actions. -** Action: Whatever is needed -** Mark: -** The program terminated without umarking all marked pointers. Marking -** can be used to track resources other than memory. mwMark(pointer,text,...) -** when the resource is allocated, and mwUnmark(pointer) when it's freed. -** The 'text' is displayed for still marked pointers when the program -** ends. -** Detect: When MemWatch terminates. -** Action: The error is logged. -** -** -************************************************************************ -** -** The author may be reached by e-mail at the address below. If you -** mail me about source code changes in MEMWATCH, remember to include -** MW's version number. -** -** Johan Lindh -** johan@link-data.com -** -** The latest version of MEMWATCH may be downloaded from -** http://www.link-data.com/ -*/ - -#ifdef MEMWATCH - -#ifndef __MEMWATCH_H -#define __MEMWATCH_H - -/* Make sure that malloc(), realloc(), calloc() and free() are declared. */ -/*lint -save -e537 */ -#include -/*lint -restore */ - -#ifdef __cplusplus -extern "C" { -#endif - - -/* -** Constants used -** All MEMWATCH constants start with the prefix MW_, followed by -** a short mnemonic which indicates where the constant is used, -** followed by a descriptive text about it. -*/ - -#define MW_ARI_NULLREAD 0x10 /* Null read (to start debugger) */ -#define MW_ARI_ABORT 0x04 /* ARI handler says: abort program! */ -#define MW_ARI_RETRY 0x02 /* ARI handler says: retry action! */ -#define MW_ARI_IGNORE 0x01 /* ARI handler says: ignore error! */ - -#define MW_VAL_NEW 0xFE /* value in newly allocated memory */ -#define MW_VAL_DEL 0xFD /* value in newly deleted memory */ -#define MW_VAL_NML 0xFC /* value in no-mans-land */ -#define MW_VAL_GRB 0xFB /* value in grabbed memory */ - -#define MW_TEST_ALL 0xFFFF /* perform all tests */ -#define MW_TEST_CHAIN 0x0001 /* walk the heap chain */ -#define MW_TEST_ALLOC 0x0002 /* test allocations & NML guards */ -#define MW_TEST_NML 0x0004 /* test all-NML areas for modifications */ - -#define MW_NML_NONE 0 /* no NML */ -#define MW_NML_FREE 1 /* turn FREE'd memory into NML */ -#define MW_NML_ALL 2 /* all unused memory is NML */ -#define MW_NML_DEFAULT 0 /* the default NML setting */ - -#define MW_STAT_GLOBAL 0 /* only global statistics collected */ -#define MW_STAT_MODULE 1 /* collect statistics on a module basis */ -#define MW_STAT_LINE 2 /* collect statistics on a line basis */ -#define MW_STAT_DEFAULT 0 /* the default statistics setting */ - -/* -** MemWatch internal constants -** You may change these and recompile MemWatch to change the limits -** of some parameters. Respect the recommended minimums! -*/ -#define MW_TRACE_BUFFER 256 /* (min 160) size of TRACE()'s output buffer */ -#define MW_FREE_LIST 64 /* (min 4) number of free()'s to track */ - -/* -** Exported variables -** In case you have to remove the 'const' keyword because your compiler -** doesn't support it, be aware that changing the values may cause -** unpredictable behaviour. -** - mwCounter contains the current action count. You can use this to -** place breakpoints using a debugger, if you want. -*/ -#ifndef __MEMWATCH_C -extern const unsigned long mwCounter; -#endif - -/* -** System functions -** Normally, it is not nessecary to call any of these. MEMWATCH will -** automatically initialize itself on the first MEMWATCH function call, -** and set up a call to mwAbort() using atexit(). Some C++ implementations -** run the atexit() chain before the program has terminated, so you -** may have to use mwInit() or the MemWatch C++ class to get good -** behaviour. -** - mwInit() can be called to disable the atexit() usage. If mwInit() -** is called directly, you must call mwTerm() to end MemWatch, or -** mwAbort(). -** - mwTerm() is usually not nessecary to call; but if called, it will -** call mwAbort() if it finds that it is cancelling the 'topmost' -** mwInit() call. -** - mwAbort() cleans up after MEMWATCH, reports unfreed buffers, etc. -*/ -void mwInit( void ); -void mwTerm( void ); -void mwAbort( void ); - -/* -** Setup functions -** These functions control the operation of MEMWATCH's protective features. -** - mwFlushNow() causes MEMWATCH to flush it's buffers. -** - mwDoFlush() controls whether MEMWATCH flushes the disk buffers after -** writes. The default is smart flushing: MEMWATCH will not flush buffers -** explicitly until memory errors are detected. Then, all writes are -** flushed until program end or mwDoFlush(0) is called. -** - mwLimit() sets the allocation limit, an arbitrary limit on how much -** memory your program may allocate in bytes. Used to stress-test app. -** Also, in virtual-memory or multitasking environs, puts a limit on -** how much MW_NML_ALL can eat up. -** - mwGrab() grabs up X kilobytes of memory. Allocates actual memory, -** can be used to stress test app & OS both. -** - mwDrop() drops X kilobytes of grabbed memory. -** - mwNoMansLand() sets the behaviour of the NML logic. See the -** MW_NML_xxx for more information. The default is MW_NML_DEFAULT. -** - mwStatistics() sets the behaviour of the statistics collector. See -** the MW_STAT_xxx defines for more information. Default MW_STAT_DEFAULT. -** - mwFreeBufferInfo() enables or disables the tagging of free'd buffers -** with freeing information. This information is written in text form, -** using sprintf(), so it's pretty slow. Disabled by default. -** - mwAutoCheck() performs a CHECK() operation whenever a MemWatch function -** is used. Slows down performance, of course. -** - mwCalcCheck() calculates checksums for all data buffers. Slow! -** - mwDumpCheck() logs buffers where stored & calc'd checksums differ. Slow!! -** - mwMark() sets a generic marker. Returns the pointer given. -** - mwUnmark() removes a generic marker. If, at the end of execution, some -** markers are still in existence, these will be reported as leakage. -** returns the pointer given. -*/ -void mwFlushNow( void ); -void mwDoFlush( int onoff ); -void mwLimit( long bytes ); -unsigned mwGrab( unsigned kilobytes ); -unsigned mwDrop( unsigned kilobytes ); -void mwNoMansLand( int mw_nml_level ); -void mwStatistics( int level ); -void mwFreeBufferInfo( int onoff ); -void mwAutoCheck( int onoff ); -void mwCalcCheck( void ); -void mwDumpCheck( void ); -void * mwMark( void *p, const char *description, const char *file, unsigned line ); -void * mwUnmark( void *p, const char *file, unsigned line ); - -/* -** Testing/verification/tracing -** All of these macros except VERIFY() evaluates to a null statement -** if MEMWATCH is not defined during compilation. -** - mwIsReadAddr() checks a memory area for read privilige. -** - mwIsSafeAddr() checks a memory area for both read & write privilige. -** This function and mwIsReadAddr() is highly system-specific and -** may not be implemented. If this is the case, they will default -** to returning nonzero for any non-NULL pointer. -** - CHECK() does a complete memory integrity test. Slow! -** - CHECK_THIS() checks only selected components. -** - CHECK_BUFFER() checks the indicated buffer for errors. -** - mwASSERT() or ASSERT() If the expression evaluates to nonzero, execution continues. -** Otherwise, the ARI handler is called, if present. If not present, -** the default ARI action is taken (set with mwSetAriAction()). -** ASSERT() can be disabled by defining MW_NOASSERT. -** - mwVERIFY() or VERIFY() works just like ASSERT(), but when compiling without -** MEMWATCH the macro evaluates to the expression. -** VERIFY() can be disabled by defining MW_NOVERIFY. -** - mwTRACE() or TRACE() writes some text and data to the log. Use like printf(). -** Note: there is a limit to the maximum resulting string length that -** can be written. This defaults to MW_TRACE_BUFFER characters. -** TRACE() can be disabled by defining MW_NOTRACE. -*/ -int mwIsReadAddr( const void *p, unsigned len ); -int mwIsSafeAddr( void *p, unsigned len ); -int mwTest( const char *file, int line, int mw_test_flags ); -int mwTestBuffer( const char *file, int line, void *p ); -int mwAssert( int, const char*, const char*, int ); -int mwVerify( int, const char*, const char*, int ); - -/* -** User I/O functions -** - mwTrace() works like printf(), but dumps output either to the -** function specified with mwSetOutFunc(), or the log file. -** - mwPuts() works like puts(), dumps output like mwTrace(). -** - mwSetOutFunc() allows you to give the adress of a function -** where all user output will go. (exeption: see mwSetAriFunc) -** Specifying NULL will direct output to the log file. -** - mwSetAriFunc() gives MEMWATCH the adress of a function to call -** when an 'Abort, Retry, Ignore' question is called for. The -** actual error message is NOT printed when you've set this adress, -** but instead it is passed as an argument. If you call with NULL -** for an argument, the ARI handler is disabled again. When the -** handler is disabled, MEMWATCH will automatically take the -** action specified by mwSetAriAction(). -** - mwSetAriAction() sets the default ARI return value MEMWATCH should -** use if no ARI handler is specified. Defaults to MW_ARI_ABORT. -** - mwAriHandler() is an ANSI ARI handler you can use if you like. It -** dumps output to stderr, and expects input from stdin. -** - mwBreakOut() is called in certain cases when MEMWATCH feels it would -** be nice to break into a debugger. If you feel like MEMWATCH, place -** an execution breakpoint on this function. -*/ -void mwTrace( const char* format_string, ... ); -void mwPuts( const char* text ); -void mwSetOutFunc( void (*func)(int) ); -void mwSetAriFunc( int (*func)(const char*) ); -void mwSetAriAction( int mw_ari_value ); -int mwAriHandler( const char* cause ); -void mwBreakOut( const char* cause ); - -/* -** Allocation/deallocation functions -** These functions are the ones actually to perform allocations -** when running MEMWATCH, for both C and C++ calls. -** - mwMalloc() debugging allocator -** - mwMalloc_() always resolves to a clean call of malloc() -** - mwRealloc() debugging re-allocator -** - mwRealloc_() always resolves to a clean call of realloc() -** - mwCalloc() debugging allocator, fills with zeros -** - mwCalloc_() always resolves to a clean call of calloc() -** - mwFree() debugging free. Can only free memory which has -** been allocated by MEMWATCH. -** - mwFree_() resolves to a) normal free() or b) debugging free. -** Can free memory allocated by MEMWATCH and malloc() both. -** Does not generate any runtime errors. -*/ -void* mwMalloc( size_t, const char*, int ); -void* mwMalloc_( size_t ); -void* mwRealloc( void *, size_t, const char*, int ); -void* mwRealloc_( void *, size_t ); -void* mwCalloc( size_t, size_t, const char*, int ); -void* mwCalloc_( size_t, size_t ); -void mwFree( void*, const char*, int ); -void mwFree_( void* ); -char* mwStrdup( char *, const char*, int ); - -/* -** Enable/disable precompiler block -** This block of defines and if(n)defs make sure that references -** to MEMWATCH is completely removed from the code if the MEMWATCH -** manifest constant is not defined. -*/ -#ifndef __MEMWATCH_C -#ifdef MEMWATCH - -#define mwASSERT(exp) while(mwAssert((int)(exp),#exp,__FILE__,__LINE__)) -#ifndef MW_NOASSERT -#ifndef ASSERT -#define ASSERT mwASSERT -#endif /* !ASSERT */ -#endif /* !MW_NOASSERT */ -#define mwVERIFY(exp) while(mwVerify((int)(exp),#exp,__FILE__,__LINE__)) -#ifndef MW_NOVERIFY -#ifndef VERIFY -#define VERIFY mwVERIFY -#endif /* !VERIFY */ -#endif /* !MW_NOVERIFY */ -#define mwTRACE mwTrace -#ifndef MW_NOTRACE -#ifndef TRACE -#define TRACE mwTRACE -#endif /* !TRACE */ -#endif /* !MW_NOTRACE */ - -#define malloc(n) mwMalloc(n,__FILE__,__LINE__) -#ifdef strdup -#undef strdup -#endif -#define strdup(p) mwStrdup(p,__FILE__,__LINE__) -#define realloc(p,n) mwRealloc(p,n,__FILE__,__LINE__) -#define calloc(n,m) mwCalloc(n,m,__FILE__,__LINE__) -#define free(p) mwFree(p,__FILE__,__LINE__) -#define CHECK() mwTest(__FILE__,__LINE__,MW_TEST_ALL) -#define CHECK_THIS(n) mwTest(__FILE__,__LINE__,n) -#define CHECK_BUFFER(b) mwTestBuffer(__FILE__,__LINE__,b) -#define MARK(p) mwMark(p,#p,__FILE__,__LINE__) -#define UNMARK(p) mwUnmark(p,__FILE__,__LINE__) - -#else /* MEMWATCH */ - -#define mwASSERT(exp) -#ifndef MW_NOASSERT -#ifndef ASSERT -#define ASSERT mwASSERT -#endif /* !ASSERT */ -#endif /* !MW_NOASSERT */ - -#define mwVERIFY(exp) exp -#ifndef MW_NOVERIFY -#ifndef VERIFY -#define VERIFY mwVERIFY -#endif /* !VERIFY */ -#endif /* !MW_NOVERIFY */ - -/*lint -esym(773,mwTRACE) */ -#define mwTRACE /*lint -save -e506 */ 1?(void)0:mwDummyTraceFunction /*lint -restore */ -#ifndef MW_NOTRACE -#ifndef TRACE -/*lint -esym(773,TRACE) */ -#define TRACE mwTRACE -#endif /* !TRACE */ -#endif /* !MW_NOTRACE */ - -extern void mwDummyTraceFunction(const char *,...); -/*lint -save -e652 */ -#define mwDoFlush(n) -#define mwPuts(s) -#define mwInit() -#define mwGrab(n) -#define mwDrop(n) -#define mwLimit(n) -#define mwTest(f,l) -#define mwSetOutFunc(f) -#define mwSetAriFunc(f) -#define mwDefaultAri() -#define mwNomansland() -#define mwStatistics(f) -#define mwMark(p,t,f,n) (p) -#define mwUnmark(p,f,n) (p) -#define mwMalloc(n,f,l) malloc(n) -#define mwStrdup(p,f,l) strdup(p) -#define mwRealloc(p,n,f,l) realloc(p,n) -#define mwCalloc(n,m,f,l) calloc(n,m) -#define mwFree(p) free(p) -#define mwMalloc_(n) malloc(n) -#define mwRealloc_(p,n) realloc(p,n) -#define mwCalloc_(n,m) calloc(n,m) -#define mwFree_(p) free(p) -#define mwAssert(e,es,f,l) -#define mwVerify(e,es,f,l) (e) -#define mwTrace mwDummyTrace -#define mwTestBuffer(f,l,b) (0) -#define CHECK() -#define CHECK_THIS(n) -#define CHECK_BUFFER(b) -#define MARK(p) (p) -#define UNMARK(p) (p) -/*lint -restore */ - -#endif /* MEMWATCH */ -#endif /* !__MEMWATCH_C */ - -#ifdef __cplusplus - } -#endif - -#if 0 /* 980317: disabled C++ */ - -/* -** C++ support section -** Implements the C++ support. Please note that in order to avoid -** messing up library classes, C++ support is disabled by default. -** You must NOT enable it until AFTER the inclusion of all header -** files belonging to code that are not compiled with MEMWATCH, and -** possibly for some that are! The reason for this is that a C++ -** class may implement it's own new() function, and the preprocessor -** would substitute this crucial declaration for MEMWATCH new(). -** You can forcibly deny C++ support by defining MEMWATCH_NOCPP. -** To enble C++ support, you must be compiling C++, MEMWATCH must -** be defined, MEMWATCH_NOCPP must not be defined, and finally, -** you must define 'new' to be 'mwNew', and 'delete' to be 'mwDelete'. -** Unlike C, C++ code can begin executing *way* before main(), for -** example if a global variable is created. For this reason, you can -** declare a global variable of the class 'MemWatch'. If this is -** is the first variable created, it will then check ALL C++ allocations -** and deallocations. Unfortunately, this evaluation order is not -** guaranteed by C++, though the compilers I've tried evaluates them -** in the order encountered. -*/ -#ifdef __cplusplus -#ifndef __MEMWATCH_C -#ifdef MEMWATCH -#ifndef MEMWATCH_NOCPP -extern int mwNCur; -extern const char *mwNFile; -extern int mwNLine; -class MemWatch { -public: - MemWatch(); - ~MemWatch(); - }; -void * operator new(size_t); -void * operator new(size_t,const char *,int); -void operator delete(void *); -#define mwNew new(__FILE__,__LINE__) -#define mwDelete (mwNCur=1,mwNFile=__FILE__,mwNLine=__LINE__),delete -#endif /* MEMWATCH_NOCPP */ -#endif /* MEMWATCH */ -#endif /* !__MEMWATCH_C */ -#endif /* __cplusplus */ - -#endif /* 980317: disabled C++ */ - -#endif /* __MEMWATCH_H */ - -#endif /* EOF MEMWATCH.H */ diff --git a/lib/mkprod.awk b/lib/mkprod.awk index 5ff1a83a..cbe5f402 100644 --- a/lib/mkprod.awk +++ b/lib/mkprod.awk @@ -4,7 +4,6 @@ BEGIN { print "#include \"../config.h\"" print "#include \"libs.h\"" - print "#include \"memwatch.h\"" print "#include \"structs.h\"" print "#include \"common.h\"" print "" diff --git a/lib/msg.c b/lib/msg.c index a5ee3274..744d03d8 100644 --- a/lib/msg.c +++ b/lib/msg.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "msgtext.h" #include "msg.h" #include "jammsg.h" diff --git a/lib/msgtext.c b/lib/msgtext.c index d2537511..ba3ddcf8 100644 --- a/lib/msgtext.c +++ b/lib/msgtext.c @@ -31,7 +31,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "msgtext.h" #include "msg.h" diff --git a/lib/nntp.c b/lib/nntp.c index a28f2f9a..99eac191 100644 --- a/lib/nntp.c +++ b/lib/nntp.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/nodelock.c b/lib/nodelock.c index 7d9ecb9a..ad2d6fca 100644 --- a/lib/nodelock.c +++ b/lib/nodelock.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "common.h" diff --git a/lib/noderecord.c b/lib/noderecord.c index 64ad4f5a..78ae28c1 100644 --- a/lib/noderecord.c +++ b/lib/noderecord.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" #include "users.h" diff --git a/lib/packet.c b/lib/packet.c index 0e6dc300..4ac8bcdf 100644 --- a/lib/packet.c +++ b/lib/packet.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/parsedate.c b/lib/parsedate.c index 7b646d07..e486715d 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -21,7 +21,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" diff --git a/lib/pktname.c b/lib/pktname.c index eee3afd0..3bf64c5a 100644 --- a/lib/pktname.c +++ b/lib/pktname.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/pop3.c b/lib/pop3.c index b94e8eb5..24432d44 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/rawio.c b/lib/rawio.c index e0960b14..72da3eb5 100644 --- a/lib/rawio.c +++ b/lib/rawio.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" #include "mberrors.h" diff --git a/lib/rfcaddr.c b/lib/rfcaddr.c index 3f0c2e78..026d260a 100644 --- a/lib/rfcaddr.c +++ b/lib/rfcaddr.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/rfcdate.c b/lib/rfcdate.c index fda5502f..dbaf0c41 100644 --- a/lib/rfcdate.c +++ b/lib/rfcdate.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" #include "clcomm.h" diff --git a/lib/rfcmsg.c b/lib/rfcmsg.c index ff18348e..2b62b119 100644 --- a/lib/rfcmsg.c +++ b/lib/rfcmsg.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/semafore.c b/lib/semafore.c index e3b170e0..4a71c7f7 100644 --- a/lib/semafore.c +++ b/lib/semafore.c @@ -31,7 +31,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "clcomm.h" #include "common.h" diff --git a/lib/signame.c b/lib/signame.c index 3bd90741..04549c22 100644 --- a/lib/signame.c +++ b/lib/signame.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "clcomm.h" diff --git a/lib/smtp.c b/lib/smtp.c index 31aad686..f21241f2 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/lib/strcasestr.c b/lib/strcasestr.c index a8475ce4..c03d6924 100644 --- a/lib/strcasestr.c +++ b/lib/strcasestr.c @@ -1,7 +1,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #ifndef HAVE_STRCASESTR diff --git a/lib/strutil.c b/lib/strutil.c index e6ea2357..69e53919 100644 --- a/lib/strutil.c +++ b/lib/strutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "common.h" @@ -339,7 +338,7 @@ char *GetDateDMY() char *OsName() { #ifdef __linux__ - return (char *)"Linux"; + return (char *)"GNU/Linux"; #elif __FreeBSD__ return (char *)"FreeBSD"; #elif __NetBSD__ @@ -372,7 +371,7 @@ char *OsCPU() /* * Return universal tearline, note if OS and CPU are - * unknow, the tearline is already 39 characters. + * unknown, the tearline is already 39 characters. */ char *TearLine() { diff --git a/lib/term.c b/lib/term.c index 95f93c2c..ed457cfa 100644 --- a/lib/term.c +++ b/lib/term.c @@ -32,7 +32,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "ansi.h" diff --git a/lib/test.c b/lib/test.c deleted file mode 100644 index 1fead4c6..00000000 --- a/lib/test.c +++ /dev/null @@ -1,108 +0,0 @@ - -/* -** NOTE: Running this program in a Win32 or Unix environment -** will probably result in a segmentation fault or protection -** error. These errors may be caused by MEMWATCH when it's -** looking at memory to see if it owns it, or may be caused by -** the test program writing to memory it does not own. -** -** MEMWATCH has two functions called 'mwIsReadAddr()' and -** 'mwIsSafeAddr()', which are system-specific. -** If they are implemented for your system, and works -** correctly, MEMWATCH will identify garbage pointers and -** avoid causing segmentation faults, GP's etc. -** -** If they are NOT implemented, count on getting the core -** dumped when running this test program! As of this writing, -** the safe-address checking has been implemented for Win32 -** and ANSI-C compliant systems. The ANSI-C checking traps -** SIGSEGV and uses setjmp/longjmp to resume processing, -** but I've only tested this under Linux (where it works). -** -** Note for Win95 users: The Win32 IsBadReadPtr() and it's -** similar functions can return incorrect values. This has -** not happened under WinNT, though, just Win95. -** -** 980318 Johan Lindh -** -*/ - -#include "../config.h" -#include "libs.h" -#include "memwatch.h" - -#error "Hey! Don't just compile this program, read the comments first!" -#ifndef SIGSEGV -#error SIGNAL.H does not define SIGSEGV; running this program WILL cause a core dump/crash! -#endif - -main() -{ - char *p; - - /* Collect stats on a line number basis */ - mwStatistics( 2 ); - - /* Slows things down, but OK for this test prg */ - /* mwAutoCheck( 1 ); */ - - TRACE("Hello world!\n"); - - p = malloc(210); - free(p); - p = malloc(20); - p = malloc(200); /* causes unfreed error */ - p[-1] = 0; /* causes underflow error */ - free(p); - - p = malloc(100); - p[ -(int)(sizeof(long)*8) ] = -1; /* try to damage MW's heap chain */ - free( p ); /* should cause relink */ - - mwSetAriFunc( mwAriHandler ); - ASSERT(1==2); - - mwLimit(1000000); - mwNoMansLand( MW_NML_ALL ); - - /* These may cause a general protection fault (segmentation fault) */ - /* They're here to help test the no-mans-land protection */ - if( mwIsSafeAddr(p+50000,1) ) { - TRACE("Killing byte at %p\n", p+50000); - *(p+50000) = 0; - } - if( mwIsSafeAddr(p+30000,1) ) { - TRACE("Killing byte at %p\n", p+30000); - *(p+30000) = 0; - } - if( mwIsSafeAddr(p+1000,1) ) { - TRACE("Killing byte at %p\n", p+1000); - *(p+1000) = 0; - } - if( mwIsSafeAddr(p-100,1) ) { - TRACE("Killing byte at %p\n", p-100); - *(p-100) = 0; - } - - /* This may cause a GP fault as well, since MW data buffers */ - /* have been damaged in the above killing spree */ - CHECK(); - - p = malloc(12000); - p[-5] = 1; - p[-10] = 2; - p[-15] = 3; - p[-20] = 4; - - /* This may cause a GP fault since MW's buffer list may have */ - /* been damaged by above killing, and it will try to repair it. */ - free(p); - - p = realloc(p,10); /* causes realloc: free'd from error */ - - /* May cause GP since MW will inspect the memory to see if it owns it. */ - free( (void*)main ); - - return 0; -} - diff --git a/lib/unpacker.c b/lib/unpacker.c index 1be8c774..d072d15f 100644 --- a/lib/unpacker.c +++ b/lib/unpacker.c @@ -32,7 +32,6 @@ #include "../config.h" #include "libs.h" -#include "memwatch.h" #include "structs.h" #include "users.h" #include "records.h" diff --git a/mbcico/Makefile b/mbcico/Makefile index f9f2cabf..d597e968 100644 --- a/mbcico/Makefile +++ b/mbcico/Makefile @@ -31,7 +31,7 @@ MBCICO_OBJS = zmmisc.o zmrle.o zmrecv.o zmsend.o binkp.o md5b.o \ ttyio.o lutil.o scanout.o emsi.o ulock.o \ callstat.o session.o call.o mbcico.o MBOUT_OBJS = outstat.o nlinfo.o mbout.o scanout.o callstat.o -LIBS += ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a \ +LIBS += ../lib/libclcomm.a ../lib/libcommon.a \ ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libnodelist.a OTHER = Makefile README TARGET = mbcico mbout @@ -87,48 +87,48 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -zmmisc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h zmodem.h -zmrle.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h ttyio.h session.h zmodem.h -zmrecv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h lutil.h ttyio.h session.h zmodem.h config.h emsi.h openfile.h filelist.h openport.h -zmsend.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ttyio.h session.h zmodem.h lutil.h emsi.h filelist.h -binkp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h openfile.h respfreq.h filelist.h opentcp.h rdoptions.h lutil.h binkp.h config.h md5b.h -md5b.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h lutil.h md5b.h -xmsend.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h ttyio.h statetbl.h xmsend.h m7send.h filelist.h filetime.h -xmrecv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h ttyio.h statetbl.h config.h lutil.h openfile.h m7recv.h xmrecv.h filelist.h filetime.h -m7recv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7recv.h -m7send.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7send.h -hydra.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/mberrors.h session.h filelist.h filetime.h ttyio.h statetbl.h config.h emsi.h openfile.h lutil.h respfreq.h mbcico.h hydra.h -answer.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h lutil.h session.h config.h answer.h openport.h portsel.h dial.h rdoptions.h mbcico.h -chat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h config.h chat.h ttyio.h -dial.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h config.h chat.h ttyio.h session.h dial.h -dietifna.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h emsi.h dietifna.h respfreq.h filelist.h xmrecv.h xmsend.h -emsidat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h emsi.h session.h lutil.h config.h emsidat.h filetime.h -filelist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h config.h session.h filelist.h -openfile.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h config.h lutil.h openfile.h -openport.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ulock.h ttyio.h openport.h -opentcp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h session.h ttyio.h openport.h opentcp.h -rdoptions.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h session.h config.h -yoohoo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/mberrors.h statetbl.h ttyio.h session.h config.h emsi.h hydra.h rdoptions.h wazoo.h dietifna.h yoohoo.h -recvbark.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h recvbark.h respfreq.h filelist.h -respfreq.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h lutil.h config.h atoul.h respfreq.h filelist.h -sendbark.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h sendbark.h xmrecv.h -tcp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h tcpproto.h tcp.h -tcpproto.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h session.h config.h emsi.h lutil.h openfile.h filelist.h tcpproto.h -wazoo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h wazoo.h zmodem.h -filetime.o: ../config.h ../lib/libs.h ../lib/memwatch.h filetime.h -ftsc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/mberrors.h session.h ttyio.h statetbl.h config.h ftsc.h rdoptions.h recvbark.h filelist.h sendbark.h respfreq.h xmrecv.h xmsend.h -atoul.o: ../config.h ../lib/libs.h ../lib/memwatch.h atoul.h -portsel.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h portsel.h -ttyio.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ttyio.h lutil.h -lutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h lutil.h -scanout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbftn.h config.h scanout.h lutil.h -emsi.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h emsidat.h hydra.h rdoptions.h tcp.h wazoo.h -ulock.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h -callstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h callstat.h -session.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h statetbl.h emsi.h ftsc.h session.h yoohoo.h mbcico.h binkp.h callstat.h -call.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h session.h callstat.h call.h config.h dial.h lutil.h portsel.h openport.h opentcp.h rdoptions.h -mbcico.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h config.h answer.h call.h lutil.h mbcico.h session.h -outstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h scanout.h callstat.h outstat.h -nlinfo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h nlinfo.h -mbout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h outstat.h nlinfo.h +zmmisc.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h zmodem.h +zmrle.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h ttyio.h session.h zmodem.h +zmrecv.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h lutil.h ttyio.h session.h zmodem.h config.h emsi.h openfile.h filelist.h openport.h +zmsend.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ttyio.h session.h zmodem.h lutil.h emsi.h filelist.h +binkp.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h openfile.h respfreq.h filelist.h opentcp.h rdoptions.h lutil.h binkp.h config.h md5b.h +md5b.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h lutil.h md5b.h +xmsend.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h ttyio.h statetbl.h xmsend.h m7send.h filelist.h filetime.h +xmrecv.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h ttyio.h statetbl.h config.h lutil.h openfile.h m7recv.h xmrecv.h filelist.h filetime.h +m7recv.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7recv.h +m7send.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7send.h +hydra.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/mberrors.h session.h filelist.h filetime.h ttyio.h statetbl.h config.h emsi.h openfile.h lutil.h respfreq.h mbcico.h hydra.h +answer.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h lutil.h session.h config.h answer.h openport.h portsel.h dial.h rdoptions.h mbcico.h +chat.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h config.h chat.h ttyio.h +dial.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h config.h chat.h ttyio.h session.h dial.h +dietifna.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h emsi.h dietifna.h respfreq.h filelist.h xmrecv.h xmsend.h +emsidat.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h emsi.h session.h lutil.h config.h emsidat.h filetime.h +filelist.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h config.h session.h filelist.h +openfile.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h config.h lutil.h openfile.h +openport.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ulock.h ttyio.h openport.h +opentcp.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h session.h ttyio.h openport.h opentcp.h +rdoptions.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h session.h config.h +yoohoo.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/mberrors.h statetbl.h ttyio.h session.h config.h emsi.h hydra.h rdoptions.h wazoo.h dietifna.h yoohoo.h +recvbark.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h recvbark.h respfreq.h filelist.h +respfreq.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h lutil.h config.h atoul.h respfreq.h filelist.h +sendbark.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h sendbark.h xmrecv.h +tcp.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h tcpproto.h tcp.h +tcpproto.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h session.h config.h emsi.h lutil.h openfile.h filelist.h tcpproto.h +wazoo.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h wazoo.h zmodem.h +filetime.o: ../config.h ../lib/libs.h filetime.h +ftsc.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/mberrors.h session.h ttyio.h statetbl.h config.h ftsc.h rdoptions.h recvbark.h filelist.h sendbark.h respfreq.h xmrecv.h xmsend.h +atoul.o: ../config.h ../lib/libs.h atoul.h +portsel.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h portsel.h +ttyio.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ttyio.h lutil.h +lutil.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h lutil.h +scanout.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbftn.h config.h scanout.h lutil.h +emsi.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h emsidat.h hydra.h rdoptions.h tcp.h wazoo.h +ulock.o: ../config.h ../lib/libs.h ../lib/clcomm.h +callstat.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h callstat.h +session.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h statetbl.h emsi.h ftsc.h session.h yoohoo.h mbcico.h binkp.h callstat.h +call.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h session.h callstat.h call.h config.h dial.h lutil.h portsel.h openport.h opentcp.h rdoptions.h +mbcico.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h config.h answer.h call.h lutil.h mbcico.h session.h +outstat.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h scanout.h callstat.h outstat.h +nlinfo.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h nlinfo.h +mbout.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h outstat.h nlinfo.h # End of generated dependencies diff --git a/mbcico/answer.c b/mbcico/answer.c index 875a4d43..b174280a 100644 --- a/mbcico/answer.c +++ b/mbcico/answer.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/atoul.c b/mbcico/atoul.c index 6fa810cf..09eb29e6 100644 --- a/mbcico/atoul.c +++ b/mbcico/atoul.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "atoul.h" diff --git a/mbcico/binkp.c b/mbcico/binkp.c index 81b2a4d0..1645838f 100644 --- a/mbcico/binkp.c +++ b/mbcico/binkp.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/call.c b/mbcico/call.c index 90af701c..d7193de2 100644 --- a/mbcico/call.c +++ b/mbcico/call.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/callstat.c b/mbcico/callstat.c index bd7698c9..636a8123 100644 --- a/mbcico/callstat.c +++ b/mbcico/callstat.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/chat.c b/mbcico/chat.c index 433b4e25..84af3c04 100644 --- a/mbcico/chat.c +++ b/mbcico/chat.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/dial.c b/mbcico/dial.c index 25839be9..2c33dd97 100644 --- a/mbcico/dial.c +++ b/mbcico/dial.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/dietifna.c b/mbcico/dietifna.c index 424f3ad3..30e8195e 100644 --- a/mbcico/dietifna.c +++ b/mbcico/dietifna.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/emsi.c b/mbcico/emsi.c index 890baff6..0cb4c2bb 100644 --- a/mbcico/emsi.c +++ b/mbcico/emsi.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/emsidat.c b/mbcico/emsidat.c index 7eba77cd..ce330357 100644 --- a/mbcico/emsidat.c +++ b/mbcico/emsidat.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/filelist.c b/mbcico/filelist.c index d61b90f4..089bbede 100644 --- a/mbcico/filelist.c +++ b/mbcico/filelist.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/filetime.c b/mbcico/filetime.c index 8eaa92e1..1ceecb4f 100644 --- a/mbcico/filetime.c +++ b/mbcico/filetime.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "filetime.h" diff --git a/mbcico/ftsc.c b/mbcico/ftsc.c index 9a25e80f..9d0c7f84 100644 --- a/mbcico/ftsc.c +++ b/mbcico/ftsc.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/hydra.c b/mbcico/hydra.c index a9dcfbc1..88119cdd 100644 --- a/mbcico/hydra.c +++ b/mbcico/hydra.c @@ -43,7 +43,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/lutil.c b/mbcico/lutil.c index ecaa9e47..ef33c951 100644 --- a/mbcico/lutil.c +++ b/mbcico/lutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbcico/m7recv.c b/mbcico/m7recv.c index 1966c816..22c9efa0 100644 --- a/mbcico/m7recv.c +++ b/mbcico/m7recv.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbcico/m7send.c b/mbcico/m7send.c index f0b53578..ee31b42f 100644 --- a/mbcico/m7send.c +++ b/mbcico/m7send.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbcico/mbcico.c b/mbcico/mbcico.c index 50d27ea7..dd9139de 100644 --- a/mbcico/mbcico.c +++ b/mbcico/mbcico.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -157,10 +156,6 @@ int main(int argc, char *argv[]) char temp[PATH_MAX]; #endif -#ifdef MEMWATCH - mwInit(); -#endif - /* * The next trick is to supply a fake environment variable * MBSE_ROOT in case we are started from inetd or mgetty, @@ -178,9 +173,6 @@ int main(int argc, char *argv[]) usage(); if (envptr) free(envptr); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_COMMANDLINE); } @@ -304,9 +296,6 @@ int main(int argc, char *argv[]) free_mem(); if (envptr) free(envptr); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERROR_EXEC_FAILED); } #endif diff --git a/mbcico/mbout.c b/mbcico/mbout.c index e280513c..c816a0f6 100644 --- a/mbcico/mbout.c +++ b/mbcico/mbout.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -180,9 +179,6 @@ int main(int argc, char *argv[]) FILE *fl; unsigned long cmmask; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); InitNode(); InitFidonet(); @@ -364,9 +360,6 @@ int main(int argc, char *argv[]) } Help(); -#ifdef MEMWATCH - mwTerm(); -#endif return MBERR_OK; } diff --git a/mbcico/md5b.c b/mbcico/md5b.c index b1ee0d13..9c11507d 100644 --- a/mbcico/md5b.c +++ b/mbcico/md5b.c @@ -56,7 +56,6 @@ documentation and/or software. #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/nlinfo.c b/mbcico/nlinfo.c index fb251ea4..470b728c 100644 --- a/mbcico/nlinfo.c +++ b/mbcico/nlinfo.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/openfile.c b/mbcico/openfile.c index 07a8bb39..236d400c 100644 --- a/mbcico/openfile.c +++ b/mbcico/openfile.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/clcomm.h" #include "../lib/common.h" diff --git a/mbcico/openport.c b/mbcico/openport.c index a5d32d95..f9ecedee 100644 --- a/mbcico/openport.c +++ b/mbcico/openport.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbcico/opentcp.c b/mbcico/opentcp.c index 1b58caaa..950b5bd3 100644 --- a/mbcico/opentcp.c +++ b/mbcico/opentcp.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/outstat.c b/mbcico/outstat.c index ab95a297..22670cc9 100644 --- a/mbcico/outstat.c +++ b/mbcico/outstat.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/portsel.c b/mbcico/portsel.c index 35fd22f4..99404d76 100644 --- a/mbcico/portsel.c +++ b/mbcico/portsel.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/rdoptions.c b/mbcico/rdoptions.c index e3221aa9..411f7487 100644 --- a/mbcico/rdoptions.c +++ b/mbcico/rdoptions.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/recvbark.c b/mbcico/recvbark.c index 92e6cd0f..c25c4855 100644 --- a/mbcico/recvbark.c +++ b/mbcico/recvbark.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/respfreq.c b/mbcico/respfreq.c index 8d535411..e2d15863 100644 --- a/mbcico/respfreq.c +++ b/mbcico/respfreq.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/scanout.c b/mbcico/scanout.c index f52fce9e..e020db23 100644 --- a/mbcico/scanout.c +++ b/mbcico/scanout.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/sendbark.c b/mbcico/sendbark.c index c51175fe..355dff8b 100644 --- a/mbcico/sendbark.c +++ b/mbcico/sendbark.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/session.c b/mbcico/session.c index c115d56a..15de39f6 100644 --- a/mbcico/session.c +++ b/mbcico/session.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/tcp.c b/mbcico/tcp.c index 4006a0e2..df57c34d 100644 --- a/mbcico/tcp.c +++ b/mbcico/tcp.c @@ -34,7 +34,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/tcpproto.c b/mbcico/tcpproto.c index fbf9dbcc..2cbfd8e6 100644 --- a/mbcico/tcpproto.c +++ b/mbcico/tcpproto.c @@ -34,7 +34,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbcico/ttyio.c b/mbcico/ttyio.c index 5e56abd1..5ada839e 100644 --- a/mbcico/ttyio.c +++ b/mbcico/ttyio.c @@ -33,7 +33,6 @@ */ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/ulock.c b/mbcico/ulock.c index bcaca647..caed6c36 100644 --- a/mbcico/ulock.c +++ b/mbcico/ulock.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/clcomm.h" #ifndef LOCKDIR diff --git a/mbcico/wazoo.c b/mbcico/wazoo.c index 39c2fdae..9f85bf66 100644 --- a/mbcico/wazoo.c +++ b/mbcico/wazoo.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbcico/xmrecv.c b/mbcico/xmrecv.c index 01cbd517..f0bbbcc4 100644 --- a/mbcico/xmrecv.c +++ b/mbcico/xmrecv.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/xmsend.c b/mbcico/xmsend.c index f187a8c4..6f8b0568 100644 --- a/mbcico/xmsend.c +++ b/mbcico/xmsend.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/yoohoo.c b/mbcico/yoohoo.c index e5062844..1df59a46 100644 --- a/mbcico/yoohoo.c +++ b/mbcico/yoohoo.c @@ -38,7 +38,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbcico/zmmisc.c b/mbcico/zmmisc.c index e03f2f2f..3e4b25ff 100644 --- a/mbcico/zmmisc.c +++ b/mbcico/zmmisc.c @@ -62,7 +62,6 @@ static void garbitch(void); #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/nodelist.h" diff --git a/mbcico/zmrecv.c b/mbcico/zmrecv.c index 28fe99b2..41c1d5ff 100644 --- a/mbcico/zmrecv.c +++ b/mbcico/zmrecv.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/clcomm.h" #include "../lib/common.h" diff --git a/mbcico/zmrle.c b/mbcico/zmrle.c index 6f573d70..b3486e06 100644 --- a/mbcico/zmrle.c +++ b/mbcico/zmrle.c @@ -39,7 +39,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/clcomm.h" #include "../lib/common.h" diff --git a/mbcico/zmsend.c b/mbcico/zmsend.c index 6f6bdc13..39924a9a 100644 --- a/mbcico/zmsend.c +++ b/mbcico/zmsend.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbfido/Makefile b/mbfido/Makefile index 83bcfa6e..06e428e3 100644 --- a/mbfido/Makefile +++ b/mbfido/Makefile @@ -41,15 +41,15 @@ MBDIFF_OBJS = mbdiff.o MBFILE_OBJS = mbfile.o mbfkill.o mbfutil.o mbfindex.o mbfcheck.o mbfpack.o mbflist.o mbfadopt.o \ mbfimport.o virscan.o mbftoberep.o mbfmove.o mbfdel.o MBMSG_OBJS = post.o mbmsg.o -MBFIDO_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ +MBFIDO_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ ../lib/libdbase.a ../lib/libdiesel.a ../lib/libmbinet.a ../lib/libnodelist.a -MBSEQ_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a -MBAFF_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ +MBSEQ_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBAFF_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ ../lib/libdbase.a ../lib/libdiesel.a -MBINDEX_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a -MBDIFF_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a -MBFILE_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a ../lib/libdiesel.a -MBMSG_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a +MBINDEX_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBDIFF_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBFILE_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a ../lib/libdiesel.a +MBMSG_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a OTHER = Makefile README TARGET = mbfido mbseq mbaff mbindex mbdiff mbfile mbmsg @@ -133,79 +133,79 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -addbbs.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h fsort.h addbbs.h -backalias.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h backalias.h -flock.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h flock.h -hatch.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbtic.h utic.h rollover.h hatch.h -mbdiff.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbdiff.h -mgrutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/diesel.h sendmail.h rollover.h addpkt.h createm.h createf.h mgrutil.h -qualify.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h qualify.h -ptic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbtic.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbdupe.h unpack.h mover.h toberep.h tic.h utic.h addbbs.h magic.h forward.h rollover.h ptic.h magic.h createf.h virscan.h qualify.h -sendmail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ../lib/dbmsgs.h addpkt.h rollover.h sendmail.h -tracker.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h tracker.h -addpkt.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h -bwrite.o: ../config.h ../lib/libs.h ../lib/memwatch.h bwrite.h -forward.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbtic.h ../lib/diesel.h tic.h sendmail.h rollover.h mgrutil.h forward.h -lhash.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h lhash.h -mbfido.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbdupe.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbuser.h ../lib/dbftn.h ../lib/dbtic.h ../lib/msg.h ../lib/mberrors.h flock.h tosspkt.h unpack.h tic.h fsort.h scan.h mbfido.h tracker.h notify.h rollover.h hatch.h scannews.h maketags.h makestat.h newspost.h rnews.h mgrutil.h backalias.h rfc2ftn.h dirsession.h dirlock.h queue.h -mkftnhdr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h atoul.h hash.h msgflags.h aliasdb.h mkftnhdr.h -ping.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h sendmail.h postnetmail.h ping.h -rfc2ftn.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h mkftnhdr.h hash.h rollover.h postnetmail.h postecho.h msgflags.h rfc2ftn.h -storeecho.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbmsgs.h ../lib/dbuser.h rollover.h storeecho.h -unpack.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h flock.h unpack.h -aliasdb.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h aliasdb.h -fsort.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h fsort.h -magic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbtic.h tic.h utic.h magic.h -mbfile.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfkill.h mbfadopt.h mbfindex.h mbfcheck.h mbfpack.h mbflist.h mbfimport.h mbftoberep.h mbfmove.h mbfdel.h mbfutil.h mbfile.h -mover.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h mover.h -post.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h post.h -rnews.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h ../lib/mberrors.h rfc2ftn.h mbfido.h ../paths.h rnews.h -storenet.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbmsgs.h ../lib/dbuser.h msgflags.h rollover.h storenet.h -utic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h mover.h tic.h utic.h -announce.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h grlist.h msgutil.h announce.h -fflist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h ../lib/msg.h fflist.h -ftn2rfc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/dbftn.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/common.h ../lib/clcomm.h rollover.h aliasdb.h postemail.h backalias.h msgflags.h ftn2rfc.h -makestat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/diesel.h ../lib/msg.h mgrutil.h makestat.h -mbindex.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbftn.h ../lib/mberrors.h mbindex.h -msgutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h msgutil.h -postecho.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ftn2rfc.h postecho.h storeecho.h addpkt.h rollover.h qualify.h -rollover.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h rollover.h -tic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbftn.h ../lib/clcomm.h unpack.h ptic.h fsort.h tic.h -areamgr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ../lib/diesel.h sendmail.h mgrutil.h scan.h createm.h areamgr.h -filefind.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h fflist.h filefind.h msgutil.h -grlist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h grlist.h -maketags.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h maketags.h -mbmsg.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/dbcfg.h ../lib/mberrors.h post.h mbmsg.h -newspost.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h newspost.h -postemail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/dbuser.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h postemail.h -scan.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msg.h ../lib/clcomm.h ../lib/msgtext.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h tracker.h ftn2rfc.h rfc2ftn.h rollover.h postemail.h scan.h -toberep.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h toberep.h -atoul.o: ../config.h ../lib/libs.h ../lib/memwatch.h atoul.h -filemgr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ../lib/diesel.h sendmail.h mgrutil.h createf.h filemgr.h -hash.o: ../config.h ../lib/libs.h ../lib/memwatch.h hash.h lhash.h -mbaff.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/mberrors.h announce.h filefind.h mbaff.h -mbseq.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbseq.h -notify.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbnode.h filemgr.h areamgr.h sendmail.h mgrutil.h notify.h -postnetmail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/common.h ../lib/records.h ../lib/dbcfg.h ../lib/dbuser.h ../lib/dbnode.h ../lib/dbftn.h ../lib/clcomm.h tracker.h addpkt.h storenet.h ftn2rfc.h areamgr.h filemgr.h ping.h bounce.h postemail.h -scannews.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h mkftnhdr.h hash.h rollover.h storeecho.h rfc2ftn.h scannews.h -tosspkt.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h tosspkt.h postnetmail.h postecho.h rollover.h createm.h -mbfkill.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfkill.h mbfutil.h -mbfutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfile.h -mbfindex.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/diesel.h ../lib/mberrors.h mbfutil.h mbfindex.h -mbfcheck.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfcheck.h -mbfpack.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfpack.h -mbflist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbflist.h -mbfadopt.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h virscan.h mbfutil.h mbflist.h -mbfimport.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h virscan.h mbfutil.h mbfimport.h -virscan.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h virscan.h -mbftoberep.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfutil.h mbftoberep.h -mbfmove.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfmove.h -mbfdel.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfmove.h -bounce.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h sendmail.h postnetmail.h ping.h -createm.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h mgrutil.h createm.h -createf.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mgrutil.h createf.h -msgflags.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h msgflags.h -dirsession.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h dirsession.h -queue.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h fsort.h dirsession.h queue.h -dirlock.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h flock.h dirlock.h +addbbs.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h fsort.h addbbs.h +backalias.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h backalias.h +flock.o: ../config.h ../lib/libs.h ../lib/clcomm.h flock.h +hatch.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbtic.h utic.h rollover.h hatch.h +mbdiff.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbdiff.h +mgrutil.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/diesel.h sendmail.h rollover.h addpkt.h createm.h createf.h mgrutil.h +qualify.o: ../config.h ../lib/libs.h ../lib/structs.h qualify.h +ptic.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbtic.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbdupe.h unpack.h mover.h toberep.h tic.h utic.h addbbs.h magic.h forward.h rollover.h ptic.h magic.h createf.h virscan.h qualify.h +sendmail.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ../lib/dbmsgs.h addpkt.h rollover.h sendmail.h +tracker.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h tracker.h +addpkt.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h +bwrite.o: ../config.h ../lib/libs.h bwrite.h +forward.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbtic.h ../lib/diesel.h tic.h sendmail.h rollover.h mgrutil.h forward.h +lhash.o: ../config.h ../lib/libs.h ../lib/clcomm.h lhash.h +mbfido.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbdupe.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbuser.h ../lib/dbftn.h ../lib/dbtic.h ../lib/msg.h ../lib/mberrors.h flock.h tosspkt.h unpack.h tic.h fsort.h scan.h mbfido.h tracker.h notify.h rollover.h hatch.h scannews.h maketags.h makestat.h newspost.h rnews.h mgrutil.h backalias.h rfc2ftn.h dirsession.h dirlock.h queue.h +mkftnhdr.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h atoul.h hash.h msgflags.h aliasdb.h mkftnhdr.h +ping.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h sendmail.h postnetmail.h ping.h +rfc2ftn.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h mkftnhdr.h hash.h rollover.h postnetmail.h postecho.h msgflags.h rfc2ftn.h +storeecho.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbmsgs.h ../lib/dbuser.h rollover.h storeecho.h +unpack.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h flock.h unpack.h +aliasdb.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h aliasdb.h +fsort.o: ../config.h ../lib/libs.h ../lib/clcomm.h fsort.h +magic.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbtic.h tic.h utic.h magic.h +mbfile.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfkill.h mbfadopt.h mbfindex.h mbfcheck.h mbfpack.h mbflist.h mbfimport.h mbftoberep.h mbfmove.h mbfdel.h mbfutil.h mbfile.h +mover.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h mover.h +post.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h post.h +rnews.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h ../lib/mberrors.h rfc2ftn.h mbfido.h ../paths.h rnews.h +storenet.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbmsgs.h ../lib/dbuser.h msgflags.h rollover.h storenet.h +utic.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h mover.h tic.h utic.h +announce.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h grlist.h msgutil.h announce.h +fflist.o: ../config.h ../lib/libs.h ../lib/clcomm.h ../lib/msg.h fflist.h +ftn2rfc.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/dbftn.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/common.h ../lib/clcomm.h rollover.h aliasdb.h postemail.h backalias.h msgflags.h ftn2rfc.h +makestat.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/diesel.h ../lib/msg.h mgrutil.h makestat.h +mbindex.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbftn.h ../lib/mberrors.h mbindex.h +msgutil.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h msgutil.h +postecho.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ftn2rfc.h postecho.h storeecho.h addpkt.h rollover.h qualify.h +rollover.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h rollover.h +tic.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbftn.h ../lib/clcomm.h unpack.h ptic.h fsort.h tic.h +areamgr.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ../lib/diesel.h sendmail.h mgrutil.h scan.h createm.h areamgr.h +filefind.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h fflist.h filefind.h msgutil.h +grlist.o: ../config.h ../lib/libs.h ../lib/clcomm.h grlist.h +maketags.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h maketags.h +mbmsg.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/dbcfg.h ../lib/mberrors.h post.h mbmsg.h +newspost.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h newspost.h +postemail.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/dbuser.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h postemail.h +scan.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msg.h ../lib/clcomm.h ../lib/msgtext.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h tracker.h ftn2rfc.h rfc2ftn.h rollover.h postemail.h scan.h +toberep.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h toberep.h +atoul.o: ../config.h ../lib/libs.h atoul.h +filemgr.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ../lib/diesel.h sendmail.h mgrutil.h createf.h filemgr.h +hash.o: ../config.h ../lib/libs.h hash.h lhash.h +mbaff.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/mberrors.h announce.h filefind.h mbaff.h +mbseq.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbseq.h +notify.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbnode.h filemgr.h areamgr.h sendmail.h mgrutil.h notify.h +postnetmail.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/common.h ../lib/records.h ../lib/dbcfg.h ../lib/dbuser.h ../lib/dbnode.h ../lib/dbftn.h ../lib/clcomm.h tracker.h addpkt.h storenet.h ftn2rfc.h areamgr.h filemgr.h ping.h bounce.h postemail.h +scannews.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h mkftnhdr.h hash.h rollover.h storeecho.h rfc2ftn.h scannews.h +tosspkt.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h tosspkt.h postnetmail.h postecho.h rollover.h createm.h +mbfkill.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfkill.h mbfutil.h +mbfutil.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfile.h +mbfindex.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/diesel.h ../lib/mberrors.h mbfutil.h mbfindex.h +mbfcheck.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfcheck.h +mbfpack.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfpack.h +mbflist.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbflist.h +mbfadopt.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h virscan.h mbfutil.h mbflist.h +mbfimport.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h virscan.h mbfutil.h mbfimport.h +virscan.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h virscan.h +mbftoberep.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfutil.h mbftoberep.h +mbfmove.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfmove.h +mbfdel.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbfutil.h mbfmove.h +bounce.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h sendmail.h postnetmail.h ping.h +createm.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h mgrutil.h createm.h +createf.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mgrutil.h createf.h +msgflags.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/clcomm.h msgflags.h +dirsession.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h dirsession.h +queue.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h fsort.h dirsession.h queue.h +dirlock.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h flock.h dirlock.h # End of generated dependencies diff --git a/mbfido/addbbs.c b/mbfido/addbbs.c index d99e2e04..57d0a2a3 100644 --- a/mbfido/addbbs.c +++ b/mbfido/addbbs.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/addpkt.c b/mbfido/addpkt.c index 0098f75d..c8c300c6 100644 --- a/mbfido/addpkt.c +++ b/mbfido/addpkt.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/aliasdb.c b/mbfido/aliasdb.c index c10c3c12..5ca032e7 100644 --- a/mbfido/aliasdb.c +++ b/mbfido/aliasdb.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/announce.c b/mbfido/announce.c index 0aeb6e9f..5293b0fd 100644 --- a/mbfido/announce.c +++ b/mbfido/announce.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/areamgr.c b/mbfido/areamgr.c index a5daeb46..32ca193f 100644 --- a/mbfido/areamgr.c +++ b/mbfido/areamgr.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/atoul.c b/mbfido/atoul.c index 3a36f010..a956f841 100644 --- a/mbfido/atoul.c +++ b/mbfido/atoul.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "atoul.h" diff --git a/mbfido/backalias.c b/mbfido/backalias.c index 601990c4..8c0d0fa2 100644 --- a/mbfido/backalias.c +++ b/mbfido/backalias.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbfido/bounce.c b/mbfido/bounce.c index 06cc2279..6ffe8830 100644 --- a/mbfido/bounce.c +++ b/mbfido/bounce.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/bwrite.c b/mbfido/bwrite.c index c1a84e5c..2d057be6 100644 --- a/mbfido/bwrite.c +++ b/mbfido/bwrite.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "bwrite.h" diff --git a/mbfido/createf.c b/mbfido/createf.c index 11e67df8..56605952 100644 --- a/mbfido/createf.c +++ b/mbfido/createf.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/createm.c b/mbfido/createm.c index 68888c7c..128d3e11 100644 --- a/mbfido/createm.c +++ b/mbfido/createm.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/dirlock.c b/mbfido/dirlock.c index 8fe17ab7..57ec7643 100644 --- a/mbfido/dirlock.c +++ b/mbfido/dirlock.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/dirsession.c b/mbfido/dirsession.c index 4684ef16..fbd6e04a 100644 --- a/mbfido/dirsession.c +++ b/mbfido/dirsession.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/fflist.c b/mbfido/fflist.c index 75ffbadf..632c449e 100644 --- a/mbfido/fflist.c +++ b/mbfido/fflist.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/clcomm.h" #include "../lib/msg.h" #include "fflist.h" diff --git a/mbfido/filefind.c b/mbfido/filefind.c index 6a013f17..60412251 100644 --- a/mbfido/filefind.c +++ b/mbfido/filefind.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/filemgr.c b/mbfido/filemgr.c index 0c889891..49c0e7e3 100644 --- a/mbfido/filemgr.c +++ b/mbfido/filemgr.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/flock.c b/mbfido/flock.c index 1740c855..fb431f27 100644 --- a/mbfido/flock.c +++ b/mbfido/flock.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/clcomm.h" #include "flock.h" diff --git a/mbfido/forward.c b/mbfido/forward.c index 1f50d0ba..c7506405 100644 --- a/mbfido/forward.c +++ b/mbfido/forward.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/fsort.c b/mbfido/fsort.c index 65069e2d..38ab17dc 100644 --- a/mbfido/fsort.c +++ b/mbfido/fsort.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/clcomm.h" #include "fsort.h" diff --git a/mbfido/ftn2rfc.c b/mbfido/ftn2rfc.c index b2a36899..8cca3383 100644 --- a/mbfido/ftn2rfc.c +++ b/mbfido/ftn2rfc.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/grlist.c b/mbfido/grlist.c index 2f156653..71149e88 100644 --- a/mbfido/grlist.c +++ b/mbfido/grlist.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/clcomm.h" #include "grlist.h" diff --git a/mbfido/hash.c b/mbfido/hash.c index 3c6807ca..bac31325 100644 --- a/mbfido/hash.c +++ b/mbfido/hash.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "hash.h" #include "lhash.h" diff --git a/mbfido/hatch.c b/mbfido/hatch.c index 7422537a..2e2d7eee 100644 --- a/mbfido/hatch.c +++ b/mbfido/hatch.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/lhash.c b/mbfido/lhash.c index a441e0d5..3f636ba3 100644 --- a/mbfido/lhash.c +++ b/mbfido/lhash.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/clcomm.h" #include "lhash.h" diff --git a/mbfido/magic.c b/mbfido/magic.c index 3e794634..0d266d3c 100644 --- a/mbfido/magic.c +++ b/mbfido/magic.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/makestat.c b/mbfido/makestat.c index 8b5faccf..cc0d8d06 100644 --- a/mbfido/makestat.c +++ b/mbfido/makestat.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/maketags.c b/mbfido/maketags.c index fa446598..c8d510c8 100644 --- a/mbfido/maketags.c +++ b/mbfido/maketags.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbaff.c b/mbfido/mbaff.c index 6d6117e9..66a8d3d3 100644 --- a/mbfido/mbaff.c +++ b/mbfido/mbaff.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -98,9 +97,6 @@ int main(int argc, char **argv) struct passwd *pw; struct tm *t; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); TermInit(1); t_start = time(NULL); diff --git a/mbfido/mbdiff.c b/mbfido/mbdiff.c index e43fb4d3..d0e6ec8f 100644 --- a/mbfido/mbdiff.c +++ b/mbfido/mbdiff.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -122,9 +121,6 @@ int main(int argc, char **argv) DIR *dp; struct dirent *de; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); TermInit(1); t_start = time(NULL); diff --git a/mbfido/mbfadopt.c b/mbfido/mbfadopt.c index 80a8d8eb..bce3a018 100644 --- a/mbfido/mbfadopt.c +++ b/mbfido/mbfadopt.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfcheck.c b/mbfido/mbfcheck.c index a4fe7eee..3342c9b9 100644 --- a/mbfido/mbfcheck.c +++ b/mbfido/mbfcheck.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfdel.c b/mbfido/mbfdel.c index 7f7b220b..f7a067c3 100644 --- a/mbfido/mbfdel.c +++ b/mbfido/mbfdel.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfido.c b/mbfido/mbfido.c index 12e3afc2..7b46a91a 100644 --- a/mbfido/mbfido.c +++ b/mbfido/mbfido.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" @@ -272,9 +271,6 @@ int main(int argc, char **argv) faddr *taddr = NULL; FILE *ofp; -#ifdef MEMWATCH - mwInit(); -#endif /* * The next trick is to supply a fake environment variable diff --git a/mbfido/mbfile.c b/mbfido/mbfile.c index 08d2f410..11ace2fc 100644 --- a/mbfido/mbfile.c +++ b/mbfido/mbfile.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -79,9 +78,6 @@ int main(int argc, char **argv) char *cmd, *FileName = NULL, *Description = NULL; struct passwd *pw; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); TermInit(1); t_start = time(NULL); diff --git a/mbfido/mbfimport.c b/mbfido/mbfimport.c index ca300930..75bba5fc 100644 --- a/mbfido/mbfimport.c +++ b/mbfido/mbfimport.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfindex.c b/mbfido/mbfindex.c index 1d29a843..c06c3090 100644 --- a/mbfido/mbfindex.c +++ b/mbfido/mbfindex.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfkill.c b/mbfido/mbfkill.c index 9b37d225..93c10546 100644 --- a/mbfido/mbfkill.c +++ b/mbfido/mbfkill.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbflist.c b/mbfido/mbflist.c index 33ba9d03..43513bd9 100644 --- a/mbfido/mbflist.c +++ b/mbfido/mbflist.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfmove.c b/mbfido/mbfmove.c index 5a68a02d..53d7d65e 100644 --- a/mbfido/mbfmove.c +++ b/mbfido/mbfmove.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfpack.c b/mbfido/mbfpack.c index 0e443d15..89561a63 100644 --- a/mbfido/mbfpack.c +++ b/mbfido/mbfpack.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbftoberep.c b/mbfido/mbftoberep.c index c10d2a18..33c71314 100644 --- a/mbfido/mbftoberep.c +++ b/mbfido/mbftoberep.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbfutil.c b/mbfido/mbfutil.c index 36fe3f83..3859d70e 100644 --- a/mbfido/mbfutil.c +++ b/mbfido/mbfutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mbindex.c b/mbfido/mbindex.c index da7ea68c..2483de48 100644 --- a/mbfido/mbindex.c +++ b/mbfido/mbindex.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -141,9 +140,6 @@ int main(int argc,char *argv[]) char *cmd; struct passwd *pw; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); InitFidonet(); TermInit(1); diff --git a/mbfido/mbmsg.c b/mbfido/mbmsg.c index 41ef7a8c..cca9d8a8 100644 --- a/mbfido/mbmsg.c +++ b/mbfido/mbmsg.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -89,9 +88,6 @@ int main(int argc, char **argv) struct passwd *pw; long tarea = 0; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); TermInit(1); diff --git a/mbfido/mbseq.c b/mbfido/mbseq.c index 28d72a9d..f6c11eec 100644 --- a/mbfido/mbseq.c +++ b/mbfido/mbseq.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -46,10 +45,6 @@ int main(int argc, char **argv) struct passwd *pw; unsigned long seq; -#ifdef MEMWATCH - mwInit(); -#endif - InitConfig(); pw = getpwuid(getuid()); diff --git a/mbfido/mgrutil.c b/mbfido/mgrutil.c index d0d3beea..71e954ff 100644 --- a/mbfido/mgrutil.c +++ b/mbfido/mgrutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mkftnhdr.c b/mbfido/mkftnhdr.c index d254e3a5..455ba35c 100644 --- a/mbfido/mkftnhdr.c +++ b/mbfido/mkftnhdr.c @@ -43,7 +43,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/mover.c b/mbfido/mover.c index 7afebf65..0abed7fb 100644 --- a/mbfido/mover.c +++ b/mbfido/mover.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/msgflags.c b/mbfido/msgflags.c index e51a712b..0a8f5053 100644 --- a/mbfido/msgflags.c +++ b/mbfido/msgflags.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/clcomm.h" #include "msgflags.h" diff --git a/mbfido/msgutil.c b/mbfido/msgutil.c index 6fddaa53..b532adf6 100644 --- a/mbfido/msgutil.c +++ b/mbfido/msgutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/newspost.c b/mbfido/newspost.c index fef954c9..e361913a 100644 --- a/mbfido/newspost.c +++ b/mbfido/newspost.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/notify.c b/mbfido/notify.c index 812ba3a0..82aeef32 100644 --- a/mbfido/notify.c +++ b/mbfido/notify.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/ping.c b/mbfido/ping.c index 9def07e3..42b51097 100644 --- a/mbfido/ping.c +++ b/mbfido/ping.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/post.c b/mbfido/post.c index d5fc011b..bf1b8bd7 100644 --- a/mbfido/post.c +++ b/mbfido/post.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/postecho.c b/mbfido/postecho.c index c273f51a..7b7241bb 100644 --- a/mbfido/postecho.c +++ b/mbfido/postecho.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/postemail.c b/mbfido/postemail.c index c239058e..44ca2695 100644 --- a/mbfido/postemail.c +++ b/mbfido/postemail.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/postnetmail.c b/mbfido/postnetmail.c index fa30b68d..09e85b98 100644 --- a/mbfido/postnetmail.c +++ b/mbfido/postnetmail.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/common.h" diff --git a/mbfido/ptic.c b/mbfido/ptic.c index b5414891..fbffd090 100644 --- a/mbfido/ptic.c +++ b/mbfido/ptic.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/qualify.c b/mbfido/qualify.c index 7ff07a10..fff1cf50 100644 --- a/mbfido/qualify.c +++ b/mbfido/qualify.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "qualify.h" diff --git a/mbfido/queue.c b/mbfido/queue.c index 0408316b..4116f354 100644 --- a/mbfido/queue.c +++ b/mbfido/queue.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/rfc2ftn.c b/mbfido/rfc2ftn.c index ab98e445..31b9f8bf 100644 --- a/mbfido/rfc2ftn.c +++ b/mbfido/rfc2ftn.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/rnews.c b/mbfido/rnews.c index cdb35eb7..9f1b9162 100644 --- a/mbfido/rnews.c +++ b/mbfido/rnews.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/rollover.c b/mbfido/rollover.c index 257755ad..041af065 100644 --- a/mbfido/rollover.c +++ b/mbfido/rollover.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/scan.c b/mbfido/scan.c index e32fb472..59458839 100644 --- a/mbfido/scan.c +++ b/mbfido/scan.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/scannews.c b/mbfido/scannews.c index 0d6b25d0..d8692b24 100644 --- a/mbfido/scannews.c +++ b/mbfido/scannews.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/sendmail.c b/mbfido/sendmail.c index f4d3298f..a5f0bb82 100644 --- a/mbfido/sendmail.c +++ b/mbfido/sendmail.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/storeecho.c b/mbfido/storeecho.c index 04c22f40..00c3ca96 100644 --- a/mbfido/storeecho.c +++ b/mbfido/storeecho.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/storenet.c b/mbfido/storenet.c index 6b2eae83..3d3ceedb 100644 --- a/mbfido/storenet.c +++ b/mbfido/storenet.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/tic.c b/mbfido/tic.c index 94777cb0..dcc83dbf 100644 --- a/mbfido/tic.c +++ b/mbfido/tic.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/toberep.c b/mbfido/toberep.c index 00bef387..749561a6 100644 --- a/mbfido/toberep.c +++ b/mbfido/toberep.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/tosspkt.c b/mbfido/tosspkt.c index ea24a895..8ac65314 100644 --- a/mbfido/tosspkt.c +++ b/mbfido/tosspkt.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/tracker.c b/mbfido/tracker.c index f1241592..6d31011a 100644 --- a/mbfido/tracker.c +++ b/mbfido/tracker.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/unpack.c b/mbfido/unpack.c index e600e510..fe9448af 100644 --- a/mbfido/unpack.c +++ b/mbfido/unpack.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/utic.c b/mbfido/utic.c index 50b9f559..21a51266 100644 --- a/mbfido/utic.c +++ b/mbfido/utic.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbfido/virscan.c b/mbfido/virscan.c index b88703e3..8351c270 100644 --- a/mbfido/virscan.c +++ b/mbfido/virscan.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbmon/Makefile b/mbmon/Makefile index b2a68a27..7500ef44 100644 --- a/mbmon/Makefile +++ b/mbmon/Makefile @@ -7,7 +7,6 @@ include ../Makefile.global SRCS = mutil.c mbmon.c common.c proglock.c HDRS = mutil.h mbmon.h common.h proglock.h OBJS = mutil.o mbmon.o common.o proglock.o -LIBS += ../lib/libmemwatch.a OTHER = Makefile ############################################################################# @@ -57,8 +56,8 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -mutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mberrors.h ../lib/structs.h common.h mutil.h -mbmon.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mberrors.h ../lib/structs.h common.h proglock.h mutil.h -common.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mberrors.h common.h -proglock.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mberrors.h ../lib/structs.h common.h proglock.h +mutil.o: ../config.h ../lib/libs.h ../lib/mberrors.h ../lib/structs.h common.h mutil.h +mbmon.o: ../config.h ../lib/libs.h ../lib/mberrors.h ../lib/structs.h common.h proglock.h mutil.h +common.o: ../config.h ../lib/libs.h ../lib/mberrors.h common.h +proglock.o: ../config.h ../lib/libs.h ../lib/mberrors.h ../lib/structs.h common.h proglock.h # End of generated dependencies diff --git a/mbmon/common.c b/mbmon/common.c index a8713cb1..0b42595e 100644 --- a/mbmon/common.c +++ b/mbmon/common.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mberrors.h" #include #include "common.h" @@ -83,9 +82,6 @@ void ExitClient(int errcode) free(pbuff); unlink(cpath); -#ifdef MEMWATCH - mwTerm(); -#endif exit(errcode); } diff --git a/mbmon/mbmon.c b/mbmon/mbmon.c index 9485814a..6eece9d1 100644 --- a/mbmon/mbmon.c +++ b/mbmon/mbmon.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mberrors.h" #include "../lib/structs.h" #include "common.h" @@ -694,10 +693,6 @@ int main(int argc, char *argv[]) int rc; FILE *fp; -#ifdef MEMWATCH - mwInit(); -#endif - /* * Read configuration */ diff --git a/mbmon/mutil.c b/mbmon/mutil.c index 799b6f56..44b933aa 100644 --- a/mbmon/mutil.c +++ b/mbmon/mutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mberrors.h" #include "../lib/structs.h" #include "common.h" diff --git a/mbmon/proglock.c b/mbmon/proglock.c index 4141e60c..31b788f0 100644 --- a/mbmon/proglock.c +++ b/mbmon/proglock.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mberrors.h" #include "../lib/structs.h" #include "common.h" diff --git a/mbsebbs/Makefile b/mbsebbs/Makefile index 6f63ea5b..7ca91565 100644 --- a/mbsebbs/Makefile +++ b/mbsebbs/Makefile @@ -27,23 +27,23 @@ MBSEBBS_OBJS = signature.o bbslist.o chat.o file.o funcs.o mail.o menu.o \ exitinfo.o filesub.o lineedit.o offline.o language.o msgutil.o \ pop3.o email.o input.o whoson.o door.o dispfile.o userlist.o timestats.o \ logentry.o morefile.o lastcallers.o -MBSEBBS_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ +MBSEBBS_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ ../lib/libdbase.a ../lib/libmbinet.a ../lib/libnodelist.a MBNEWUSR_OBJS = mbnewusr.o newuser.o language.o timeout.o dispfile.o oneline.o \ timecheck.o input.o exitinfo.o funcs.o misc.o change.o door.o \ filesub.o mail.o email.o msgutil.o pop3.o lineedit.o fsedit.o whoson.o -MBNEWUSR_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ +MBNEWUSR_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ ../lib/libdbase.a ../lib/libmbinet.a ../lib/libnodelist.a MBALL_OBJS = mball.o -MBALL_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBALL_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a MBLANG_OBJS = mblang.o -MBLANG_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBLANG_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a MBSTAT_OBJS = mbstat.o -MBSTAT_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBSTAT_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a MBTOBE_OBJS = mbtoberep.o -MBTOBE_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBTOBE_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a MBUSER_OBJS = mbuser.o -MBUSER_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a +MBUSER_LIBS = ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a OTHER = Makefile TARGET = mbsebbs mbnewusr mball mblang mbstat mbtoberep mbuser @@ -127,46 +127,46 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -signature.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/ansi.h ../lib/clcomm.h ../lib/common.h signature.h funcs.h input.h language.h timeout.h -filesub.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h funcs.h language.h input.h misc.h timeout.h exitinfo.h change.h -language.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h input.h language.h -mbtoberep.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/mberrors.h -msgutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h oneline.h msgutil.h -oneline.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h oneline.h funcs.h input.h language.h -bbslist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h bbslist.h funcs.h input.h language.h -morefile.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h language.h morefile.h timeout.h -email.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/msgtext.h ../lib/msg.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h exitinfo.h language.h mail.h timeout.h msgutil.h input.h email.h whoson.h -fsedit.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h mail.h input.h language.h timeout.h pinfo.h fsedit.h -lineedit.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mail.h input.h language.h timeout.h lineedit.h -mblang.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/mberrors.h -mbuser.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbuser.h -page.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h dispfile.h input.h chat.h page.h timeout.h mail.h language.h -bye.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h dispfile.h misc.h language.h bye.h -funcs.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h ../lib/mberrors.h funcs.h -mail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/msgtext.h ../lib/clcomm.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h door.h whoson.h -newuser.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h funcs.h input.h newuser.h language.h timeout.h change.h dispfile.h -pinfo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h pinfo.h input.h -timecheck.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h -change.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h change.h dispfile.h funcs.h input.h language.h misc.h timeout.h exitinfo.h bye.h -exitinfo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h funcs.h input.h language.h oneline.h misc.h bye.h timeout.h timecheck.h exitinfo.h -mball.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/mbse.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbcfg.h ../lib/clcomm.h ../lib/mberrors.h mball.h -mbsebbs.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/mberrors.h mbsebbs.h user.h dispfile.h language.h menu.h misc.h bye.h timeout.h funcs.h -menu.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h oneline.h mail.h bbslist.h change.h chat.h file.h funcs.h input.h misc.h timeout.h menu.h page.h pinfo.h bye.h timecheck.h whoson.h language.h offline.h email.h door.h dispfile.h userlist.h timestats.h logentry.h morefile.h lastcallers.h signature.h -pop3.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/msgtext.h ../lib/msg.h msgutil.h pop3.h -lastcallers.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h language.h lastcallers.h -timeout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h -chat.o: ../config.h ../lib/libs.h ../lib/ansi.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h chat.h funcs.h input.h language.h misc.h whoson.h -file.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h dispfile.h -mbstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbstat.h -misc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h funcs.h input.h language.h misc.h timeout.h exitinfo.h -offline.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/mbse.h ../lib/users.h ../lib/records.h ../lib/bluewave.h ../lib/common.h ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h -user.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h email.h -mbnewusr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h -input.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h input.h timeout.h language.h -whoson.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h input.h language.h exitinfo.h whoson.h -door.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h input.h timeout.h exitinfo.h whoson.h door.h -dispfile.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h funcs.h language.h oneline.h misc.h timeout.h timecheck.h exitinfo.h mail.h email.h input.h dispfile.h filesub.h -userlist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h userlist.h language.h input.h timeout.h -timestats.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h timestats.h funcs.h language.h input.h exitinfo.h -logentry.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h logentry.h +signature.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/ansi.h ../lib/clcomm.h ../lib/common.h signature.h funcs.h input.h language.h timeout.h +filesub.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h funcs.h language.h input.h misc.h timeout.h exitinfo.h change.h +language.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h input.h language.h +mbtoberep.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/mberrors.h +msgutil.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h oneline.h msgutil.h +oneline.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h oneline.h funcs.h input.h language.h +bbslist.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h bbslist.h funcs.h input.h language.h +morefile.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h language.h morefile.h timeout.h +email.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/msgtext.h ../lib/msg.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h exitinfo.h language.h mail.h timeout.h msgutil.h input.h email.h whoson.h +fsedit.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h mail.h input.h language.h timeout.h pinfo.h fsedit.h +lineedit.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mail.h input.h language.h timeout.h lineedit.h +mblang.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/mberrors.h +mbuser.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbuser.h +page.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h dispfile.h input.h chat.h page.h timeout.h mail.h language.h +bye.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h dispfile.h misc.h language.h bye.h +funcs.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h ../lib/mberrors.h funcs.h +mail.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/msgtext.h ../lib/clcomm.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h door.h whoson.h +newuser.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h funcs.h input.h newuser.h language.h timeout.h change.h dispfile.h +pinfo.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h pinfo.h input.h +timecheck.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h +change.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h change.h dispfile.h funcs.h input.h language.h misc.h timeout.h exitinfo.h bye.h +exitinfo.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h funcs.h input.h language.h oneline.h misc.h bye.h timeout.h timecheck.h exitinfo.h +mball.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/mbse.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbcfg.h ../lib/clcomm.h ../lib/mberrors.h mball.h +mbsebbs.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/mberrors.h mbsebbs.h user.h dispfile.h language.h menu.h misc.h bye.h timeout.h funcs.h +menu.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h oneline.h mail.h bbslist.h change.h chat.h file.h funcs.h input.h misc.h timeout.h menu.h page.h pinfo.h bye.h timecheck.h whoson.h language.h offline.h email.h door.h dispfile.h userlist.h timestats.h logentry.h morefile.h lastcallers.h signature.h +pop3.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/msgtext.h ../lib/msg.h msgutil.h pop3.h +lastcallers.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h language.h lastcallers.h +timeout.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h +chat.o: ../config.h ../lib/libs.h ../lib/ansi.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h chat.h funcs.h input.h language.h misc.h whoson.h +file.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h dispfile.h +mbstat.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbstat.h +misc.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h funcs.h input.h language.h misc.h timeout.h exitinfo.h +offline.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/mbse.h ../lib/users.h ../lib/records.h ../lib/bluewave.h ../lib/common.h ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h +user.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h email.h +mbnewusr.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h +input.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h input.h timeout.h language.h +whoson.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h input.h language.h exitinfo.h whoson.h +door.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h input.h timeout.h exitinfo.h whoson.h door.h +dispfile.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h funcs.h language.h oneline.h misc.h timeout.h timecheck.h exitinfo.h mail.h email.h input.h dispfile.h filesub.h +userlist.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h userlist.h language.h input.h timeout.h +timestats.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h timestats.h funcs.h language.h input.h exitinfo.h +logentry.o: ../config.h ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h logentry.h # End of generated dependencies diff --git a/mbsebbs/bbslist.c b/mbsebbs/bbslist.c index 232a2efe..5864e903 100644 --- a/mbsebbs/bbslist.c +++ b/mbsebbs/bbslist.c @@ -33,7 +33,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/bye.c b/mbsebbs/bye.c index 8fb59721..bbb74dca 100644 --- a/mbsebbs/bye.c +++ b/mbsebbs/bye.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" @@ -126,9 +125,6 @@ void Good_Bye(int onsig) Unsetraw(); Free_Language(); free(pTTY); -#ifdef MEMWATCH - mwTerm(); -#endif exit(onsig); } @@ -152,9 +148,6 @@ void Quick_Bye(int onsig) Free_Language(); free(pTTY); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_OK); } diff --git a/mbsebbs/change.c b/mbsebbs/change.c index d1976671..cf53ef9b 100644 --- a/mbsebbs/change.c +++ b/mbsebbs/change.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/chat.c b/mbsebbs/chat.c index 1f8794e4..5e4eb04f 100644 --- a/mbsebbs/chat.c +++ b/mbsebbs/chat.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" #include "../lib/ansi.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/dispfile.c b/mbsebbs/dispfile.c index 5b2c33fd..1abc8795 100644 --- a/mbsebbs/dispfile.c +++ b/mbsebbs/dispfile.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/door.c b/mbsebbs/door.c index 9688325e..971e66b3 100644 --- a/mbsebbs/door.c +++ b/mbsebbs/door.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/email.c b/mbsebbs/email.c index 4c46048f..a1d04006 100644 --- a/mbsebbs/email.c +++ b/mbsebbs/email.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/exitinfo.c b/mbsebbs/exitinfo.c index a023a690..d507dd90 100644 --- a/mbsebbs/exitinfo.c +++ b/mbsebbs/exitinfo.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/file.c b/mbsebbs/file.c index b222c1e0..67a35e61 100644 --- a/mbsebbs/file.c +++ b/mbsebbs/file.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index e4f0ceb0..bf988851 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/fsedit.c b/mbsebbs/fsedit.c index b13b5b3d..a3077789 100644 --- a/mbsebbs/fsedit.c +++ b/mbsebbs/fsedit.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/funcs.c b/mbsebbs/funcs.c index aee2b742..c825b26e 100644 --- a/mbsebbs/funcs.c +++ b/mbsebbs/funcs.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" @@ -317,9 +316,6 @@ void FindMBSE() if (getenv("MBSE_ROOT") == NULL) { printf("FATAL ERROR: Environment variable MBSE_ROOT not set\n"); free(FileName); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_INIT_ERROR); } sprintf(FileName, "%s/etc/config.data", getenv("MBSE_ROOT")); @@ -329,9 +325,6 @@ void FindMBSE() printf("Please run mbsetup to create configuration file.\n"); printf("Or check that your environment variable MBSE_ROOT is set to the BBS Path!\n"); free(FileName); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_CONFIG_ERROR); } diff --git a/mbsebbs/input.c b/mbsebbs/input.c index 3c8ce638..5e0bc2b7 100644 --- a/mbsebbs/input.c +++ b/mbsebbs/input.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/language.c b/mbsebbs/language.c index b08f1e0a..0d5ec51e 100644 --- a/mbsebbs/language.c +++ b/mbsebbs/language.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/lastcallers.c b/mbsebbs/lastcallers.c index ecc86928..268bba1c 100644 --- a/mbsebbs/lastcallers.c +++ b/mbsebbs/lastcallers.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/lineedit.c b/mbsebbs/lineedit.c index f1452862..3ad5e59b 100644 --- a/mbsebbs/lineedit.c +++ b/mbsebbs/lineedit.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/logentry.c b/mbsebbs/logentry.c index 21831cab..d6a5fe33 100644 --- a/mbsebbs/logentry.c +++ b/mbsebbs/logentry.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/mail.c b/mbsebbs/mail.c index e9c91038..8f5683e2 100644 --- a/mbsebbs/mail.c +++ b/mbsebbs/mail.c @@ -37,7 +37,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/mball.c b/mbsebbs/mball.c index 726904d7..f4112cb0 100644 --- a/mbsebbs/mball.c +++ b/mbsebbs/mball.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/mbse.h" #include "../lib/users.h" @@ -137,10 +136,6 @@ int main(int argc, char **argv) char *cmd; struct passwd *pw; -#ifdef MEMWATCH - mwInit(); -#endif - InitConfig(); TermInit(1); t_start = time(NULL); diff --git a/mbsebbs/mblang.c b/mbsebbs/mblang.c index cf8448f7..3071aa5b 100644 --- a/mbsebbs/mblang.c +++ b/mbsebbs/mblang.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -43,9 +42,6 @@ int main(int argc, char **argv) int i, j, lines; char *temp, *temp1; -#ifdef MEMWATCH - mwInit(); -#endif temp = calloc(PATH_MAX, sizeof(char)); temp1 = calloc(PATH_MAX, sizeof(char)); @@ -54,9 +50,6 @@ int main(int argc, char **argv) if (argc < 3) { printf("\nUsage: %s [language data file] [language text file]\n\n", *(argv)); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_COMMANDLINE); } @@ -66,17 +59,11 @@ int main(int argc, char **argv) sprintf(temp, "%s", *(argv + 2)); if ((fp1 = fopen(temp, "r")) == NULL) { printf("\nUnable to open %s\n", temp); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_COMMANDLINE); } sprintf(temp1, "%s", *(argv + 1)); if ((fp = fopen(temp1, "a+")) == NULL) { printf("\nUnable to open %s\n", temp1); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_COMMANDLINE); } @@ -95,9 +82,6 @@ int main(int argc, char **argv) } if (i > 29) { printf("\nKey part in line %d too long (%d chars)", lines, i); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_GENERAL); } @@ -113,9 +97,6 @@ int main(int argc, char **argv) } if (j > 84) { printf("\nLanguage string in line %d too long (%d chars)", lines, j); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_GENERAL); } @@ -130,9 +111,6 @@ int main(int argc, char **argv) printf("\nCompiled %d language lines\n", lines); -#ifdef MEMWATCH - mwTerm(); -#endif return 0; } diff --git a/mbsebbs/mbnewusr.c b/mbsebbs/mbnewusr.c index 14202466..16de8df4 100644 --- a/mbsebbs/mbnewusr.c +++ b/mbsebbs/mbnewusr.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" @@ -61,9 +60,6 @@ int main(int argc, char **argv) char temp[PATH_MAX]; struct passwd *pw; -#ifdef MEMWATCH - mwInit(); -#endif printf("\n\nLoading MBSE BBS New User Registration ...\n\n"); pTTY = calloc(15, sizeof(char)); tty = ttyname(1); @@ -74,9 +70,6 @@ int main(int argc, char **argv) FindMBSE(); if (!strlen(CFG.startname)) { printf("FATAL: No bbs startname, edit mbsetup 1.2.10\n"); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_CONFIG_ERROR); } @@ -85,9 +78,6 @@ int main(int argc, char **argv) */ if ((pw = getpwnam((char *)"mbse")) == NULL) { perror("Can't find user \"mbse\" in /etc/passwd"); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_INIT_ERROR); } @@ -96,9 +86,6 @@ int main(int argc, char **argv) */ if ((seteuid(pw->pw_uid) == -1) || (setegid(pw->pw_gid) == -1)) { perror("Can't seteuid() or setegid() to \"mbse\" user"); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_INIT_ERROR); } diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index 3fe62919..b570a7d0 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" @@ -61,9 +60,6 @@ int main(int argc, char **argv) char *p, *tty, temp[PATH_MAX]; int i; -#ifdef MEMWATCH - mwInit(); -#endif printf("Loading MBSE BBS ...\n"); pTTY = calloc(15, sizeof(char)); tty = ttyname(1); diff --git a/mbsebbs/mbstat.c b/mbsebbs/mbstat.c index 2ea3e870..cec6f776 100644 --- a/mbsebbs/mbstat.c +++ b/mbsebbs/mbstat.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -113,9 +112,6 @@ int main(int argc, char **argv) int do_sema = FALSE; struct passwd *pw; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); TermInit(1); t_start = time(NULL); diff --git a/mbsebbs/mbtoberep.c b/mbsebbs/mbtoberep.c index 320969f3..707db290 100644 --- a/mbsebbs/mbtoberep.c +++ b/mbsebbs/mbtoberep.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/mberrors.h" @@ -43,14 +42,8 @@ int main(int argc, char **argv) struct _filerecord rep; int i; -#ifdef MEMWATCH - mwInit(); -#endif if ((BBSpath = getenv("MBSE_ROOT")) == NULL) { printf("MBSE_ROOT variable not set\n"); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_INIT_ERROR); } @@ -60,9 +53,6 @@ int main(int argc, char **argv) if ((fp = fopen(temp, "r")) == NULL) { printf("File %s not found\n", temp); free(temp); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_INIT_ERROR); } @@ -96,9 +86,6 @@ int main(int argc, char **argv) fclose(fp); chmod(temp, 0640); free(temp); -#ifdef MEMWATCH - mwTerm(); -#endif return 0; } diff --git a/mbsebbs/mbuser.c b/mbsebbs/mbuser.c index 58dcd9cb..ed04ada0 100644 --- a/mbsebbs/mbuser.c +++ b/mbsebbs/mbuser.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -57,9 +56,6 @@ int main(int argc, char **argv) char *cmd; struct passwd *pw; -#ifdef MEMWATCH - mwInit(); -#endif InitConfig(); TermInit(1); Days = 0; diff --git a/mbsebbs/menu.c b/mbsebbs/menu.c index aefcadda..74c98173 100644 --- a/mbsebbs/menu.c +++ b/mbsebbs/menu.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/misc.c b/mbsebbs/misc.c index 53c3beed..50ad24c8 100644 --- a/mbsebbs/misc.c +++ b/mbsebbs/misc.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/morefile.c b/mbsebbs/morefile.c index 095aaf24..cf21a915 100644 --- a/mbsebbs/morefile.c +++ b/mbsebbs/morefile.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/msgutil.c b/mbsebbs/msgutil.c index 31d8e14d..cfbd1d6c 100644 --- a/mbsebbs/msgutil.c +++ b/mbsebbs/msgutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/newuser.c b/mbsebbs/newuser.c index 55ae54a1..92b1091d 100644 --- a/mbsebbs/newuser.c +++ b/mbsebbs/newuser.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" @@ -581,9 +580,6 @@ void Fast_Bye(int onsig) Free_Language(); free(pTTY); -#ifdef MEMWATCH - mwTerm(); -#endif exit(MBERR_OK); } diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index a2ab6ee4..aaa084a9 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/mbse.h" #include "../lib/users.h" diff --git a/mbsebbs/oneline.c b/mbsebbs/oneline.c index 9493c0d6..6d1c0718 100644 --- a/mbsebbs/oneline.c +++ b/mbsebbs/oneline.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/page.c b/mbsebbs/page.c index aa62906a..06c9e027 100644 --- a/mbsebbs/page.c +++ b/mbsebbs/page.c @@ -31,7 +31,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/pinfo.c b/mbsebbs/pinfo.c index fc91c1c6..bda07967 100644 --- a/mbsebbs/pinfo.c +++ b/mbsebbs/pinfo.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/pop3.c b/mbsebbs/pop3.c index 9e75df87..a1270ae9 100644 --- a/mbsebbs/pop3.c +++ b/mbsebbs/pop3.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/signature.c b/mbsebbs/signature.c index 01e1a43a..9a987bb8 100644 --- a/mbsebbs/signature.c +++ b/mbsebbs/signature.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/timecheck.c b/mbsebbs/timecheck.c index 46c9bf8c..035b5483 100644 --- a/mbsebbs/timecheck.c +++ b/mbsebbs/timecheck.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/timeout.c b/mbsebbs/timeout.c index d45c03d5..c2cb9416 100644 --- a/mbsebbs/timeout.c +++ b/mbsebbs/timeout.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/timestats.c b/mbsebbs/timestats.c index 26378223..3f04eb39 100644 --- a/mbsebbs/timestats.c +++ b/mbsebbs/timestats.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/user.c b/mbsebbs/user.c index b7c90979..8a5c82e2 100644 --- a/mbsebbs/user.c +++ b/mbsebbs/user.c @@ -32,7 +32,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/userlist.c b/mbsebbs/userlist.c index 97d153ac..2c188eb0 100644 --- a/mbsebbs/userlist.c +++ b/mbsebbs/userlist.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsebbs/whoson.c b/mbsebbs/whoson.c index a9f88002..4f88e2bb 100644 --- a/mbsebbs/whoson.c +++ b/mbsebbs/whoson.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/mbse.h" #include "../lib/structs.h" #include "../lib/users.h" diff --git a/mbsetup/Makefile b/mbsetup/Makefile index d8f9e87c..048dc82f 100644 --- a/mbsetup/Makefile +++ b/mbsetup/Makefile @@ -22,7 +22,7 @@ OBJS = grlist.o m_domain.o m_fgroup.o m_lang.o m_marea.o m_new.o m_protocol.o \ m_magic.o m_mgroup.o m_node.o m_task.o m_users.o screen.o m_bbs.o m_ff.o \ m_hatch.o m_mail.o m_modem.o m_ol.o m_tic.o m_virus.o stlist.o m_bbslist.o \ m_route.o -LIBS += ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a +LIBS += ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a OTHER = Makefile ############################################################################# @@ -72,42 +72,42 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -grlist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h screen.h grlist.h ledit.h -m_domain.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_menu.h m_domain.h -m_fgroup.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_node.h m_archive.h m_ngroup.h m_ticarea.h m_fgroup.h -m_lang.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_lang.h -m_marea.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h screen.h mutil.h ledit.h grlist.h m_global.h m_node.h m_mgroup.h m_marea.h -m_new.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h grlist.h m_new.h m_lang.h m_marea.h m_ngroup.h -m_protocol.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_protocol.h -m_ticarea.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h grlist.h m_global.h m_node.h m_fgroup.h m_farea.h m_archive.h m_ticarea.h -mbsetup.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h ledit.h m_global.h m_bbs.h m_farea.h m_fgroup.h m_mail.h m_mgroup.h m_hatch.h m_tic.h m_ticarea.h m_magic.h m_fido.h m_lang.h m_archive.h m_virus.h m_tty.h m_limits.h m_users.h m_node.h m_fdb.h m_new.h m_ol.h m_bbslist.h m_protocol.h m_ff.h m_modem.h m_marea.h m_ngroup.h m_service.h m_domain.h m_task.h m_route.h -ledit.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h screen.h mutil.h ledit.h -m_farea.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_fgroup.h m_archive.h m_farea.h m_fgroup.h m_ngroup.h -m_fido.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_fido.h -m_limits.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_limits.h -m_menu.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mutil.h screen.h ledit.h m_lang.h m_menu.h -m_ngroup.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_ngroup.h -m_service.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_service.h -m_tty.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_modem.h m_global.h m_tty.h -mutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h -m_archive.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_archive.h -m_fdb.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_farea.h m_fdb.h -m_global.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h ledit.h m_node.h m_marea.h m_ticarea.h m_new.h m_fgroup.h m_mgroup.h m_global.h -m_magic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_ticarea.h m_global.h m_magic.h -m_mgroup.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_node.h m_marea.h m_mgroup.h -m_node.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h grlist.h stlist.h m_global.h m_lang.h m_ticarea.h m_marea.h m_node.h -m_task.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_task.h -m_users.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_lang.h m_global.h m_archive.h m_protocol.h m_users.h -screen.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h screen.h -m_bbs.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h screen.h mutil.h ledit.h m_lang.h m_protocol.h m_ol.h m_fgroup.h m_farea.h m_menu.h m_bbs.h m_bbslist.h m_limits.h -m_ff.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h screen.h mutil.h ledit.h stlist.h m_global.h m_ff.h m_lang.h m_marea.h -m_hatch.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_fgroup.h m_ticarea.h m_hatch.h -m_mail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h screen.h mutil.h ledit.h m_global.h m_marea.h m_mgroup.h m_mail.h -m_modem.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_modem.h -m_ol.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_ol.h -m_tic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h screen.h mutil.h ledit.h m_fgroup.h m_ticarea.h m_magic.h m_hatch.h m_tic.h -m_virus.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_virus.h -stlist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h stlist.h -m_bbslist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_bbslist.h -m_route.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h grlist.h m_node.h m_route.h +grlist.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h screen.h grlist.h ledit.h +m_domain.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_menu.h m_domain.h +m_fgroup.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_node.h m_archive.h m_ngroup.h m_ticarea.h m_fgroup.h +m_lang.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_lang.h +m_marea.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h screen.h mutil.h ledit.h grlist.h m_global.h m_node.h m_mgroup.h m_marea.h +m_new.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h grlist.h m_new.h m_lang.h m_marea.h m_ngroup.h +m_protocol.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_protocol.h +m_ticarea.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h grlist.h m_global.h m_node.h m_fgroup.h m_farea.h m_archive.h m_ticarea.h +mbsetup.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h ledit.h m_global.h m_bbs.h m_farea.h m_fgroup.h m_mail.h m_mgroup.h m_hatch.h m_tic.h m_ticarea.h m_magic.h m_fido.h m_lang.h m_archive.h m_virus.h m_tty.h m_limits.h m_users.h m_node.h m_fdb.h m_new.h m_ol.h m_bbslist.h m_protocol.h m_ff.h m_modem.h m_marea.h m_ngroup.h m_service.h m_domain.h m_task.h m_route.h +ledit.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h screen.h mutil.h ledit.h +m_farea.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_fgroup.h m_archive.h m_farea.h m_fgroup.h m_ngroup.h +m_fido.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_fido.h +m_limits.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_limits.h +m_menu.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mutil.h screen.h ledit.h m_lang.h m_menu.h +m_ngroup.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_ngroup.h +m_service.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_service.h +m_tty.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_modem.h m_global.h m_tty.h +mutil.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h +m_archive.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_archive.h +m_fdb.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_farea.h m_fdb.h +m_global.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h ledit.h m_node.h m_marea.h m_ticarea.h m_new.h m_fgroup.h m_mgroup.h m_global.h +m_magic.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_ticarea.h m_global.h m_magic.h +m_mgroup.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_node.h m_marea.h m_mgroup.h +m_node.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h grlist.h stlist.h m_global.h m_lang.h m_ticarea.h m_marea.h m_node.h +m_task.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_task.h +m_users.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_lang.h m_global.h m_archive.h m_protocol.h m_users.h +screen.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h screen.h +m_bbs.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h screen.h mutil.h ledit.h m_lang.h m_protocol.h m_ol.h m_fgroup.h m_farea.h m_menu.h m_bbs.h m_bbslist.h m_limits.h +m_ff.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h screen.h mutil.h ledit.h stlist.h m_global.h m_ff.h m_lang.h m_marea.h +m_hatch.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_fgroup.h m_ticarea.h m_hatch.h +m_mail.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h screen.h mutil.h ledit.h m_global.h m_marea.h m_mgroup.h m_mail.h +m_modem.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_modem.h +m_ol.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_ol.h +m_tic.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h screen.h mutil.h ledit.h m_fgroup.h m_ticarea.h m_magic.h m_hatch.h m_tic.h +m_virus.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_virus.h +stlist.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h stlist.h +m_bbslist.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_bbslist.h +m_route.o: ../config.h ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h grlist.h m_node.h m_route.h # End of generated dependencies diff --git a/mbsetup/grlist.c b/mbsetup/grlist.c index 7153efdd..b7f8c5a1 100644 --- a/mbsetup/grlist.c +++ b/mbsetup/grlist.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbsetup/ledit.c b/mbsetup/ledit.c index e111bece..d38672c4 100644 --- a/mbsetup/ledit.c +++ b/mbsetup/ledit.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_archive.c b/mbsetup/m_archive.c index 8130483d..2836b763 100644 --- a/mbsetup/m_archive.c +++ b/mbsetup/m_archive.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_bbs.c b/mbsetup/m_bbs.c index c50ace74..ae6fca16 100644 --- a/mbsetup/m_bbs.c +++ b/mbsetup/m_bbs.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "screen.h" diff --git a/mbsetup/m_bbslist.c b/mbsetup/m_bbslist.c index 5f94d8eb..add8585f 100644 --- a/mbsetup/m_bbslist.c +++ b/mbsetup/m_bbslist.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_domain.c b/mbsetup/m_domain.c index de12e7a9..5ce601d2 100644 --- a/mbsetup/m_domain.c +++ b/mbsetup/m_domain.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_farea.c b/mbsetup/m_farea.c index a90527fa..a7e70a6d 100644 --- a/mbsetup/m_farea.c +++ b/mbsetup/m_farea.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_fdb.c b/mbsetup/m_fdb.c index 5a09ad07..1285e7c5 100644 --- a/mbsetup/m_fdb.c +++ b/mbsetup/m_fdb.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_ff.c b/mbsetup/m_ff.c index 138c89ca..a1e31695 100644 --- a/mbsetup/m_ff.c +++ b/mbsetup/m_ff.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_fgroup.c b/mbsetup/m_fgroup.c index 76e890b2..1f5d5ff3 100644 --- a/mbsetup/m_fgroup.c +++ b/mbsetup/m_fgroup.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_fido.c b/mbsetup/m_fido.c index 278d1357..80bdb34b 100644 --- a/mbsetup/m_fido.c +++ b/mbsetup/m_fido.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_global.c b/mbsetup/m_global.c index eddb196b..3ce20725 100644 --- a/mbsetup/m_global.c +++ b/mbsetup/m_global.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_hatch.c b/mbsetup/m_hatch.c index 3d8f89c0..242fb647 100644 --- a/mbsetup/m_hatch.c +++ b/mbsetup/m_hatch.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_lang.c b/mbsetup/m_lang.c index 4d061b40..828b5c62 100644 --- a/mbsetup/m_lang.c +++ b/mbsetup/m_lang.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_limits.c b/mbsetup/m_limits.c index 05621e59..e1ba1a21 100644 --- a/mbsetup/m_limits.c +++ b/mbsetup/m_limits.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_magic.c b/mbsetup/m_magic.c index 19bb81ff..862b751d 100644 --- a/mbsetup/m_magic.c +++ b/mbsetup/m_magic.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_mail.c b/mbsetup/m_mail.c index d7d5749b..349121c4 100644 --- a/mbsetup/m_mail.c +++ b/mbsetup/m_mail.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_marea.c b/mbsetup/m_marea.c index 1a1f363f..6a072ea0 100644 --- a/mbsetup/m_marea.c +++ b/mbsetup/m_marea.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_menu.c b/mbsetup/m_menu.c index f3d67f82..571ce7f1 100644 --- a/mbsetup/m_menu.c +++ b/mbsetup/m_menu.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_mgroup.c b/mbsetup/m_mgroup.c index af5eaf17..9cbec8bd 100644 --- a/mbsetup/m_mgroup.c +++ b/mbsetup/m_mgroup.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_modem.c b/mbsetup/m_modem.c index 71dd6085..b10c3a3c 100644 --- a/mbsetup/m_modem.c +++ b/mbsetup/m_modem.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_new.c b/mbsetup/m_new.c index a7895cdd..38d6af68 100644 --- a/mbsetup/m_new.c +++ b/mbsetup/m_new.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_ngroup.c b/mbsetup/m_ngroup.c index da1f3a7b..5392be18 100644 --- a/mbsetup/m_ngroup.c +++ b/mbsetup/m_ngroup.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_node.c b/mbsetup/m_node.c index 4960df93..256b999d 100644 --- a/mbsetup/m_node.c +++ b/mbsetup/m_node.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_ol.c b/mbsetup/m_ol.c index a2a72eee..1aeada2c 100644 --- a/mbsetup/m_ol.c +++ b/mbsetup/m_ol.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_protocol.c b/mbsetup/m_protocol.c index a85fbbe3..5d9eb3eb 100644 --- a/mbsetup/m_protocol.c +++ b/mbsetup/m_protocol.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_route.c b/mbsetup/m_route.c index 775c720c..d480e3e4 100644 --- a/mbsetup/m_route.c +++ b/mbsetup/m_route.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_service.c b/mbsetup/m_service.c index e2ff253d..4d303277 100644 --- a/mbsetup/m_service.c +++ b/mbsetup/m_service.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_task.c b/mbsetup/m_task.c index 07dc7fac..e0827cda 100644 --- a/mbsetup/m_task.c +++ b/mbsetup/m_task.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_tic.c b/mbsetup/m_tic.c index ecf4bcce..1cfd68d0 100644 --- a/mbsetup/m_tic.c +++ b/mbsetup/m_tic.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "screen.h" diff --git a/mbsetup/m_ticarea.c b/mbsetup/m_ticarea.c index 317abc5b..05bcc7b8 100644 --- a/mbsetup/m_ticarea.c +++ b/mbsetup/m_ticarea.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_tty.c b/mbsetup/m_tty.c index 40fc9cb3..79e25ed0 100644 --- a/mbsetup/m_tty.c +++ b/mbsetup/m_tty.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_users.c b/mbsetup/m_users.c index fc61c7c8..787dcc33 100644 --- a/mbsetup/m_users.c +++ b/mbsetup/m_users.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/m_virus.c b/mbsetup/m_virus.c index d9c32158..be171140 100644 --- a/mbsetup/m_virus.c +++ b/mbsetup/m_virus.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" diff --git a/mbsetup/mbsetup.c b/mbsetup/mbsetup.c index 6f3d6049..c9998bc3 100644 --- a/mbsetup/mbsetup.c +++ b/mbsetup/mbsetup.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/users.h" #include "../lib/records.h" @@ -416,10 +415,6 @@ int main(int argc, char *argv[]) exit(MBERR_INIT_ERROR); } -#ifdef MEMWATCH - mwInit(); -#endif - /* * Read the global configuration data, registrate connection */ diff --git a/mbsetup/mutil.c b/mbsetup/mutil.c index b27ce7ef..b0bed617 100644 --- a/mbsetup/mutil.c +++ b/mbsetup/mutil.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" diff --git a/mbsetup/screen.c b/mbsetup/screen.c index ed09c31e..e385e4db 100644 --- a/mbsetup/screen.c +++ b/mbsetup/screen.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/ansi.h" #include "../lib/common.h" diff --git a/mbsetup/stlist.c b/mbsetup/stlist.c index 7f24746b..7414890e 100644 --- a/mbsetup/stlist.c +++ b/mbsetup/stlist.c @@ -30,7 +30,6 @@ #include "../config.h" #include "../lib/libs.h" -#include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h"