ByteCode.h 496 B

123456789101112131415161718192021
  1. #ifndef BYTECODE_H
  2. #define BYTECODE_H
  3. #include "vm/Operation.h"
  4. typedef struct {
  5. int capacity;
  6. int length;
  7. unsigned char* code;
  8. } ByteCode;
  9. ByteCode* bcInit();
  10. void bcDelete(ByteCode* bc);
  11. int bcReserveBytes(ByteCode* bc, int length);
  12. void bcSetBytes(ByteCode* bc, int p, const void* data, int length);
  13. void bcAddBytes(ByteCode* bc, const void* data, int length);
  14. int bcGetAddress(ByteCode* bc);
  15. void bcInsertBytes(ByteCode* bc, const void* data, int length, int address);
  16. #endif