コード例 #1
0
ファイル: clock.c プロジェクト: torevm/clock
int main ( int argc, char *argv[] ) {
	int option = -1;
	int format = -1;
	if (argc>1)
		option = getopt(argc, argv, options);

	time(&clocktime); /* get time frim Epoch */
	loctime = localtime(&clocktime);
	loctime->tm_year += 1900; /* Needed because tm_year equals year - 1900 */
	loctime->tm_hour %= 12;

	format = getopt(argc, argv, formatoptions);
#ifdef DEBUG_FLAG
	printf("option1 : %d\noption2 : %d\n", option, format);
#endif
	if ( option == 'h' )
		puts(licence);
	else
		convertto(option, format, loctime);

	return EXIT_SUCCESS;
}
コード例 #2
0
ファイル: converter.c プロジェクト: Masshat/Posix-LI356
/* Converts from any to any */
double convert(char* input_currency, char* target_currency, double input_amount) {
  return convertto(target_currency, convertfrom(input_currency, input_amount));
}