Category : C Source Code
Archive   : IMDSRC78.ZIP
Filename : MSHELL.H

 
Output of file : MSHELL.H contained in archive : IMDSRC78.ZIP
/*----------------------------------------------------------------------
*++
* mshell.h -- Dynamic memory handler interface
* Description: mshell.h provides the interface definitions for the dynamic
* memory handler.
* See mshell.c for complete documentation.
*+-
* $Log$
*--
*/

/* Include files which may be needed */
#if !defined(printf)
#include
#endif

#if !defined(malloc)
#include
#endif

#if !defined(strcpy)
#include
#endif

/* Compilation options */
#define MEM_LIST /* Build internal list */
#define MEM_WHERE /* Keep track of memory block source */

/* Interface functions */
unsigned long Mem_Used(void) ;
void Mem_Display(FILE *) ;

/* Interface functions to access only through macros */
#if defined(MEM_WHERE)
void *mem_alloc(size_t, char *, int) ;
void *mem_realloc(void *, size_t, char *, int) ;
void mem_free(void *, char *, int) ;
char *mem_strdup(char *, char *, int) ;
#else
void *mem_alloc(size_t) ;
void *mem_realloc(void *, size_t) ;
void mem_free(void *) ;
char *mem_strdup(char *) ;
#endif

/* Interface macros */
#if !defined(__MSHELL__)
#if defined(MEM_WHERE)
#define malloc(a) mem_alloc((a),__FILE__,__LINE__)
#define realloc(a,b) mem_realloc((a),(b),__FILE__,__LINE__)
#define free(a) mem_free((a),__FILE__,__LINE__)
#define strdup(a) mem_strdup((a),__FILE__,__LINE__)
#else
#define malloc(a) mem_alloc(a)
#define realloc(a, b) mem_realloc((a),(b))
#define free(a) mem_free(a)
#define strdup(a) mem_strdup(a)
#endif
#endif

/*----------------------------------------------------------------------*/


  3 Responses to “Category : C Source Code
Archive   : IMDSRC78.ZIP
Filename : MSHELL.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/