Component index
Section index

Component tlmpprogram


Search

	<mod>
	int main (int argc, char *argv[])
	{
	    <call tlmpprogram>(argc, argv);
	    <f usage>
	        fprintf (stderr
	            ,"This is a sample TLMP program used to demonstrate\n"
	             "various general purposes components, including tlmpprogram\n"
	             "\n"
	             "The program accepts one argument: The name of the component\n"
	             "demonstrate.\n"
	             "\n"
	             "\tcopyfile\n"
	             "\tloadfile\n"
	             "\tsavefile\n"
	             "\tstreamp\n"
	             "\tSTREAMP\n"
	             "\tstreamp_do\n"
	             "\twalkpopen\n"
	             "\twalkfs\n"
	            );
	    </f>
	    <f onearg>
	        // This is an optional tag used to validate command line options
	
	        return -1;
	    </f>
	    <f main>
	        dialog_clear();
	        // Main receives the argument vector without the program name
	        if (argc < 1){
	            // We are allowed to call a functag from another functag
	            // context btw.
	            usage();
	        }else if (strcmp(argv[0],"loadfile")==0){
	            sample_loadfile();
	        }else if (strcmp(argv[0],"savefile")==0){
	            sample_savefile();
	        }else if (strcmp(argv[0],"walkfs")==0){
	            sample_walkfs();
	        }else if (strcmp(argv[0],"walkpopen")==0){
	            sample_walkpopen();
	        }else if (strcmp(argv[0],"copyfile")==0){
	            sample_copyfile();
	        }else if (strcmp(argv[0],"streamp")==0){
	            sample_streamp();
	        }else if (strcmp(argv[0],"streamp_do")==0){
	            sample_streamp_do();
	        }else if (strcmp(argv[0],"STREAMP")==0){
	            sample_STREAMP();
	        }else if (strcmp(argv[0],"coroutine0")==0){
	            sample_coroutine0();
	        }else if (strcmp(argv[0],"coroutine1")==0){
	            sample_coroutine1();
	        }else if (strcmp(argv[0],"coroutine2")==0){
	            sample_coroutine2();
	        }else if (strcmp(argv[0],"coroutine3")==0){
	            sample_coroutine3();
	        }else if (strcmp(argv[0],"coroutine4")==0){
	            sample_coroutine4();
	        }else{
	            usage();
	        }
	        return 0;
	    </f>
	    </call>
	    return 0;
	}
	</mod>