Skip to content

Instantly share code, notes, and snippets.

@wilhelmtell
Created January 26, 2010 04:18
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 wilhelmtell/286541 to your computer and use it in GitHub Desktop.
Save wilhelmtell/286541 to your computer and use it in GitHub Desktop.
#include<stdlib.h>
#include<stdio.h>
typedef struct state_t {
int current_line;
int heading_level;
token* previous_token;
} state;
state* state_with(state* s) /* just for readability when invoking */
{
return s;
}
state* current_line(int l, state* s)
{
s->current_line = l;
return s;
}
/* ... */
int main(int argc, char* argv[])
{
state* s = state_with(
current_line(1,
heading_level(0,
previous_token(NULL,
(state*)malloc(sizeof(state))))));
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment