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->pop_back())->_value); g_verbose = verbose; } void help() { // software name cout<=1) { ARG_MUST_BE_OF_TYPE(0, cmd_number); int precision = int(((number*)_stack->pop_back())->_value); 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->pop_back())->_value); 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->pop_back())->_value); 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() { // allocate and set object unsigned int naked_entry_len = strlen(version); ostring* str = (ostring*)_stack->allocate_back(sizeof(ostring)+naked_entry_len+1, cmd_string); str->set(version, naked_entry_len); } void rpn_uname() { // allocate and set object unsigned int naked_entry_len = strlen(uname); ostring* str = (ostring*)_stack->allocate_back(sizeof(ostring)+naked_entry_len+1, cmd_string); str->set(uname, naked_entry_len); } void type() { MIN_ARGUMENTS(1); int type = _stack->pop_back()->_type; if (type < 0 || type >= (int)cmd_max) type = (int)cmd_undef; unsigned int string_size = strlen(cmd_type_string[type]); unsigned int size = sizeof(symbol)+string_size+1; symbol* sym = (symbol*)allocate_back(size, cmd_symbol); sym->set(cmd_type_string[type], string_size); } void rpn_default() { program::apply_default(); }