MCPcopy Create free account
hub / github.com/coreutils/coreutils / mbbuf_init

Function mbbuf_init

gl/lib/mbbuf.h:64–75  ·  view source on GitHub ↗

Initialize MBBUF with an allocated BUFFER of SIZE bytes and a file stream FP open for reading. SIZE must be greater than or equal to MCEL_LEN_MAX. */

Source from the content-addressed store, hash-verified

62 FP open for reading. SIZE must be greater than or equal to MCEL_LEN_MAX.
63 */
64MBBUF_INLINE void
65mbbuf_init (mbbuf_t *mbbuf, char *buffer, idx_t size, FILE *fp)
66{
67 if (size < MCEL_LEN_MAX)
68 unreachable ();
69 mbbuf->buffer = buffer;
70 mbbuf->fp = fp;
71 mbbuf->size = size;
72 mbbuf->length = 0;
73 mbbuf->offset = 0;
74 mbbuf->eof = false;
75}
76
77/* Fill the input buffer with at least MCEL_LEN_MAX bytes if possible.
78 Return the number of bytes available from the current offset.

Callers 6

expandFunction · 0.85
unexpandFunction · 0.85
fold_fileFunction · 0.85
cut_characters_modeFunction · 0.85
cut_fields_mb_anyFunction · 0.85
cut_fields_bytesearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected