summaryrefslogtreecommitdiff
path: root/src/mp-equation.h
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-11-24 23:33:08 -0300
committerPerberos <[email protected]>2011-11-24 23:33:08 -0300
commitaf876ebbd621a63a1a0636fb0ce74da5c2aca480 (patch)
treefffc4b798e4172059fbd25d78f5bce93b3284af2 /src/mp-equation.h
parent5b8921d58fbb5ad226815829dece99d5cfc781b8 (diff)
downloadmate-calc-af876ebbd621a63a1a0636fb0ce74da5c2aca480.tar.bz2
mate-calc-af876ebbd621a63a1a0636fb0ce74da5c2aca480.tar.xz
allman style format
Diffstat (limited to 'src/mp-equation.h')
-rw-r--r--src/mp-equation.h71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/mp-equation.h b/src/mp-equation.h
index 60e6690..c5b86fa 100644
--- a/src/mp-equation.h
+++ b/src/mp-equation.h
@@ -22,56 +22,55 @@
#include "mp.h"
-typedef enum
-{
- PARSER_ERR_NONE = 0,
- PARSER_ERR_INVALID,
- PARSER_ERR_OVERFLOW,
- PARSER_ERR_UNKNOWN_VARIABLE,
- PARSER_ERR_UNKNOWN_FUNCTION,
- PARSER_ERR_UNKNOWN_CONVERSION,
- PARSER_ERR_MP
+typedef enum {
+ PARSER_ERR_NONE = 0,
+ PARSER_ERR_INVALID,
+ PARSER_ERR_OVERFLOW,
+ PARSER_ERR_UNKNOWN_VARIABLE,
+ PARSER_ERR_UNKNOWN_FUNCTION,
+ PARSER_ERR_UNKNOWN_CONVERSION,
+ PARSER_ERR_MP
} MPErrorCode;
/* Options for parser */
typedef struct {
- /* Default number base */
- int base;
+ /* Default number base */
+ int base;
- /* The wordlength for binary operations in bits (e.g. 8, 16, 32) */
- int wordlen;
+ /* The wordlength for binary operations in bits (e.g. 8, 16, 32) */
+ int wordlen;
- /* Units for angles (e.g. radians, degrees) */
- MPAngleUnit angle_units;
+ /* Units for angles (e.g. radians, degrees) */
+ MPAngleUnit angle_units;
- // FIXME:
- // int enable_builtins;
+ // FIXME:
+ // int enable_builtins;
- /* Data to pass to callbacks */
- void *callback_data;
-
- /* Function to check if a variable is defined */
- int (*variable_is_defined)(const char *name, void *data);
+ /* Data to pass to callbacks */
+ void *callback_data;
- /* Function to get variable values */
- int (*get_variable)(const char *name, MPNumber *z, void *data);
+ /* Function to check if a variable is defined */
+ int (*variable_is_defined)(const char* name, void* data);
- /* Function to set variable values */
- void (*set_variable)(const char *name, const MPNumber *x, void *data);
+ /* Function to get variable values */
+ int (*get_variable)(const char* name, MPNumber* z, void* data);
- /* Function to check if a function is defined */
- int (*function_is_defined)(const char *name, void *data);
+ /* Function to set variable values */
+ void (*set_variable)(const char* name, const MPNumber *x, void* data);
- /* Function to solve functions */
- int (*get_function)(const char *name, const MPNumber *x, MPNumber *z, void *data);
+ /* Function to check if a function is defined */
+ int (*function_is_defined)(const char* name, void* data);
- /* Function to convert units */
- int (*convert)(const MPNumber *x, const char *x_units, const char *z_units, MPNumber *z, void *data);
+ /* Function to solve functions */
+ int (*get_function)(const char* name, const MPNumber* x, MPNumber* z, void* data);
+
+ /* Function to convert units */
+ int (*convert)(const MPNumber* x, const char* x_units, const char* z_units, MPNumber* z, void* data);
} MPEquationOptions;
-MPErrorCode mp_equation_parse(const char *expression, MPEquationOptions *options, MPNumber *result, char **error_token);
-const char *mp_error_code_to_string(MPErrorCode error_code);
+MPErrorCode mp_equation_parse(const char* expression, MPEquationOptions* options, MPNumber* result, char** error_token);
+const char* mp_error_code_to_string(MPErrorCode error_code);
-int sub_atoi(const char *data);
-int super_atoi(const char *data);
+int sub_atoi(const char* data);
+int super_atoi(const char* data);
#endif