4 * Copyright (c) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 #include <glib/gi18n.h>
31 /* To make lint happy. */
32 #define SNPRINTF (void) snprintf
33 #define STRNCPY (void) strncpy
35 /* Base definitions. */
36 typedef enum { BIN
, OCT
, DEC
, HEX
, MAXBASES
} BaseType
;
38 #define MAX_DIGITS 200 /* Maximum displayable number of digits. */
39 #define MAX_LOCALIZED (MAX_DIGITS * (1 + MB_LEN_MAX) + MB_LEN_MAX)
41 #define DEFAULT_ACCURACY 9
44 #define MAXLINE 512 /* Length of character strings. */
47 #define MAXACC 99 /* Max. number of digits after numeric point. */
49 #define MAX_CONSTANTS 10
50 #define MAX_FUNCTIONS 10
51 #define MAX_REGISTERS 10 /* Maximum number of memory registers. */
54 #define RCNAME ".gcalctoolrc"
62 #define MPMATH_ERR 20001
64 /* Calctool variables and options. */
66 char *progname
; /* Name of this program. */
68 GCDisplay display
; /* Display stack */
70 const char *radix
; /* Locale specific radix string. */
71 const char *tsep
; /* Locale specific thousands separator. */
72 int tsep_count
; /* Number of digits between separator. */
74 BaseType base
; /* Numeric base (BIN, OCT, DEC or HEX). */
75 MPAngleUnit ttype
; /* Angle unit type */
76 int wordlen
; /* Length of word for bitwise operations */
77 int accuracy
; /* Number of digits precision. */
79 int error
; /* true if there is a display error */
80 int math_error
; /* Math error */
81 char *math_error_text
; /* Text for math error */
82 } CalculatorVariables
;
84 extern CalculatorVariables
*v
; /* Calctool variables and options. */
85 extern int basevals
[]; /* Supported arithmetic bases. */