/* Setup procedure */ #include "common.h" #define PPREFIX "con_" /* prefix for names of permanent files */ #define TPREFIX "tmp_" /* prefix for names of temporary files */ #define USERDIR 0 /* don't show User Directory: it is always set to . */ #define PAL 0 /* don't show Palette */ /* Platform-dependent constants */ #if _WIN #define EXT_C ".c" #define EXT_CPP ".cpp" #define EXT_H ".h" #define EXT_OBJ ".obj" #ifdef WIN32 #define EXT_RUN ".bat" #else #define EXT_RUN ".pif" #endif #define EXT_BAT ".bat" #define EXT_LIB ".dll" #define EXT_ARCH ".cat" #define EXT_TEMP ".tmp" #define EXT_SYS ".cpf" #define EXT_DESC ".con" #define EXT_DIAG ".dgm" #define EXT_PS ".ps" #define EXT_ES ".es" /* exported system file */ #define EXT_ED ".ed" /* exported diagram file */ #define EXT_EC ".ec" /* exported curve file */ #define DIRECTORY ".\\" #define CONFIG_FILE APP_NAME".ini" #define FORBID_CHARS " /~.," #define SETFIL_DIR ".\\" #define RDONLY_DIR "\\content\\" #define WRITE_DIR ".\\" #ifdef WIN32 #define CC "bcc32 -tWDE" #define COMPCOMP_OPT " -O2 -ff -3" #define COMPLINK_OPT "" #define COMPINCL_OPT "-Ic:\\bc5\\include" #define COMPINCL_OPTE ";" #define COMPLIB_OPT "-Lc:\\bc5\\lib" #define COM_CERRLINEO "Error line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "Error: %[^"STR_NL"]" #define CPP "bcc32 -tWC" #define W2(p) " "#p #define W1(p) W2(p) #define COM_RHSATTR W1(FAR PASCAL)" _export" #else /* WIN32 */ #define CC "bcc -WDE" #define COMPCOMP_OPT " -O2 -ff -f287 -ml -2" #define COMPLINK_OPT "" #define COMPINCL_OPT "-Ic:\\borlandc\\include" #define COMPINCL_OPTE ";" #define COMPLIB_OPT "-Lc:\\borlandc\\lib" #define COM_CERRLINEO "Error line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "Error: %[^"STR_NL"]" #define CPP "bcc -tDe" #define COM_RHSATTR "far pascal _export" #endif /* WIN32 */ #endif #if _MAC #error "EXT_C" is undefined #error "EXT_CPP" is undefined #error "EXT_H" is undefined #error "EXT_OBJ" is undefined #error "EXT_RUN" is undefined #error "EXT_BAT" is undefined #error "EXT_LIB" is undefined #error "EXT_ARCH" is undefined #error "EXT_TEMP" is undefined #error "EXT_SYS" is undefined #error "EXT_DESC" is undefined #error "EXT_DIAG" is undefined #error "EXT_PS" is undefined #error "EXT_ES" is undefined #error "EXT_ED" is undefined #error "EXT_EC" is undefined #error "DIRECTORY" is undefined #error "COM_RHSATTR" is undefined #error "CONFIG_FILE": APP_NAME".cnf" #define FORBID_CHARS " " #error "SETFIL_DIR" is undefined #error "RDONLY_DIR" is undefined #error "WRITE_DIR" is undefined #error "COMPCOMP_OPT" is undefined #error "COMPLINK_OPT" is undefined #error "COMPINCL_OPT" is undefined #error "COMPINCL_OPTE" is undefined #error "COMPLIB_OPT" is undefined #error "COM_CERRLINEO" is undefined #error "COM_LERRLINEI" is undefined #error "CPP" is undefined #endif #if _UNIX #define EXT_C ".c" #define EXT_CPP ".cc" #define EXT_H ".h" #define EXT_OBJ ".o" #define EXT_RUN STR_EMPTY #define EXT_BAT STR_EMPTY #define EXT_ARCH ".cat" #define EXT_TEMP ".tmp" #define EXT_SYS ".cpf" #define EXT_DESC ".con" #define EXT_DIAG ".dgm" #define EXT_PS ".ps" #define EXT_ES ".es" /* exported system file */ #define EXT_ED ".ed" /* exported diagram file */ #define EXT_EC ".ec" /* exported curve file */ #define DIRECTORY "./" #define COM_RHSATTR STR_EMPTY #define CONFIG_FILE "."APP_NAME"rc" #define FORBID_CHARS " \\," #define RDONLY_DIR "" #define WRITE_DIR "." #define SETFIL_DIR WRITE_DIR #define COMPINCL_OPTE " -I" #ifdef _UNIX_SGI #define UnIx_DeFiNeD #define EXT_LIB ".so" #define LD "ld" #define COMPCOMP_OPT " -O2 -32" /* optimize, 32-bit objects */ #define COMPLINK_OPT " -shared -32" /* create Shared Object (.so) */ #define COM_CERRLINEO "! Error: in line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "Warning: %[^"STR_NL"]" #define COMPINCL_OPT "" #define COMPLIB_OPT "-lc -lm" #define CPPLIB_OPT COMPCOMP_OPT" -lc -lm" #define CPP "CC" #endif /* _UNIX_SGI */ #ifdef _UNIX_SOL #define UnIx_DeFiNeD #define EXT_LIB ".so" #define COMPCOMP_OPT " -O2 -Xa" /* optimize and ANSI */ #define COMPLINK_OPT " -G" /* create Shared Object (.so) */ #define COM_CERRLINEO "! Error: in line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "ld: fatal: %[^\\]" #define COMPINCL_OPT "" #define COMPLIB_OPT "-lc -lm" #define CPPLIB_OPT " -O2 -lc -lm" #define LD "ld" #define CPP "CC" #endif /* _UNIX_SOL */ #ifdef _UNIX_HP #define UnIx_DeFiNeD #define EXT_LIB ".sl" #define LD "ld" #define COMPCOMP_OPT " +z -O -Aa -D_HPUX_SOURCE" /* PIC, optimize, ANSI */ #define COMPLINK_OPT " -b" /* create Shared Library (.sl) */ #define COM_CERRLINEO "! Error: in line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "Warning: %[^"STR_NL"]" #define COMPINCL_OPT "" #define COMPLIB_OPT "-lc -lm" #define CPPLIB_OPT COMPCOMP_OPT" -lc -lm" #define CPP "CC" #endif /* _UNIX_HP */ #ifdef _UNIX_ALF #define UnIx_DeFiNeD #define EXT_LIB ".so" #define COMPCOMP_OPT " -std -O2" /* ANSI, optimize */ #define COMPLINK_OPT " -shared" /* create Shared Object (.so) */ #define COM_CERRLINEO "! Error: in line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "Warning: %[^"STR_NL"]" #define COMPINCL_OPT "" #define COMPLIB_OPT "-lc -lm" #define CPPLIB_OPT COMPCOMP_OPT" -lc -lm" #define LD "ld" #define CPP "c++" #endif /* _UNIX_ALF */ #ifdef _UNIX_R6K #define UnIx_DeFiNeD #define EXT_LIB ".so" #define LD "cc" #define COMPCOMP_OPT " -O2 -qattr" /* optimize, 32-bit objects */ #define COMPLINK_OPT " -W l,-bM:SRE -W l,-bE:$1.exp -W l,-berok" /* create Shared Object (.so) */ #define COM_CERRLINEO "! Error: in line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "Warning: %[^"STR_NL"]" #define COMPINCL_OPT "" #define COMPLIB_OPT "-lc -lm" #define CPPLIB_OPT COMPCOMP_OPT" -lC -lm" #define CPP "cc -+" #endif /* _UNIX_R6K */ #ifdef _UNIX_LNX #define UnIx_DeFiNeD #define EXT_LIB ".so" #define LD "cc" #define COMPCOMP_OPT " -O2 -fPIC" /* optimize+PIC */ #define COMPLINK_OPT " -shared -Wl,-soname,$2.so" /* create Shared Object (.so) */ #define COM_CERRLINEO "! Error: in line %i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "Warning: %[^"STR_NL"]" #define COMPINCL_OPT "" #define COMPLIB_OPT "-lc -lm" #define CPPLIB_OPT COMPCOMP_OPT" -lc -lm" #define CPP "c++" #endif /* _UNIX_LNX */ #ifdef COMP_GNU /* SunOs 4 + gcc */ #define COMPCOMP_OPT " -O2" /* optimize */ #define COMPLINK_OPT " -shared" /* create Shared Object (.so) */ #define COM_CERRLINEO "!.c:%i: $("SFS_COMPILER".CURERMSG)" #define COM_LERRLINEI "ld: fatal: %[^\\]" #define COMPINCL_OPT "" #define COMPLIB_OPT "-lc -lm" #define CPPLIB_OPT COMPCOMP_OPT" -lc -lm" #define LD "ld" #define CPP "g++" #define UnIx_DeFiNeD #endif /* COMP_GNU */ #ifdef UnIx_DeFiNeD #undef UnIx_DeFiNeD #else #error Unsupported version of Unix #endif #endif /* _UNIX */ Local(CharPtr) SetData[]={ ";", "["SFS_PATHS"]", "KERNEL=", "KERNELW=", "INCLUDE=$("SFS_PATHS".KERNEL)", ";", "["SFS_EXTENSIONS"]", "C="EXT_C, "CPP="EXT_CPP, "H="EXT_H, "OBJ="EXT_OBJ, "RUN="EXT_RUN, "BAT="EXT_BAT, "LIB="EXT_LIB, "ARCH="EXT_ARCH, "TEMP="EXT_TEMP, "SYS="EXT_SYS, "DESC="EXT_DESC, "DIAG="EXT_DIAG, "PS="EXT_PS, "ES="EXT_ES, "ED="EXT_ED, "EC="EXT_EC, ";", "["SFS_LIBRARIES"]", "RHSLIB=", "WINLIB=", "PARLIB=", "UDFLIB=", "WINCLASSLIB=", "FORMAT=$("SFS_PATHS".KERNEL)%s$("SFS_EXTENSIONS".LIB)", "LIBNAME=", "AUTODIF=$("SFS_PATHS".KERNEL)contdiff$("SFS_EXTENSIONS".LIB)", "AUTODIFOPT=+", "HELPLIB=$("SFS_PATHS".KERNEL)conthelp$("SFS_EXTENSIONS".LIB)", ";", "["SFS_FUNCTIONS"]", "AUTODIF=autodif", ";", "["SFS_FILES"]", "TEMP=$("SFS_PATHS".KERNELW)tmp$("SFS_EXTENSIONS".TEMP)", "TEMP2=$("SFS_PATHS".KERNELW)tmp2$("SFS_EXTENSIONS".TEMP)", "NAMES=$("SFS_PATHS".KERNELW)filenums$("SFS_EXTENSIONS".SYS)", "NAMES1.2=$("SFS_PATHS".KERNELW)filenums$("SFS_EXTENSIONS".DESC)", "FORMAT=cont%04x", "VN=$("SFS_PATHS".KERNELW)visuals$("SFS_EXTENSIONS".SYS)", "RHS="TPREFIX"sys", "WIN="TPREFIX"win", "PAR="TPREFIX"par", "DER="TPREFIX"der", "UDF="TPREFIX"udf", "STAGEN=stagen1$("SFS_EXTENSIONS".H)", "CLASSFILE=$("SFS_PATHS".KERNEL)classes$("SFS_EXTENSIONS".DESC)", "CLASSFILECUR=$("SFS_PATHS".KERNEL)%s$("SFS_EXTENSIONS".DESC)", "INITFILE=$("SFS_PATHS".KERNEL)init$("SFS_EXTENSIONS".SYS)", "PALETTE=$("SFS_PATHS".KERNELW)palette$("SFS_EXTENSIONS".SYS)", ";", "["SFS_MAINWIN"]", "OPTMASK=+-+++++++++", ";", "["SFS_CURRENTS"]", "; Set LOCK to - to run Content after a crash", "LOCK=-", "; Set STARTUP to 1 to run Content without active system after crash", "STARTUP=0", "CLASSCUR=", "DIRECTORY="DIRECTORY, "ARCHIVE="APP_NAME"$("SFS_EXTENSIONS".ARCH)", "SYSFONT=*", "PRGFONT=*", "W_MAIN=1/0,1/0", "W_CURVE=-50/0,-50/0", "W_POINT=-50/0,-50/0", "W_HELPS=-1/0,-99/0", /* search */ "W_HELP=-99/0,-99/0", /* main win */ "S_HELP=0.65,0.85", /* panel's dims rel to screenRect */ ";", "["SFS_CURVES"]", "UNTITLED=***", "UNTITLEDMAX=2", "FILTER=1,500,1", "KEYS=space esc space enter", #if _WIN "MOUSE=1", #endif #if _UNIX "MOUSE=0", #endif "EXPORTOP=.", ";", "["SFS_COMPILER"]", "INCLUDE=", "LIB=", #if _UNIX /***&& DEB==0***/ "CPPNAME=", "CPPLIB=", #endif "LOGFILE=ErrLog", "SOURCE=", "TARGET=", /* It must be blank */ "DIFF=n", "BATCH=$("SFS_PATHS".KERNEL)CompRhs$("SFS_EXTENSIONS".BAT)", "MAKERHS=$("SFS_PATHS".KERNEL)CompRhs$("SFS_EXTENSIONS".RUN)" " $("SFS_COMPILER".SOURCE) $("SFS_COMPILER".TARGET)" " $("SFS_COMPILER".DIFF)", #if _WIN "RESPONSE=$("SFS_PATHS".KERNEL)response$("SFS_EXTENSIONS".SYS)", #endif /* _WIN */ "HEADERF="PPREFIX"sys$("SFS_EXTENSIONS".H)", "HEADER=#include \"$("SFS_COMPILER".HEADERF)\""STR_NL, "HEADERPAR=#include \"$("SFS_FILES".STAGEN)\""STR_NL "#include "STR_NL, "RHSATTR="COM_RHSATTR, #if _WIN "CERRLINEO=$("SFS_COMPILER".SOURCE)$("SFS_EXTENSIONS".C)"COM_CERRLINEO, "LERRLINEI="COM_LERRLINEI, #endif #if _MAC "CERRLINEO=$("SFS_COMPILER".SOURCE)$("SFS_EXTENSIONS".C)"COM_CERRLINEO, "LERRLINEI="COM_LERRLINEI, #endif #if _UNIX "CERRLINEO=$("SFS_COMPILER".SOURCE)$("SFS_EXTENSIONS".C)"COM_CERRLINEO, "LERRLINEI="COM_LERRLINEI, #endif "CURERMSG=", #if ED "EXTDIFFB=$("SFS_PATHS".KERNELW)CompDiff$("SFS_EXTENSIONS".BAT)", #if _MAC #endif /* _MAC */ #if _WIN "EXTDIFF=maple -q <%s >tmp.1"STR_NL"sort tmp.2"STR_NL"grep \"[ts][0-9]* =\" tmp.3"STR_NL"awk_win tmp.4"STR_NL"copy /B tmp.4+tmp.1 %s >nul"STR_NL, #endif /* _WIN */ #if _UNIX "EXTDIFF=maple -q <%s >tmp.mo;grep '[ts][0-9]* =' tmp.mo|awk '{print \"double \",$1,\";\"}'|sort -u|cat - tmp.mo >%s", #endif /* _UNIX */ #endif /* ED */ ";", "["SFS_VISUAL"]", "WINFILE=$("SFS_PATHS".KERNEL)windows$("SFS_EXTENSIONS".DESC)", "WINHEADER="TPREFIX"win$("SFS_EXTENSIONS".H)", "WINPAR=_ptr", "WINDEFA=#define %s ((double *)((char *)**($("SFS_VISUAL".WINPAR)+%i)+%u))"STR_NL, "WINDEFS=#define %s (*((double *)((char *)**($("SFS_VISUAL".WINPAR)+%i)+%u)))"STR_NL, "INCLUDE=#include "STR_NL"#include \"$("SFS_VISUAL".WINHEADER)\""STR_NL, #if _WIN "HCPRINTER=print %s", #endif #if _UNIX "HCVIEWER=ghostview -a5 -magstep 0 %s", "HCPRINTER=lpr %s", #endif ";", "["SFS_PARAMS"]", "FUNPAR1=_ptr", "PRECISION=7", ";", "["SFS_HELP"]", "FILES=content.hlp contds.hlp", #if _WIN "TEXT_FONT=MS Sans Serif,12", "FORMM_FONT=symbol,12", "FORMT_FONT=arial,12", "FORMML_FONT=symbol,22", "SCRT_FONT=arial,9", "SCRM_FONT=symbol,9", "JUMP_FONT=MS Sans Serif,12,b", "BOLD_FONT=MS Sans Serif,12,b", "PROG_FONT=Fixedsys,12", #endif #if _UNIX #define TS "14" #ifdef _UNIX_LNX #undef TS #define TS "18" #endif "TEXT_FONT=times,"TS, "FORMM_FONT=symbol,"TS, "FORMT_FONT=times,"TS, "FORMML_FONT=symbol,24", "SCRT_FONT=times,12,b", "SCRM_FONT=symbol,12", "JUMP_FONT=times,"TS",b", "BOLD_FONT=times,"TS",b", "PROG_FONT=helvetica,"TS",b", #undef TS #endif #if _MAC "TEXT_FONT=times,14", "FORMM_FONT=symbol,14", "FORMT_FONT=times,14", "FORMML_FONT=symbol,24", "SCRT_FONT=times,12,b", "SCRM_FONT=symbol,12", "JUMP_FONT=times,14,b", "BOLD_FONT=times,14,b", "PROG_FONT=times,14,b", #endif "JUMP_COLOR=0 0 255", ";", "[Window_2DGraphic]", "HARDCOPY=hardcopy$("SFS_EXTENSIONS".PS) 425.19685 340.15748 2 Times-Roman 10 2 2 1 f" #if _UNIX " t f", #else "", #endif #if _UNIX "NUMWIDTH=5", #else "NUMWIDTH=4", #endif ";", "[Window_3DGraphic]", "HARDCOPY=hardcopy$("SFS_EXTENSIONS".PS) 425.19685 340.15748 2 Times-Roman 10 2 2 1 f" #if _UNIX " t f", #else "", #endif #if _UNIX "NUMWIDTH=5", #else "NUMWIDTH=4", #endif ";", "[Window_Numeric]", "OPTIONS=6,t", ";", "[Window_ScrollTable]", "OPTIONS=100,6,t,t,t", "HARDCOPY=hardcopy.dat 1", ";", "["SFS_KERNELERRORS"]", "_NoMemory=cannot allocate memory", "_Open=cannot open file '%s'", "_IoError=i/o error in file '%s'", "_Tell=tell error"STR_NL"%s", "_Seek=cannot seek to %08lx", "_Read=cannot read %i bytes from %08lx", "_Write=cannot write %i bytes from %08lx", "LIBLOAD=- cannot load."STR_NL, #if _WIN "LIBLOAD0=System was out of memory, executable file was corrupt," "or relocations were invalid", "LIBLOAD2=File was not found", "LIBLOAD3=Path was not found", "LIBLOAD5=Attempt was made to dynamically link to a task," " or there was a sharing or network-protection error", "LIBLOAD6=Library required separate data segments for each task", "LIBLOAD8=There was insufficient memory to start the application", "LIBLOAD10=Windows version was incorrect", "LIBLOAD11=Executable file was invalid. Either it was not a Windows" " application or there was an error in the .EXE image", "LIBLOAD12=Application was designed for a different operating system", "LIBLOAD13=Application was designed for MS-DOS 4.0", "LIBLOAD14=Type of executable file was unknown", "LIBLOAD15=Attempt was made to load a real-mode application " "(developed for an earlier version of Windows)", "LIBLOAD16=Attempt was made to load a second instance of an " "executable file containing multiple data segments that " "were not marked read-only", "LIBLOAD19=Attempt was made to load a compressed executable file." " The file must be decompressed before it can be loaded", "LIBLOAD20=Dynamic-link library (DLL) file was invalid. One of" " the DLLs required to run this application was corrupt", "LIBLOAD21=Application requires 32-bit extensions", "WINEXEC=- cannot run."STR_NL, "WINEXECT=SetTimer cannot install a system timer", "FUNCADR=: function not found", #endif /* _WIN */ #if defined(_UNIX_HP) || defined (_UNIX_LNX) "LIBLOAD=- cannot load shared library", "FUNCADR=- function not found", #endif /* defined(PROC_HPPA) || defined (OS_UNIX_LINUX) */ "TRANSLN=Settings file '%s',"STR_NL"section '%s',"STR_NL"key '%s'"STR_NL"contains a " "reference to undefined value", "MENUMEM=CreateMenus:"STR_NL "$("SFS_KERNELERRORS"._NoMemory)", "DL_READ=DataLib '%s':"STR_NL"$("SFS_KERNELERRORS"._Read)", "DL_WRITE=DataLib '%s':"STR_NL"$("SFS_KERNELERRORS"._Write)", "DL_SEEK=DataLib '%s':"STR_NL"$("SFS_KERNELERRORS"._Seek)", "DL_TELL=DataLib '%s':"STR_NL"$("SFS_KERNELERRORS"._Tell)", "ED_MEM=Editor:"STR_NL "$("SFS_KERNELERRORS"._NoMemory)", "ED_VARS=You are about to change declaration of variables."STR_NL "This may invalidate all the curves stored in all diagrams."STR_NL "Do you want to delete all curves now?"STR_NL "If you don't, you will not be allowed to change number of variables", "ED_VARREP=You are not allowed to change number of variables", "ED_LEN1=The text length is greater than 32767 characters."STR_NL "Due to a limitation of the software Content is based on"STR_NL "it is not possible to determine position of the cursor"STR_NL "and the selected text (if any)."STR_NL STR_NL, "ED_LEN2=To avoid the limitation put your text into a separate file"STR_NL "and include it via the #include directive."STR_NL STR_NL, "ED_TEXTLONG=$("SFS_KERNELERRORS".ED_LEN1)$("SFS_KERNELERRORS".ED_LEN2)" "Your request has been ignored.", "ED_WRTLONG=?ync$("SFS_KERNELERRORS".ED_LEN1)$("SFS_KERNELERRORS".ED_LEN2)" "Press the 'Yes' button if you are sure the selected text"STR_NL "is within first 32767 characters."STR_NL "Press the 'No' button to write the whole text.", "CT_OPEN=CurveTypes: $("SFS_KERNELERRORS"._Open)", "CT_REF=CurveTypes: invalid reference in line"STR_NL"'%s'", "CT_TYPE=CurveTypes: invalid type '%i'", "CT_INVAL=CurveTypes: invalid description in"STR_NL"'%s'", "CT_TFN=CurveTypes, file '%s':"STR_NL"The total number of test functions in the " SECPRF"testfuncs section differs from one in the "SECPRF"types section", "CT_TFM=CurveTypes: Different number of test functions in the "SECPRF"types section, line %i", "CT_PFN=CurveTypes, file '%s':"STR_NL"The total number of processors in the " SECPRF"procfuncs section differs from one in the "SECPRF"types section", "CT_TFC=CurveTypes: Invalid character '%c' in the "SECPRF"types section, line %i", "CT_SWITCH=Cannot switch to another curve:"STR_NL "there is no selected diagram or"STR_NL " number of untitled curve was set to 0", "CT_CONT=Cannot continue this curve:"STR_NL " no last point data associated with it", "CT_UNSUPP=%s->%s: not supported", "CT_FLT='%s' is an invalid value."STR_NL "%i will be used instead.", "VI_CLASS=Visualizer: unknown name of class:"STR_NL"'%s'", "VI_OPEN=Visualizer: $("SFS_KERNELERRORS"._Open)", "VI_WRITE=Visualizer: $("SFS_KERNELERRORS"._IoError)", "VI_MANY=Visualizer: too many windows", "VI_PAL=Visualizer: empty palette file '%s'", "VI_PARBUF=Visualizer: Cannot expand text, buffer is too small", "VI_WFE=Errors have been detected in a window function:"STR_NL""STR_NL"%s", "VI_EXPAND=%s is too small (%i)", "VI_EMPTY=An input field is empty."STR_NL"Set to '%s'", "PA_OPEN=ParBuildData: $("SFS_KERNELERRORS"._Open)", "PA_NODIAG=You cannot edit functional parameters when there is no selected diagram", "PA_ERRMSG=Error in functional parameter %s, line %i:"STR_NL"%s"STR_NL "IMPORTANT: it is strongly advised to correct the error"STR_NL "before you change curve/point type or quit Content."STR_NL, "AD_ERR=Cannot create a function for symbolical computation of %s."STR_NL "Messages issued by compiler/linker:", "AD_UD=You did not supply a function for computation of "STR_NL"%s", "AD_DF=Symbolical differentiation has failed."STR_NL STR_NL "This may be due to bugs in the specification"STR_NL "of your dynamical system."STR_NL "In such a case you'll get compiler's report.", "HC_OPEN=Hardcopy: $("SFS_KERNELERRORS"._Open)", "UT_EMPTY=Label or name is empty", "UT_DUPLICATE=Duplicate label or name", "UF_MANY=You are not allowed to have more than %i functions enabled.", "UF_NO=A user function used to detect this point"STR_NL "was deleted or is disabled", "DT_STR=Line in "SECPRF"deftypes section does not contain three labels:"STR_NL"'%s'", "DT_COMPCL=The number of lines in"SECPRF"compclass section differs from the number of types", "FU_NO=You must supply a function for"STR_NL"%s", "RHS_NO=You must supply equations"STR_NL, "IF_NOT=File does not contain an exported system (%i)", "IF_CLASS=Exported system belongs to the class"STR_NL " '%s'"STR_NL "The current class is '%s'", "IF_VERSION=Cannot export - an obsolete format", "ID_CREATE=Cannot create partition for diagram"STR_NL"%s", "ID_FILE=Cannot create diagram file"STR_NL"Error %i", "EC_NOPOINT=Use the list of names to choose coordinates to export", "SECONDCOPY=Content is still running or was not terminated properly."STR_NL "In the first case click 'Yes', otherwise click 'No'"STR_NL "Terminate now?", NULL }; /* Commnad file for rhs compilation */ Local(CharPtr) CompileRhs[]={ #if _WIN CC " @$("SFS_COMPILER".RESPONSE)" " -e%2$("SFS_EXTENSIONS".LIB)" " %1$("SFS_EXTENSIONS".C)" " >delete.me", " if not .%3 == .y goto end", " if not exist %2$("SFS_EXTENSIONS".LIB) goto end", " del tmp_der.exe", " del tmp_fun$("SFS_EXTENSIONS".C)", " del tmp_fun1$("SFS_EXTENSIONS".H)", CPP " -P @$("SFS_COMPILER".RESPONSE)" " -etmp_der.exe" " tmp_der$("SFS_EXTENSIONS".CPP)" " $("SFS_PATHS".KERNEL)autodif$("SFS_EXTENSIONS".OBJ)" " >$("SFS_COMPILER".LOGFILE)1", " if not exist tmp_der.exe goto compile", " tmp_der.exe", #if ED " if exist $("SFS_COMPILER".EXTDIFFB) call $("SFS_COMPILER".EXTDIFFB)", #endif /* ED */ ":compile", CC " @$("SFS_COMPILER".RESPONSE)" " -e%2$("SFS_EXTENSIONS".LIB)" " %1$("SFS_EXTENSIONS".C)" " >delete.me", ":end", " del" " %1$("SFS_EXTENSIONS".OBJ)", " rename" " delete.me" " $("SFS_COMPILER".LOGFILE)", #endif /* _WIN */ #if _UNIX "#! /bin/csh -f ", "unset noclobber", "cc" " -c"COMPCOMP_OPT " -o delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".INCLUDE)" " $1$("SFS_EXTENSIONS".C)" " >&$("SFS_COMPILER".LOGFILE)", #ifdef _UNIX_R6K "awk '/extern function/ { print $1 }' $1.lst >$1.exp; rm $1.lst", #endif LD COMPLINK_OPT " -o" " $2$("SFS_EXTENSIONS".LIB)" " delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".LIB)" " >>&$("SFS_COMPILER".LOGFILE)", #ifdef _UNIX_R6K "rm $1.exp", #endif "if ( $3 == 'y' ) then", " if ( -r $2$("SFS_EXTENSIONS".LIB) ) then", " if ( -r tmp_der ) then", " rm -f tmp_der tmp_fun$("SFS_EXTENSIONS".C) tmp_fun1$("SFS_EXTENSIONS".H)", " endif", " $("SFS_COMPILER".CPPNAME) " " -o tmp_der" " $("SFS_COMPILER".INCLUDE)" " tmp_der$("SFS_EXTENSIONS".CPP)" #if defined(_UNIX_R6K) || 1 /* always .o */ " $("SFS_PATHS".KERNEL)autodif$("SFS_EXTENSIONS".OBJ)" #else " $("SFS_PATHS".KERNEL)autodif$("SFS_EXTENSIONS".LIB)" #endif " $("SFS_COMPILER".CPPLIB)" " >&$("SFS_COMPILER".LOGFILE)1", " if ( -r tmp_der ) then", " tmp_der" " >>&$("SFS_COMPILER".LOGFILE)1", #if ED " if ( -r $("SFS_COMPILER".EXTDIFFB) ) then", " $("SFS_COMPILER".EXTDIFFB)", " endif", #endif /* ED */ " endif", " cc" " -c"COMPCOMP_OPT " -o delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".INCLUDE)" " $1$("SFS_EXTENSIONS".C)" " >&$("SFS_COMPILER".LOGFILE)", #ifdef _UNIX_R6K "awk '/extern function/ { print $1 }' $1.lst >$1.exp; rm $1.lst", #endif " "LD COMPLINK_OPT " -o" " $2$("SFS_EXTENSIONS".LIB)" " delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".LIB)" " >>&$("SFS_COMPILER".LOGFILE)", #ifdef _UNIX_R6K "rm $1.exp", #endif " endif", "endif", "rm" " -f" " delete$("SFS_EXTENSIONS".OBJ)", #endif /* UNIX */ #if _MAC ??? #endif NULL }; #if _UNIX /* Alternative commnad file(s) for rhs compilation */ Local(CharPtr) CompileRhsKsh[]={ "#! /bin/bash ", "unset noclobber", "cc" " -c"COMPCOMP_OPT " -o delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".INCLUDE)" " $1$("SFS_EXTENSIONS".C)" " >$("SFS_COMPILER".LOGFILE) 2>&1", #ifdef _UNIX_R6K "awk '/extern function/ { print $1 }' $1.lst >$1.exp; rm $1.lst", #endif LD COMPLINK_OPT " -o" " $2$("SFS_EXTENSIONS".LIB)" " delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".LIB)" " >>$("SFS_COMPILER".LOGFILE) 2>&1", #ifdef _UNIX_R6K "rm $1.exp", #endif "if [ $3 = 'y' ]; then", " if [ -r $2$("SFS_EXTENSIONS".LIB) ]; then", " if [ -r tmp_der ]; then", " rm -f tmp_der tmp_fun$("SFS_EXTENSIONS".C) tmp_fun1$("SFS_EXTENSIONS".H)", " fi", " $("SFS_COMPILER".CPPNAME) " " -o tmp_der" " $("SFS_COMPILER".INCLUDE)" " tmp_der$("SFS_EXTENSIONS".CPP)" #if defined(_UNIX_R6K) || 1 /* always .o */ " $("SFS_PATHS".KERNEL)autodif$("SFS_EXTENSIONS".OBJ)" #else " $("SFS_PATHS".KERNEL)autodif$("SFS_EXTENSIONS".LIB)" #endif " $("SFS_COMPILER".CPPLIB)" " >$("SFS_COMPILER".LOGFILE)1 2>&1", " if [ -r tmp_der ]; then", " tmp_der" " >>$("SFS_COMPILER".LOGFILE)1 2>&1", #if ED " if [ -r $("SFS_COMPILER".EXTDIFFB) ]; then", " $("SFS_COMPILER".EXTDIFFB)", " fi", #endif /* ED */ " fi", " cc" " -c"COMPCOMP_OPT " -o delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".INCLUDE)" " $1$("SFS_EXTENSIONS".C)" " >$("SFS_COMPILER".LOGFILE) 2>&1", #ifdef _UNIX_R6K "awk '/extern function/ { print $1 }' $1.lst >$1.exp; rm $1.lst", #endif " "LD COMPLINK_OPT " -o" " $2$("SFS_EXTENSIONS".LIB)" " delete$("SFS_EXTENSIONS".OBJ)" " $("SFS_COMPILER".LIB)" " >>$("SFS_COMPILER".LOGFILE) 2>&1", #ifdef _UNIX_R6K "rm $1.exp", #endif " fi", "fi", "rm" " -f" " delete$("SFS_EXTENSIONS".OBJ)", NULL }; /* Messages */ Local(WindoW) msgPrevWin; Local(void) msgCloseProc(WindoW win) { Remove(win); Select(msgPrevWin); } Local(void) helpMessage(CharPtr text) { WindoW win; GrouP g; CharPtr p,q,r; msgPrevWin=CurrentWindow(); win=FixedWindow(-50,-50,-stdCharWidth,-stdLineHeight,NULL,msgCloseProc); g=HiddenGroup(win,0,100,NULL); p=r=MemNew(StringLen(text)+1); StrCpy(p,text); do { q=StrChr(p,'\n'); if (q) *q='\0'; StaticPrompt(g,p,0,0,NULL,'l'); if (q) p=q+1; else break; } while (TRUE); MemFree(r); Show(win); } /* Shells */ Local(GrouP) gShellStyle,gShellPath; Local(TexT) tShellPath; typedef struct { CharPtr shell; CharPtr options; CharPtr PNTR batch; } Shell; static Shell shells[]={ {"csh", " -f", CompileRhs}, {"ksh", " ", CompileRhsKsh} }; Local(void) ShellStyleProc(GrouP g) { Int2 i; i=GetValue(g)-1; StrCpy(ParBuf,getenv("SHELL")); StrCat(ParBuf,shells[i].options); SetTitle(tShellPath,ParBuf); } #endif /* _UNIX */ #if _WIN Local(CharPtr) CompileResp[]={ COMPCOMP_OPT, " $("SFS_COMPILER".INCLUDE)", " $("SFS_COMPILER".LIB)", NULL }; #define helpMessage(text) Message(MSG_OK,text) #endif /* _WIN */ /* The run-time included header for rhs functions */ Local(CharPtr) IncludeRhs[]={ "#include ", STR_EMPTY, #if _WIN #ifdef WIN32 "#include ", "#pragma extref _floatconvert", /* to force BC++ to link in float-point formats */ #else "#pragma argsused", "int far pascal LibMain(unsigned hinst, unsigned wDataSeg, unsigned cbHeap, char * lpszCmdLine) {", " return 1;", "}", #endif STR_EMPTY, #endif "#define iff(cond,e1,e2) ((cond) ? (e1) : (e2))", "#define sqr(x) ((x)*(x))", "#define cube(x) ((x)*(x)*(x))", STR_EMPTY, "#define dersub2(i,j) ((i)+(((j)*((j)+1))>>1))", "#define dersub3(i,j,k) ((i)+(((j)*((j)+1))>>1)+(k)*((k)+1)*((k)+2)/6)", "#define dersub4(i,j,k,l) dersub3(i,j,k)+(l)*((l)+1)*((l)+2)*((l)+3)/24", "#define dersub5(i,j,k,l,m) dersub4(i,j,k,l)+(m)*((m)+1)*((m)+2)*((m)+3)*((m)+4)/120", STR_EMPTY, "#define FALSE 0", "#define TRUE 1", NULL }; /* Init file is the same for all object classes */ Local(CharPtr) init[]={ SECPRF"archive", "SELARCH_C=Waiting for Archives selection", SECPRF"curve", "ARCH_W=Archive filter", "IPOINT_W=Initial point", "PAUSE_W=Pause mode", "SELCURV_C=Waiting for Curve selection", "REDRAW_C=Redrawing...", "STA_C=Computing...", "SUS_C=Suspended", "LOAD_C=Loading starter and generator...", "SELINIT_C=Waiting for inital point selection", "FILTER_C=Waiting for filter changing", "PAUSEOPT_C=Waiting for pause mode setting", "EXPORTING_C=Exporting curve", "IMPORTING_C=Importing curve", "EXPORT_C=Waiting for Export parameters", "CUR_T=Curve", "SUSPEND_B=Suspend", "RESUME_B=Resume", "ABORT_B=Abort", "TAKE_B=Switch", "OPTARCHMU_P=Maximum number of untitled curves", "OPTARCHGF_T=Path filter", "OPTARCHMF_T=Trace filter", "OPTARCHCF_T=Coordinates filter", "OPTARCHFR_P=From", "OPTARCHTO_P=To", "OPTARCHST_P=Step", "PAUSE_T=Suspend computation", "PAUSES_B=At special points", "PAUSEE_B=At each point", "PAUSEN_B=Never", "PAUSEKEY_T=Hot keys", "MOUSE_B=Enable pause buttons", "LIST=38 20 ! listwidth listheight ! don't increase 38 - VGA!", "REDRAW_M=Curves{", "REDRAWALL_I=Redraw diagram", "REDRAWHI_I=Redraw curve", "REDRAWCL_I=Clear}", "SEPARATOR_I=-", "EXPORT_T=Export to file", "EXPORTOF_B=Browse", "EXPORTPT_T=Points", "EXPORTPTS_B=Export special points only", "EXPORTCO_T=Columns", "EXPORTCO_B=Output title", "EXPORTFO_P=Format", "EXPORTSN_T=Selected names", "LISTN=(10,12)", "EXPORTAN_T=Add name", "EXPORTDN_T=Delete name", "EXPORTPT_I=", "EXPORTFO_B=overwrite", "EXPORTFA_B=append", SECPRF"datalib", "LIST=38 20 ! listwidth listheight ! don't increase 38 - VGA!", "RENAME_T=New name:", "GROUP_T=Name of group:", "CREATE_T=Name:", "DELETE_T=Do you wish to delete"STR_NL"'%s'?", "DELETEGF_T=Cannot delete - the group is not empty", "DELETEALL_T=Do you wish to delete all items at the current level?", "SELECT_B=Select", "DESELECT_B=Deselect", "ESCAPE_B=\" Up \"", "CANCEL_B=Cancel", "HELP_B=Help", "SEPARATOR_I=-", "FUNCTION_M=Actions{", "RENAME_I=Rename...", "GROUP_I=Group...", "EDIT_I=Edit...", "CREATE_I=New...", "DELETE_I=Delete...", "DELETEALL_I=Delete all...", "IMPORT_I=Import...", "EXPORT_I=Export...", "DUMMYEND_I=}", SECPRF"diagram", "SELDIAG_C=Waiting for Diagram selection", "REDRAW_C=Redrawing...", "EXPORT_C=Waiting for Export parameters", "IMPORT_C=Waiting for Import parameters", "EXPORTING_C=Exporting diagram", "IMPORTING_C=Importing diagram", "SEL_T=Diagram", "EXPORT_T=Export to file", "IMPORT_T=Import from file", "EXPORTOF_B=Browse", "IMPORTOF_B=Browse", "EXPORTC_T=Export curves", "EXPORTCI_B=initial points only", "EXPORTCF_B=everything", SECPRF"dialog", "OK_B=\" Ok \"", "CANCEL_B=Cancel", "HELP_B=Help", "YES_B=\" Yes \"", "NO_B=\" No \"", "FIND_T=Text to find", "REPLACE_T=New text", "SELALL_B=Select all", "DESELALL_B=Deselect all", "REVSEL_B=Reverse selection", "SEPARATOR_I=-", "EDIT_M=Edit{", "COPY_I=Copy", "CUT_I=Cut", "PASTE_I=Paste", "CLEAR_I=Clear", "READ_I=Read from file...", "WRITE_I=Write to file...}", "SEARCH_M=Search{", "FIND_I=Find...", "FINDNEXT_I=Search again", "REPLACE_I=Replace...}", "EDIT_M=Help{", "EDITHELP_I=Editor commands}", "LSTDIM=(10,12) ! (ListLines,LineLen)", SECPRF"function", "EDITWINDOW=38 20 ! textwidth textheight ! don't increase 38 - VGA!", "SELSYST_C=Waiting for System selection", "CONTEXT_C=Compiling RHS...", "EDIT_C=Editing system specification", "EXPORT_C=Waiting for Export parameters", "IMPORT_C=Waiting for Import parameters", "EXPORTING_C=Exporting system", "IMPORTING_C=Importing system", "ERROR_T=Error messages", "DERI_T=Compute derivatives", "DERIN_T=- numerically", "DERIS_T=- symbolically", "DERIU_T=- by a routine", "DERI1_T=1st order", "DERI2_T=2nd order", "DERI3_T=3rd order", "DERI4_T=4th order", "DERI5_T=5th order", "FUNC_M=Specify", "FUNCH_I=RHS only", "FUNCV_I=Local functions", "SEL_T=System", "NAME1=First character of a name is not a letter"STR_NL, "NAMEDIM=Dimension must be a constant>1 enclosed in brackets, e.g. x[10]"STR_NL, "PHASE=Specify at least one phase variable"STR_NL, "COMPNUM=The number of names must be %s %i"STR_NL, "EXPORT_T=Export to file", "IMPORT_T=Import from file", "EXPORTOF_B=Browse", "IMPORTOF_B=Browse", "EXPORTD_T=Export diagrams", "EXPORTDN_B=don't export", "EXPORTDI_B=initial points only", "EXPORTDF_B=everything", SECPRF"mainwnd", "MAIN_C=Ready", "INIT_C=Initializing...", "MAINOPT_C=Waiting for options setting", "CURSYS=30", #if DEB "DEBUG_M=Debug{", #if DEB_VIS "VIEWVIS_I=Visual List", "WIN_I=Windows", #endif #if DEB_DL "VIEWCAT_I=View Archives", "VIEWDGM_I=View Diagrams", "VIEWSYS_I=View Special", "UPDATE_I=Enable update?", /* ? means status item */ #endif #if DEB_MEM "MEMTRACE_I=Memory trace?", /* ? means status item */ #endif #if DEB_CT "CURVETYPES_I=Curve Types", #endif "PARAMCLEAN_I=FuncParamCleanup", #endif "DUMMYEND_I=}", "SEPARATOR_I=-", "SYSTEMS_M=Select{", "CLASS_M=Class{", "ARCHIVES_I=Archive...", "FUNCTIONS_I=System...", "DIAGRAM_I=Diagram...", "CURVE_I=Curve...", "IPOINT_I=Initial point...", "USERTEST_I=User functions...", "EXIT_I=Exit", "WINDOWS_M=Window{", "CREATEG_I=Open graphics", "CREATET_I=Open text", "CREATEC_I=Open values", "REDRAW_I=Redraw diagram", "REDRAWC_I=Redraw curve", "CLEARALL_I=Clear all", "SHOWHIDDEN_I=Show hidden...", "TYPE_M=Type{", "COMPUTE_M=Compute{", "FORWARD_I=Forward", "BACKWARD_I=Backward", "CONTINUE_I=Extend", "OPTIONS_M=Options{", "SYSFONT_I=System font...", "PRGFONT_I=Text font...", "MAINWIN_I=Main window...", "ARCH_I=Archive filter...", "PAUSE_I=Pause mode...", "POINT_I=Special points...", "CLASS_T=Class", "ARCHNAME_T=Archive", "CURSYS_T=System", "DIAGRAM_T=Diagram", "CURVE_T=Curve", "INITTYPE_T=Point type", "CURVETYPE_T=Curve type", "DERIVATIVES_T=Derivatives", "STATUS_T=Status", "DURATION_T=Duration", "MESSAGE_T=Message", "OPTWIN_W=Main window", "OPTWIN_T=Show in Main Window", "HELP_M=Help{", "THISWIN_I=Main window", "INDEX_I=Index", "SEARCH_I=Search", "HELPPT_I=Point type", "HELPCT_I=Curve type", "HELPST_I=Starter", "HELPGE_I=Generator", "HELPAB_I=About CONTENT", "CREATE_M=Open{", SECPRF"param", "EDITWINDOW=38 20 ! textwidth textheight ! don't increase 38 - VGA!", "CONTEXT_C=Compiling functional parameters...", "EDIT_C=Editing functional parameter...", "EDIT_T=Edit...", "METHOD_I=Method", SECPRF"point", "OPT_C=Waiting for attributes changing", "POINT_I=Special points", "TYPE_P=Set options for points of type", "LABEL_B=Label", "MARKER_B=Marker", "SETCOLOR_B=Set color", "DEFCOLOR_B=Default color", "SAMPLE_T=Sample", "SCALE_T=Scale factor", SECPRF"visual", "CONTEXT_C=Compiling window functions...", "HIDDEN_C=Waiting for selection of window", "LIST_P=List of names", "SHW_T=Select window to show", SECPRF"userfunc", "WINTITLE=User functions", "ADD_B=Add", "DELETE_B=Delete", "RENAME_B=Rename", "DISABLE_B=Disable", "ENABLE_B=Enable", "LIST=15 10", "EDITOR=38 15 ! textwidth textheight ! don't increase 38 - VGA!", "LABEL=Label", "TITLE=Name", "CONTEXT_C=Compiling user-defined functions...", "USERFUNC_C=Defining user functions...", "ERROR_T=Error messages", SECPRF"markers", "C4", /* painted circle */ "c4", /* framed circle */ "c4p2l0u4l0d8p2l4u0r8u0", /* framed circle with + */ "c4p2l3u3r6d6p2l3d3r6u6", /* framed circle with x */ "s4", /* framed square */ "s4p4l4u4r8d8l0u8l8d8", /* framed square with diagonals */ "s4p2l4u0r8d0p2l0u4l0d8", /* framed square with + */ "s4p4l0u3l3d3r3d3r3u3", /* framed square with diamond */ "S4", /* painted square */ "p4l0u4l4d4r4d4r4u4", /* framed diamond */ "p8l4u0r4u4l0d8l4u4r8u0l4u4l0d8r4u4", /* framed diamond with diagonals */ "P4l0u4l4d4r4d4r4u4", /* painted diamond */ "p5l0u4l3d8r7u4l8u0r7d4", /* framed star */ "P5l0u4l3d8r7u4l8u0r7d4", /* painted star */ "p2l0u4l0d8p2l4u0r8u0p2l3u3r6d6p2l3d3r6u6", /* snow */ "p3l0u4l4d8r8u0", /* framed up arrow */ "P3l0u4l4d8r8u0", /* painted up arrow */ "p3l0d4l4u8r8u0", /* framed down arrow */ "P3l0d4l4u8r8u0", /* painted down arrow */ "p3l4u0r8d4l0u8", /* framed left arrow */ "P3l4u0r8d4l0u8", /* painted left arrow */ "p3r4u0l8d4l0u8", /* framed right arrow */ "P3r4u0l8d4l0u8", /* painted right arrow */ "p4l4u4r8u0l8d8r8u0", /* framed */ "P4l4u4r8u0l8d8r8u0", /* painted */ "p4l4u4l0d8r8u8l0d8", /* framed */ "P4l4u4l0d8r8u8l0d8", /* painted */ SECPRF"psfonts", /* PostScript fonts */ "Times-Roman", "Times-Italic", "Times-Bold", "Times-BoldItalic", "Helvetica", "Helvetica-Oblique", "Helvetica-Bold", "Helvetica-BoldOblique", "Courier", "Courier-Oblique", "Courier-Bold", "Courier-BoldOblique", NULL }; /* Don't create anymore the following files: - stdalg.con, - deri.con, - ode_g.con, - pde_1.con, - map_g.con. */ /* Palette */ Local(CharPtr) Palette[]={ #if _MAC ??? #endif #if _WIN /* rgb.par for __test.c, TEST==21 (127 255 128) ( 0 0 0) ( 0 0 0) (255 127 -128) (255 127 -128) ( 0 0 0) ( 0 0 0) (127 255 128) ( 0 0 0) ( 0 0 0) (255 127 -128) (255 127 -128) ( 0 0 0) ( 0 0 0) (255 127 -128) (127 255 128) ( 0 0 0) (127 255 128) (255 63 -64) (255 63 -64) (255 63 -64) */ "127 0 0", "255 0 0", "255 255 0", "127 127 0", "0 127 0", "0 255 0", "0 255 255", "0 127 127", "0 0 255", "0 0 127", "127 0 127", "255 0 255", "255 255 255", "191 191 191", "127 127 127", "63 63 63", #endif #if _UNIX /* Only basic colors (some of 48 colors defined in the vibrant vibextras.c file) */ "64 0 0", "128 0 0", "255 0 0", "255 255 128", "255 255 0", "255 128 0", "128 255 0", "128 128 0", "0 64 0", "0 128 0", "0 255 0", "0 255 255", "0 128 128", "0 64 64", "0 0 255", "0 0 160", "0 0 128", "0 0 64", "64 0 64", "128 0 128", "255 0 255", "255 255 255", "192 192 192", "128 128 128", "64 64 64", "0 0 0", /***** "128 64 0", "128 64 64", "128 0 64", "255 128 128", "128 255 128", "0 255 128", "128 255 255", "0 128 255", "255 128 192", "255 128 255", "0 255 64", "0 128 192", "128 128 192", "0 64 128", "128 128 255", "255 0 128", "0 128 64", "128 0 255", "64 0 128", "128 128 64", "64 128 128", ******/ #endif /* _UNIX */ NULL }; #if _WIN #pragma argsused #endif Local(Boolean) CreateFile(CharPtr file, CharPtr PNTR text, CharPtr filemode, Boolean trans) { FILE PNTR stream; #if _UNIX Char sfile[PATH_MAX]; int mode,i,m; StrCpy(sfile,file); chmod(file,0600); /* rw- --- --- (0600 is octal!) */ #endif stream=FileOpen(file,"wt"); if (stream) { for (; *text; text++) if (trans) { SetParam("TMP","TMP",*text); /* force symb.ref. replacement */ FilePuts(StrCat(GetParamString("TMP","TMP"),"\n"),stream); } else if (fprintf(stream,"%s\n",*text)==EOF) { Message(MSG_OK,"Cannot write file '%s'",file); break; } FileClose(stream); if (trans) SetParam("TMP",NULL,NULL); #if _UNIX /* filemode: rwxrwxrwx for user,group,other */ for (i=0,mode=0,m=0100; i<3; i++,m>>=3) { if (filemode[3*i+0]=='r') mode+=4*m; if (filemode[3*i+1]=='w') mode+=2*m; if (filemode[3*i+2]=='x') mode+=1*m; } chmod(sfile,mode); #endif return TRUE; } else { Message(MSG_OK,"Cannot open file '%s'",file); return FALSE; } } Local(GrouP) gC; Local(TexT) tKernel,tInclude,tLib; #if _MAC Local(TexT) tSettings; #endif #if USERDIR Local(TexT) tKernelW; #endif Local(GrouP) gInst; #define H_A_ED "The External differentiator input field specifies commands\n" \ "used by Content when it tries to build derivatives\n" \ "of 4th and 5th orders using 'symbolical differentiation' method.\n\n" \ "Currently Content can use the Maple system.\n\n" \ "Note for unix systems: you can instruct Content to run Maple\n" \ "on any particular machine:\n" \ " rsh maple -q <%s ...\n" \ "Don't forget to add the name of your machine to the .rhosts file.\n\n" \ "If the Maple system is not available, set this field to blank.\n" \ "In such a case only derivatives of orders 1, 2, and 3 may be\n" \ "computed 'symbolically'." #define H_A_PC "The Printer command input field specifies the command\n" \ "used by Content to print hardcopy files.\n" \ "The printer should be capable of printing PostScript files.\n\n" \ "If there is no printer available, set this field to blank." #define H_A_PP "The Postscript previewer input field specifies the command\n" \ "used by Content to visualize hardcopy files.\n\n" \ "If there is no previewer, set this field to blank." /* Adjustment */ Local(GrouP) gAdjust=NULL; struct { CharPtr Prompt; CharPtr Section; CharPtr Key; TexT Handle; IteM HelpItem; CharPtr HelpText; } Adjust[]={ #if _MAC #endif /* _MAC */ #if _WIN {"Printer command", SFS_VISUAL, "HCPRINTER", NULL,NULL, H_A_PC}, #if ED {"External differentiator", SFS_COMPILER, "EXTDIFF", NULL,NULL, H_A_ED}, #endif /* ED */ #endif /* _WIN */ #if _UNIX {"Printer command", SFS_VISUAL, "HCPRINTER", NULL,NULL, H_A_PC}, {"PostScript previewer", SFS_VISUAL, "HCVIEWER", NULL,NULL, H_A_PP}, #if ED {"External differentiator", SFS_COMPILER, "EXTDIFF", NULL,NULL, H_A_ED}, #endif /* ED */ #endif /* _UNIX */ {NULL,NULL,NULL,NULL} }; /* Help related things */ #define H_CONTDIR "Content directory input field specifies the directory that contains\n" \ "all Content executable and auxiliary files.\n\n" \ "For Full installation Content sets it to the current directory by default.\n\n" \ "For User installation you have to type in the full path to Content directory." #define H_C "The C compiler Include input field specifies compiler's options\n" \ "for directories that contain include files.\n" \ "If the field is blank, only standard (default) and the current\n" \ "directories will be searched.\n\n" \ "The C compiler Libraries input field specifies compiler's options\n" \ "used to access run-time libraries.\n\n" \ "Specifing the options you should follow notation for your host\n" \ "operating system and compiler.\n\n" \ "The options are put into the script/batch file named CompRhs.\n" \ "Content runs the file to compile specification of your dynamical\n" \ "systems.\n\n" \ "Usually you don't need to change these fields." #define H_CPP "The C++ compiler Name input field specifies the name of C++ compiler.\n\n" \ "The C++ compiler Options input field specifies options for\n" \ "the C++ compiler.\n\n" \ "The name and the options are put into the script/batch file\n" \ "named CompRhs. The compiler is called only when you request the\n" \ "'symbolical' method of calculation of derivatives. You choose the\n" \ "method when you specify your dynamical system.\n\n" \ "If there is no C++ compiler available, leave these fields unchanged.\n" \ "In such a case Conent disables the 'symbolical differentiation' feature." #define H_SHELL "The Shell Style switch and the Shell path input field specify the shell\n" \ "that Content will use to run the CompRhs script. The script is used to\n" \ "compile specification of dynamical systems.\n\n" \ "Content gets the default settings from the value of the SHELL environment\n" \ "variable. Shell styles are read from the shells.con file." #define H_INST "The Installation switch lets you choose between Full and User installations.\n\n" \ "The Full installation must be made prior any User installation and\n" \ "running Content. During Full Installation setup creates some files\n" \ "used by Content. For the Full Installation you should run the setup program\n" \ "from the directory that contains Content executable files.\n\n" \ "The User Installation should be done if you (or other user) want\n" \ "to be able to run Content from other directory. In such a case\n" \ "run setup from the directory and choose the User Installation.\n" \ "Running Content from different directory allows you to keep files\n" \ "created by Content for your dynamical systems separate from Content\n" \ "files and from files created for other users." Local(IteM) iKernel=NULL; Local(IteM) iC=NULL; Local(MenU) mAdjust=NULL; #if _UNIX Local(IteM) iShell=NULL; Local(IteM) iCpp=NULL; #endif /* _UNIX */ Local(IteM) iInst=NULL; Local(void) HelpProc(IteM i) { Int2 n; if (i==iKernel) {helpMessage(H_CONTDIR); return;} if (i==iC) {helpMessage(H_C); return;} for (n=0; ndel1;uname -a>del2;cat del1 del2" static Char msg[]= REGDATA "|mail victor@cwi.nl yuri@cwi.nl;" "rm del1 del2"; #endif Local(GrouP) gTerm; /* Setup button callback */ #if __BORLANDC__ #pragma argsused #endif Local(void) SetupProc(ButtoN b) { Int2 len,i,Inst; Char FullName[MAX(2*PATH_MAX+2*FILENAME_MAX+1,PAR_BUF)]; FILE PNTR sf; CharPtr p; CharPtr PNTR pp; #if _UNIX Boolean CompAuto; #endif Disable(gTerm); GetTitle(tKernel,FullName,sizeof(FullName)); len=(Int2)StrLen(FullName); if (!len) { Message(MSG_OK,"Specify full path to the CONTENT's home directory"); Enable(gTerm); return; } /* Check executable */ FileBuildPath(FullName,NULL,APP_NAME #if _WIN ".exe" #endif #if _UNIX "" #endif #if _MAC #error Executable file extension required #endif ); if (access(FullName,0)) { Message(MSG_OK,"The path you've specified does not contain CONTENT executable"); Enable(gTerm); return; } Inst=GetValue(gInst); /* Installation: 1 - full, 2 - user */ /* Get full filename of settings file and open it */ #if _MAC GetTitle(tSettings,FullName,sizeof(FullName)); #else StrCpy(FullName,SETFIL_DIR); #endif len=(Int2)StrLen(FullName); if (!len) { Message(MSG_OK,"Settings file directory must be specified"); Enable(gTerm); return; } /* Create the settings file */ FileBuildPath(FullName,NULL,CONFIG_FILE); if (CreateFile(FullName,SetData,"rw-r--r--",FALSE)) { GetConfigFilePath(); /* Store paths to kernel */ GetTitle(tKernel,FullName,sizeof(FullName)); /* Read-only */ FileBuildPath(FullName,NULL,NULL); /* append delim, if needed */ SetParam(SFS_PATHS,"KERNEL",FullName); #if USERDIR GetTitle(tKernelW,FullName,sizeof(FullName)); /* Writable */ #else StrCpy(FullName,WRITE_DIR); #endif FileBuildPath(FullName,NULL,NULL); /* append delim, if needed */ SetParam(SFS_PATHS,"KERNELW",FullName); /* Include and Lib options of the compiler */ GetTitle(tInclude,FullName,sizeof(FullName)); StrCat(StrCat(FullName,COMPINCL_OPTE),GetParam(SFS_PATHS,"KERNEL")); SetParam(SFS_COMPILER,"INCLUDE",FullName); GetTitle(tLib,FullName,sizeof(FullName)); SetParam(SFS_COMPILER,"LIB",FullName); #if _UNIX /***&& DEB==0***/ /* C++ compiler */ GetTitle(tCppName,FullName,sizeof(FullName)); SetParam(SFS_COMPILER,"CPPNAME",FullName); GetTitle(tCppLib,ParBuf,sizeof(ParBuf)); SetParam(SFS_COMPILER,"CPPLIB",ParBuf); sprintf(CompAutodif,"%s -c -o autodif"EXT_OBJ" autodif"EXT_CPP" %s",FullName,ParBuf); /* compile for full installation only! see below */ #endif for (i=0; i0 || difftime(stat_cpp.st_mtime,stat_o.st_mtime)>0; } if (CompAuto) { system(CompAutodif); if (access("autodif"EXT_OBJ,0)) { Message(MSG_OK,"Cannot compile autodif.cc.\n" "Symbolical differentiation feature will be disabled.\n" "Please check the name of C++ compiler\n" "and ensure it is accessable via the PATH variable"); SetParam(SFS_LIBRARIES,"AUTODIFOPT","-"); } } #endif #endif } else { /* user installation */ #if _UNIX #if DEB==0 /* Check autodif feature */ SetParam("TMP","TMP", #if defined(_UNIX_R6K) || 1 /* always .o */ "$("SFS_PATHS".KERNEL)autodif$("SFS_EXTENSIONS".OBJ)" #else "$("SFS_PATHS".KERNEL)autodif$("SFS_EXTENSIONS".LIB)" #endif ); GetParam("TMP","TMP"); if (access(ParBuf,0)) { Message(MSG_OK,"Could not run C++ compiler during the full installation.\n" "Symbolical differentiation feature will be disabled."); SetParam(SFS_LIBRARIES,"AUTODIFOPT","-"); } #endif /* DEB==0 */ #endif /* _UNIX */ } /* Remove datalib with definitions of visual classes */ unlink(GetParam(SFS_FILES,"VN")); } else { Message(MSG_OK,"Cannot open settings file '%s'",FullName); Enable(gTerm); return; } /* Create palette file */ CreateFile(GetParam(SFS_FILES,"PALETTE"),Palette,"rw-r--r--",FALSE); if (DescOpen(GetParam(SFS_FILES,"CLASSFILE"))) { if (FindLine(SECPRF"hierarchy")>=0) { #define buf CompAutodif GetLine(buf); sscanf(buf," %s %s",ParBuf,FullName); SetParam(SFS_CURRENTS,"CLASSCUR",ParBuf); GetParam(SFS_FILES,"CLASSFILECUR",FullName); /* force $(,) replacement */ SetParam(SFS_FILES,"CLASSFILECUR",ParBuf); #undef buf } DescClose(); } else { Message(MSG_OK,"Cannot open class description file\n%s",GetParam(SFS_FILES,"CLASSFILE")); Enable(gTerm); return; } #if _UNIX && DEB==0 if (bReg && GetStatus(bReg)==TRUE) { CharPtr p; p=StrChr(msg,'?'); if (p) *p=Inst==1 ? 'm' : 'u'; system(msg); } #endif QuitProgram(); } /* DialogText for pathes callback */ Local(void) PathCheckProc(TexT t) { Char path[PATH_MAX+1]; CharPtr cp; GetTitle(t,path,sizeof(path)); if ((cp=StrPBrk(path,FORBID_CHARS))!=NULL) { Beep(); StrCpy(cp,cp+1); /* erase illegal char */ SetTitle(t,path); } } #if PAL /* Palette panel draw callback */ static Int2 PALWIDTH; static void PaletteProc(PaneL p) { RecT rt; Int2 i; int r,g,b; GetPosition(p,&rt); for (i=0; i>1); mY=(Int2)(stdFontHeight>>1); w=FixedWindow(-50,-50,-10,-10,APP_NAME" "VERSION" setup",NULL); m=PulldownMenu(w,"Help"); /*----------------------------------------------*/ #if _WIN&0 /* _WIN as _UNIX */ g=NormalGroup(w,2,0,"Directories",NULL,NULL); #define DIR "" #else g=HiddenGroup(w,2,0,NULL); #define DIR " directory" #endif SetGroupMargins(g,mX,mY); SetGroupSpacing(g,mX,mY); #if _MAC StaticPrompt(g,"Settings file",0,dialogTextHeight,NULL,'l'); tSettings=DialogText(g,SETFIL_DIR,WIDTH,PathCheckProc); #endif StaticPrompt(g,"CONTENT"DIR,0,dialogTextHeight,NULL,'l'); tKernel=DialogText(g,RDONLY_DIR,WIDTH,PathCheckProc); iKernel=CommandItem(m,"CONTENT"DIR,HelpProc); #undef DIR #if USERDIR StaticPrompt(g,"User",0,dialogTextHeight,NULL,'l'); tKernelW=DialogText(g,WRITE_DIR,WIDTH,PathCheckProc); #endif /*----------------------------------------------*/ gC=NormalGroup(w,2,0,"C compiler",NULL,NULL); SetGroupMargins(gC,mX,mY); SetGroupSpacing(gC,mX,mY); StaticPrompt(gC,"Include",0,dialogTextHeight,NULL,'l'); tInclude=DialogText(gC,COMPINCL_OPT,WIDTH,NULL); StaticPrompt(gC,"Libraries",0,dialogTextHeight,NULL,'l'); tLib=DialogText(gC,COMPLIB_OPT,WIDTH,NULL); iC=CommandItem(m,"C compiler",HelpProc); #if _UNIX /***&& DEB==0***/ /*----------------------------------------------*/ gCpp=NormalGroup(w,2,0,"C++ compiler",NULL,NULL); SetGroupMargins(gCpp,mX,mY); SetGroupSpacing(gCpp,mX,mY); StaticPrompt(gCpp,"Name",0,dialogTextHeight,NULL,'l'); tCppName=DialogText(gCpp,CPP,WIDTH,NULL); StaticPrompt(gCpp,"Options",0,dialogTextHeight,NULL,'l'); tCppLib=DialogText(gCpp,CPPLIB_OPT,WIDTH,NULL); iCpp=CommandItem(m,"C++ compiler",HelpProc); #endif /*----------------------------------------------*/ if (DIM(Adjust)>1) { gAdjust=NormalGroup(w,2,0,"Tuning",NULL,NULL); mAdjust=SubMenu(m,"Tuning"); SetGroupMargins(gAdjust,mX,mY); SetGroupSpacing(gAdjust,mX,mY); for (i=0; idel3"); f=fopen("del3","r"); if (f) { gReg=NormalGroup(w,0,10,"Registration",NULL,NULL); SetGroupMargins(gReg,mX,mY); SetGroupSpacing(gReg,mX,mY); bReg=CheckBox(gReg,"I authorize the following e-mail message be sent to the authors:",NULL); SetStatus(bReg,FALSE); gg=HiddenGroup(gReg,0,20,NULL); SetGroupMargins(gg,2*mX,0); SetGroupSpacing(gg,0,0); while(!feof(f)) { if (fgets(ParBuf,PAR_BUF,f)==NULL) break; StrTrim(ParBuf); p=StrChr(ParBuf,'?'); if (p) *p=GetValue(gInst)==1 ? 'm' : 'u'; if (!*ParBuf) continue; StaticPrompt(gg,ParBuf,0,0,NULL,'l'); } StaticPrompt(gReg,"This data will be used to notify you about new versions of Content",0,0,NULL,'l'); fclose(f); } else gReg=NULL; system("rm del1 del2 del3"); }} #endif /*----------------------------------------------*/ InstActnProc(gInst); GetPosition(g,&r); mX=(Int2)(r.right-r.left); gTerm=HiddenGroup(w,3,0,NULL); b=PushButton(gTerm,"Setup",SetupProc); GetPosition(b,&r); mX-=(Int2)(r.right-r.left); Remove(b); b=PushButton(gTerm,"Cancel",CancelProc); GetPosition(b,&r); mX-=(Int2)(r.right-r.left); Remove(b); mX/=3; SetGroupMargins(gTerm,mX,mY); SetGroupSpacing(gTerm,mX,mY); PushButton(gTerm,"Setup",SetupProc); PushButton(gTerm,"Cancel",CancelProc); /*----------------------------------------------*/ j=DIM(Adjust)>1 ? j=DIM(Adjust)-1 : 1; for (i=0; i