Пример #1
0
 *	struct stk
 * Frames have structure
 *	struct frame
 *	data
 */

#define STK_ALIGN	ALIGN_BOUND
#define STK_FSIZE	(1024*sizeof(char*))
#define STK_HDRSIZE	(sizeof(Sfio_t)+sizeof(Sfdisc_t))

typedef char* (*_stk_overflow_)(int);

static int stkexcept(Sfio_t*,int,void*,Sfdisc_t*);
static Sfdisc_t stkdisc = { 0, 0, 0, stkexcept };

Sfio_t _Stak_data = SFNEW((char*)0,0,-1,SF_STATIC|SF_WRITE|SF_STRING,&stkdisc,0);

__EXTERN__(Sfio_t, _Stak_data);

struct frame
{
	char	*prev;		/* address of previous frame */
	char	*end;		/* address of end this frame */
	char	**aliases;	/* address aliases */
	int	nalias;		/* number of aliases */
};

struct stk
{
	_stk_overflow_	stkoverflow;	/* called when malloc fails */
	short		stkref;	/* reference count; */
Пример #2
0
Файл: stk.c Проект: juddy/edcde
 */
#define STK_FSIZE	(1024*sizeof(int))
#define STK_HDRSIZE	(sizeof(Sfio_t)+sizeof(Sfdisc_t))

typedef char* (*_stk_overflow_) __PROTO__((int));

static int stkexcept __PROTO__((Sfio_t*,int,Sfdisc_t*));
static Sfdisc_t stkdisc = { 0, 0, 0, stkexcept };

#if _DLL_INDIRECT_DATA && !_DLL
static Sfio_t _Stk_data_data =
#else
Sfio_t _Stk_data =
#endif

SFNEW((char*)0,0,-1,SF_STATIC|SF_WRITE|SF_STRING,&stkdisc);

#if _DLL_INDIRECT_DATA && !_DLL
Sfio_t _Stk_data = &_Stk_data_data;
#endif

struct frame
{
	char	*prev;	/* address of previous frame */
	char	*end;	/* address of end this frame */
};

struct stk
{
	_stk_overflow_	stkoverflow;	/* called when malloc fails */
	short		stkref;	/* reference count; */