ReactOS  0.4.10-dev-479-g13a3cf0
rpn.c File Reference
#include "calc.h"
Include dependency graph for rpn.c:

Go to the source code of this file.

Classes

struct  stack_node_t
 
struct  calc_operator_t
 

Typedefs

typedef void(* operator_call )(calc_number_t *, calc_number_t *, calc_number_t *)
 

Functions

static void rpn_add_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_sub_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_mul_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_div_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_mod_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_pow_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_sqr_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_and_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_or_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_xor_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_shl_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_shr_f (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_add_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_sub_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_mul_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_div_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_mod_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_and_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_or_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_xor_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_shl_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_shr_i (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_add_p (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_sub_p (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_mul_p (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static void rpn_div_p (calc_number_t *r, calc_number_t *a, calc_number_t *b)
 
static stack_node_tpop (void)
 
static int is_stack_empty (void)
 
static void push (stack_node_t *op)
 
void run_operator (calc_node_t *result, calc_node_t *a, calc_node_t *b, unsigned int operation)
 
static void evalStack (calc_number_t *number)
 
int exec_infix2postfix (calc_number_t *number, unsigned int func)
 
void exec_change_infix (void)
 
void exec_closeparent (calc_number_t *number)
 
int eval_parent_count (void)
 
void flush_postfix ()
 
void start_rpn_engine (void)
 
void stop_rpn_engine (void)
 

Variables

static stack_node_tstack
 
static stack_node_t temp
 
static BOOL percent_mode
 
static const calc_operator_t operator_list []
 

Typedef Documentation

typedef void(* operator_call)(calc_number_t *, calc_number_t *, calc_number_t *)

Definition at line 8 of file rpn.c.

Function Documentation

int eval_parent_count ( void  )

Definition at line 432 of file rpn.c.

433 {
434  stack_node_t *s = stack;
435  int n = 0;
436 
437  while (s != NULL) {
439  n++;
440  s = (stack_node_t *)(s->next);
441  }
442  return n;
443 }
static stack_node_t * stack
Definition: rpn.c:17
GLuint n
Definition: s_context.h:57
smooth NULL
Definition: ftsmooth.c:416
GLdouble s
Definition: gl.h:2039
calc_node_t node
Definition: rpn.c:4
unsigned int operation
Definition: calc.h:85
void * next
Definition: rpn.c:5
static void evalStack ( calc_number_t number)
static

Definition at line 331 of file rpn.c.

Referenced by exec_infix2postfix().

332 {
333  stack_node_t *op, ip;
334  unsigned int prec;
335 
336  op = pop();
337  ip = *op;
338  prec = operator_list[ip.node.operation].prec;
339  while (!is_stack_empty()) {
340  op = pop();
341 
342  if (prec <= operator_list[op->node.operation].prec) {
343  if (op->node.operation == RPN_OPERATOR_PARENT) continue;
344 
345  calc.prev = ip.node.number;
346  run_operator(&ip.node, &op->node, &ip.node, op->node.operation);
347  if (calc.is_nan) {
348  flush_postfix();
349  return;
350  }
351  } else {
352  push(op);
353  break;
354  }
355  }
356 
358  push(&ip);
359 
361 
362  *number = ip.node.number;
363 }
void flush_postfix()
Definition: rpn.c:445
static stack_node_t * pop(void)
Definition: rpn.c:70
BOOL is_nan
Definition: calc.h:132
static int is_stack_empty(void)
Definition: rpn.c:82
UINT op
Definition: effect.c:223
int ip[4]
Definition: rtl.c:1176
unsigned int prec
Definition: rpn.c:11
unsigned int prev_operator
Definition: calc.h:147
void run_operator(calc_node_t *result, calc_node_t *a, calc_node_t *b, unsigned int operation)
Definition: rpn.c:288
static void push(stack_node_t *op)
Definition: rpn.c:87
calc_number_t number
Definition: calc.h:84
calc_node_t node
Definition: rpn.c:4
static const calc_operator_t operator_list[]
Definition: rpn.c:52
unsigned int operation
Definition: calc.h:85
calc_t calc
Definition: winmain.c:226
calc_number_t prev
Definition: calc.h:128
void exec_change_infix ( void  )

Definition at line 397 of file rpn.c.

398 {
399  stack_node_t *op = stack;
400 
401  if (op == NULL)
402  return;
403  if (op->node.operation == RPN_OPERATOR_PARENT ||
406  return;
407  /* remove the head, it will be re-inserted with new operator */
408  pop();
409 }
static stack_node_t * pop(void)
Definition: rpn.c:70
static stack_node_t * stack
Definition: rpn.c:17
UINT op
Definition: effect.c:223
smooth NULL
Definition: ftsmooth.c:416
calc_node_t node
Definition: rpn.c:4
unsigned int operation
Definition: calc.h:85
void exec_closeparent ( calc_number_t number)

Definition at line 411 of file rpn.c.

412 {
413  stack_node_t *op, ip;
414 
415  ip.node.number = *number;
416  ip.node.base = calc.base;
417  while (!is_stack_empty()) {
418  op = pop();
419 
421  break;
422 
423  run_operator(&ip.node, &op->node, &ip.node, op->node.operation);
424  if (calc.is_nan) {
425  flush_postfix();
426  return;
427  }
428  }
429  *number = ip.node.number;
430 }
DWORD base
Definition: calc.h:138
void flush_postfix()
Definition: rpn.c:445
static stack_node_t * pop(void)
Definition: rpn.c:70
BOOL is_nan
Definition: calc.h:132
static int is_stack_empty(void)
Definition: rpn.c:82
UINT op
Definition: effect.c:223
static size_t double number
Definition: printf.c:64
int ip[4]
Definition: rtl.c:1176
void run_operator(calc_node_t *result, calc_node_t *a, calc_node_t *b, unsigned int operation)
Definition: rpn.c:288
calc_number_t number
Definition: calc.h:84
calc_node_t node
Definition: rpn.c:4
DWORD base
Definition: calc.h:86
unsigned int operation
Definition: calc.h:85
calc_t calc
Definition: winmain.c:226
int exec_infix2postfix ( calc_number_t number,
unsigned int  func 
)

Definition at line 365 of file rpn.c.

366 {
367  stack_node_t tmp;
368 
369  if (is_stack_empty() && func == RPN_OPERATOR_EQUAL) {
370  /* if a number has been entered with exponential */
371  /* notation, I may update it with normal mode */
372  if (calc.sci_in)
373  return 1;
374  return 0;
375  }
376 
377  if (func == RPN_OPERATOR_PERCENT)
378  percent_mode = TRUE;
379 
380  tmp.node.number = *number;
381  tmp.node.base = calc.base;
382  tmp.node.operation = func;
383  tmp.next = NULL;
384 
385  push(&tmp);
386 
387  if (func == RPN_OPERATOR_NONE)
388  return 0;
389 
390  if (func != RPN_OPERATOR_PARENT) {
392  evalStack(number);
393  }
394  return 1;
395 }
GLenum func
Definition: glext.h:6028
DWORD base
Definition: calc.h:138
#define TRUE
Definition: types.h:120
static int is_stack_empty(void)
Definition: rpn.c:82
static size_t double number
Definition: printf.c:64
smooth NULL
Definition: ftsmooth.c:416
static void push(stack_node_t *op)
Definition: rpn.c:87
BOOL sci_in
Definition: calc.h:134
unsigned int last_operator
Definition: calc.h:146
calc_number_t number
Definition: calc.h:84
calc_node_t node
Definition: rpn.c:4
static void evalStack(calc_number_t *number)
Definition: rpn.c:331
static BOOL percent_mode
Definition: rpn.c:19
DWORD base
Definition: calc.h:86
unsigned int operation
Definition: calc.h:85
void * next
Definition: rpn.c:5
calc_t calc
Definition: winmain.c:226
void flush_postfix ( void  )

Definition at line 445 of file rpn.c.

Referenced by evalStack(), and exec_closeparent().

446 {
447  while (!is_stack_empty())
448  pop();
449  /* clear prev and last typed operators */
451  calc.last_operator = 0;
452 }
static stack_node_t * pop(void)
Definition: rpn.c:70
static int is_stack_empty(void)
Definition: rpn.c:82
unsigned int prev_operator
Definition: calc.h:147
unsigned int last_operator
Definition: calc.h:146
calc_t calc
Definition: winmain.c:226
static int is_stack_empty ( void  )
static

Definition at line 82 of file rpn.c.

Referenced by evalStack(), exec_closeparent(), exec_infix2postfix(), and flush_postfix().

83 {
84  return (stack == NULL);
85 }
smooth NULL
Definition: ftsmooth.c:416
Definition: _stack.h:47
static stack_node_t* pop ( void  )
static

Definition at line 70 of file rpn.c.

Referenced by crc32(), evalStack(), exec_change_infix(), exec_closeparent(), flush_postfix(), MyAppendUnicodeToString_(), MyInitUnicodeString(), push_buffer(), RtlAppendUnicodeToString(), UDFCheckZeroBuf(), UDFCrc(), UDFDissectName(), UDFGetExtentLength(), UDFGetMappingLength(), UDFIsIllegalChar(), UDFPhysLbaToPart(), UDFUnicodeCksum(), UDFUnicodeCksum150(), and WCacheGetSortedListIndex().

71 {
72  if (stack == NULL)
73  return NULL;
74 
75  temp = *stack;
76  free(stack);
77  stack = temp.next;
78 
79  return &temp;
80 }
#define free
Definition: debug_ros.c:5
static stack_node_t * stack
Definition: rpn.c:17
smooth NULL
Definition: ftsmooth.c:416
Definition: _stack.h:47
static stack_node_t temp
Definition: rpn.c:18
void * next
Definition: rpn.c:5
static void rpn_add_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 106 of file rpn.c.

107 {
108  r->f = a->f + b->f;
109 }
double f
Definition: calc.h:77
static void rpn_add_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 208 of file rpn.c.

209 {
210  r->i = a->i + b->i;
211 }
INT64 i
Definition: calc.h:78
static void rpn_add_p ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 265 of file rpn.c.

266 {
267  r->f = a->f * (1. + b->f/100.);
268 }
double f
Definition: calc.h:77
static void rpn_and_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 141 of file rpn.c.

142 {
143  calc_number_t ai, bi;
144 
145  ai.i = logic_dbl2int(a);
146  bi.i = logic_dbl2int(b);
147 
148  r->f = (long double)(ai.i & bi.i);
149 }
double f
Definition: calc.h:77
__int64 logic_dbl2int(calc_number_t *a)
Definition: function.c:240
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
INT64 i
Definition: calc.h:78
static void rpn_and_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 239 of file rpn.c.

240 {
241  r->i = a->i & b->i;
242 }
INT64 i
Definition: calc.h:78
static void rpn_div_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 121 of file rpn.c.

122 {
123  if (b->f == 0)
124  calc.is_nan = TRUE;
125  else
126  r->f = a->f / b->f;
127 }
#define TRUE
Definition: types.h:120
double f
Definition: calc.h:77
BOOL is_nan
Definition: calc.h:132
calc_t calc
Definition: winmain.c:226
static void rpn_div_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 223 of file rpn.c.

224 {
225  if (b->i == 0)
226  calc.is_nan = TRUE;
227  else
228  r->i = a->i / b->i;
229 }
#define TRUE
Definition: types.h:120
BOOL is_nan
Definition: calc.h:132
INT64 i
Definition: calc.h:78
calc_t calc
Definition: winmain.c:226
static void rpn_div_p ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 280 of file rpn.c.

281 {
282  if (b->f == 0)
283  calc.is_nan = TRUE;
284  else
285  r->f = a->f * 100. / b->f;
286 }
#define TRUE
Definition: types.h:120
double f
Definition: calc.h:77
BOOL is_nan
Definition: calc.h:132
calc_t calc
Definition: winmain.c:226
static void rpn_mod_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 129 of file rpn.c.

130 {
131  double t;
132 
133  if (b->f == 0)
134  calc.is_nan = TRUE;
135  else {
136  modf(a->f/b->f, &t);
137  r->f = a->f - (t * b->f);
138  }
139 }
#define TRUE
Definition: types.h:120
double f
Definition: calc.h:77
GLdouble GLdouble t
Definition: gl.h:2047
BOOL is_nan
Definition: calc.h:132
calc_t calc
Definition: winmain.c:226
_Check_return_ _CRTIMP double __cdecl modf(_In_ double x, _Out_ double *y)
static void rpn_mod_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 231 of file rpn.c.

232 {
233  if (b->i == 0)
234  calc.is_nan = TRUE;
235  else
236  r->i = a->i % b->i;
237 }
#define TRUE
Definition: types.h:120
BOOL is_nan
Definition: calc.h:132
INT64 i
Definition: calc.h:78
calc_t calc
Definition: winmain.c:226
static void rpn_mul_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 116 of file rpn.c.

117 {
118  r->f = a->f * b->f;
119 }
double f
Definition: calc.h:77
static void rpn_mul_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 218 of file rpn.c.

219 {
220  r->i = a->i * b->i;
221 }
INT64 i
Definition: calc.h:78
static void rpn_mul_p ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 275 of file rpn.c.

276 {
277  r->f = a->f * b->f / 100.;
278 }
double f
Definition: calc.h:77
static void rpn_or_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 151 of file rpn.c.

152 {
153  calc_number_t ai, bi;
154 
155  ai.i = logic_dbl2int(a);
156  bi.i = logic_dbl2int(b);
157 
158  r->f = (long double)(ai.i | bi.i);
159 }
double f
Definition: calc.h:77
__int64 logic_dbl2int(calc_number_t *a)
Definition: function.c:240
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
INT64 i
Definition: calc.h:78
static void rpn_or_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 244 of file rpn.c.

245 {
246  r->i = a->i | b->i;
247 }
INT64 i
Definition: calc.h:78
static void rpn_pow_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 189 of file rpn.c.

190 {
191  r->f = pow(a->f, b->f);
192  if (_finite(r->f) == 0 || _isnan(r->f))
193  calc.is_nan = TRUE;
194 }
#define TRUE
Definition: types.h:120
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _isnan(_In_ double)
double f
Definition: calc.h:77
BOOL is_nan
Definition: calc.h:132
float pow(float __x, int __y)
Definition: _cmath.h:458
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _finite(_In_ double)
calc_t calc
Definition: winmain.c:226
static void rpn_shl_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 171 of file rpn.c.

172 {
174 
175  modf(b->f, &n.f);
176 
177  r->f = a->f * pow(2., n.f);
178 }
double f
Definition: calc.h:77
GLuint n
Definition: s_context.h:57
float pow(float __x, int __y)
Definition: _cmath.h:458
_Check_return_ _CRTIMP double __cdecl modf(_In_ double x, _Out_ double *y)
static void rpn_shl_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 254 of file rpn.c.

255 {
256  r->i = a->i << b->i;
257 }
INT64 i
Definition: calc.h:78
static void rpn_shr_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 180 of file rpn.c.

181 {
183 
184  modf(b->f, &n.f);
185 
186  r->f = a->f / pow(2., n.f);
187 }
double f
Definition: calc.h:77
GLuint n
Definition: s_context.h:57
float pow(float __x, int __y)
Definition: _cmath.h:458
_Check_return_ _CRTIMP double __cdecl modf(_In_ double x, _Out_ double *y)
static void rpn_shr_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 259 of file rpn.c.

260 {
261  r->i = a->i >> b->i;
262 }
INT64 i
Definition: calc.h:78
static void rpn_sqr_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 196 of file rpn.c.

197 {
198  if (b->f == 0)
199  calc.is_nan = TRUE;
200  else {
201  r->f = pow(a->f, 1./b->f);
202  if (_finite(r->f) == 0 || _isnan(r->f))
203  calc.is_nan = TRUE;
204  }
205 }
#define TRUE
Definition: types.h:120
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _isnan(_In_ double)
double f
Definition: calc.h:77
BOOL is_nan
Definition: calc.h:132
float pow(float __x, int __y)
Definition: _cmath.h:458
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _finite(_In_ double)
calc_t calc
Definition: winmain.c:226
static void rpn_sub_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 111 of file rpn.c.

112 {
113  r->f = a->f - b->f;
114 }
double f
Definition: calc.h:77
static void rpn_sub_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 213 of file rpn.c.

214 {
215  r->i = a->i - b->i;
216 }
INT64 i
Definition: calc.h:78
static void rpn_sub_p ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 270 of file rpn.c.

271 {
272  r->f = a->f * (1. - b->f/100.);
273 }
double f
Definition: calc.h:77
static void rpn_xor_f ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 161 of file rpn.c.

162 {
163  calc_number_t ai, bi;
164 
165  ai.i = logic_dbl2int(a);
166  bi.i = logic_dbl2int(b);
167 
168  r->f = (long double)(ai.i ^ bi.i);
169 }
double f
Definition: calc.h:77
__int64 logic_dbl2int(calc_number_t *a)
Definition: function.c:240
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
INT64 i
Definition: calc.h:78
static void rpn_xor_i ( calc_number_t r,
calc_number_t a,
calc_number_t b 
)
static

Definition at line 249 of file rpn.c.

250 {
251  r->i = a->i ^ b->i;
252 }
INT64 i
Definition: calc.h:78
void run_operator ( calc_node_t result,
calc_node_t a,
calc_node_t b,
unsigned int  operation 
)

Definition at line 288 of file rpn.c.

Referenced by evalStack(), and exec_closeparent().

292 {
293  calc_number_t da, db, dc;
294  DWORD base = calc.base;
295 
296  da = a->number;
297  db = b->number;
298  if (a->base == IDC_RADIO_DEC && b->base != IDC_RADIO_DEC) {
299  db.f = logic_int2dbl(&b->number);
300  base = IDC_RADIO_DEC;
301  } else
302  if (a->base != IDC_RADIO_DEC && b->base == IDC_RADIO_DEC) {
303  da.f = logic_int2dbl(&a->number);
304  base = IDC_RADIO_DEC;
305  }
306 
307  if (base == IDC_RADIO_DEC) {
308  if (percent_mode) {
310  operator_list[operation].op_p(&dc, &da, &db);
311  } else
312  operator_list[operation].op_f(&dc, &da, &db);
313  if (_finite(dc.f) == 0)
314  calc.is_nan = TRUE;
315  } else {
316  operator_list[operation].op_i(&dc, &da, &db);
317  /* apply final limiter to result */
318  apply_int_mask(&dc);
319  }
320 
321  if (a->base == IDC_RADIO_DEC && b->base != IDC_RADIO_DEC) {
322  result->number.i = logic_dbl2int(&dc);
323  apply_int_mask(&result->number);
324  } else
325  if (a->base != IDC_RADIO_DEC && b->base == IDC_RADIO_DEC)
326  result->number.f = dc.f;
327  else
328  result->number = dc;
329 }
DWORD base
Definition: calc.h:138
#define TRUE
Definition: types.h:120
#define IDC_RADIO_DEC
Definition: resource.h:17
double f
Definition: calc.h:77
HDC dc
Definition: cylfrac.c:34
double logic_int2dbl(calc_number_t *a)
Definition: function.c:253
BOOL is_nan
Definition: calc.h:132
DWORD DWORD
Definition: winlogon.h:83
__int64 logic_dbl2int(calc_number_t *a)
Definition: function.c:240
#define FALSE
Definition: types.h:117
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _finite(_In_ double)
INT64 i
Definition: calc.h:78
calc_number_t number
Definition: calc.h:84
operator_call op_f
Definition: rpn.c:12
static BOOL percent_mode
Definition: rpn.c:19
DWORD base
Definition: calc.h:86
static const calc_operator_t operator_list[]
Definition: rpn.c:52
operator_call op_i
Definition: rpn.c:13
operator_call op_p
Definition: rpn.c:14
calc_t calc
Definition: winmain.c:226
void apply_int_mask(calc_number_t *a)
Definition: fun_mpfr.c:3
void start_rpn_engine ( void  )

Definition at line 454 of file rpn.c.

455 {
456  stack = NULL;
457 }
smooth NULL
Definition: ftsmooth.c:416
Definition: _stack.h:47
void stop_rpn_engine ( void  )

Definition at line 459 of file rpn.c.

460 {
461 }

Variable Documentation

const calc_operator_t operator_list[]
static
Initial value:
= {
{ 0, NULL, NULL, NULL, },
{ 0, NULL, NULL, NULL, },
{ 0, NULL, NULL, NULL, },
{ 1, rpn_or_f, rpn_or_i, NULL, },
{ 2, rpn_xor_f, rpn_xor_i, NULL, },
{ 3, rpn_and_f, rpn_and_i, NULL, },
{ 4, rpn_shl_f, rpn_shl_i, NULL, },
{ 4, rpn_shr_f, rpn_shr_i, NULL, },
{ 6, rpn_mod_f, rpn_mod_i, NULL, },
{ 7, rpn_pow_f, NULL, NULL, },
{ 7, rpn_sqr_f, NULL, NULL, },
}
static void rpn_mul_p(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:275
static void rpn_add_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:106
static void rpn_or_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:151
static void rpn_sub_p(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:270
static void rpn_and_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:141
static void rpn_sqr_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:196
static void rpn_pow_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:189
static void rpn_and_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:239
static void rpn_or_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:244
static void rpn_mod_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:129
static void rpn_div_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:121
static void rpn_div_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:223
static void rpn_mod_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:231
static void rpn_shr_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:180
static void rpn_sub_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:213
smooth NULL
Definition: ftsmooth.c:416
static void rpn_shr_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:259
static void rpn_shl_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:171
static void rpn_add_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:208
static void rpn_add_p(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:265
static void rpn_mul_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:116
static void rpn_xor_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:161
static void rpn_xor_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:249
static void rpn_div_p(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:280
static void rpn_sub_f(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:111
static void rpn_shl_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:254
static void rpn_mul_i(calc_number_t *r, calc_number_t *a, calc_number_t *b)
Definition: rpn.c:218

Definition at line 52 of file rpn.c.

BOOL percent_mode
static

Definition at line 19 of file rpn.c.

Referenced by exec_infix2postfix(), and run_operator().

stack_node_t temp
static

Definition at line 18 of file rpn.c.

Referenced by __ieee754_jn(), __ieee754_yn(), __readmsr(), _aligned_offset_malloc(), _aligned_offset_realloc(), _chm_find_in_PMGL(), _chm_parse_cword(), _getopt_internal(), _hypot(), _lzx_get_bytes(), _mesa_Lightfv(), _unmarshal_int64(), _unmarshal_uint64(), accel_fill_rect(), accel_screen_copy(), acpi_bus_get_flags(), add_diff(), AddToRingBuffer(), aes_setup(), vertexArray::appendVertex(), arith_decode(), arith_encode(), AtapiHexToString(), AVISplitter_ProcessOldIndex(), bezierPatchDeleteList(), bezierPatchListDraw(), bezierPatchMeshEndStrip(), bezierPatchMeshInsertUV(), bezierPatchMeshListCollect(), bezierPatchMeshListDelDeg(), bezierPatchMeshListDraw(), bezierPatchMeshListEval(), bezierPatchMeshListNumTriangles(), bezierPatchMeshListPrint(), bezierPatchMeshListReverse(), bezierPatchMeshListTotalStrips(), bezierPatchMeshListTotalVert(), bezierPatchPrintList(), bin_to_DLineLoops(), Bus_PDO_QueryDeviceId(), Bus_PlugInDevice(), CC_PaintTriangle(), CdRomFindFeaturePage(), cf2_interpT2CharString(), cff_face_init(), cfgets(), monoChain::chainIntersectHoriz(), check_leased_list(), check_messages(), check_no_duplicates(), check_version(), cid_parse_font_matrix(), COMM_BuildNewCommDCB(), COMM_ParseByteSize(), COMM_ParseStopBits(), COMMAND_PROTOTYPE(), CommaSeparateNumberString(), confirm_lease(), convert_file_list(), convert_text2number_2(), ConvertTokenToModule(), ConvertTokenToModuleAndName(), ConvertTokenToSymbol(), ConvertULargeInteger(), copy_mipmap_chain(), CREATE_CreateView(), create_file_test(), CreateTemplateDialog(), CRYPT_AsnDecodeBitsSwapBytes(), CRYPT_EncodeLen(), CRYPT_LoadSIP(), CryptAcquireContextW(), directedLine::cutIntersectionAllPoly(), directedLine::cutoffPolygon(), d3d_device7_Load(), d3dcompiler_parse_type(), D3DReflect(), D3DRMQuaternionMultiply(), D3DRMQuaternionSlerp(), D3DRMVectorAdd(), D3DRMVectorCrossProduct(), D3DRMVectorReflect(), D3DRMVectorScale(), D3DRMVectorSubtract(), D3DXComputeBoundingSphere(), D3DXMatrixMultiplyTranspose(), D3DXPlaneIntersectLine(), D3DXQuaternionRotationAxis(), D3DXQuaternionSlerp(), D3DXSHEvalConeLight(), D3DXSHEvalDirectionalLight(), D3DXSHEvalHemisphereLight(), D3DXSHEvalSphericalLight(), D3DXSHRotate(), DBG_check(), DBG_checkConnectivity(), DBG_collectSampledLinesAllPoly(), DBG_collectSampledLinesPoly(), DBG_cutIntersectionAllPoly(), DBG_edgeIntersectChainD(), DBG_edgeIntersectPoly(), DBG_enclosingPolygons(), DBG_is_U_direction(), DBG_is_U_monotone(), DBG_isConvex(), DBG_polygonListIntersect(), DBG_polygonsIntersect(), DBG_rayIntersectPoly(), DBG_reverse(), DeckClickProc(), DecodeVmFlags(), DecompressBitmap(), decrypt_byte(), deformat_string_internal(), directedLine::deleteDegenerateLines(), directedLine::deleteDegenerateLinesAllPolygons(), sampledLine::deleteList(), monoChain::deleteLoop(), monoChain::deleteLoopList(), directedLine::deletePolygonList(), directedLine::deletePolygonListWithSline(), directedLine::deleteSinglePolygon(), directedLine::deleteSinglePolygonWithSline(), device_disabled_registry(), DIALOG_DlgDirListW(), dictionary_remove(), directedLineLoopListToMonoChainLoopList(), directedLineLoopToMonoChainLoop(), DirPrintWideList(), DirReadParam(), Subdivider::drawSurfaces(), DSOUND_RecalcVolPan(), EMFDRV_ArcChordPie(), EMFDRV_Ellipse(), EMFDRV_Rectangle(), EMFDRV_RoundRect(), EMFDRV_UpdateBBox(), emit_eobrun(), encode_mcu_AC_first(), encode_mcu_AC_refine(), encode_mcu_DC_first(), encode_one_block(), primStream::end(), TTelnetHandler::escapeIAC(), exchange(), ext2_expand_block(), ext2_get_block(), ExtractTypeName(), FD31_StripEditControl(), FFSExpandBlock(), FFSTruncateBlock(), FFSv1GetBlock(), FFSv2GetBlock(), file_stat(), FilterGraph2_Connect(), FilterMapper3_EnumMatchingFilters(), monoChain::find(), find_lease(), findDiagonal_singleCuspX(), findInteriorCuspsX(), findNeckF(), FindParenCount(), directedLine::findRoot(), finish_pass(), forward_DCT(), FT_DivFix(), FT_MulDiv(), FT_MulDiv_No_Round(), FT_Raccess_Get_DataOffsets(), ft_smooth_render_generic(), ftc_snode_load(), GdipGetPathWorldBounds(), get_default_domain(), get_temp_filename(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetDisplayNameOf(), GetTempPathW(), gtStripContig(), gtStripSeparate(), gtTileContig(), gtTileSeparate(), handle_try(), htest_one_block(), ID3DXMatrixStackImpl_RotateAxis(), ID3DXMatrixStackImpl_RotateAxisLocal(), ID3DXMatrixStackImpl_RotateYawPitchRoll(), ID3DXMatrixStackImpl_RotateYawPitchRollLocal(), ID3DXMatrixStackImpl_Scale(), ID3DXMatrixStackImpl_ScaleLocal(), ID3DXMatrixStackImpl_Translate(), ID3DXMatrixStackImpl_TranslateLocal(), IDirectPlayLobby3AImpl_RunApplication(), OpenGLSurfaceEvaluator::inBPMEvalEM(), OpenGLSurfaceEvaluator::inBPMListEval(), OpenGLSurfaceEvaluator::inBPMListEvalEM(), OpenGLSurfaceEvaluator::inEvalULine(), OpenGLSurfaceEvaluator::inEvalVLine(), init(), init_leases_list(), OpenGLCurveEvaluator::inPreEvaluate(), OpenGLSurfaceEvaluator::inPreEvaluate(), OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(), reflexChain::insert(), rectBlockArray::insert(), primStream::insert(), INSERT_CreateView(), IntGetProp(), invert_matrix_3d(), is_mip_level_subset(), IsModuleLoaded(), directedLine::isPolygon(), jpeg_add_quant_table(), LoadSymbolsFromConfig(), main(), MainWndProc(), make_tmp_file(), OpenGLSurfaceEvaluator::map2f(), matrix_multiply(), monoChain::monoChain(), monoTriangulationLoop(), monoTriangulationRec(), monoTriangulationRecGenOpt(), CardRegion::MoveCard(), msi_check_product_patches(), MsiSIPGetSignedDataMsg(), multiply_matrix(), multiply_vector_matrix(), names_dump(), NewGame(), CEnumIDList::Next(), CEnumIDListBase::Next(), monoChain::numChainsAllLoops(), monoChain::numChainsSingleLoop(), directedLine::numEdges(), directedLine::numEdgesAllPolygons(), numInteriorCuspsX(), o_curve_to_DLineLoop(), o_trim_to_DLineLoops(), CAttributesDialog::OnInitDialog(), CardRegion::OnLButtonUp(), parse_charstrings(), parse_subrs(), PATH_Arc(), PATH_CheckCorners(), PB_Read(), PDEVOBJ_vSwitchPdev(), directedLine::polyArea(), polygonConvert(), pop(), prepare_clip_space_planes(), prepare_rpn_result_2(), monoChain::printAllLoops(), directedLine::printAllPolygons(), monoChain::printChainLoop(), PrintkCallback(), directedLine::printList(), monoChain::printOneChain(), process_stabs(), PropertyStorage_WritePropertyToStream(), PropertyStore_SetValue(), PropertyStore_SetValueAndState(), PROPSHEET_CreateDialog(), ProtocolReceive(), ps_mask_table_merge(), ps_parser_load_field(), QTMupdatemodel(), raise(), ReadfromSMBus(), hda_controller::ReadModifyWrite16(), hda_controller::ReadModifyWrite32(), hda_controller::ReadModifyWrite8(), ReadPhysMem(), real_path(), reg_get_value(), REGION_CopyRegion(), REGION_CropRegion(), REGION_PtsToRegion(), release_lease(), remglob(), CardStack::RemoveCard(), RemoveFile(), replace_backslashes(), CardStack::Reverse(), reverse(), reverse_bgr8(), RevirtualizeBreakpointsForModule(), RtlDeleteTimerQueueEx(), RtlIntegerToUnicode(), directedLine::samePolygon(), sampleCompRight(), sampleLeftOneGridStep(), sampleRightOneGridStep(), scale_internal(), scale_internal_byte(), scale_internal_float(), scale_internal_int(), scale_internal_short(), scale_internal_ubyte(), scale_internal_uint(), scale_internal_ushort(), scaleInternal3D(), scaleInternalPackedPixel(), ScanExports(), ScanExportsByAddress(), SetMacro(), CardStack::Shuffle(), signal(), START_TEST(), Stream_LoadString(), swap(), t1_parse_font_matrix(), t42_parse_font_matrix(), sampledLine::tessellate(), sampledLine::tessellateAll(), test_calchash(), test_collection(), test_EnumChildContainerNames(), test_EnumPropNames(), test_FDIIsCabinet(), test_filesourcefilter(), test_GetAdaptersAddresses(), test_getat(), Test_GetMonitorFrequency(), test_incorrect_api_usage(), test_invalid_callbackA(), test_invalid_callbackW(), test_invalid_parametersA(), test_invalid_parametersW(), Test_MouseSpeed(), test_MsiEnumComponentCosts(), test_PlaySound(), test_propertystore(), test_publish(), test_publish_product(), test_register_product(), test_Sdb(), test_SetupDecompressOrCopyFile(), test_SetupGetFileCompressionInfo(), test_SetupGetFileCompressionInfoEx(), test_simple_enumerationA(), test_simple_enumerationW(), test_toplevel_stat(), test_unicode(), test_WritePrivateProfileString(), to_upper(), monoChain::toArrayAllLoops(), directedLine::toArrayAllPolygons(), monoChain::toArraySingleLoop(), directedLine::toArraySinglePolygon(), transform_region_element(), transpose_matrix(), TreeNodeMaximum(), TreeNodeMinimum(), TreeView_GetRealSubtreeState(), triangulateRectGen(), TruncateString(), TuiEditBox(), TuiMessageBoxCritical(), ui_screenblt(), TScroller::update(), UpdateBtnStates(), UPDOWN_HandleMouseEvent(), UpDownWindowProc(), VarAbs(), VarBstrFromDec(), VarFix(), VarInt(), VarNeg(), VarNot(), VarRound(), VfdCheckHandlers(), VfdRegisterHandlers(), VfdUnregisterHandlers(), VgaZeroVideoMemory(), VisualizeFlags(), wave_header_flags(), whilePaintingL(), write_conformant_array_pointer_descriptions(), write_fixed_array_pointer_descriptions(), write_varying_array_pointer_descriptions(), directedLine::writeAllPolygons(), WritePhysMem(), TConsole::WriteString(), WriteToSMBus(), xmlAddDefAttrs(), xmlCleanupThreads(), xmlPathToURI(), xmlSaveUri(), xmlSaveUriRealloc(), xmlURIEscapeStr(), and CMiniportWaveStreamCMI::~CMiniportWaveStreamCMI().