Fix errors from make distcheck
[gcalctool.git] / src / calctool.h
blobeb32fe009733b8161b2e2bd94577d9f1ac758df1
2 /* $Header$
4 * Copyright (c) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.
5 *
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)
9 * any later version.
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
19 * 02111-1307, USA.
22 #ifndef CALCTOOL_H
23 #define CALCTOOL_H
25 #include <glib/gi18n.h>
27 #include "config.h"
28 #include "mp.h"
29 #include "display.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
43 #ifndef MAXLINE
44 #define MAXLINE 512 /* Length of character strings. */
45 #endif
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. */
53 #ifndef RCNAME
54 #define RCNAME ".gcalctoolrc"
55 #endif
57 #undef TRUE
58 #define TRUE 1
59 #undef FALSE
60 #define FALSE 0
62 #define MPMATH_ERR 20001
64 /* Calctool variables and options. */
65 typedef struct {
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. */
87 void doerr(char *);
89 #endif /*CALCTOOL_H*/