//------------------------------------------------------------ // preprocessor package //------------------------------------------------------------ #include #include "llist.h" // Create instances of "the llist class" specialized // for int and char* types. // Note that the full definition of the implementations // will be injected as a result of these macro invocations. CREATE_LLIST_TYPE(int,int); CREATE_LLIST_TYPE(char*,string); static char* string_data[] = { "zero", "one", "two", "three", "four", NULL }; #define LEN 5 //----------------------------------------------------- // Helper functions //----------------------------------------------------- bool printIntEl(int el) { printf("%d\n", el); return false; // indicate we should continue the iteration } bool printStringEl(char *el) { printf("%s\n", el); return false; // indicate we should continue the iteration } // main int main(int argc, char *argv[]) { //----------------------------------------------------- // Usage of an int LList //----------------------------------------------------- LList_int myIntList = LList_int_init(&myIntList); for (int i=0; i