Skip to content

Instantly share code, notes, and snippets.

@maksspace
Created February 2, 2016 22:59
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 maksspace/b074f0530ad37cc60860 to your computer and use it in GitHub Desktop.
Save maksspace/b074f0530ad37cc60860 to your computer and use it in GitHub Desktop.
typedef struct { void *prev, *next; } node_link_t;
void* list_prepend(void* node, void* head) {
*(node_link_t*)node = (node_link_t){NULL, head};
return ((node_link_t*)head)->prev = node;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment