bytecode_serialization.rst 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. .. _api_ref_bytecode_serialization:
  2. ======================
  3. Bytecode serialization
  4. ======================
  5. .. _sq_readclosure:
  6. .. c:function:: SQRESULT sq_readclosure(HSQUIRRELVM v, SQREADFUNC readf, SQUserPointer up)
  7. :param HSQUIRRELVM v: the target VM
  8. :param SQREADFUNC readf: pointer to a read function that will be invoked by the vm during the serialization.
  9. :param SQUserPointer up: pointer that will be passed to each call to the read function
  10. :returns: a SQRESULT
  11. serialize (read) a closure and pushes it on top of the stack, the source is user defined through a read callback.
  12. .. _sq_writeclosure:
  13. .. c:function:: SQRESULT sq_writeclosure(HSQUIRRELVM v, SQWRITEFUNC writef, SQUserPointer up)
  14. :param HSQUIRRELVM v: the target VM
  15. :param SQWRITEFUNC writef: pointer to a write function that will be invoked by the vm during the serialization.
  16. :param SQUserPointer up: pointer that will be passed to each call to the write function
  17. :returns: a SQRESULT
  18. :remarks: closures with free variables cannot be serialized
  19. serializes(writes) the closure on top of the stack, the destination is user defined through a write callback.