|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3865 (0xf19)
Types: TextFile
Notes: UNIX file
Names: »defs.h«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦f4b8d8c84⟧ UNIX Filesystem
└─⟦this⟧ »unimenu/src/menu/defs.h«
#define SFS /* for uNETix */
#include <sys/types.h>
#include <windows.h>
/*
* Copyright (c) 1984
*
* LANTECH Systems, Incoroporated
*
* All rights reserved
*/
/*
* Module: defs.h
*
* Purpose: Define data structures, values.
*
* Included by: everyone
*
* History: Original code June 84, Robert Adams.
* Added #include <stdio.h> July 84.
* Added LERROR return code July 84.
* took stdio.h out in favor of local routines - drm
*
* Notes:
*/
/* #include <stdio.h> - drm 3/85 */
#define LERROR 0 /* error return code */
#define LTEXT 1 /* text, title */
#define LHELP 2 /* help message, file */
#define LEXEC 3 /* how to do it */
#define LPRMPT 4 /* prompt to use. */
#define LBAD 5 /* prompt to use later */
#define LCOL 6 /* how many columns ? */
#define LEXPL 7 /* one line explanantion */
#define LTOP 8 /* top line of the screen */
#define LHCOL 9 /* left hand column */
#define LPWD 10 /* display the current directory */
#define LOTHR 99 /* unknown */
struct line_f /* one line in a Menu Control file */
{
int l_type; /* What kind of line is it? */
char *l_key; /* keyword that began the line*/
char *l_val; /* the rest of the line */
struct line_f *l_next; /* for expansion */
};
struct choice_f /* one choice on a screen */
{
struct line_f *c_text; /* the text to display */
struct line_f *c_expl; /* one line explanation */
struct line_f *c_help; /* how to help out */
struct line_f *c_exec; /* what to do */
struct line_f *c_list; /* in case there were more */
struct choice_f *c_next; /* menu wants a linked list */
};
struct menu_f /* a "menu" or one screen */
{
struct choice_f m_global; /* global keywords */
struct choice_f *m_list; /* to keep track of choices */
char *m_current; /* current choice */
char *m_prompt; /* to ask the user */
char *m_bad; /* to bitch about */
int m_col; /* how many columns to print */
/*
* added row, fsiz, entries for select function usage - drm
*/
int m_row; /* how many rows in the menu */
int m_entries;
int m_fsiz; /* how wide the entries are */
int m_ulhr; /* menu location on screen */
int m_ulhc; /* upper left-hand column */
};
/* options that a user can chose at the prompt
* this structure also used to parse the input file,
* except that o_type has vaules say, LEXEC and LHELP.
*/
#define CHEXEC 1 /* run */
#define CHHELP 2 /* get help */
#define CHBACK 3 /* pop some levels */
#define CHOTHR 4 /* something undefined */
#define CHRPLOT 5 /* no-op, just cls */
#define CHEXIT 6 /* pop some levels */
#define CHDUMP 7 /* print menu struct */
#define CHINVLD 8 /* Didn't recognize choice */
struct option
{
char *o_text; /* e.g. "Help" or "Exec" */
int o_type; /* has values listed here */
int o_size; /* Sizeof o_text */
};
#define FALSE 0
#define TRUE 1
#define NULL 0
#define EOF -1
/* conveniences */
#define c_Text c_text->l_val
#define c_Help c_help->l_val
#define c_Exec c_exec->l_val
#define c_Expl c_expl->l_val
#define m_Title m_global.c_Text
#define m_Help m_global.c_Help
/* ASCII character set. */
#define SPACE ' '
#define TAB '\t'
#define EOS '\0'
#define NL '\n'
#define OPENQ '{'
#define CLOSEQ '}'
/* What does strcmp return? */
#define SAME 0
/* To deal with some machine dependancies (sorta) */
#ifdef z8000 /* Actually most unices */
#define STRUCT_ASSIGN
#define CLS "/usr/local/bin/cls"
#endif
#ifdef SFS /* Actually, all uNETices */
#define VT100
#endif
/*
* define our window size
*/
#define SCR_WID 80 /* how wide the screen is */
#define SCR_LEN 24 /* how long the screen is */
extern W2B SCR_SIZ;
#ifdef XENIX
#define V_SPACE 0x0720
#define RV_SPACE 0x7020
#endif
#ifdef COHERENT
#define V_SPACE 0x2007 /* char and attr */
#define RV_SPACE 0x2070
#endif