diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-02-09 11:03:33 +0100 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-02-21 17:24:08 -0800 |
commit | 999868f06f49ec6450872f224a7cc0a43214b063 (patch) | |
tree | 30f34b5c0133c948654ebcb386f0b53127d4309d /nasmlib.h | |
parent | 04616f4e85d7c5c8501432f7124cf15f440aeae1 (diff) | |
download | nasm-999868f06f49ec6450872f224a7cc0a43214b063.tar.gz nasm-999868f06f49ec6450872f224a7cc0a43214b063.tar.bz2 nasm-999868f06f49ec6450872f224a7cc0a43214b063.zip |
Unify all-zero buffers; add fwritezero()
We have a number of all-zero buffers in the code. Put a single
all-zero buffer in nasmlib.c. Additionally, add fwritezero()
which can be used to write an arbitrary number of all-zero bytes;
this prevents the situation where the all-zero buffer is simply
too small.
Diffstat (limited to 'nasmlib.h')
-rw-r--r-- | nasmlib.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -329,4 +329,8 @@ extern struct dfmt *null_debug_arr[2]; const char *prefix_name(int); +#define ZERO_BUF_SIZE 4096 +extern const uint8_t zero_buffer[ZERO_BUF_SIZE]; +size_t fwritezero(size_t bytes, FILE *fp); + #endif |