1 #include <../../nrnconf.h>
6 #include <InterViews/cursor.h>
7 #include <InterViews/window.h>
16 static FILE* help_pipe;
18 #if MAC && !defined(carbon)
22 #if defined(WIN32) && !defined(MINGW)
37 static CopyStringList* filequeue;
39 extern "C" void ivoc_help(
const char* s) {
45 strncpy(
buf, s + 4, 256);
61 filequeue =
new CopyStringList();
63 if (strncmp(
p,
"?0", 2) == 0) {
66 filequeue->append(str);
68 }
else if (strncmp(
p,
"?1", 2) == 0) {
81 static void readmore() {
82 #if !defined(WIN32) && !defined(MAC)
84 char* cmd =
"ls $NEURONHOME/doc/help/*.help";
87 printf(
"couldn't do: %s\n", cmd);
90 while (fgets(
buf, 1024,
p)) {
96 #if !defined(WIN32) && !defined(MAC)
99 printf(
"online help not currently working\n");
101 if (help_pipe && ferror(help_pipe)) {
103 "error on the help pipe, restarting\n\
104 but will be missing this sessions hoc help text\n");
109 printf(
"Starting the help system\n");
111 sprintf(
buf,
"%s/ochelp",
"$NEURONHOME/bin/$CPU");
112 if ((help_pipe =
popen(
buf,
"w")) == (FILE*) 0) {
118 for (
long i = 0;
i < filequeue->count(); ++
i) {
119 fprintf(help_pipe,
"%s\n", filequeue->item_ref(
i).string());
121 filequeue->remove_all();
126 if (strncmp(s,
"?0", 2) == 0) {
139 #if defined(WIN32) || defined(MAC)
144 static bool ran_ochelp =
false;
148 printf(
"Could not connect to nrnbbs service\n");
151 if (!ran_ochelp && !
nrnbbs_look(
"ochelp running")) {
153 printf(
"Starting the help system\n");
156 printf(
"proper ochelp version not running\n");
162 for (
long i = 0;
i < filequeue->count(); ++
i) {
163 sprintf(
buf,
"%s\n", filequeue->item_ref(
i).string());
166 filequeue->remove_all();
169 if (strncmp(s,
"?0", 2) == 0) {
197 static const CursorPattern question_pat = {0x0000,
214 static const CursorPattern question_mask = {
217 #if !defined(UNIX) && (defined(WIN32) || defined(MAC))
static Cursor * help_cursor_
static void help(const char *)
static Cursor * help_cursor()
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
char * hoc_current_xopen(void)
void ivoc_help(const char *)
void nrnbbs_exec(const char *)
bool nrnbbs_look(const char *)
void nrnbbs_post_string(const char *, const char *)
#define declareList(List, T)
implementList(__AnyPtrList, __AnyPtr) static long ListImpl_best_new_sizes[]
FILE * popen(char *s1, char *s2)