diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/word2x/tblock.h.orig |
Initial commit
Diffstat (limited to 'support/word2x/tblock.h.orig')
-rw-r--r-- | support/word2x/tblock.h.orig | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/support/word2x/tblock.h.orig b/support/word2x/tblock.h.orig new file mode 100644 index 0000000000..8aef3cd471 --- /dev/null +++ b/support/word2x/tblock.h.orig @@ -0,0 +1,48 @@ +/* $Id: tblock.h,v 1.2 1997/03/21 20:20:53 dps Exp $ */ +/* Dynamically grown text block */ + +#ifndef __tblock_h__ +#define __tblock_h__ + +#include <strings.h> + +class tblock +{ +private: + struct block + { + int limit; + int pos; + char *text; + struct block *next; + }; + + struct block dummy_block; + struct block *head; + + static const struct block dummy_init; + static const int block_size=1024; + + const char *collect(void) const; + +public: + inline tblock(void) + { + dummy_block=dummy_init; + head=&dummy_block; + } + tblock(const tblock &); + + ~tblock(void); + void zero(void); + int add(char); + int add(const char *, int); + inline int add(const char *s) + { + return this->add(s, strlen(s)); + } + tblock &operator=(const tblock &); + operator const char *(); +}; + +#endif |