ngspice/src/nghelp.c

115 lines
2.0 KiB
C
Raw Normal View History

2000-04-27 22:03:57 +02:00
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
**********/
/*
* The main routine for the help system in stand-alone mode.
*/
#include <config.h>
#include "ngspice.h"
#include "cpdefs.h"
#include "hlpdefs.h"
src/Makefile.am src/help.c src/main.c src/circuit/Makefile.am src/circuit/ifnewuid.c src/frontend/Makefile.am src/frontend/aspice.c src/frontend/circuits.h src/frontend/com_display.c src/frontend/com_hardcopy.c src/frontend/commands.c src/frontend/commands.h src/frontend/cpitf.c src/frontend/debugcom.c src/frontend/device.c src/frontend/diff.c src/frontend/display.c src/frontend/dotcards.c src/frontend/fourier.c src/frontend/inp.c src/frontend/inpcom.c src/frontend/linear.c src/frontend/misccoms.c src/frontend/mw_coms.c src/frontend/nutinp.c src/frontend/options.c src/frontend/outitf.c src/frontend/parse.c src/frontend/postcoms.c src/frontend/postsc.c src/frontend/rawfile.c src/frontend/resource.c src/frontend/runcoms.c src/frontend/runcoms2.c src/frontend/shyu.c src/frontend/spec.c src/frontend/spiceif.c src/frontend/subckt.c src/frontend/vectors.c src/frontend/where.c src/frontend/plotting/Makefile.am src/frontend/plotting/agraf.c src/frontend/plotting/graf.c src/frontend/plotting/plotcurv.c src/frontend/plotting/plotit.c src/frontend/plotting/x11.c src/frontend/plotting/xgraph.c src/include/Makefile.am src/maths/cmaths/cmath4.c src/misc/terminal.c src/misc/terminal.h src/parser/cshpar.c src/parser/front.c src/parser/front.h src/parser/history.c src/parser/history.h src/parser/modify.c src/parser/var2.c src/parser/var2.h src/parser/variable.c: Refactoring of frontend code. * src/include/ftehelp.h src/include/variable.h: Moved into frontend directory. * src/include/cpdefs.h src/include/cpextern.h src/include/ftedefs.h src/include/plot.h: Updates.
2000-06-27 18:09:02 +02:00
#include "frontend/variable.h"
2000-04-27 22:03:57 +02:00
#ifndef X_DISPLAY_MISSING
Widget toplevel;
#endif
FILE *cp_in, *cp_out, *cp_err;
char *Spice_Exec_Dir = NGSPICEBINDIR;
char *Spice_Lib_Dir = NGSPICEDATADIR;
char *Def_Editor = "vi";
int AsciiRawFile = 0;
char *Bug_Addr = "";
char *Spice_Host = "";
char *Spiced_Log = "";
/* dummy declaration so CP.a doesn't pull in lexical.o and other objects */
bool cp_interactive = FALSE;
char *hlp_filelist[] = { "ngspice", 0 };
int
main(int ac, char **av)
{
wordlist *wl = NULL;
#ifndef X_DISPLAY_MISSING
char *displayname;
/* grrr, Xtk forced contortions */
char *argv[2];
int argc = 2;
char buf[512];
#endif
ivars( );
cp_in = stdin;
cp_out = stdout;
cp_err = stderr;
#ifndef X_DISPLAY_MISSING
if (cp_getvar("display", VT_STRING, buf)) {
displayname = buf;
} else if (!(displayname = getenv("DISPLAY"))) {
fprintf(stderr, "Can't open X display.");
goto out;
}
argv[0] = "nutmeg";
argv[1] = displayname;
/* initialize X toolkit */
toplevel = XtInitialize("nutmeg", "Nutmeg", NULL, 0, &argc, argv);
#endif
out:
if (ac > 1)
wl = wl_build(av + 1);
hlp_main(Help_Path, wl);
#ifndef X_DISPLAY_MISSING
if (hlp_usex) {
printf("Hit control-C when done.\n"); /* sigh */
XtMainLoop();
}
#endif
exit(EXIT_NORMAL);
}
void
fatal(char *s)
{
fprintf(stderr, "fatal error: %s\n", s);
exit(1);
}
/* There is a conflict witj another cp_printword in cp/quote.c
static void
cp_printword(s)
char *s;
{
printf("%s", s);
return;
}
*/
bool
2001-02-09 09:18:35 +01:00
cp_getvar(char *n, int t, void *r)
2000-04-27 22:03:57 +02:00
{
return (FALSE);
}
char *
cp_tildexpand(char *s)
{
return tilde_expand(s);
}