-- Replaced static buffers with dynamic ones and broke everything.

This commit is contained in:
dfs
1998-02-07 05:35:50 +00:00
parent f8d91f559a
commit ce88211f50
22 changed files with 1542 additions and 925 deletions
+44
View File
@@ -0,0 +1,44 @@
/***************************************************************/
/* */
/* DYNBUF.H */
/* */
/* Declaration of functions for manipulating dynamic buffers */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1998 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: dynbuf.h,v 1.1 1998-02-07 05:35:57 dfs Exp $ */
#ifndef DYNBUF_H
#define DYNBUF_H
#include <stdio.h> /* For FILE */
#define DBUF_STATIC_SIZE 128
typedef struct {
char *buffer;
int len;
int allocatedLen;
char staticBuf[DBUF_STATIC_SIZE];
} DynamicBuffer;
#ifndef ARGS
#ifdef HAVE_PROTOS
#define ARGS(x) x
#else
#define ARGS(x) ()
#endif
#endif
void DBufInit(DynamicBuffer *dbuf);
int DBufPutc(DynamicBuffer *dbuf, char c);
int DBufPuts(DynamicBuffer *dbuf, char *str);
void DBufFree(DynamicBuffer *dbuf);
int DBufGets(DynamicBuffer *dbuf, FILE *fp);
#define DBufValue(bufPtr) ((bufPtr)->buffer)
#define DBufLen(bufPtr) ((bufPtr)->len)
#endif /* DYNBUF_H */