Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // avp 2016 (for ru.stackoverflow.com)
- #ifndef _SCALC_H
- #define _SCALC_H
- #define CALC_OK 0
- #define CALC_OUT_OF_MEM 1
- #define CALC_NO_OP 2 // two operands without operation beetwen them
- #define CALC_NO_VAL 3 // operand expected, but found ')' or operation
- #define CALC_NO_RP 4 // unbalanced '(' ('(' found in stack by EOF)
- #define CALC_NO_LP 5 // unbalanced ')' ('(' not found in stack)
- #define CALC_ERR_OP 6 // invalid operation in expr() (internal error)
- #define CALC_NO_NUMS 7 // no operands for current operation
- #define CALC_NUMS_ERR 8 // at end operands stack depth greater than 1
- #define CALC_OPRS_ERR 9 // at end operations left in stack
- #define CALC_ERR_INPUT 10 // invalid input char (letter, graph ...)
- #define CALC_NO_INPUT 11 // empty input
- #define CALC_ERR_CODE 12 // invalid rc for message
- #define CALC_EOD 13 // EOF
- extern
- #ifdef __cplusplus
- "C" {
- #endif
- // scalc.c http://pastebin.com/stQw5kyc
- int scalc (const char *str, double *pres);
- const char *scalc_strerr (int code);
- #ifdef __cplusplus
- }
- #endif
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement