Jspice3
arg.c File Reference
#include "spice.h"
#include "ftedefs.h"
#include "scedio.h"
Include dependency graph for arg.c:

Go to the source code of this file.

Macros

#define MAXPROMPT   1024
 

Functions

static int countargs ()
 
static void common ()
 
static int countargs (wordlist *wl)
 
 arg_print (wordlist *wl, struct comm *command)
 
 arg_plot (wordlist *wl, struct comm *command)
 
 arg_load (wordlist *wl, struct comm *command)
 
 arg_let (wordlist *wl, struct comm *command)
 
 arg_set (wordlist *wl, struct comm *command)
 
 arg_display ()
 
static void common (char *string, struct wordlist *wl, struct comm *command)
 
wordlistoutmenuprompt (char *string)
 

Variables

static char buf [MAXPROMPT]
 

Macro Definition Documentation

#define MAXPROMPT   1024

Definition at line 17 of file arg.c.

Function Documentation

arg_display ( )

Definition at line 91 of file arg.c.

92 {
93 
94  /* just return; display does the right thing */
95 
96 }
arg_let ( wordlist wl,
struct comm command 
)

Definition at line 73 of file arg.c.

76 {
77 
78  common("which vector", wl, command);
79 
80 }
static void common()
arg_load ( wordlist wl,
struct comm command 
)

Definition at line 64 of file arg.c.

67 {
68  /* just call com_load */
69  (*command->co_func) (wl);
70 
71 }
void(* co_func)()
Definition: cpdefs.h:22
arg_plot ( wordlist wl,
struct comm command 
)

Definition at line 55 of file arg.c.

58 {
59 
60  common("which variable", wl, command);
61 
62 }
static void common()
arg_print ( wordlist wl,
struct comm command 
)

Definition at line 46 of file arg.c.

49 {
50 
51  common("which variable", wl, command);
52 
53 }
static void common()
arg_set ( wordlist wl,
struct comm command 
)

Definition at line 82 of file arg.c.

85 {
86 
87  common("which variable", wl, command);
88 
89 }
static void common()
static void common ( )
static
static void common ( char *  string,
struct wordlist wl,
struct comm command 
)
static

Definition at line 100 of file arg.c.

105 {
106 
107  struct wordlist *w;
108  char *buf;
109 
110  if (!countargs(wl)) {
111  w = outmenuprompt(string);
112  if (w == NULL)
113  return;
114  (*command->co_func) (w);
115  wl_free(w);
116  }
117 }
static char buf[MAXPROMPT]
Definition: arg.c:18
static int countargs()
Definition: cddefs.h:169
void wl_free()
#define NULL
Definition: spdefs.h:121
Definition: cpstd.h:21
void(* co_func)()
Definition: cpdefs.h:22
wordlist * outmenuprompt(char *string)
Definition: arg.c:121
static int countargs ( )
static
static int countargs ( wordlist wl)
static

Definition at line 30 of file arg.c.

33 {
34 
35  int number=0;
36  wordlist *w;
37 
38  for (w = wl; w; w = w->wl_next) {
39  number++ ;
40  }
41  return(number);
42 
43 }
Definition: cddefs.h:169
Definition: cpstd.h:21
struct wordlist * wl_next
Definition: cpstd.h:23
wordlist* outmenuprompt ( char *  string)

Definition at line 121 of file arg.c.

123 {
124  wordlist *wl;
125  char buf[100], buf1[100];
126  char *c;
127 
128  sprintf(buf1, "%s: ", string);
129  if (SCEDfgets(buf,sizeof(buf),cp_in,buf1) == NULL)
130  return (NULL);
131  if ((c = strchr(buf,'\n')) != NULL)
132  *c = '\0';
133  wl = alloc(wordlist);
134  wl->wl_word = copy(buf);
135  cp_variablesubst(&wl);
136  cp_bquote(&wl);
137  cp_doglob(&wl);
138  return (wl);
139 }
static char buf[MAXPROMPT]
Definition: arg.c:18
void cp_bquote()
Definition: library.c:18
void cp_doglob()
#define alloc(type)
Definition: cdmacs.h:21
char * copy()
#define NULL
Definition: spdefs.h:121
char * SCEDfgets(char *s, int n, FILE *fp, char *prompt)
Definition: scedstub.c:41
static double c
Definition: vectors.c:16
Definition: cpstd.h:21
void cp_variablesubst()
char * wl_word
Definition: cpstd.h:22
FILE * cp_in
Definition: help.c:101

Variable Documentation

char buf[MAXPROMPT]
static

Definition at line 18 of file arg.c.