Runtime Library Reference
· Constants
· Data types
Standard C
· assert.h
· complex.h
· ctype.h
· fenv.h
· float.h
· locale.h
· math.h
· setjmp.h
· signal.h
· stdarg.h
· stddef.h
· stdio.h
· stdlib.h
· string.h
· time.h
Standard C++
· IOstream
· new
Win32
· gc.h
DOS, DOS32, Win16
· bios.h
· cerror.h
· disp.h
· dos.h
· dos.h part 2
· emm.h
· handle.h
· int.h
· msmouse.h
· sound.h
· swap.h
· tsr.h
· winio.h
Other C
· bitops.h
· conio.h
· controlc.h
· direct.h
· fltpnt.h
· io.h
· page.h
· process.h
· search.h
· sys\stat.h
· tabsize.h
· trace.h
· utime.h
· unmangle.h
· util.h
Other C++
· regexp.h
· class complex
|
util.h
These are very useful utility functions. They aren't part of any
standard, but ought to be.
- Header
- util.h
- Prototype
-
int file_append(const char *name, void *buffer, size_t size);
- Description
-
Takes the number of bytes specified by size
pointed to by buffer and appends it to the file specified
by name. If the file does not exist, it is created.
The append is always done in binary mode; no CR-LF translation
is done.
file_append() is very useful for maintaining log files.
- Return Value
-
0 if successful. Otherwise, returns the error code.
- Compatibility
-
DOS Windows 3.x Phar Lap DOSX Win32
- See Also
-
file_read
file_write
- Header
- util.h
- Prototype
- int file_read(const char *name, void **pbuffer, size_t *psize);
- Description
- Reads the contents of the file specified by name into a buffer.
The buffer is allocated by malloc(), and a pointer to it
is returned in *pbuffer. *psize is set to the length of the
file.
The read is always done in binary mode; no CR-LF translation
is done.
In 16 bit memory models, an extra byte is always stored at buffer[size].
This makes it safe to use functions on it that rely on 0 terminated strings.
32 bit memory models have three 0 bytes after the end, this insures that
not only will char string scans terminate, but wide character scanning
functions as well. Having a guaranteed 0 at the end makes for faster
scans of the data because a length check is not needed unless a zero is
encountered.
- Return Value
- 0 if successful. Otherwise, returns the error code.
- Compatibility
- DOS Windows 3.x Phar Lap DOSX Win32
- See Also
- file_read
file_write
- Header
- util.h
- Prototype
- int file_write(const char *name, void *buffer, size_t size);
- Description
- Takes the number of bytes specified by size
pointed to by buffer and writes it to the file specified
by name.
The write is always done in binary mode; no CR-LF translation
is done.
- Return Value
- 0 if successful. Otherwise, returns the error code.
- Compatibility
- DOS Windows 3.x Phar Lap DOSX Win32
- See Also
- file_append
file_read
|