22 lines
307 B
C
22 lines
307 B
C
|
#ifndef CHUNK_INCLUDED
|
||
|
#define CHUNK_INCLUDED
|
||
|
|
||
|
#include "common.h"
|
||
|
|
||
|
typedef enum {
|
||
|
OP_RETURN,
|
||
|
OP_COUNT,
|
||
|
}OpCode;
|
||
|
|
||
|
typedef struct {
|
||
|
int len;
|
||
|
int cap;
|
||
|
uint8_t* code;
|
||
|
} Chunk;
|
||
|
|
||
|
void initChunk(Chunk *chunk);
|
||
|
void freeChunk(Chunk *chunk);
|
||
|
void writeChunk(Chunk *chunk, uint8_t byte);
|
||
|
|
||
|
#endif
|