Example #1
0
int main(int argc, const char *argv[])
{
    
    //pointer usage per chapter subject
    //not really neccesary but...
    fiftyDollarBills = &fifties;
    twentyDollarBills = &twenties;
    tenDollarBills   = &tens;
    fiveDollarBills = &fives;
    oneDollarBills = &ones;
    
	myMain();
	return 0;
}
Example #2
0
void calcDifference(float d, float p)
{
	difference = d - p;

	if (d < p) {
        
		//convert to absolute value before sending to next function
        difference = fabs(difference);
		
	} else {
		// a bit of error checking
		printf("Please reenter the amounts.\n");
		myMain();
	}
}
Example #3
0
int main( int argc, char ** argv )
{
  cgiScript sc("text/html", false);
  cgiInput & args = sc.ClientArguments();
  bool loggedIn = false;
  if( args.count("logout") )
  {
    oLogin.logout();
  } 
  else
  {
    loggedIn = oLogin.testLoginStatus();
    if( !loggedIn )
    {    
      if(args.count("login") && args.count("password"))
      {
        loggedIn = oLogin.checkUser( args["login"], args["password"] );
      }
    }
  }
  if(loggedIn)
  {
    /* The next two lines provide an option list, 
       and set the site id cookie if only one site. 
       MUST be invoked before closing header */
    site_pick pick_a_site(sc);
    string & options = pick_a_site.getSiteOptions(sc,oLogin);
    
    sc.closeHeader();     
        
    Artisan_Main myMain(sc,oLogin);  
    cgiTemplates pgTemplate;
    pgTemplate.load("Templates/adminPane.htmp");
    sc << ocString(pgTemplate.getParagraph("top"))
            .replaceAll("$heading$","Artisan Point")
            .replace("$menu$",getNavMenu().c_str())
            .replace("$instructions$",
                    "Main");                     
    myMain.display(options);
    sc << pgTemplate.getParagraph("list-bottom");
  }
  else
  {   
    showSignOnForm ( sc ); 
  }
};
Example #4
0
int main(int argc, const char *argv[])
{
	// pointer usage per chapter subject
	// not really neccesary but...
	hundredDollarBills	= &hundreds;
	fiftyDollarBills	= &fifties;
	twentyDollarBills	= &twenties;
	tenDollarBills		= &tens;
	fiveDollarBills		= &fives;
	oneDollarBills		= &ones;
	quarterDollars		= &quarters;
	tenthDollars		= &dimes;
	twentiethDollars	= &nickels;
	hundrethsDollars	= &pennies;

	myMain();
	return 0;
}
Example #5
0
void runProgramAgain()
{
	char yesOrNo[100];

	printf("Would you like to run the program again? y/n ");
	scanf("%s", yesOrNo);

	if (strncmp(yesOrNo, "y", 2) == 0) {
		printf("\n");

		temp		= 0;
		hot			= 0;
		pleasant	= 0;
		cold		= 0;
		myMain();
	}

	if (strncmp(yesOrNo, "n", 2) == 0) {
		printf("\nGood Bye!\n");
	}
}
Example #6
0
void myMain(){
    
    welcomeUser();
	inputYear();
	inputWeight();
	computeFee(year, weight);
    reportFee(weight, weightClass, fee);
    
    char yesOrNo[100];
	printf("Would you like to calculate another? y/n ");
	scanf("%s", yesOrNo);
    
	if (strncmp(yesOrNo, "y", 2) == 0) {
		printf("\n");
		myMain();
	}
    
	if (strncmp(yesOrNo, "n", 2) == 0) {
		printf("Good bye!");
	}

}
Example #7
0
/*
 *  Entry Point
 */
int main()
{
  myMain();
  return 0;
}   /* main */
Example #8
0
int main(int argc, char* argv[])
{
    return myMain(argc, argv);
}
Example #9
0
void test_module_generator_needs_to_be_implemented(void)
{
	myMain();
}
Example #10
0
int main(int argc, char *argv[])
{
    //** init Qt (graphics toolkit) - www.qtsoftware.com
    // note: environment variable parsing is done by Qt before main is entered.
    // This makes setting environment vars to modify Qt behavior impossible.
    QApplication app(argc, argv);

    //** init splash screen, do it as early in program start as possible
    QSplashScreen mySplash(QPixmap(":/title_page.png"));
    mySplash.show();
    app.processEvents();

    //** set the names to our website
    QCoreApplication::setOrganizationName("the-butterfly-effect.org");
    QCoreApplication::setOrganizationDomain("the-butterfly-effect.org");
    QCoreApplication::setApplicationName(APPNAME);

    //** parse the command line arguments
    QStringList myCmdLineList = app.arguments();
    bool isParsingSuccess = true;
    // we can skip argument zero - that's the tbe executable itself
    for (int i = 1; i < myCmdLineList.size() && isParsingSuccess; i++) {
        QString myArg = myCmdLineList[i];
        if (myArg.startsWith("-")) {
            // remove one or two dashes - we're slightly more flexible than usual
            myArg.remove(0, 1);
            if (myArg.startsWith("-"))
                myArg.remove(0, 1);

            // extract value with = if there is one
            QStringList myExp = myArg.split("=");

            // is it matching with short or long?
            int j = 0;
            bool isMatch = false;
            while (theArgsTable[j].theFunctionPtr != nullptr) {
                if (myExp[0] == theArgsTable[j].theFullCommand
                        || myExp[0] == theArgsTable[j].theShortCommand) {
                    isMatch = true;
                    QString myVal;
                    if (theArgsTable[j].needsArgument == true) {
                        // was it '='?
                        if (myExp.count() == 2)
                            myVal = myExp[1];
                        else {
                            // or is it ' ' -> which means we need to grab next arg
                            if (i + 1 < myCmdLineList.size()) {
                                myVal = myCmdLineList[i + 1];
                                i++;
                            } else {
                                isParsingSuccess = false;
                                break;
                            }
                        }
                    }
                    if (theArgsTable[j].theFunctionPtr(myVal) == false)
                        isParsingSuccess = false;
                }
                ++j;
            }
            if (isMatch == false) {
                isParsingSuccess = false;
                break;
            }
        } else {
            // if it is a single string, it probably is a file name
            theStartFileName = myArg;
        }

    }

    if (isParsingSuccess == false)
        displayHelp("");

#ifdef QT_DEBUG
    setupBacktrace();
#endif

    //** read the locale from the environment and set the output language
    if (theIsRunAsRegression) {
        DEBUG1("Regression: not loading any translators!");
    } else
        TheTranslator.init();
    //** now the i18n is set up, let's show a message in the user's language.
    mySplash.showMessage(MainWindow::getWelcomeMessage());
    app.processEvents();

    DEBUG3("SUMMARY:");
    DEBUG3("  Verbosity is: %d / Fullscreen is %d", theVerbosity, theIsMaximized);
    if (theIsRunAsRegression) {
        DEBUG3("  Regression levels: '%s'", ASCII(theStartFileName));
    } else {
        DEBUG3("  Start file name is: '%s'", ASCII(theStartFileName));
    }

    // scope limiting
    {
        QSettings mySettings;
        DEBUG3("  using settings from: '%s'", ASCII(mySettings.fileName()));
    }

    if (theIsLevelCreator) {
        // TODO: check for environment variable QT_HASH_SEED=1
        if (NULL == getenv("QT_HASH_SEED")) {
            printf("\nIMPORTANT:\n");
            printf("Please 'export QT_HASH_SEED=1' before starting the TBE level creator.\n");
            printf("This ensures that the level files will be written in a consistent order.\n");
            exit(1);
        }
        DEBUG3("  got QT_HASH_SEED environment set, xml consistent order writing enabled");
    }

    //** setup main window, shut down splash screen
    MainWindow myMain(theIsMaximized);
    myMain.show();
    mySplash.finish(&myMain);

    //** run the main display loop until oblivion
    return app.exec();
}
Example #11
0
int main(int argc, const char *argv[])
{
	myMain();
	return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
	myMain();
	getchar();
	return 0;
}