Skip to content

Instantly share code, notes, and snippets.

@DoubleDi
Created December 20, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DoubleDi/64ad269d1b0158847d0d to your computer and use it in GitHub Desktop.
Save DoubleDi/64ad269d1b0158847d0d to your computer and use it in GitHub Desktop.
{
$type typemap__struct = ($type)$arg;
SV *x;
SV *y;
sv_setnv(x, typemap__struct->x);
sv_setnv(y, typemap__struct->y);
HV *point = newHV();
hv_store((HV *)point, \"x\", 1, x, 0);
hv_store((HV *)point, \"y\", 1, y, 0);
SV *ref = newRV_inc((SV*)point);
sv_setsv((SV *)ref, (SV *)$var);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment