Jspice3
inperrc.c File Reference
#include "spice.h"
#include "inpdefs.h"
#include "misc.h"
Include dependency graph for inperrc.c:

Go to the source code of this file.

Functions

char * INPerrCat (char *a, char *b)
 
char * INPdevErr (char *str)
 

Function Documentation

char* INPdevErr ( char *  str)

Definition at line 43 of file inperrc.c.

46 {
47  static char buf[64];
48 
49  if (str)
50  sprintf(buf,"Device type %s not available in this binary.",str);
51  else
52  sprintf(buf,"Incorrect model type.");
53  return (buf);
54 }
static char buf[MAXPROMPT]
Definition: arg.c:18
char* INPerrCat ( char *  a,
char *  b 
)

Definition at line 14 of file inperrc.c.

18 {
19 char *errtmp;
20 
21  if (a != (char *)NULL) {
22  if (b == (char *)NULL)
23  /* a valid, b null, return a */
24  return (a);
25 
26  else { /* both valid - hard work...*/
27  errtmp = (char *)tmalloc( (strlen(a) + strlen(b)+2)*sizeof(char));
28  (void) strcpy(errtmp,a);
29  (void) strcat(errtmp,"\n");
30  (void) strcat(errtmp,b);
31  txfree(a);
32  txfree(b);
33  return (errtmp);
34  }
35  }
36  else
37  /* a null, so return b */
38  return (b);
39 }
char * strcpy()
char * tmalloc()
void txfree()
#define NULL
Definition: spdefs.h:121
Definition: sced.h:120