Jspice3
cpdefs.h
Go to the documentation of this file.
1 /**********
2 Copyright 1990 Regents of the University of California. All rights reserved.
3 Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
4 **********/
5 
6 /*
7  * General stuff for the C-shell parser.
8  */
9 
10 /* Standard definitions */
11 #ifndef CPDEFS
12 #define CPDEFS
13 
14 #include "cpstd.h"
15 
16 #define MAXWORDS 512
17 
18 /* Information about spice commands. */
19 
20 struct comm {
21  char *co_comname; /* The name of the command. */
22  void (*co_func) (); /* The function that handles the command. */
23  bool co_stringargs; /* Collapse the arguments into a string. */
24  bool co_spiceonly; /* These can't be used from nutmeg. */
25  bool co_major; /* Is this a "major" command? */
26  long co_cctypes[4]; /* Bitmasks for command completion. */
27  unsigned int co_env;/* print help message on this environment mask */
28  int co_minargs; /* minimum number of arguments required */
29  int co_maxargs; /* maximum number of arguments allowed */
30  int (*co_argfn) (); /* The fn that prompts the user. */
31  char *co_help; /* When these are printed, printf(string, av[0]) .. */
32 };
33 
34 #define LOTS 1000
35 
36 /* The history list. Things get put here after the first (basic) parse.
37  * The word list will change later, so be sure to copy it.
38  */
39 
40 struct histent {
41  int hi_event;
43  struct histent *hi_next;
44  struct histent *hi_prev;
45 };
46 
47 /* The values returned by cp_userset(). */
48 
49 #define US_OK 1 /* Either not relevant or nothing special. */
50 #define US_READONLY 2 /* Complain and don't set this var. */
51 #define US_DONTRECORD 3 /* Ok, but don't keep track of this one. */
52 
53 /* Aliases. These will be expanded if the word is the first in an input
54  * line. The substitution string may contain arg selectors.
55  */
56 
57 struct alias {
58  char *al_name; /* The word to be substituted for. */
59  wordlist *al_text; /* What to substitute for it. */
60  struct alias *al_next;
61  struct alias *al_prev;
62 } ;
63 
64 /* The current record of what characters are special. */
65 
66 #define CPC_BRR 004 /* Break word to right of character. */
67 #define CPC_BRL 010 /* Break word to left of character. */
68 
69 /* For quoting individual characters. '' strings are all quoted, but `` and
70  * "" strings are maintained as single words with the quotes around them.
71  * Note that this won't work on non-ascii machines.
72  */
73 
74 #define quote(c) ((c) | 0200)
75 #define strip(c) ((c) & 0177)
76 
77 #define CT_ALIASES 1
78 #define CT_LABEL 15
79 
80 /* Get all the extern definitions... */
81 
82 #include "cpextern.h"
83 
84 #endif /*CPDEFS*/
wordlist * hi_wlist
Definition: cpdefs.h:42
struct histent * hi_prev
Definition: cpdefs.h:44
struct alias * al_next
Definition: cpdefs.h:60
char * al_name
Definition: cpdefs.h:58
int(* co_argfn)()
Definition: cpdefs.h:30
Definition: cpdefs.h:20
int co_maxargs
Definition: cpdefs.h:29
bool co_spiceonly
Definition: cpdefs.h:24
wordlist * al_text
Definition: cpdefs.h:59
Definition: cpdefs.h:40
char * co_help
Definition: cpdefs.h:31
int co_minargs
Definition: cpdefs.h:28
bool co_major
Definition: cpdefs.h:25
unsigned int co_env
Definition: cpdefs.h:27
struct alias * al_prev
Definition: cpdefs.h:61
Definition: cpstd.h:21
int hi_event
Definition: cpdefs.h:41
void(* co_func)()
Definition: cpdefs.h:22
struct histent * hi_next
Definition: cpdefs.h:43
bool co_stringargs
Definition: cpdefs.h:23
char * co_comname
Definition: cpdefs.h:21
Definition: cpdefs.h:57
long co_cctypes[4]
Definition: cpdefs.h:26