|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 2899 (0xb53)
Types: TextFile
Names: »calctool.h«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec1/calctool/calctool.h«
/* calctool.c
*
* This files contains all the definitions used by the calctool program.
*
* Copyright (c) Rich Burridge - January 1987.
* Sun Microsystems, Australia - All rights reserved.
*
* Version 1.2.
*
* No responsibility is taken for any errors or inaccuracies inherent
* either to the comments or the code of this program, but if
* reported to me then an attempt will be made to fix them.
*/
#include <stdio.h>
#include <strings.h>
#include <ctype.h>
#include <math.h>
#ifdef SUNTOOL
#include <suntool/sunview.h>
#include <suntool/canvas.h>
#include <suntool/panel.h>
#else
#include <sgtty.h>
#endif SUNTOOL
char *sprintf() ;
#define PATCHLEVEL 0
#define FGETS (void) fgets /* To make lint happy. */
#define FPRINTF (void) fprintf
#define IOCTL (void) ioctl
#define PANEL_SET (void) panel_set
#define READ (void) read
#define SPRINTF (void) sprintf
#define SSCANF (void) sscanf
#define STRCPY (void) strcpy
#define STRNCAT (void) strncat
#ifdef SUNTOOL
#define SMALLFONT "/usr/lib/fonts/fixedwidthfonts/screen.r.7"
#define NORMALFONT "/usr/lib/fonts/fixedwidthfonts/screen.r.12"
#endif SUNTOOL
#define BIN 0 /* Base definitions. */
#define OCT 1
#define DEC 2
#define HEX 3
#define BUTTON_BORDER 5 /* No of pixels in border. */
#define BUTTON_COLS 6 /* No of columns of buttons. */
#define BUTTON_GAP 5 /* No of pixels between buttons. */
#define BUTTON_HEIGHT 22 /* Number of pixels for height. */
#define BUTTON_ROWS 7 /* No of rows of buttons. */
#define BUTTON_WIDTH 36 /* No of pixels for width. */
#define DEF_CONT_MSG "Hit any key or button to continue."
#define DISPLAY 30 /* Calculators numerical display. */
#define EQUAL !strcmp /* For character comparisons. */
#define EXTRA 4 /* Extra useful character definitions. */
#define HELPNAME "calctool.help"
#define MAX_DIGITS 32 /* Maximum displayable number of digits. */
#define MAXLINE 80 /* Length of character strings. */
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define NOBUTTONS BUTTON_ROWS * BUTTON_COLS
#define TOTAL_HEIGHT (BUTTON_ROWS * BUTTON_HEIGHT) + \
((BUTTON_ROWS - 1) * BUTTON_GAP) + (2 * BUTTON_BORDER)
#define TOTAL_ITEMS NOBUTTONS + EXTRA /* Total number of definitions. */
#define TOTAL_WIDTH (BUTTON_COLS * BUTTON_WIDTH) + \
((BUTTON_COLS - 1) * BUTTON_GAP) + (2 * BUTTON_BORDER)
typedef unsigned long BOOLEAN ;
struct button {
char *str ;
int (*func)() ;
char value ;
} ;