Jspice3
inpfindl.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3e2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8  /* INPfindLev(line)
9  * find the 'level' parameter on the given line and return its
10  * value (1,2,or 3 for now, 1 default)
11  */
12 
13 #include "spice.h"
14 #include "inpdefs.h"
15 #include "misc.h"
16 
17 
18 char *
20 
21 char *line;
22 int *level;
23 {
24  char *where;
25 
26  where = line;
27 
28  for (;;) {
29  where = strchr(where,'l');
30  if(where == 0) { /* no 'l' in the line => no 'level' => default */
31  *level = 1;
32  return((char *)NULL);
33  }
34  if(strncmp(where,"level",5)!=0) { /* this l isn't in the word
35  * 'level', so lets try again */
36  where++; /* make sure we don't match same char again */
37  continue;
38  }
39  /* found the word level, lets look at the rest of the line */
40  where += 5;
41  while( (*where == ' ') || (*where == '\t') || (*where == '=') ||
42  (*where == ',') || (*where == '(') || (*where == ')') ||
43  (*where == '+') ) { /* legal white space - ignore */
44  where++;
45  }
46 
47  /* now the magic number */
48 
49  switch (*where) {
50  case '1':
51  *level=1;
52  return((char *)NULL);
53  case '2':
54  *level=2;
55  return((char *)NULL);
56  case '3':
57  *level=3;
58  return((char *)NULL);
59  case '4':
60  *level=4;
61  return((char *)NULL);
62  case '5':
63  *level=5;
64  return((char *)NULL);
65  case '6':
66  *level=6;
67  return((char *)NULL);
68  case '7':
69  *level=7;
70  return((char *)NULL);
71  case '8':
72  *level=8;
73  return((char *)NULL);
74  case '9':
75  *level=9;
76  return((char *)NULL);
77  default:
78  *level=1;
79  return (copy(
80  " illegal argument to level parameter - level=1 assumed"));
81  }
82  }
83 }
char * INPfindLev(char *line, int *level)
Definition: inpfindl.c:19
char * copy()
Definition: fteinp.h:14
#define NULL
Definition: spdefs.h:121
This document describes the JSPICE3 Josephson junction model I derivation of the model The expression for the junction current is where
Definition: model.doc:9