akuma akuma
关注数: 0 粉丝数: 20 发帖数: 720 关注贴吧数: 0
命令行计算器 /* Name: Command Line Calculator Version 1.0.1 Copyright: akuma@tds Author: akuma@tds Date: 06/01/05 03:00 Description: This is a free software distributed under The free beer license version 1.02*/#include #include #include #include #include int isNumber(const char *buf);void display_license(void);void display_copyright(void);void display_help(void);int process_cmd(char *cmd);void get_cmd(char *buf, int buf_size);const char *delimiters = " \n\t,;";const char *fs_d = "%ld";const char *s_prompt = "# ";const char *s_acc_mode_prompt = " + ";const char *s_final_result = "\n[result] = %ld\n";const char *s_result = "[result] = %ld, [operand] = %ld\n";const char *s_clear = "[result] and [operand] had been set to zero\n";const char *s_acc_mode ="[+] accumulation mode activated, enter zero to exit\n";const char *s_acc_exit = "[-] exit accumulation mode\n";const char *s_trc_mode = "[+] trace mode activated\n";const char *s_trc_exit = "[-] trace mode off\n";const char *s_warning_2_num ="[warning] more than one numbers entered, set operand equal to the first one\n";const char *s_warning_2_cmd ="[warning] entered more than one command, only the first one will be used\n";const char *s_warning_mt_2_cmd ="[warning] too much command, every entry except first two will be discarded\n";const char *s_warning_ofr_num = "[warning] the number is out of range, reset operand to zero\n";const char *s_error_bad_num ="[error] unrecognizable number entered\n";const char *s_error_unknown ="[error] unknown command\n";const char *s_error_dbz ="[error] %ld cannot be devided by zero\n";const char *s_copyright ="Command Line Calculator 1.0.1 - copyright © 2005 akuma@tds\n""- This is a free software distributed under The free beer license version 1.02\n""- enter h for help, L for license information, q to exit\n""\n";/* 下面继续 */
1 下一页