ByteCode.h 565 B

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