Example #1
0
File: acme.c Project: Jedzia/acm3
// guess what
int main(int argc, const char *argv[]) {
	// if called without any arguments, show usage info (not full help)
	if(argc == 1)
		show_help_and_exit();
	msg_stream = stderr;
	cliargs_init(argc, argv);
	DynaBuf_init();// inits *global* dynamic buffer - important, so first
	// Init platform-specific stuff.
	// For example, this could read the library path from an
	// environment variable, which in turn may need DynaBuf already.
	PLATFORM_INIT;
	// init some keyword trees needed for argument handling
	CPUtype_init();
	Outputfile_init();
	// handle command line arguments
	cliargs_handle_options(short_option, long_option);
	// generate list of files to process
	cliargs_get_rest(&toplevel_src_count, &toplevel_sources,
		"No top level sources given");
	// Init modules (most of them will just build keyword trees)
	ALU_init();
	Basics_init();
	CPU_init();
	Encoding_init();
	Flow_init();
	Input_init();
	Label_init();
	Macro_init();
	Mnemo_init();
	Output_init(fill_value);
	Section_init();
	if(do_actual_work())
		save_output_file();
	return(ACME_finalize(EXIT_SUCCESS));	// dump labels, if wanted
}
Example #2
0
autoLabel Label_create (long initialNumberOfTiers) {
	try {
		autoLabel me = Thing_new (Label);
		Label_init (me.peek(), initialNumberOfTiers);
		return me;
	} catch (MelderError) {
		Melder_throw (U"Label not created.");
	}
}
Example #3
0
CrBool crAppInitialize()
{
	char utf8[] = {0xEF, 0xBB, 0xBF, 0xE9, 0x80, 0x99, 0xE6, 0x98, 0xAF, 0x55, 0x54, 0x46, 0x38, 0x00};

	app = appAlloc();
	appInit(app);
	
	// label
	{
		label = Label_alloc();
		Label_init(label, crAppContext.context->xres, crAppContext.context->yres);
		Label_setText(label, utf8);
		Label_commit(label);
	}

	// materials
	{
		const char* directives[] = {nullptr};
		appLoadMaterialBegin(app, directives);

		mtlText = appLoadMaterial(
			"Common.Ui.Vertex",
			"Common.Text.Fragment",
			nullptr, nullptr, nullptr);

		appLoadMaterialEnd(app);
	}

	// mesh
	{
		meshBg = meshAlloc();
		meshInitWithScreenQuad(meshBg);
	}

	return CrTrue;
}