2000-06-27 18:15:43 +02:00
|
|
|
/**********
|
|
|
|
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
|
|
|
|
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|
|
|
|
**********/
|
|
|
|
|
|
2009-08-15 11:27:08 +02:00
|
|
|
/* Initialize io, cp_chars[], variable "history". */
|
2000-06-27 18:15:43 +02:00
|
|
|
|
2011-12-11 19:05:00 +01:00
|
|
|
#include "ngspice/ngspice.h"
|
|
|
|
|
#include "ngspice/cpdefs.h"
|
2000-06-27 18:15:43 +02:00
|
|
|
|
|
|
|
|
#include "init.h"
|
|
|
|
|
#include "variable.h"
|
|
|
|
|
|
|
|
|
|
|
2009-08-15 11:27:08 +02:00
|
|
|
char cp_chars[128]; /* used in fcn cp_lexer() from lexical.c */
|
2000-06-27 18:15:43 +02:00
|
|
|
|
|
|
|
|
static char *singlec = "<>;&";
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
cp_init(void)
|
2009-08-15 11:27:08 +02:00
|
|
|
/* called from ft_cpinit() in cpitf.c.
|
|
|
|
|
Uses global variables:
|
|
|
|
|
cp_chars[128]
|
|
|
|
|
cp_maxhistlength (set to 10000 in com_history.c)
|
|
|
|
|
cp_curin, cp_curout, cp_curerr (defined in streams.c)
|
|
|
|
|
*/
|
2000-06-27 18:15:43 +02:00
|
|
|
{
|
2009-08-15 11:27:08 +02:00
|
|
|
char *s;
|
2000-06-27 18:15:43 +02:00
|
|
|
|
2016-07-22 20:44:17 +02:00
|
|
|
memset(cp_chars, 0, 128);
|
2000-06-27 18:15:43 +02:00
|
|
|
for (s = singlec; *s; s++)
|
2009-08-15 11:27:08 +02:00
|
|
|
/* break word to right or left of characters <>;&*/
|
2000-06-27 18:15:43 +02:00
|
|
|
cp_chars[(int) *s] = (CPC_BRR | CPC_BRL);
|
2009-08-15 11:27:08 +02:00
|
|
|
|
2010-07-20 21:19:51 +02:00
|
|
|
cp_vset("history", CP_NUM, &cp_maxhistlength);
|
2000-06-27 18:15:43 +02:00
|
|
|
|
|
|
|
|
cp_curin = stdin;
|
|
|
|
|
cp_curout = stdout;
|
|
|
|
|
cp_curerr = stderr;
|
|
|
|
|
|
2012-09-22 19:32:30 +02:00
|
|
|
/* io redirection in streams.c:
|
2009-08-15 11:27:08 +02:00
|
|
|
cp_in set to cp_curin etc. */
|
2012-09-22 19:32:30 +02:00
|
|
|
cp_ioreset();
|
2000-06-27 18:15:43 +02:00
|
|
|
}
|