Skip to content

Instantly share code, notes, and snippets.

@kabbi
Last active December 18, 2015 16:59
Show Gist options
  • Save kabbi/5815732 to your computer and use it in GitHub Desktop.
Save kabbi/5815732 to your computer and use it in GitHub Desktop.
Inferno's native 'array of array of someAdt' example.
ar = H2D(Array*, heaparray(&Tptr, nimports));
ai = (Array**)ar->data;
for(i2 = m->ldt; *i2 != nil; i2++){
nimports = 0;
for(i1 = *i2; i1->name != nil; i1++)
nimports++;
*ai = H2D(Array*, heaparray(Timport, nimports));
li = (Loader_Import*)(*ai)->data;
for(i1 = *i2; i1->name != nil; i1++){
li->name = c2string(i1->name, strlen(i1->name));
li->sig = i1->sig;
li++;
}
ai++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment