Idris2-boot/dist/rts/idris_buffer.h
Edwin Brady da675b38a0 Add some machinery to generate C
This is towards making a distribution that allows building from C,
rather than having to build from the Idris source, to make it easier to
install.
2020-02-25 14:09:08 +00:00

30 lines
894 B
C

#ifndef __BUFFER_H
#define __BUFFER_H
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include "idris_rts.h"
VAL idris_newBuffer(VM* vm, int bytes);
int idris_getBufferSize(void* buffer);
void idris_setBufferByte(void* buffer, int loc, uint8_t byte);
void idris_setBufferInt(void* buffer, int loc, int val);
void idris_setBufferDouble(void* buffer, int loc, double val);
void idris_setBufferString(void* buffer, int loc, char* str);
void idris_copyBuffer(void* from, int start, int len,
void* to, int loc);
int idris_readBuffer(FILE* h, void* buffer, int loc, int max);
void idris_writeBuffer(FILE* h, void* buffer, int loc, int len);
uint8_t idris_getBufferByte(void* buffer, int loc);
int idris_getBufferInt(void* buffer, int loc);
double idris_getBufferDouble(void* buffer, int loc);
VAL idris_getBufferString(void* buffer, int loc, int len);
#endif