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. */
| 62 | FP open for reading. SIZE must be greater than or equal to MCEL_LEN_MAX. |
| 63 | */ |
| 64 | MBBUF_INLINE void |
| 65 | mbbuf_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. |
no outgoing calls
no test coverage detected