All pastes #100659 Raw Edit

Something

public text v1 · immutable
#100659 ·published 2006-07-26 09:51 UTC
rendered paste body
typedef struct {
	int start_x;
	int end_x;
	int y;
	char* text;
} main_menuitem;

typedef struct tab_menuitem tab_menuitem;
struct tab_menuitem {
	int end_x;
	int y;
	bool visible;
	void (*load_content) ();
	tab_menuitem *next;
	tab_menuitem *previous;
	char* text;
};

void fill_string ( char* location, char string[500] ) {

	location = NULL;
	if ((location = realloc ( location, ( strlen ( string ) + 1 ) ))==NULL) {
		exit(0);
	}
	strcpy ( location, string );

}

void set_end_x( tab_menuitem *menu ) {

	menu->end_x = strlen ( menu->text ) + 3;
	if ( menu->next != NULL ) {
		set_end_x ( menu->next );
	}

}

fill_string ( f1.text, "<F1 SET DEFAULTS>" );

first_tab_menuitem = &general;
set_end_x ( first_tab_menuitem );