63 #define ZRO ((struct ENVIRONMENT *)0)
65 #define ENV_NOT_SAVED 0
77 double ctr = M_PI / 180.0;
78 double ctd = 180.0 / M_PI;
79 double sol = 299792458.0;
105 {
"Package Dir",
"LINUXPOPS_HOME",
pkg_home,
"/home/staff/tfolkers/cactus/linuxpops/linuxpops"},
106 {
"Data Dir",
"OBSDAT",
data_home,
"./linuxpops" },
107 {
"Obs Dir",
"HOME",
obs_home,
"./" },
108 {
"Obs Inits",
"OBSINIT",
obs_inits,
"sys" },
109 {
"Printer",
"PRINTER",
printer,
"lp" },
110 {
"Help Dir",
"LINUXPOPS_HELP_DIR",
help_home,
"../help" },
111 {
"Demo Dir",
"DEMO_DIR",
demo_dir,
"../demo" },
112 {
"Hostname",
"HOST",
hostname,
"Unknown_Host" },
113 {
"Session",
"LPSESSION",
session,
"12345" },
114 {
"Mailbox Defs",
"MAILBOXDEFS",
mailboxdefs,
"../mailboxdefs" },
115 {
"Site",
"SITE",
site_name,
"SITE_NONE" },
116 {
"Gnuplot Dir",
"LINUXPOPS_GNUPLOT",
gnuplot_ver,
"/usr/bin/gnuplot" },
118 { NULL, NULL, NULL, NULL }
152 { NULL, 0, NULL, NULL, 0, NULL }
155 #define MAX_DVARS_INIT ((sizeof(dvars_init) / sizeof(struct DVARS_INIT))-1)
167 if(nenv < 0 || nenv >=
MAX_ENV)
173 st_report(
"Clearing Environment %d", nenv);
190 strcpy(
dvars[j].
name, dvars_init[j].name);
219 for(i=0;i<ngs;i++,p++)
277 st_report(
"Reseting this environment to the defaults");
279 st_report(
"Be Sure to set a data filename and 'name' this environment");
293 case 0:
_h0();
break;
294 case 1:
_h1();
break;
295 case 2:
_h2();
break;
296 case 3:
_h3();
break;
297 case 4:
_h4();
break;
298 case 5:
_h5();
break;
299 case 6:
_h6();
break;
300 case 7:
_h7();
break;
301 case 8:
_h8();
break;
302 case 9:
_h9();
break;
328 st_fail(
"Environment Index %d out of range; Valid Range: 0 to %d", tmp,
MAX_ENV-1);
335 st_warn(
"Missing Arg for setEnv()");
353 st_warn(
"Missing Arg for nameEnv()");
369 st_report(
"Previously Defined Environments:");
370 st_report(
"Env Title Mode SMT Source Freq Data File");
386 st_report(
"%2d%s %16.16s %9.9s %d %12.12s %6.2f %16.16s", i, active,
397 st_report(
"%2d%s %16.16s", i, active,
"Unused");
407 int src = 0, dest = 0, len;
421 if(src < 0 || src > (
MAX_ENV-1))
423 st_fail(
"Source Environment Index: %d, out of range", src);
428 if(dest < 0 || dest > (
MAX_ENV-1))
430 st_fail(
"Destination Environment Index: %d, out of range", dest);
437 st_fail(
"Source & Destination are the same: %d %d", src, dest);
441 st_report(
"Coping Environment %d to %d", src, dest);
447 st_report(
"Force Reloading Current Env");
479 char *cp, tbuf[256], cmdBuf[256];
500 sprintf(cmdBuf,
"gnuplot -V");
502 if( (fp = popen(cmdBuf,
"r") ) <= (FILE *)0 )
504 st_fail(
"getEnvironment(): Unable to open %s", cmdBuf);
509 bzero(tbuf,
sizeof(tbuf));
512 while((cp = fgets(tbuf,
sizeof(tbuf), fp)) != NULL)
552 static char buffer[4096];
555 if(!(p = strstr(str, orig)))
560 strncpy(buffer, str, p-str);
561 buffer[p-str] =
'\0';
563 sprintf(buffer+(p-str),
"%s%s", rep, p+strlen(orig));
590 st_report(
"substituteEnv(): Comparing if: %s is in: %s", tbuf,
args->
tok[i]);
604 st_report(
"substituteEnv(): New value: %s ", cp);
642 strcpy(
env->
title,
"Online Filters");
662 strcpy(
env->
title,
"Online Filters");
726 st_fail(
"No Environment Saved");
char * strcmprs(char *str)
struct PARSE_STACK * args
int deNewLineIt(char *buf)
int initGnuplotBackground()
struct ENVIRONMENT envrs[MAX_ENV]
struct DYNAMIC_VARIABLES dvars[MAX_DYN_VARS]
int findDataVersion(char *ini, char *dir)
char tok[MAX_TOKENS][MAX_TOKENS]
struct ENVIRONMENT savedEnv
struct ENV_VARIABLES env_vars[]
struct GLOBAL_MEMORY * CGM
struct DVARS_INIT dvars_init[]
char * replace_str(char *str, char *orig, char *rep)
void subArgs(int wt, const char *fmt,...)
#define LAST_PLOT_SPEC_ACCUM