Created
January 26, 2010 04:18
-
-
Save wilhelmtell/286541 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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