|
Tou
Tou header library
|
Topics | |
| Lower file operations | |
| System/IO control | |
Functions | |
| size_t | tou_read_fp_in_blocks (FILE *fp, size_t blocksize, tou_func3 cb, void *userdata) |
| Reads file in blocks, calling user-provided function for each block. | |
| char * | tou_read_file (const char *filename, size_t *read_len) |
Reads file from filename. | |
| char * | tou_read_fp (FILE *fp, size_t *read_len) |
Reads from fp. | |
| char * tou_read_file | ( | const char * | filename, |
| size_t * | read_len ) |
Reads file from filename.
Automatically allocates memory and optionally returns amount read (may be set to null).
| [in] | filename | Either file name or ""/"stdin" to read from stdin |
| [out] | read_len | Optional pointer to where to store file size |
| char * tou_read_fp | ( | FILE * | fp, |
| size_t * | read_len ) |
Reads from fp.
Automatically allocates memory and optionally returns amount read (may be set to null).
| [in] | fp | FILE* to read from |
| [out] | read_len | Optional pointer to where to store file size |
| size_t tou_read_fp_in_blocks | ( | FILE * | fp, |
| size_t | blocksize, | ||
| tou_func3 | cb, | ||
| void * | userdata ) |
Reads file in blocks, calling user-provided function for each block.
Automatically allocates memory and returns amount read. Function receives 3 parameters:
data [in] Pointer to new datalen [in] Amount of bytes actually readuserdata [in,out] User data providedLook into this function's source and/or tou_block_store_cb and tou_block_store_struct for more info about using it.
| [in] | fp | FILE* from which data is to be read |
| [in] | blocksize | Size in bytes; set to 0 to use default (TOU_DEFAULT_BLOCKSIZE) |
| [in] | cb | Function to call for each block |
| [in] | userdata | Custom data to be passed to function |