void test(); // void nop() { // nop } void good_bye() { ERR_CONTEXT(ret_good_bye); } void verbose() { MIN_ARGUMENTS(1); ARG_MUST_BE_OF_TYPE(0, cmd_number); int verbose = int(((number*)_stack->back())->_value); _stack->pop_back(); g_verbose = verbose; } void help() { cout<=1) { ARG_MUST_BE_OF_TYPE(0, cmd_number); int precision = int(((number*)_stack->back())->_value); _stack->pop_back(); number::s_default_precision = int(precision); } number::s_current_precision = number::s_default_precision; number::s_mode = number::std; // format for mpfr_printf stringstream ss; ss << number::s_current_precision; s_mpfr_printf_format = s_mpfr_printf_format_beg + ss.str() + s_mpfr_printf_format_std; } void fix() { MIN_ARGUMENTS(1); ARG_MUST_BE_OF_TYPE(0, cmd_number); int precision = int(((number*)_stack->back())->_value); _stack->pop_back(); number::s_current_precision = int(precision); number::s_mode = number::fix; // format for mpfr_printf stringstream ss; ss << number::s_current_precision; s_mpfr_printf_format = s_mpfr_printf_format_beg + ss.str() + s_mpfr_printf_format_fix; } void sci() { MIN_ARGUMENTS(1); ARG_MUST_BE_OF_TYPE(0, cmd_number); int precision = int(((number*)_stack->back())->_value); _stack->pop_back(); number::s_current_precision = int(precision); number::s_mode = number::sci; // format for mpfr_printf stringstream ss; ss << number::s_current_precision; s_mpfr_printf_format = s_mpfr_printf_format_beg + ss.str() + s_mpfr_printf_format_sci; } void rpn_version() { int naked_entry_len; int obj_len; ostring* str; // entry length without prefix / postfix naked_entry_len = (int)strlen(version); // total object length obj_len = sizeof(ostring)+naked_entry_len+1; // allocate object str = (ostring*)malloc(obj_len); // set it str->set(version, naked_entry_len); // push in stack _stack->push_back(str, str->size(), cmd_string); free(str); } void rpn_uname() { int naked_entry_len; int obj_len; ostring* str; // entry length without prefix / postfix naked_entry_len = (int)strlen(uname); // total object length obj_len = sizeof(ostring)+naked_entry_len+1; // allocate object str = (ostring*)malloc(obj_len); // set it str->set(uname, naked_entry_len); // push in stack _stack->push_back(str, str->size(), cmd_string); free(str); }