1999-08-17 16:01:18 -07:00
|
|
|
/***************************************************************
|
|
|
|
* MEM.H -- Header file for mem.c *
|
|
|
|
* -- Michael Jennings *
|
|
|
|
* -- 07 January 1997 *
|
|
|
|
***************************************************************/
|
|
|
|
/*
|
1999-08-17 18:12:47 -07:00
|
|
|
* This file is original work by Michael Jennings <mej@eterm.org>.
|
1999-08-17 16:01:18 -07:00
|
|
|
*
|
|
|
|
* Copyright (C) 1997, Michael Jennings
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MEM_H_
|
|
|
|
|
|
|
|
#define _MEM_H_
|
|
|
|
|
|
|
|
typedef struct memrec_struct {
|
|
|
|
unsigned char init;
|
|
|
|
unsigned long Count, TotalSize;
|
|
|
|
void **Ptrs;
|
|
|
|
size_t *Size;
|
|
|
|
} MemRec;
|
|
|
|
|
|
|
|
#ifdef WITH_DMALLOC
|
|
|
|
# include <dmalloc.h>
|
|
|
|
# define MALLOC(sz) malloc(sz)
|
|
|
|
# define CALLOC(type,n) calloc((n),(sizeof(type)))
|
1999-09-16 15:40:44 -07:00
|
|
|
# define REALLOC(mem,sz) realloc((mem), (sz))
|
1999-08-17 16:01:18 -07:00
|
|
|
# define FREE(ptr) free(ptr)
|
1999-08-17 18:12:47 -07:00
|
|
|
#elif (DEBUG >= DEBUG_MALLOC)
|
1999-08-17 16:01:18 -07:00
|
|
|
# define MALLOC(sz) Malloc(sz)
|
|
|
|
# define CALLOC(type,n) Calloc((n),(sizeof(type)))
|
|
|
|
# define REALLOC(mem,sz) Realloc((mem),(sz))
|
|
|
|
/* # define FREE(ptr) Free(ptr) */
|
1999-08-17 18:12:47 -07:00
|
|
|
# define FREE(ptr) do { Free(ptr); ptr = NULL; } while(0)
|
1999-08-17 16:01:18 -07:00
|
|
|
# define MALLOC_MOD 25
|
|
|
|
# define REALLOC_MOD 25
|
|
|
|
# define CALLOC_MOD 25
|
|
|
|
# define FREE_MOD 25
|
|
|
|
#else
|
|
|
|
# define MALLOC(sz) malloc(sz)
|
|
|
|
# define CALLOC(type,n) calloc((n),(sizeof(type)))
|
1999-09-16 15:40:44 -07:00
|
|
|
# define REALLOC(mem,sz) ((sz) ? ((mem) ? (realloc((mem), (sz))) : (malloc(sz))) : ((mem) ? (free(mem)) : (NULL)))
|
Fri Nov 19 23:05:31 PST 1999 Michael Jennings <mej@eterm.org>
Once again, I've rendered old themes obselete. :-)
I added a new config file attribute and command-line parameter. The
option is --default-font-index, but I wouldn't necessarily use it.
The config file attribute makes more sense. :-)
Anyway, your themes will now need to have a line like this:
font default <index>
in the attributes section. This tells Eterm which font it should use
on startup. (<index> is a number between 0 and the highest-numbered
font you define.) You can now have up to 256 fonts. Font 0 is no
longer necessarily the default font; it is the smallest font. And the
larger the font index, the larger the font should be. (Of course,
this assumes you want Ctrl-> and Ctrl-< to increase/decrease your font
size. In reality, you can have your fonts in any order, and those
keys will cycle through them in order.)
Before, font 0 was always the default, and you didn't have much
freedom in rearranging your fonts. Plus, you were limited to 5. Not
any more. :-) The new system is much more straight-forward, logical,
and powerful.
So please be sure to update your themes by hand, or remove your theme
directory before installing this new version. If your theme lacks
the "font default" line, your Eterms will start with the wrong font.
:-]
SVN revision: 1344
1999-11-19 21:17:29 -08:00
|
|
|
# define FREE(ptr) do { free(ptr); ptr = NULL; } while(0)
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
extern char *SafeStr(char *, unsigned short);
|
|
|
|
extern MemRec memrec;
|
|
|
|
extern void memrec_init(void);
|
1999-08-17 18:12:47 -07:00
|
|
|
extern void memrec_add_var(void *, size_t);
|
|
|
|
extern void memrec_rem_var(void *);
|
|
|
|
extern void memrec_chg_var(void *, void *, size_t);
|
|
|
|
extern void memrec_dump(void);
|
1999-08-17 16:01:18 -07:00
|
|
|
extern void *Malloc(size_t);
|
|
|
|
extern void *Realloc(void *, size_t);
|
|
|
|
extern void *Calloc(size_t, size_t);
|
|
|
|
extern void Free(void *);
|
|
|
|
extern void myalarm(long);
|
|
|
|
extern void HandleSigSegv(int);
|
|
|
|
extern char *GarbageCollect(char *, size_t);
|
|
|
|
extern char *FileGarbageCollect(char *, size_t);
|
|
|
|
extern void *fixed_realloc(void *, size_t);
|
|
|
|
|
|
|
|
#endif /* _MEM_H_ */
|
|
|
|
|