Browse Source

if SHARED_MODULE, exclude some unused function from build.

Finally complete main.c should be removed in shared ngspice.
pre-master-46
Holger Vogt 5 years ago
parent
commit
55359e36e0
  1. 14
      src/main.c

14
src/main.c

@ -165,8 +165,10 @@ struct variable *(*if_getparam)(CKTcircuit *ckt, char **name, char *param, int i
/* static functions */ /* static functions */
int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator); int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator);
#ifndef SHARED_MODULE
static ATTRIBUTE_NORETURN void sp_shutdown(int exitval); static ATTRIBUTE_NORETURN void sp_shutdown(int exitval);
static void app_rl_readlines(void); static void app_rl_readlines(void);
#endif /* SHARED_MODULE */
#if defined(HAVE_GNUREADLINE) || defined(HAVE_BSDEDITLINE) #if defined(HAVE_GNUREADLINE) || defined(HAVE_BSDEDITLINE)
static char *prompt(void); static char *prompt(void);
@ -176,13 +178,14 @@ static int app_event_func(void);
#endif #endif
#endif #endif
#ifndef SHARED_MODULE
static void show_help(void); static void show_help(void);
static bool read_initialisation_file(const char *dir, const char *name); static bool read_initialisation_file(const char *dir, const char *name);
#ifdef SIMULATOR #ifdef SIMULATOR
static void append_to_stream(FILE *dest, FILE *source); static void append_to_stream(FILE *dest, FILE *source);
#endif #endif
#endif /* SHARED_MODULE */
extern IFsimulator SIMinfo; extern IFsimulator SIMinfo;
#ifdef SIMULATOR #ifdef SIMULATOR
@ -511,7 +514,7 @@ SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator)
} /* end of function SIMinit */ } /* end of function SIMinit */
#ifndef SHARED_MODULE
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* Shutdown gracefully. */ /* Shutdown gracefully. */
static ATTRIBUTE_NORETURN void static ATTRIBUTE_NORETURN void
@ -528,6 +531,7 @@ sp_shutdown(int exitval)
exitval = EXIT_NORMAL; exitval = EXIT_NORMAL;
exit(exitval); exit(exitval);
} }
#endif
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
@ -593,6 +597,7 @@ app_event_func(void)
#endif #endif
#ifndef SHARED_MODULE
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* This is the command processing loop for spice and nutmeg. /* This is the command processing loop for spice and nutmeg.
The function is called even when GNU readline is unavailable, in which The function is called even when GNU readline is unavailable, in which
@ -672,7 +677,6 @@ app_rl_readlines(void)
} /* end of function app_rl_readlines */ } /* end of function app_rl_readlines */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static void static void
show_help(void) show_help(void)
@ -768,8 +772,6 @@ static bool read_initialisation_file(const char *dir, const char *name)
return result; return result;
} /* end of function read_initialisation_file */ } /* end of function read_initialisation_file */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static void print_news(void) static void print_news(void)
{ {
@ -786,7 +788,7 @@ static void print_news(void)
} }
} }
} /* end of function print_news */ } /* end of function print_news */
#endif
#ifdef HAS_WINGUI #ifdef HAS_WINGUI
#define main xmain #define main xmain

Loading…
Cancel
Save