Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions src/ivoc/ivocmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ std::ostream* OcIdraw::idraw_stream = 0;
#endif
/*****************************************************************************/
extern void ivoc_cleanup();
#if OCSMALL
static char* ocsmall_argv[] = {0, "difus.hoc"};
#endif
#if defined(WIN32) && HAVE_IV
extern HWND hCurrWnd;
#endif
Expand Down Expand Up @@ -513,13 +510,6 @@ nrniv [options] [fileargs]
#endif // !unix.

#if HAVE_IV
#if OCSMALL
our_argc = 2;
our_argv = new char*[2];
our_argv[0] = "Neuron";
our_argv[1] = ":lib:hoc:macload.hoc";
session = new Session("NEURON", our_argc, our_argv, options, properties);
#else
#if defined(WIN32)
if (hoc_usegui) {
session = new Session("NEURON", our_argc, (char**) our_argv, options, properties);
Expand Down Expand Up @@ -564,8 +554,6 @@ nrniv [options] [fileargs]
}
}

#endif /*OCSMALL*/

if (session) {
session->style()->find_attribute("NSTACK", hoc_nstack);
session->style()->find_attribute("NFRAME", hoc_nframe);
Expand Down Expand Up @@ -679,15 +667,9 @@ nrniv [options] [fileargs]
#if USENRNJAVA
nrn_InitializeJavaVM();
#endif
#if OCSMALL
if (argc == 1) {
ocsmall_argv[0] = our_argv[0];
exit_status = oc.run(2, ocsmall_argv);
Copy link
Copy Markdown
Member Author

@alkino alkino Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the reason I want to remove this macro because this code looks unable to compile due to the variable oc that is defined in an other "macro-hierarchy".

} else
#endif
#if defined(USE_PYTHON)
#if HAVE_IV
if (session && session->style()->value_is_on("python")) {
if (session && session->style()->value_is_on("python")) {
use_python_interpreter = 1;
}
#endif
Expand Down
28 changes: 0 additions & 28 deletions src/oc/audit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ maintain a list of xopen statements with the proper rcs version number.


static void hoc_audit_init(void) {
#if !OCSMALL
if (retrieve_audit.mode) {
/* clean up. there must have been an execerror */
retrieve_audit.mode = 0;
Expand All @@ -50,11 +49,9 @@ static void hoc_audit_init(void) {
retrieve_audit.pipe = (FILE*) 0;
}
}
#endif
}

void hoc_audit_from_hoc_main1(int argc, const char** argv, const char** envp) {
#if !OCSMALL
/*ARGSUSED*/
int i;
char buf[200];
Expand Down Expand Up @@ -101,10 +98,8 @@ void hoc_audit_from_hoc_main1(int argc, const char** argv, const char** envp) {
}
}
fprintf(faudit, "\n");
#endif
}

#if !OCSMALL
static void pipesend(int type, const char* s) {
int err;
if (audit_pipe) {
Expand All @@ -118,25 +113,19 @@ static void pipesend(int type, const char* s) {
fflush(audit_pipe);
}
}
#endif
void hoc_audit_command(const char* buf) {
#if !OCSMALL
if (doaudit) {
fprintf(faudit, "%s", buf);
}
#endif
}

void hoc_audit_from_xopen1(const char* fname, const char* rcs) {
#if !OCSMALL
if (!hoc_retrieving_audit() && doaudit && !rcs) {
pipesend(1, fname);
}
#endif
}

void hoc_audit_from_final_exit(void) {
#if !OCSMALL
if (faudit) {
fclose(faudit);
faudit = 0;
Expand All @@ -146,20 +135,16 @@ void hoc_audit_from_final_exit(void) {
audit_pipe = 0;
}
doaudit = 0;
#endif
}

void hoc_Saveaudit(void) {
int err;
#if !OCSMALL
err = hoc_saveaudit();
#endif
hoc_ret();
hoc_pushx((double) err);
}

int hoc_saveaudit(void) {
#if !OCSMALL
static int n = 0;
char buf[200];
if (hoc_retrieving_audit() || !doaudit) {
Expand All @@ -178,34 +163,26 @@ int hoc_saveaudit(void) {
doaudit = 0;
return 0;
}
#endif
return 1;
}

int hoc_retrieving_audit(void) {
#if !OCSMALL
return retrieve_audit.mode;
#else
return 0;
#endif
}

void hoc_Retrieveaudit(void) {
int err, id;
#if !OCSMALL
if (ifarg(1)) {
id = (int) chkarg(1, 0., 1e7);
} else {
id = 0;
}
#endif
err = hoc_retrieve_audit(id);
hoc_ret();
hoc_pushx((double) err);
}

static void xopen_audit(void) {
#if !OCSMALL
char buf[200], *bp;
constexpr auto rm_str = "rm ";
strcpy(buf, rm_str);
Expand All @@ -218,11 +195,9 @@ static void xopen_audit(void) {
#if 1
nrn_assert(system(buf) >= 0);
#endif
#endif
}

int hoc_retrieve_audit(int id) {
#if !OCSMALL
RetrieveAudit save;
char buf[200];
char retdir[200];
Expand All @@ -241,12 +216,10 @@ int hoc_retrieve_audit(int id) {
/* pclose(retrieve_audit.pipe);*/
retrieve_audit = save;
fprintf(stderr, "should now delete %s", retdir);
#endif
return 1;
}

void hoc_xopen_from_audit(const char* fname) {
#if !OCSMALL
char buf[200];
/* check the synchronization */
nrn_assert(fgets(buf, 200, retrieve_audit.pipe));
Expand All @@ -255,5 +228,4 @@ void hoc_xopen_from_audit(const char* fname) {
fprintf(stderr, "Warning: xopen_from_audit files have different names %s %s\n", fname, buf);
}
xopen_audit();
#endif
}
2 changes: 0 additions & 2 deletions src/oc/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ void hoc_debug(void) /* print the machine */

/* running copy of calls to execute */
void debugzz(Inst* p) {
#if !OCSMALL
{
if (p->in == STOP)
Printf("STOP\n");
Expand Down Expand Up @@ -151,7 +150,6 @@ void debugzz(Inst* p) {
}
p++;
}
#endif /*OCSMALL*/
}

#if NRN_DIGEST
Expand Down
7 changes: 0 additions & 7 deletions src/oc/getsym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
/* /local/src/master/nrn/src/oc/getsym.cpp,v 1.2 1996/02/16 16:19:26 hines Exp */
/*
getsym.cpp,v
* Revision 1.2 1996/02/16 16:19:26 hines
* OCSMALL used to throw out things not needed by teaching programs
*
* Revision 1.1.1.1 1994/10/12 17:22:08 hines
* NEURON 3.0 distribution
*
Expand Down Expand Up @@ -59,9 +56,6 @@ getsym.cpp,v

hoc_execstr(char *s) compiles and executes the string
*/
#if OCSMALL
#else

#include "hocgetsym.h"
#include "parse.hpp"
#include "hocparse.h"
Expand Down Expand Up @@ -172,4 +166,3 @@ void hoc_execstr(const char* cp) {
hoc_pc = pcsav;
hoc_free_list(&symlist);
}
#endif /*OCSMALL*/
36 changes: 1 addition & 35 deletions src/oc/hoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,11 @@ void start_profile(int i) {}
void add_profile(int i) {}
void pr_profile(void) {}

#if OCSMALL
#define READLINE 0
#endif

#ifndef READLINE
#define READLINE 1
#endif

#if READLINE
extern "C" {
extern char* readline(const char* prompt);
extern void rl_deprep_terminal(void);
extern void add_history(const char*);
}
#endif

int nrn_nobanner_;
int hoc_pipeflag;
Expand Down Expand Up @@ -958,7 +948,7 @@ void hoc_final_exit(void) {
/* Don't close the plots for the sub-processes when they finish,
by default they are then closed when the master process ends */
hoc_close_plot();
#if READLINE && !defined(MINGW)
#if !defined(MINGW)
rl_deprep_terminal();
#endif
ivoc_cleanup();
Expand Down Expand Up @@ -1482,7 +1472,6 @@ extern int run_til_stdin(); /* runs the interviews event loop. Returns 1

extern void hoc_notify_value(void);

#if READLINE
#ifdef MINGW
extern "C" int (*rl_getc_function)(void);
extern "C" int rl_getc(void);
Expand Down Expand Up @@ -1551,7 +1540,6 @@ static int event_hook(void) {
#endif /* not use_rl_getc_function */

#endif /* not MINGW */
#endif /* READLINE */
#endif /* INTERVIEWS */

/*
Expand Down Expand Up @@ -1629,7 +1617,6 @@ int hoc_get_line(void) { /* supports re-entry. fill hoc_cbuf with next line */
return EOF;
}
} else {
#if READLINE
if (nrn_fw_eq(hoc_fin, stdin) && nrn_istty_) {
char* line;
int n;
Expand Down Expand Up @@ -1691,27 +1678,6 @@ int hoc_get_line(void) { /* supports re-entry. fill hoc_cbuf with next line */
return EOF;
}
}
#else // READLINE
#if INTERVIEWS
if (nrn_fw_eq(hoc_fin, stdin) && hoc_interviews && !hoc_in_yyparse) {
run_til_stdin());
}
#endif // INTERVIEWS
#if defined(WIN32)
if (nrn_fw_eq(hoc_fin, stdin)) {
if (gets(hoc_cbuf) == (char*) 0) {
/*DebugMessage("gets returned NULL\n");*/
return EOF;
}
strcat(hoc_cbuf, "\n");
} else
#endif // WIN32
{
if (hoc_fgets_unlimited(hoc_cbufstr, hoc_fin) == (char*) 0) {
return EOF;
}
}
#endif // READLINE
}
errno = 0;
hoc_lineno++;
Expand Down
Loading
Loading