Exemplo n.º 1
0
static void program_deserialise(pony_ctx_t* ctx, void* object)
{
  program_t* program = (program_t*)object;

  program->package_groups = (package_group_list_t*)pony_deserialise_offset(ctx,
    package_group_list_pony_type(), (uintptr_t)program->package_groups);
  program->signature = (char*)pony_deserialise_block(ctx,
    (uintptr_t)program->signature, SIGNATURE_LENGTH);
  program->libpaths = (strlist_t*)pony_deserialise_offset(ctx,
    strlist_pony_type(), (uintptr_t)program->libpaths);
  program->libs = (strlist_t*)pony_deserialise_offset(ctx, strlist_pony_type(),
    (uintptr_t)program->libs);
  program->lib_args = (char*)pony_deserialise_block(ctx,
    (uintptr_t)program->lib_args, program->lib_args_size + 1);
}
Exemplo n.º 2
0
static void package_deserialise(pony_ctx_t* ctx, void* object)
{
  package_t* package = (package_t*)object;

  package->path = string_deserialise_offset(ctx, (uintptr_t)package->path);
  package->qualified_name = string_deserialise_offset(ctx,
    (uintptr_t)package->qualified_name);
  package->id = string_deserialise_offset(ctx, (uintptr_t)package->id);
  package->filename = string_deserialise_offset(ctx,
    (uintptr_t)package->filename);
  package->symbol = string_deserialise_offset(ctx, (uintptr_t)package->symbol);

  package->ast = (ast_t*)pony_deserialise_offset(ctx, ast_pony_type(),
    (uintptr_t)package->ast);
  package_set_deserialise(ctx, &package->dependencies);
  package->group = (package_group_t*)pony_deserialise_offset(ctx,
    package_group_pony_type(), (uintptr_t)package->group);
}
Exemplo n.º 3
0
void* pony_deserialise(pony_ctx_t* ctx, void* in)
{
  // This can raise an error.
  ponyint_array_t* r = (ponyint_array_t*)in;
  ctx->serialise_buffer = r->ptr;
  ctx->serialise_size = r->size;

  void* object = pony_deserialise_offset(ctx, NULL, 0);
  ponyint_gc_handlestack(ctx);

  serialise_cleanup(ctx);
  return object;
}
Exemplo n.º 4
0
static void deferred_reification_deserialise(pony_ctx_t* ctx, void* object)
{
  deferred_reification_t* d = (deferred_reification_t*)object;

  d->ast = (ast_t*)pony_deserialise_offset(ctx, ast_pony_type(),
    (uintptr_t)d->ast);
  d->type_typeparams = (ast_t*)pony_deserialise_offset(ctx, ast_pony_type(),
    (uintptr_t)d->type_typeparams);
  d->type_typeargs = (ast_t*)pony_deserialise_offset(ctx, ast_pony_type(),
    (uintptr_t)d->type_typeargs);
  d->method_typeparams = (ast_t*)pony_deserialise_offset(ctx, ast_pony_type(),
    (uintptr_t)d->method_typeparams);
  d->method_typeargs = (ast_t*)pony_deserialise_offset(ctx, ast_pony_type(),
    (uintptr_t)d->method_typeargs);
  d->thistype = (ast_t*)pony_deserialise_offset(ctx, ast_pony_type(),
    (uintptr_t)d->thistype);
}