Created
February 6, 2009 06:58
-
-
Save tbielawa/59261 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
// FUNC_LIB.H | |
// Provides: | |
// (STRUCT) FUNC_ITEM | |
// (METHOD) FIND_FUNCTION((STRING) FUNC_NAME) | |
// | |
// TDF-OS http://ducksarepeople.com/tdf/ | |
#include <stdio.h> | |
#include "FUNC_LIB.H" | |
#include "DATE.H" | |
struct func_item { | |
char name[NAME_LENGTH]; | |
int (*function)(); | |
struct func_item *next; //set last item in list to NULL | |
} ; | |
void Tehfoobar() { | |
printf("foobar <3s you"); | |
} | |
// Lets define some items we could call | |
struct func_item *head; //head will point at first real item | |
// Real items (just look at their names!) | |
struct func_item item_one; | |
item_one.function = Tehfoobar; //this could call the 'foobar' function | |
strncpy(&item_one.name, "foobar\0", NAME_LENGTH); | |
int main( int argc, char *argv[]) { | |
printf("\nhi2u\n"); | |
return 0; | |
} |
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
// Built in Function library | |
// Who wants a struct for Christmas? | |
#define NAME_LENGTH 9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment