Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / bc / dc / dc.h
blob3300f44426e8289d109daafe9059fd1e94e630d4
1 /*
2 * Header file for dc routines
4 * Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
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,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU 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, you can either send email to this
18 * program's author (see below) or write to:
20 * The Free Software Foundation, Inc.
21 * 59 Temple Place, Suite 330
22 * Boston, MA 02111 USA
25 #ifndef DC_DEFS_H
26 #define DC_DEFS_H
28 /* 'I' is a command, and bases 17 and 18 are quite
29 * unusual, so we limit ourselves to bases 2 to 16
31 #define DC_IBASE_MAX 16
33 #define DC_SUCCESS 0
34 #define DC_DOMAIN_ERROR 1
35 #define DC_FAIL 2 /* generic failure */
38 #ifndef __STDC__
39 # define DC_PROTO(x) ()
40 # define DC_DECLVOID() ()
41 # define DC_DECLARG(arglist) arglist
42 # define DC_DECLSEP ;
43 # define DC_DECLEND ;
44 #else /* __STDC__ */
45 # define DC_PROTO(x) x
46 # define DC_DECLVOID() (void)
47 # define DC_DECLARG(arglist) (
48 # define DC_DECLSEP ,
49 # define DC_DECLEND )
50 #endif /* __STDC__ */
53 typedef enum {DC_TOSS, DC_KEEP} dc_discard;
54 typedef enum {DC_NONL, DC_WITHNL} dc_newline;
57 /* type discriminant for dc_data */
58 typedef enum {DC_UNINITIALIZED, DC_NUMBER, DC_STRING} dc_value_type;
60 /* only numeric.c knows what dc_num's *really* look like */
61 typedef struct dc_number *dc_num;
63 /* only string.c knows what dc_str's *really* look like */
64 typedef struct dc_string *dc_str;
67 /* except for the two implementation-specific modules, all
68 * dc functions only know of this one generic type of object
70 typedef struct {
71 dc_value_type dc_type; /* discriminant for union */
72 union {
73 dc_num number;
74 dc_str string;
75 } v;
76 } dc_data;
79 /* This is dc's only global variable: */
80 extern const char *progname; /* basename of program invocation */
82 #endif /* not DC_DEFS_H */