Polly 20.0.0git
|
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <getopt.h>
#include <unistd.h>
#include "imath.h"
#include "imrat.h"
#include "iprime.h"
Go to the source code of this file.
Classes | |
struct | cstate_t |
struct | calcop_t |
Macros | |
#define | BUFFER_SIZE 16384 /* max. length of input values, in chars */ |
Typedefs | |
typedef mp_result(* | op_func) (cstate_t *) |
Enumerations | |
enum | token_t { t_eof , t_symbol , t_number , t_error } |
Variables | |
static calcop_t | g_ops [] |
static mp_result | MP_INPUT |
static int | g_output_radix = 10 |
static FILE * | g_output_file = NULL |
#define BUFFER_SIZE 16384 /* max. length of input values, in chars */ |
Definition at line 663 of file imcalc.c.
References a(), cstate_t::elts, mp_int_abs, and cstate_t::used.
Definition at line 675 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_add, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 938 of file imcalc.c.
References MP_OK, and stack_flush().
Definition at line 1089 of file imcalc.c.
References mem_clear().
Definition at line 859 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_compare, mp_int_set_value, res, stack_pop(), and cstate_t::used.
Definition at line 849 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_compare, mp_int_set_value, res, stack_pop(), and cstate_t::used.
Definition at line 829 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_compare, mp_int_set_value, res, stack_pop(), and cstate_t::used.
Definition at line 839 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_compare, mp_int_set_value, res, stack_pop(), and cstate_t::used.
Definition at line 819 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_compare, mp_int_set_value, res, stack_pop(), and cstate_t::used.
Definition at line 869 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_compare, mp_int_set_value, res, stack_pop(), and cstate_t::used.
Definition at line 962 of file imcalc.c.
References cstate_t::elts, mp_int_alloc, mp_int_copy, mp_int_free, mp_int_to_int, MP_MEMORY, MP_OK, MP_RANGE, n, res, stack_pop(), stack_push(), and cstate_t::used.
Definition at line 885 of file imcalc.c.
References a(), cstate_t::elts, mp_int_sub_value, and cstate_t::used.
Definition at line 712 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_div, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 705 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_div, and cstate_t::used.
Definition at line 946 of file imcalc.c.
References cstate_t::elts, mp_int_alloc, mp_int_copy, mp_int_free, MP_MEMORY, MP_OK, res, stack_push(), and cstate_t::used.
Definition at line 732 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_expt, mp_int_to_int, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 744 of file imcalc.c.
References a(), b(), cstate_t::elts, m, mp_int_exptmod, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 891 of file imcalc.c.
References cstate_t::elts, mp_int_clear, mp_int_compare_value, mp_int_compare_zero, mp_int_copy, mp_int_init_value, mp_int_mul, mp_int_sub_value, MP_OK, MP_UNDEF, res, and cstate_t::used.
Definition at line 774 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_gcd, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 879 of file imcalc.c.
References a(), cstate_t::elts, mp_int_add_value, and cstate_t::used.
Definition at line 764 of file imcalc.c.
References a(), cstate_t::elts, m, mp_int_invmod, res, stack_pop(), and cstate_t::used.
Definition at line 722 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_mod, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 695 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_mul, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 669 of file imcalc.c.
References a(), cstate_t::elts, mp_int_neg, and cstate_t::used.
Definition at line 1009 of file imcalc.c.
References cstate_t::elts, mp_int_copy, mp_int_to_int, MP_OK, MP_RANGE, n, pos(), res, and cstate_t::used.
Definition at line 1091 of file imcalc.c.
References g_output_file, cstate_t::mem, MP_OK, cstate_t::mused, cstate_t::names, and print_value().
Definition at line 944 of file imcalc.c.
References stack_pop().
Definition at line 912 of file imcalc.c.
References cstate_t::elts, MP_OK, print_value(), stack_pop(), and cstate_t::used.
Definition at line 918 of file imcalc.c.
References cstate_t::elts, MP_OK, print_value(), and cstate_t::used.
Definition at line 923 of file imcalc.c.
References cstate_t::elts, g_output_file, MP_OK, print_value(), and cstate_t::used.
Definition at line 1120 of file imcalc.c.
References cstate_t::ibuf, mem_recall(), mp_int_alloc, mp_int_free, MP_MEMORY, MP_OK, res, stack_push(), and val.
Definition at line 1074 of file imcalc.c.
References cstate_t::buflen, cstate_t::ibuf, cstate_t::ifp, mem_recall(), MP_INPUT, mp_int_alloc, mp_int_free, MP_MEMORY, MP_OK, next_token(), res, stack_push(), t_symbol, and val.
Definition at line 807 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_root, mp_int_to_int, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 999 of file imcalc.c.
References cstate_t::elts, MP_OK, t, and cstate_t::used.
Definition at line 1035 of file imcalc.c.
References g_output_radix, and MP_OK.
Definition at line 1021 of file imcalc.c.
References a(), cstate_t::elts, g_output_radix, mp_int_to_int, MP_MAX_RADIX, MP_OK, MP_RANGE, res, stack_pop(), and cstate_t::used.
Definition at line 801 of file imcalc.c.
References a(), cstate_t::elts, mp_int_sqrt(), and cstate_t::used.
Definition at line 758 of file imcalc.c.
References a(), cstate_t::elts, mp_int_sqr, and cstate_t::used.
Definition at line 1063 of file imcalc.c.
References cstate_t::buflen, cstate_t::elts, cstate_t::ibuf, cstate_t::ifp, mem_insert(), MP_INPUT, MP_OK, next_token(), res, stack_pop(), t_symbol, and cstate_t::used.
Definition at line 685 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_sub, MP_OK, res, stack_pop(), and cstate_t::used.
Definition at line 990 of file imcalc.c.
References cstate_t::elts, MP_OK, t, and cstate_t::used.
Definition at line 784 of file imcalc.c.
References a(), b(), cstate_t::elts, mp_int_alloc, mp_int_egcd, mp_int_free, MP_MEMORY, MP_OK, res, stack_push(), t, and cstate_t::used.
|
static |
Definition at line 372 of file imcalc.c.
References g_ops, calcop_t::name, name, and op.
Referenced by run_file().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 208 of file imcalc.c.
References g_output_file, mp_error_string, MP_INPUT, MP_MINERR, MP_OK, res, run_file(), state_clear(), and state_init().
Definition at line 651 of file imcalc.c.
References cstate_t::mem, mp_int_free, MP_OK, cstate_t::mused, and cstate_t::names.
Referenced by cf_cmem().
Definition at line 591 of file imcalc.c.
References cstate_t::mem, mp_int_alloc, mp_int_copy, mp_int_free, MP_MEMORY, cstate_t::mslots, cstate_t::mused, name, and cstate_t::names.
Referenced by cf_store().
Definition at line 639 of file imcalc.c.
References cstate_t::mem, mp_int_copy, MP_UNDEF, name, and cstate_t::names.
Referenced by cf_qrecall(), and cf_recall().
|
static |
Definition at line 282 of file imcalc.c.
References assert, pos(), res, size, t_eof, t_error, t_number, and t_symbol.
Referenced by cf_recall(), cf_store(), and run_file().
|
static |
Definition at line 390 of file imcalc.c.
References g_output_file, g_output_radix, mp_int_binary_len, mp_int_string_len, mp_int_to_binary, and mp_int_to_string.
Referenced by cf_pmem(), cf_pprint(), cf_print(), and cf_pstack().
Definition at line 325 of file imcalc.c.
References assert, MP_BADARG, mp_int_alloc, mp_int_free, mp_int_read_string, MP_MEMORY, MP_OK, pos(), and res.
Referenced by run_file().
Definition at line 421 of file imcalc.c.
References cstate_t::buflen, find_command(), g_ops, cstate_t::ibuf, cstate_t::ifp, MP_BADARG, mp_error_string, MP_INPUT, MP_OK, next_token(), read_number(), res, stack_push(), calcop_t::stack_size, t_eof, t_number, t_symbol, and cstate_t::used.
Referenced by main().
|
static |
Definition at line 545 of file imcalc.c.
References assert, cstate_t::elts, mp_int_clear, and cstate_t::used.
Referenced by cf_clstk().
Definition at line 579 of file imcalc.c.
References assert, cstate_t::elts, mp_int_clear, MP_OK, MP_UNDEF, and cstate_t::used.
Referenced by cf_add(), cf_cmpeq(), cf_cmpge(), cf_cmpgt(), cf_cmple(), cf_cmplt(), cf_cmpne(), cf_copy(), cf_div(), cf_expt(), cf_exptmod(), cf_gcd(), cf_invmod(), cf_mod(), cf_mul(), cf_pop(), cf_pprint(), cf_root(), cf_setr(), cf_store(), and cf_sub().
Definition at line 558 of file imcalc.c.
References cstate_t::alloc, cstate_t::elts, MP_MEMORY, MP_OK, and cstate_t::used.
Referenced by cf_copy(), cf_dup(), cf_qrecall(), cf_recall(), cf_xgcd(), and run_file().
|
static |
Definition at line 501 of file imcalc.c.
References cstate_t::alloc, assert, cstate_t::buflen, cstate_t::elts, cstate_t::ibuf, cstate_t::ifp, cstate_t::mem, mp_int_clear, mp_int_free, cstate_t::mslots, cstate_t::mused, cstate_t::names, and cstate_t::used.
Referenced by main().
Definition at line 463 of file imcalc.c.
References cstate_t::alloc, assert, BUFFER_SIZE, cstate_t::buflen, cstate_t::elts, cstate_t::ibuf, cstate_t::mem, MP_MEMORY, MP_OK, cstate_t::mslots, cstate_t::mused, cstate_t::names, and cstate_t::used.
Referenced by main().
|
static |
Definition at line 129 of file imcalc.c.
Referenced by cf_help(), find_command(), and run_file().
|
static |
Definition at line 206 of file imcalc.c.
Referenced by cf_pmem(), cf_pstack(), main(), and print_value().
|
static |
Definition at line 205 of file imcalc.c.
Referenced by cf_setbin(), cf_setr(), and print_value().
|
static |
Definition at line 203 of file imcalc.c.
Referenced by cf_recall(), cf_store(), main(), and run_file().