home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dbmalloc.zip / patch14.emx < prev    next >
Text File  |  1993-07-27  |  30KB  |  954 lines

  1. *** Makefile    Tue Sep 08 04:56:36 1992
  2. --- ../dbm14emx/Makefile    Tue Jul 27 15:13:28 1993
  3. ***************
  4. *** 64,70 ****
  5.   #    settings and you could have a problem if you attempt to use the file
  6.   #    in a compile session that doesn't include these flags.
  7.   #
  8. ! CFLAGS=-g
  9.   #
  10.   # Where the code will be installed
  11.   #
  12. --- 64,70 ----
  13.   #    settings and you could have a problem if you attempt to use the file
  14.   #    in a compile session that doesn't include these flags.
  15.   #
  16. ! CFLAGS=
  17.   #
  18.   # Where the code will be installed
  19.   #
  20. ***************
  21. *** 92,103 ****
  22.   # NOTE: if you change CC to a non-K&R compiler be sure to read the 
  23.   #       PROBLEMS file first.
  24.   #
  25. ! CC=cc
  26.   CPROTO=/usr/local/bin/cproto
  27.   LINT=lint
  28.   NROFF=nroff
  29.   SHARCMD=makekit -p -m -nmallocshar.
  30. ! SHELL=/bin/sh
  31.   
  32.   LIB=libdbmalloc.a
  33.   LINTLIB=llib-ldbmal.ln
  34. --- 92,103 ----
  35.   # NOTE: if you change CC to a non-K&R compiler be sure to read the 
  36.   #       PROBLEMS file first.
  37.   #
  38. ! CC=gcc
  39.   CPROTO=/usr/local/bin/cproto
  40.   LINT=lint
  41.   NROFF=nroff
  42.   SHARCMD=makekit -p -m -nmallocshar.
  43. ! #SHELL=/bin/sh
  44.   
  45.   LIB=libdbmalloc.a
  46.   LINTLIB=llib-ldbmal.ln
  47. ***************
  48. *** 165,171 ****
  49.       Configure Config.flags Runtests testerr.base
  50.   SRCFILES=MANIFEST $(MANSRCFILES)
  51.   
  52. ! TESTS=testmalloc testmem testerr teststack
  53.   
  54.   all:    $(LIB)
  55.   
  56. --- 165,171 ----
  57.       Configure Config.flags Runtests testerr.base
  58.   SRCFILES=MANIFEST $(MANSRCFILES)
  59.   
  60. ! TESTS=testmalloc.exe testmem.exe testerr.exe teststack.exe
  61.   
  62.   all:    $(LIB)
  63.   
  64. ***************
  65. *** 238,248 ****
  66.       chmod -w MANIFEST
  67.       
  68.   $(LIB): $(LIBOBJS)
  69. !     ar ru $(LIB) $(LIBOBJS)
  70. !     @-if test -s $(RANLIB); then $(RANLIB) $@; \
  71. !          else if test -s /bin/ranlib; then /bin/ranlib $@; \
  72. !      else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $@; \
  73. !      else exit 0; fi; fi; fi
  74.   
  75.   $(LINTLIB): $(LIBSRCS)
  76.       $(LINT) -x -v -o dbmal $(LIBSRCS)
  77. --- 238,246 ----
  78.       chmod -w MANIFEST
  79.       
  80.   $(LIB): $(LIBOBJS)
  81. !     -rm -f $(LIB)
  82. !     ar r $(LIB) $(LIBOBJS)
  83. !     ar s $(LIB)
  84.   
  85.   $(LINTLIB): $(LIBSRCS)
  86.       $(LINT) -x -v -o dbmal $(LIBSRCS)
  87. ***************
  88. *** 265,280 ****
  89.   #
  90.   # stuff for building the test programs
  91.   #
  92. ! testmalloc:    $(LIB) testmalloc.o
  93.       $(CC) $(CFLAGS) -o $@ testmalloc.o $(LIB)
  94.   
  95. ! testmem:    $(LIB) testmem.o
  96.       $(CC) $(CFLAGS) -o $@ testmem.o $(LIB)
  97.   
  98. ! teststack:    $(LIB) teststack.o
  99.       $(CC) $(CFLAGS) -o $@ teststack.o $(LIB)
  100.   
  101. ! testerr:    $(LIB) testerr.o
  102.       $(CC) $(CFLAGS) -o $@ testerr.o $(LIB)
  103.   
  104.   #
  105. --- 263,278 ----
  106.   #
  107.   # stuff for building the test programs
  108.   #
  109. ! testmalloc.exe:    $(LIB) testmalloc.o
  110.       $(CC) $(CFLAGS) -o $@ testmalloc.o $(LIB)
  111.   
  112. ! testmem.exe:    $(LIB) testmem.o
  113.       $(CC) $(CFLAGS) -o $@ testmem.o $(LIB)
  114.   
  115. ! teststack.exe:    $(LIB) teststack.o
  116.       $(CC) $(CFLAGS) -o $@ teststack.o $(LIB)
  117.   
  118. ! testerr.exe:    $(LIB) testerr.o
  119.       $(CC) $(CFLAGS) -o $@ testerr.o $(LIB)
  120.   
  121.   #
  122. ***************
  123. *** 325,348 ****
  124.   # special rules for building datams.o and datamc.o
  125.   #
  126.   datams.o: datams.c malloc.h mallocin.h sysdefs.h
  127. -     @rm -f datams.o; \
  128. -     if [ -s datams.O ]; then \
  129. -         echo "        cp datams.O $@"; \
  130. -         cp datams.O $@; \
  131. -     else \
  132. -         echo "        $(CC) $(CFLAGS) -c datams.c"; \
  133. -         $(CC) $(CFLAGS) -c datams.c; \
  134. -     fi
  135.   datamc.o: datamc.c malloc.h mallocin.h sysdefs.h
  136. -     @rm -f datamc.o; \
  137. -     if [ -s datamc.O ]; then \
  138. -         echo "        cp datamc.O $@"; \
  139. -         cp datamc.O $@; \
  140. -     else \
  141. -         echo "        $(CC) $(CFLAGS) -c datamc.c"; \
  142. -         $(CC) $(CFLAGS) -c datamc.c; \
  143. -     fi
  144.   
  145.   #
  146.   # include file dependencies
  147. --- 323,329 ----
  148. *** malloc.c    Tue Sep 08 04:57:10 1992
  149. --- ../dbm14emx/malloc.c    Tue Jul 27 15:06:06 1993
  150. ***************
  151. *** 1324,1330 ****
  152.                           3, B_DEC, '0');
  153.                       filenam[14] = '\0';
  154.                       VOIDCAST unlink(filenam);
  155. !                     if( link("core",filenam) == 0)
  156.                       {
  157.                           VOIDCAST unlink("core");
  158.                       }
  159. --- 1324,1330 ----
  160.                           3, B_DEC, '0');
  161.                       filenam[14] = '\0';
  162.                       VOIDCAST unlink(filenam);
  163. !                     if( rename("core",filenam) == 0)
  164.                       {
  165.                           VOIDCAST unlink("core");
  166.                       }
  167. *** malloc.h    Tue Jul 27 15:30:14 1993
  168. --- ../dbm14emx/malloc.h    Tue Jul 27 15:32:32 1993
  169. ***************
  170. *** 0 ****
  171. --- 1,624 ----
  172. + /*
  173. +  * (c) Copyright 1990, 1991, 1992 Conor P. Cahill (cpcahil@virtech.vti.com)
  174. +  *
  175. +  * This software may be distributed freely as long as the following conditions
  176. +  * are met:
  177. +  *         * the distribution, or any derivative thereof, may not be
  178. +  *          included as part of a commercial product
  179. +  *        * full source code is provided including this copyright
  180. +  *        * there is no charge for the software itself (there may be
  181. +  *          a minimal charge for the copying or distribution effort)
  182. +  *        * this copyright notice is not modified or removed from any
  183. +  *          source file
  184. +  */
  185. + /*
  186. +  * $Id: malloc.h.org,v 1.38 1992/08/22 16:27:13 cpcahil Exp $
  187. +  */
  188. + #ifndef _DEBUG_MALLOC_INC
  189. + #define _DEBUG_MALLOC_INC 1
  190. + #ifdef    force_cproto_to_use_defines
  191. + /*
  192. +  * these are just here because cproto used the c-preprocessor to generate
  193. +  * the prototypes and if they were left as #defines the prototypes.h file
  194. +  * would have the contents of the define, not the define itself
  195. +  */
  196. + typedef char        DATATYPE;
  197. + typedef int        SIZETYPE;
  198. + typedef void        VOIDTYPE;
  199. + typedef char        MEMDATA;
  200. + typedef int        MEMSIZE;
  201. + typedef int        STRSIZE;
  202. + typedef int        FREETYPE;
  203. + typedef int        EXITTYPE;
  204. + #ifdef WRTSIZE
  205. + #undef WRTSIZE
  206. + #endif
  207. + typedef unsigned int    WRTSIZE;
  208. + /*
  209. +  * for now, define CONST as const.  A sed script in the makefile will change 
  210. +  * this back to CONST in the prototypes.h file.
  211. +  */
  212. + #define CONST const
  213. + #else  /* force_cproto_to_use_defines */
  214. + /*
  215. +  * The following entries are automatically added by the Configure script.
  216. +  * If they are not correct for your system, then Configure is not handling
  217. +  * your system correctly.  Please report this to the author along with
  218. +  * a description of your system and the correct values
  219. +  */
  220. + #if  __GNUC__ && __STDC__
  221. + #define VOIDTYPE    void
  222. + #define CONST        const
  223. + #define EXITTYPE    void
  224. + #define DATATYPE    void
  225. + #define SIZETYPE    size_t
  226. + #define FREETYPE    void
  227. + #define MEMDATA        void
  228. + #define MEMSIZE        size_t
  229. + #define MEMCMPTYPE    unsigned char
  230. + #define STRSIZE        size_t
  231. + #define STRCMPTYPE    unsigned char
  232. + #else  /* __GNUC__ && __STDC__ */
  233. + #if       __GNUC__
  234. + #define VOIDTYPE     void
  235. + #define CONST 
  236. + #define EXITTYPE     void
  237. + #define DATATYPE     void
  238. + #define SIZETYPE    size_t
  239. + #define FREETYPE    void
  240. + #define MEMDATA        void
  241. + #define MEMSIZE        size_t
  242. + #define MEMCMPTYPE    unsigned char
  243. + #define STRSIZE        size_t
  244. + #define STRCMPTYPE    unsigned char
  245. + #else  /* __GNUC__ */
  246. + #define VOIDTYPE    void
  247. + #define CONST 
  248. + #define EXITTYPE    void
  249. + #define DATATYPE    void
  250. + #define SIZETYPE    size_t
  251. + #define FREETYPE    void
  252. + #define MEMDATA        void
  253. + #define MEMSIZE        int
  254. + #define MEMCMPTYPE    unsigned char
  255. + #define STRSIZE        size_t
  256. + #define STRCMPTYPE    unsigned char
  257. + #endif /* __GNUC__ */
  258. + #endif /* __GNUC__ && __STDC__ */
  259. + /*
  260. +  * END of automatic configuration stuff.
  261. +  */
  262. + /*
  263. +  * if DATATYPE is not defined, then the configure script must have had a 
  264. +  * problem, or was used with a different compiler.  So we have to stop
  265. +  * here and get the user to fix the problem.
  266. +  */
  267. + #ifndef   DATATYPE
  268. +     /*
  269. +      * the following string should cause a comilation error and get the
  270. +      * user to look at this stuff to find out what is wrong.
  271. +      */
  272. +     "This file is not configured correctly for this system. Run configure
  273. +      and check its results"
  274. +     char * malloc(); /* DON'T REMOVE THIS LINE if you get a compiler error
  275. +                 here it is because the malloc.h file is not 
  276. +                 configured correctly  See the readme/problems
  277. +                 files for more info */
  278. + #endif /* DATATYPE */
  279. + #endif /* force_cproto_to_use_defines */
  280. + #define VOIDCAST (VOIDTYPE)
  281. + /*
  282. +  * since we redefine much of the stuff that is #defined in string.h and 
  283. +  * memory.h, we should do what we can to make sure that they don't get 
  284. +  * included after us.  This is typically accomplished by a special symbol
  285. +  * (similar to _DEBUG_MALLOC_INC defined above) that is #defined when the
  286. +  * file is included.  Since we don't want the file to be included we will
  287. +  * #define the symbol ourselves.  These will typically have to change from
  288. +  * one system to another.  I have put in several standard mechanisms used to
  289. +  * support this mechanism, so hopefully you won't have to modify this file.
  290. +  */
  291. + #ifndef _H_STRING
  292. + #define _H_STRING        1
  293. + #endif 
  294. + #ifndef __STRING_H
  295. + #define __STRING_H        1
  296. + #endif 
  297. + #ifndef _STRING_H_
  298. + #define _STRING_H_        1
  299. + #endif 
  300. + #ifndef _STRING_H 
  301. + #define _STRING_H         1
  302. + #endif 
  303. + #ifndef _STRING_INCLUDED
  304. + #define _STRING_INCLUDED    1
  305. + #endif
  306. + #ifndef __string_h
  307. + #define __string_h        1
  308. + #endif
  309. + #ifndef _string_h
  310. + #define _string_h        1
  311. + #endif
  312. + #ifndef __string_h__
  313. + #define __string_h__        1
  314. + #endif
  315. + #ifndef _strings_h
  316. + #define _strings_h        1
  317. + #endif
  318. + #ifndef __strings_h
  319. + #define __strings_h        1
  320. + #endif
  321. + #ifndef __strings_h__
  322. + #define __strings_h__        1
  323. + #endif
  324. + #ifndef _H_MEMORY
  325. + #define _H_MEMORY        1
  326. + #endif
  327. + #ifndef __MEMORY_H
  328. + #define __MEMORY_H        1
  329. + #endif
  330. + #ifndef _MEMORY_H_
  331. + #define _MEMORY_H_        1
  332. + #endif
  333. + #ifndef _MEMORY_H
  334. + #define _MEMORY_H        1
  335. + #endif
  336. + #ifndef _MEMORY_INCLUDED
  337. + #define _MEMORY_INCLUDED    1
  338. + #endif
  339. + #ifndef __memory_h
  340. + #define __memory_h        1
  341. + #endif
  342. + #ifndef _memory_h
  343. + #define _memory_h        1
  344. + #endif
  345. + #ifndef __memory_h__
  346. + #define __memory_h__        1
  347. + #endif
  348. + /*
  349. +  * for NCR, we need to disable their in-line expansion of the str* routines
  350. +  */
  351. + #define ISTRING    1
  352. + /*
  353. +  * Malloc warning/fatal error handler defines...
  354. +  */
  355. + #define M_HANDLE_DUMP    0x80  /* 128 */
  356. + #define M_HANDLE_IGNORE    0
  357. + #define M_HANDLE_ABORT    1
  358. + #define M_HANDLE_EXIT    2
  359. + #define M_HANDLE_CORE    3
  360. +     
  361. + /*
  362. +  * Mallopt commands and defaults
  363. +  *
  364. +  * the first four settings are ignored by the debugging dbmallopt, but are
  365. +  * here to maintain compatibility with the system malloc.h.
  366. +  */
  367. + #define M_MXFAST    1        /* ignored by mallopt        */
  368. + #define M_NLBLKS    2        /* ignored by mallopt        */
  369. + #define M_GRAIN        3        /* ignored by mallopt        */
  370. + #define M_KEEP        4        /* ignored by mallopt        */
  371. + #define MALLOC_WARN    100        /* set malloc warning handling    */
  372. + #define MALLOC_FATAL    101        /* set malloc fatal handling    */
  373. + #define MALLOC_ERRFILE    102        /* specify malloc error file    */
  374. + #define MALLOC_CKCHAIN    103        /* turn on chain checking    */
  375. + #define MALLOC_FILLAREA    104        /* turn off area filling    */
  376. + #define MALLOC_LOWFRAG    105        /* use best fit allocation mech    */
  377. + #define MALLOC_CKDATA    106        /* turn off/on data checking    */
  378. + #define MALLOC_REUSE    107        /* turn off/on freed seg reuse    */
  379. + #define MALLOC_SHOWLINKS 108        /* turn off/on adjacent link disp */
  380. + #define MALLOC_DETAIL    109        /* turn off/on detail output    */
  381. + #define MALLOC_FREEMARK    110        /* warn about freeing marked segs*/
  382. + #define MALLOC_ZERO    111        /* warn about zero len allocs    */
  383. + union dbmalloptarg
  384. + {
  385. +     int      i;
  386. +     char    * str;
  387. + };
  388. + /*
  389. +  * disable the standard mallopt function
  390. +  */
  391. + #define mallopt(a,b)    (0)
  392. + /*
  393. +  * Malloc warning/fatal error codes
  394. +  */
  395. + #define M_CODE_CHAIN_BROKE    1    /* malloc chain is broken    */
  396. + #define M_CODE_NO_END        2    /* chain end != endptr        */
  397. + #define M_CODE_BAD_PTR        3    /* pointer not in malloc area    */
  398. + #define M_CODE_BAD_MAGIC    4    /* bad magic number in header    */
  399. + #define M_CODE_BAD_CONNECT    5    /* chain poingers corrupt    */
  400. + #define M_CODE_OVERRUN        6    /* data overrun in malloc seg    */
  401. + #define M_CODE_REUSE        7    /* reuse of freed area        */
  402. + #define M_CODE_NOT_INUSE    8    /* pointer is not in use    */
  403. + #define M_CODE_NOMORE_MEM    9    /* no more memory available    */
  404. + #define M_CODE_OUTOF_BOUNDS    10    /* gone beyound bounds         */
  405. + #define M_CODE_FREELIST_BAD    11    /* inuse segment on freelist    */
  406. + #define M_CODE_NOBOUND        12    /* can't calculate boundry    */
  407. + #define M_CODE_STK_NOCUR    13    /* no current element on stack    */
  408. + #define M_CODE_STK_BADFUNC    14    /* current func doesn't match    */
  409. + #define M_CODE_UNDERRUN        15    /* data underrun in malloc seg    */
  410. + #define M_CODE_FREEMARK        16    /* free of marked segment    */
  411. + #define M_CODE_ZERO_ALLOC    17    /* zero length allocation    */
  412. + #ifndef __STDCARGS
  413. + #if  __STDC__ || __cplusplus
  414. + #define __STDCARGS(a) a
  415. + #else
  416. + #define __STDCARGS(a) ()
  417. + #endif
  418. + #endif
  419. + #if __cplusplus
  420. + extern "C" {
  421. + #endif
  422. + VOIDTYPE      malloc_dump __STDCARGS((int));
  423. + VOIDTYPE      malloc_list __STDCARGS((int,unsigned long, unsigned long));
  424. + int          dbmallopt __STDCARGS((int, union dbmalloptarg *));
  425. + DATATYPE    * debug_calloc __STDCARGS((CONST char *,int,SIZETYPE,SIZETYPE));
  426. + FREETYPE      debug_cfree __STDCARGS((CONST char *, int, DATATYPE *));
  427. + FREETYPE      debug_free __STDCARGS((CONST char *, int, DATATYPE *));
  428. + DATATYPE    * debug_malloc __STDCARGS((CONST char *,int, SIZETYPE));
  429. + DATATYPE    * debug_realloc __STDCARGS((CONST char *,int,
  430. +                         DATATYPE *,SIZETYPE));
  431. + VOIDTYPE      DBmalloc_mark __STDCARGS((CONST char *,int, DATATYPE *));
  432. + unsigned long      DBmalloc_inuse __STDCARGS((CONST char *,int,
  433. +                         unsigned long *));
  434. + int          DBmalloc_chain_check __STDCARGS((CONST char *,int,int));
  435. + SIZETYPE      DBmalloc_size __STDCARGS((CONST char *,int,CONST DATATYPE *));
  436. + DATATYPE    * DBmemalign __STDCARGS((CONST char *, int,SIZETYPE, SIZETYPE));
  437. + void          StackEnter __STDCARGS((CONST char *, CONST char *, int));
  438. + void          StackLeave __STDCARGS((CONST char *, CONST char *, int));
  439. + /*
  440. +  * X allocation related prototypes
  441. +  */
  442. + char        * debug_XtMalloc __STDCARGS((CONST char *, int, unsigned int));
  443. + char        * debug_XtRealloc __STDCARGS((CONST char *, int,
  444. +                         char *, unsigned int));
  445. + char        * debug_XtCalloc __STDCARGS((CONST char *, int,
  446. +                         unsigned int, unsigned int));
  447. + void          debug_XtFree __STDCARGS((CONST char *, int, char *));
  448. + void        * debug_XtBCopy  __STDCARGS((CONST char *, int, char *,
  449. +                         char *, int));
  450. + extern void    (*XtAllocErrorHandler) __STDCARGS((CONST char *));
  451. + /*
  452. +  * memory(3) related prototypes
  453. +  */
  454. + MEMDATA      * DBmemccpy __STDCARGS((CONST char *file, int line,
  455. +                     MEMDATA  *ptr1, CONST MEMDATA  *ptr2,
  456. +                     int ch, MEMSIZE len));
  457. + MEMDATA      * DBmemchr __STDCARGS((CONST char *file, int line,
  458. +                     CONST MEMDATA  *ptr1, int ch,
  459. +                     MEMSIZE len));
  460. + MEMDATA     * DBmemmove __STDCARGS((CONST char *file, int line,
  461. +                     MEMDATA  *ptr1, CONST MEMDATA  *ptr2,
  462. +                     MEMSIZE len));
  463. + MEMDATA     * DBmemcpy __STDCARGS((CONST char *file, int line,
  464. +                     MEMDATA  *ptr1, CONST MEMDATA  *ptr2,
  465. +                     MEMSIZE len));
  466. + int          DBmemcmp __STDCARGS((CONST char *file, int line,
  467. +                     CONST MEMDATA  *ptr1,
  468. +                     CONST MEMDATA  *ptr2, MEMSIZE len));
  469. + MEMDATA     * DBmemset __STDCARGS((CONST char *file, int line,
  470. +                     MEMDATA  *ptr1, int ch, MEMSIZE len));
  471. + MEMDATA     * DBbcopy __STDCARGS((CONST char *file, int line,
  472. +                     CONST MEMDATA  *ptr2, MEMDATA  *ptr1,
  473. +                     MEMSIZE len));
  474. + MEMDATA      * DBbzero __STDCARGS((CONST char *file, int line,
  475. +                     MEMDATA  *ptr1, MEMSIZE len));
  476. + int          DBbcmp __STDCARGS((CONST char *file, int line,
  477. +                     CONST MEMDATA  *ptr2,
  478. +                     CONST MEMDATA  *ptr1, MEMSIZE len));
  479. + /*
  480. +  * string(3) related prototypes
  481. +  */
  482. + char        * DBstrcat __STDCARGS((CONST char *file,int line, char *str1,
  483. +                     CONST char *str2));
  484. + char        * DBstrdup __STDCARGS((CONST char *file, int line,
  485. +                     CONST char *str1));
  486. + char        * DBstrncat __STDCARGS((CONST char *file, int line, char *str1,
  487. +                     CONST char *str2, STRSIZE len));
  488. + int          DBstrcmp __STDCARGS((CONST char *file, int line,
  489. +                     CONST char *str1, CONST char *str2));
  490. + int          DBstrncmp __STDCARGS((CONST char *file, int line,
  491. +                     CONST char *str1, CONST char *str2,
  492. +                     STRSIZE len));
  493. + int          DBstricmp __STDCARGS((CONST char *file, int line,
  494. +                     CONST char *str1, CONST char *str2));
  495. + int          DBstrincmp __STDCARGS((CONST char *file, int line,
  496. +                     CONST char *str1, CONST char *str2,
  497. +                     STRSIZE len));
  498. + char        * DBstrcpy __STDCARGS((CONST char *file, int line, char *str1,
  499. +                     CONST char *str2));
  500. + char        * DBstrncpy __STDCARGS((CONST char *file, int line, char *str1,
  501. +                     CONST char *str2, STRSIZE len));
  502. + STRSIZE          DBstrlen __STDCARGS((CONST char *file, int line,
  503. +                     CONST char *str1));
  504. + char        * DBstrchr __STDCARGS((CONST char *file, int line,
  505. +                     CONST char *str1, int c));
  506. + char        * DBstrrchr __STDCARGS((CONST char *file, int line,
  507. +                     CONST char *str1, int c));
  508. + char        * DBindex __STDCARGS((CONST char *file, int line,
  509. +                     CONST char *str1, int c));
  510. + char        * DBrindex __STDCARGS((CONST char *file, int line,
  511. +                     CONST char *str1, int c));
  512. + char        * DBstrpbrk __STDCARGS((CONST char *file, int line,
  513. +                     CONST char *str1, CONST char *str2));
  514. + STRSIZE          DBstrspn __STDCARGS((CONST char *file, int line,
  515. +                     CONST char *str1, CONST char *str2));
  516. + STRSIZE          DBstrcspn __STDCARGS((CONST char *file, int line,
  517. +                     CONST char *str1, CONST char *str2));
  518. + char        * DBstrstr __STDCARGS((CONST char *file, int line,
  519. +                     CONST char *str1, CONST char *str2));
  520. + char        * DBstrtok __STDCARGS((CONST char *file, int line, char *str1,
  521. +                     CONST char *str2));
  522. + #if __cplusplus
  523. + };
  524. + #endif
  525. + /*
  526. +  * Macro which enables logging of the file and line number for each allocation
  527. +  * so that it is easier to determine where the offending malloc comes from.
  528. +  *
  529. +  * NOTE that only code re-compiled with this include file will have this 
  530. +  * additional info.  Calls from libraries that have not been recompiled will
  531. +  * just have a null string for this info.
  532. +  */
  533. + #ifndef IN_MALLOC_CODE
  534. + /*
  535. +  * allocation functions
  536. +  */
  537. + #define malloc(len)        debug_malloc( __FILE__,__LINE__, (len))
  538. + #define realloc(ptr,len)    debug_realloc(__FILE__,__LINE__, (ptr), (len))
  539. + #define calloc(numelem,size)    debug_calloc(__FILE__,__LINE__,(numelem),(size))
  540. + #define cfree(ptr)        debug_cfree(__FILE__,__LINE__,(ptr))
  541. + #define free(ptr)        debug_free(__FILE__,__LINE__,(ptr))
  542. + #define malloc_chain_check(do)  DBmalloc_chain_check(__FILE__,__LINE__,(do))
  543. + #define malloc_mark(ptr)    DBmalloc_mark(__FILE__,__LINE__,(ptr))
  544. + #define malloc_inuse(histptr)    DBmalloc_inuse(__FILE__,__LINE__,(histptr))
  545. + #define malloc_size(ptr)    DBmalloc_size(__FILE__,__LINE__,(ptr))
  546. + #define memalign(align,size)    DBmemalign(__FILE__,__LINE__,(align),(size))
  547. + /* 
  548. +  * X allocation routines
  549. +  */
  550. + #define XtCalloc(_num,_size)    debug_XtCalloc(__FILE__,__LINE__,_num,_size)
  551. + #define XtMalloc(_size)        debug_XtMalloc(__FILE__,__LINE__,_size)
  552. + #define XtRealloc(_ptr,_size)    debug_XtRealloc(__FILE__,__LINE__,_ptr,_size)
  553. + #define XtFree(_ptr)        debug_XtFree(__FILE__,__LINE__,_ptr)
  554. + #define _XtBCopy(ptr1,ptr2,len) debug_XtBcopy(__FILE__,__LINE__,ptr1,ptr2,len)
  555. + /*
  556. +  * Other allocation functions
  557. +  */
  558. + #define _malloc(_size)        debug_malloc(__FILE__,__LINE__,_size)
  559. + #define _realloc(_ptr,_size)    debug_realloc(__FILE__,__LINE__,_ptr,_size)
  560. + #define _calloc(_num,_size)    debug_calloc(__FILE__,__LINE__,_num,_size)
  561. + #define _free(_ptr)        debug_free(__FILE__,__LINE__,_ptr)
  562. + /*
  563. +  * memory(3) related functions
  564. +  */
  565. + #ifdef bcopy
  566. + #undef bcopy
  567. + #endif
  568. + #ifdef bzero
  569. + #undef bzero
  570. + #endif
  571. + #ifdef bcmp
  572. + #undef bcmp
  573. + #endif
  574. + #define memccpy(ptr1,ptr2,ch,len) DBmemccpy(__FILE__,__LINE__,ptr1,ptr2,ch,len)
  575. + #define memchr(ptr1,ch,len)      DBmemchr(__FILE__,__LINE__,ptr1,ch,len)
  576. + #define memmove(ptr1,ptr2,len)    DBmemmove(__FILE__,__LINE__,ptr1, ptr2, len)
  577. + #define memcpy(ptr1,ptr2,len)     DBmemcpy(__FILE__, __LINE__, ptr1, ptr2, len)
  578. + #define memcmp(ptr1,ptr2,len)     DBmemcmp(__FILE__,__LINE__,ptr1, ptr2, len)
  579. + #define memset(ptr1,ch,len)       DBmemset(__FILE__,__LINE__,ptr1, ch, len)
  580. + #define bcopy(ptr2,ptr1,len)      DBbcopy(__FILE__,__LINE__,ptr2,ptr1,len)
  581. + #define bzero(ptr1,len)           DBbzero(__FILE__,__LINE__,ptr1,len)
  582. + #define bcmp(ptr2,ptr1,len)       DBbcmp(__FILE__, __LINE__, ptr2, ptr1, len)
  583. + #define _bcopy(ptr2,ptr1,len)     DBbcopy(__FILE__,__LINE__,ptr2,ptr1,len)
  584. + #define _bzero(ptr1,len)          DBbzero(__FILE__,__LINE__,ptr1,len)
  585. + #define _bcmp(ptr2,ptr1,len)      DBbcmp(__FILE__,__LINE__,ptr2,ptr1,len)
  586. + #define __dg_bcopy(ptr2,ptr1,len) DBbcopy(__FILE__,__LINE__,ptr2,ptr1,len)
  587. + #define __dg_bzero(ptr1,len)      DBbzero(__FILE__,__LINE__,ptr1,len)
  588. + #define __dg_bcmp(ptr2,ptr1,len)  DBbcmp(__FILE__,__LINE__,ptr2,ptr1,len)
  589. + /*
  590. +  * string(3) related functions
  591. +  */
  592. + #ifdef index
  593. + #undef index
  594. + #endif
  595. + #ifdef rindex
  596. + #undef rindex
  597. + #endif
  598. + #ifdef strcpy
  599. + #undef strcpy
  600. + #endif
  601. + #ifdef strcpy
  602. + #undef strcmp
  603. + #endif
  604. + #define index(str1,c)          DBindex(__FILE__, __LINE__, str1, c)
  605. + #define rindex(str1,c)          DBrindex(__FILE__, __LINE__, str1, c)
  606. + #define strcat(str1,str2)      DBstrcat(__FILE__,__LINE__,str1,str2)
  607. + #define strchr(str1,c)          DBstrchr(__FILE__, __LINE__, str1,c)
  608. + #define strcmp(str1,str2)      DBstrcmp(__FILE__, __LINE__, str1, str2)
  609. + #define strcpy(str1,str2)      DBstrcpy(__FILE__, __LINE__, str1, str2)
  610. + #define strcspn(str1,str2)      DBstrcspn(__FILE__, __LINE__, str1,str2)
  611. + #define strdup(str1)          DBstrdup(__FILE__, __LINE__, str1)
  612. + #define stricmp(str1,str2)      DBstricmp(__FILE__, __LINE__, str1, str2)
  613. + #define strincmp(str1,str2,len)      DBstrincmp(__FILE__, __LINE__, str1,str2,len)
  614. + #define strlen(str1)          DBstrlen(__FILE__, __LINE__, str1)
  615. + #define strncat(str1,str2,len)      DBstrncat(__FILE__, __LINE__, str1,str2,len)
  616. + #define strncpy(str1,str2,len)      DBstrncpy(__FILE__,__LINE__,str1,str2,len)
  617. + #define strncmp(str1,str2,len)      DBstrncmp(__FILE__, __LINE__, str1,str2,len)
  618. + #define strpbrk(str1,str2)      DBstrpbrk(__FILE__, __LINE__, str1,str2)
  619. + #define strrchr(str1,c)          DBstrrchr(__FILE__,__LINE__,str1,c)
  620. + #define strspn(str1,str2)      DBstrspn(__FILE__, __LINE__, str1,str2)
  621. + #define strstr(str1,str2)      DBstrstr(__FILE__, __LINE__, str1, str2)
  622. + #define strtok(str1,str2)      DBstrtok(__FILE__, __LINE__, str1, str2)
  623. + /*
  624. +  * malloc stack related functions
  625. +  */
  626. + #define malloc_enter(func)      StackEnter(func,__FILE__,__LINE__)
  627. + #define malloc_leave(func)      StackLeave(func,__FILE__,__LINE__)
  628. + #endif /* IN_MALLOC_CODE */
  629. + #endif /* _DEBUG_MALLOC_INC */
  630. + /*
  631. +  * $Log: malloc.h.org,v $
  632. +  * Revision 1.38  1992/08/22  16:27:13  cpcahil
  633. +  * final changes for pl14
  634. +  *
  635. +  * Revision 1.37  1992/08/18  11:42:00  cpcahil
  636. +  * added more #defs to preclude memory/string.h inclusion
  637. +  *
  638. +  * Revision 1.36  1992/07/12  15:30:58  cpcahil
  639. +  * Merged in Jonathan I Kamens' changes
  640. +  *
  641. +  * Revision 1.35  1992/07/03  00:03:25  cpcahil
  642. +  * more fixes for pl13, several suggestons from Rich Salz.
  643. +  *
  644. +  * Revision 1.34  1992/07/02  15:35:52  cpcahil
  645. +  * misc cleanups for PL13
  646. +  *
  647. +  * Revision 1.33  1992/07/02  13:49:54  cpcahil
  648. +  * added support for new malloc_size function and additional tests to testerr
  649. +  *
  650. +  * Revision 1.32  1992/06/30  13:06:39  cpcahil
  651. +  * added support for aligned allocations
  652. +  *
  653. +  * Revision 1.31  1992/06/22  23:40:10  cpcahil
  654. +  * many fixes for working on small int systems
  655. +  *
  656. +  * Revision 1.30  1992/05/06  04:53:29  cpcahil
  657. +  * performance enhancments
  658. +  *
  659. +  * Revision 1.29  1992/04/22  18:17:32  cpcahil
  660. +  * added support for Xt Alloc functions, linted code
  661. +  *
  662. +  * Revision 1.28  1992/04/13  19:08:18  cpcahil
  663. +  * fixed case insensitive stuff
  664. +  *
  665. +  * Revision 1.27  1992/04/13  18:41:18  cpcahil
  666. +  * added case insensitive string comparison routines
  667. +  *
  668. +  * Revision 1.26  1992/04/13  17:26:25  cpcahil
  669. +  * minor portability changes
  670. +  *
  671. +  * Revision 1.25  1992/04/13  14:13:18  cpcahil
  672. +  * cleanup of log message.
  673. +  *
  674. +  * Revision 1.24  1992/04/13  03:09:14  cpcahil
  675. +  * lots of changes.
  676. +  *
  677. +  * Revision 1.23  1992/03/01  12:42:38  cpcahil
  678. +  * added support for managing freed areas and fixed doublword bndr problems
  679. +  *
  680. +  * Revision 1.22  1992/02/07  15:51:07  cpcahil
  681. +  * mods for sun4
  682. +  *
  683. +  * Revision 1.21  1992/01/29  01:35:32  cpcahil
  684. +  * added sgi definition.
  685. +  *
  686. +  * Revision 1.20  1992/01/28  21:42:25  cpcahil
  687. +  * changes for the ibmRS6000
  688. +  *
  689. +  * Revision 1.19  1992/01/28  18:05:37  cpcahil
  690. +  * misc fixes for patch 7
  691. +  *
  692. +  * Revision 1.18  1992/01/22  16:21:35  cpcahil
  693. +  * added code to prevent inclusions of string.h and memory.h after malloc.h
  694. +  * was included.
  695. +  *
  696. +  * Revision 1.17  1992/01/10  17:26:46  cpcahil
  697. +  * fixed prototypes use of void.
  698. +  *
  699. +  * Revision 1.16  1992/01/10  16:53:39  cpcahil
  700. +  * added more info on sizetype and datatype. added support for overriding
  701. +  * use of void type.
  702. +  *
  703. +  * Revision 1.15  1992/01/09  17:19:11  cpcahil
  704. +  * put the close brace in the correct position.
  705. +  *
  706. +  * Revision 1.14  1992/01/09  17:12:36  cpcahil
  707. +  * added code to support inclusion in C++ modules
  708. +  *
  709. +  * Revision 1.13  1991/12/31  21:31:26  cpcahil
  710. +  * changes for patch 6.  See CHANGES file for more info
  711. +  *
  712. +  * Revision 1.12  1991/12/26  22:31:29  cpcahil
  713. +  * added check to make sure file is not included twice.
  714. +  *
  715. +  * Revision 1.11  1991/12/06  17:58:46  cpcahil
  716. +  * added cfree() for compatibility with some wierd systems
  717. +  *
  718. +  * Revision 1.10  91/12/06  08:54:18  cpcahil
  719. +  * cleanup of __STDC__ usage and addition of CHANGES file
  720. +  * 
  721. +  * Revision 1.9  91/12/04  09:23:40  cpcahil
  722. +  * several performance enhancements including addition of free list
  723. +  * 
  724. +  * Revision 1.8  91/12/02  19:10:11  cpcahil
  725. +  * changes for patch release 5
  726. +  * 
  727. +  * Revision 1.7  91/11/25  14:42:00  cpcahil
  728. +  * Final changes in preparation for patch 4 release
  729. +  * 
  730. +  * Revision 1.6  91/11/24  00:49:28  cpcahil
  731. +  * first cut at patch 4
  732. +  * 
  733. +  * Revision 1.5  91/11/20  11:54:10  cpcahil
  734. +  * interim checkin
  735. +  * 
  736. +  * Revision 1.4  90/08/29  22:23:38  cpcahil
  737. +  * fixed mallopt to use a union as an argument.
  738. +  * 
  739. +  * Revision 1.3  90/05/11  11:04:10  cpcahil
  740. +  * took out some extraneous lines
  741. +  * 
  742. +  * Revision 1.2  90/05/11  00:13:09  cpcahil
  743. +  * added copyright statment
  744. +  * 
  745. +  * Revision 1.1  90/02/23  07:09:03  cpcahil
  746. +  * Initial revision
  747. +  * 
  748. +  */
  749. *** sysdefs.h    Tue Jul 27 15:22:40 1993
  750. --- ../dbm14emx/sysdefs.h    Tue Jul 20 13:46:16 1993
  751. ***************
  752. *** 0 ****
  753. --- 1,152 ----
  754. + /*
  755. +  * This file is mechanically generated by the Configure script.
  756. +  * If there is something wrong here, modify the configure script
  757. +  * so that it is no longer generated wrong and please send email
  758. +  * to the author so that the fix is included with the next patch
  759. +  * release.
  760. +  */
  761. + #ifndef _SYSDEF_H     /* double inclusion guard */
  762. + #define _SYSDEF_H 1
  763. + #if       __GNUC__ && __STDC__
  764. + /*
  765. +  * Signal to use to abort program 
  766. +  */
  767. + #define ABORT_SIGNAL SIGABRT
  768. + /*
  769. +  * Use setenv() for env mods
  770. +  */
  771. + #define USE_SETENV 1
  772. + /*
  773. +  * POSIX header files are available
  774. +  */
  775. + /* #define POSIX_HEADERS 1 */
  776. + /*
  777. +  * ANSI header files are available
  778. +  */
  779. + #define ANSI_HEADERS 1
  780. + /*
  781. +  * ASM settings that only apply to 80x86 systems 
  782. +  */
  783. + /*
  784. +  * Use Underscores for ASM global symbols
  785. +  */
  786. + #define USE_UNDERSCORE 1
  787. + /*
  788. +  * Use REPE instruction for ASM repeat op
  789. +  */
  790. + #define USE_REPE 1
  791. + #define WRTSIZE size_t
  792. + #else  /* __GNUC__ && __STDC__ */
  793. + #if       __GNUC__
  794. + /*
  795. +  * Signal to use to abort program 
  796. +  */
  797. + #define ABORT_SIGNAL 6
  798. + /*
  799. +  * Use setenv() for env mods
  800. +  */
  801. + #define USE_SETENV 1
  802. + /*
  803. +  * POSIX header files are available
  804. +  */
  805. + /* #define POSIX_HEADERS 1 */
  806. + /*
  807. +  * ANSI header files are available
  808. +  */
  809. + #define ANSI_HEADERS 1
  810. + /*
  811. +  * ASM settings that only apply to 80x86 systems 
  812. +  */
  813. + /*
  814. +  * Use Underscores for ASM global symbols
  815. +  */
  816. + /* #define USE_UNDERSCORE 1 */
  817. + /*
  818. +  * Use REPE instruction for ASM repeat op
  819. +  */
  820. + /*#define USE_REPE 1*/
  821. + #define WRTSIZE size_t
  822. + #else  /* __GNUC__ */
  823. + /*
  824. +  * Signal to use to abort program 
  825. +  */
  826. + #define ABORT_SIGNAL SIGABRT
  827. + /*
  828. +  * Use setenv() for env mods
  829. +  */
  830. + #define USE_SETENV 1
  831. + /*
  832. +  * POSIX header files are available
  833. +  */
  834. + #define POSIX_HEADERS 1
  835. + /*
  836. +  * ANSI header files are available
  837. +  */
  838. + #define ANSI_HEADERS 1
  839. + /*
  840. +  * ASM settings that only apply to 80x86 systems 
  841. +  */
  842. + /*
  843. +  * Use Underscores for ASM global symbols
  844. +  */
  845. + /* #define USE_UNDERSCORE 1 */
  846. + /*
  847. +  * Use REPE instruction for ASM repeat op
  848. +  */
  849. + /*#define USE_REPE 1*/
  850. + #define WRTSIZE size_t
  851. + #endif /* __GNUC__ */
  852. + #endif /* __GNUC__ && __STDC__ */
  853. + /*
  854. +  * Found X intrinsic file in /usr/include/X11
  855. +  */
  856. + /* #define FOUND_X_INTRINSIC 1 */
  857. + /*
  858. +  * Found wait.h in /usr/include/sys
  859. +  */
  860. + /* #define NEED_WAIT 1 */
  861. + /*
  862. +  * don't force inclusion of XtHeap
  863. +  */
  864. + #define DONT_FORCE_HEAPSTUFF 1
  865. + #endif  /* _SYSDEF_H */
  866.