From a10a9bc1cb95391e0762b9b776efb6d088969332 Mon Sep 17 00:00:00 2001 From: Richard Gowers Date: Sun, 30 Dec 2018 00:13:22 -0600 Subject: [PATCH] removed using_the_mac stuff from tightbind (#24) --- tightbind/Mac_Fopen.c | 0 tightbind/Mac_Fopen.h | 1 - tightbind/bind.h | 11 ----------- tightbind/distance_mat.c | 5 +---- tightbind/fileio.c | 11 ----------- tightbind/genutil.c | 32 -------------------------------- tightbind/kpoints.c | 9 +-------- tightbind/main.c | 30 ------------------------------ tightbind/new3_fileio.c | 8 -------- tightbind/postprocess.c | 4 ---- tightbind/prototypes.h | 3 --- tightbind/utils/Mac_Fopen.c | 1 - tightbind/utils/Mac_Fopen.h | 1 - tightbind/utils/add_dos.c | 32 -------------------------------- tightbind/utils/cooperate.c | 30 ------------------------------ tightbind/utils/dumb_walsh.c | 26 -------------------------- tightbind/utils/fit_FCO.c | 30 +----------------------------- tightbind/utils/fit_FCO.orig.c | 29 ----------------------------- tightbind/utils/fit_coop.c | 25 ------------------------- tightbind/utils/fit_dos.c | 27 --------------------------- tightbind/utils/fit_props.h | 6 ------ tightbind/utils/matrix_view.c | 32 +------------------------------- tightbind/utils/sub_dos.c | 32 -------------------------------- 23 files changed, 4 insertions(+), 381 deletions(-) delete mode 100644 tightbind/Mac_Fopen.c delete mode 100644 tightbind/Mac_Fopen.h delete mode 100644 tightbind/utils/Mac_Fopen.c delete mode 100644 tightbind/utils/Mac_Fopen.h diff --git a/tightbind/Mac_Fopen.c b/tightbind/Mac_Fopen.c deleted file mode 100644 index e69de29b..00000000 diff --git a/tightbind/Mac_Fopen.h b/tightbind/Mac_Fopen.h deleted file mode 100644 index 55ce20c2..00000000 --- a/tightbind/Mac_Fopen.h +++ /dev/null @@ -1 +0,0 @@ -/******************************************************* Copyright (C) 1995 Greg Landrum All rights reserved This file is part of yaehmop. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ********************************************************************/ /************** these are used in the Mac file browsing stuff **************/ #ifdef USING_THE_MAC #ifndef _MAC_FOPEN_ #define _MAC_FOPEN_ /* open the file and change dirs to the right disk/folder */ #define MAC_FOPEN_OPEN_CD 1 /* open the file without changing dirs */ #define MAC_FOPEN_OPEN_NOCD 2 /* don't open it, but change dirs */ #define MAC_FOPEN_NOOPEN_CD 3 /* don't open or change dirs */ #define MAC_FOPEN_NOOPEN_NOCD 4 #endif #endif \ No newline at end of file diff --git a/tightbind/bind.h b/tightbind/bind.h index 52fc5e37..55270468 100644 --- a/tightbind/bind.h +++ b/tightbind/bind.h @@ -75,12 +75,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#ifndef USING_THE_MAC #include #include -#else -#include -#endif #ifdef INCLUDE_NETCDF_SUPPORT #include @@ -93,11 +89,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. properly. In general the user doesn't have to worry about this. **********/ -#ifndef USING_THE_MAC -#include -#else -#include -#endif #include #include #include @@ -141,10 +132,8 @@ the ******/ #define BOOL_CHAR_TO_VALUE(a) a = (a == 'T' ? 1 : 0) -#ifndef USING_THE_MAC #define TRUE 1 #define FALSE 0 -#endif /***** used as tabs into the matrices diff --git a/tightbind/distance_mat.c b/tightbind/distance_mat.c index 06baccbd..637a5982 100644 --- a/tightbind/distance_mat.c +++ b/tightbind/distance_mat.c @@ -481,11 +481,8 @@ void dump_distance_mats(cell,details) /* open the file */ sprintf(tempfilename,"%s.DMAT",details->filename); -#ifndef USING_THE_MAC matfile = open(tempfilename,O_RDWR|O_APPEND|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR); -#else - matfile = open(tempfilename,O_RDWR|O_TRUNC|O_APPEND|O_CREAT); -#endif + if( matfile == -1 ){ error("Can't open DMAT file for binary I/O"); return; diff --git a/tightbind/fileio.c b/tightbind/fileio.c index c91aa63a..a67149ab 100644 --- a/tightbind/fileio.c +++ b/tightbind/fileio.c @@ -453,10 +453,8 @@ void fill_atomic_parms(atoms,num_atoms,infile,parm_file_name) /* open the parameter file */ -#ifndef USING_THE_MAC if (!parm_file_name) parm_file_name = (char *)getenv("BIND_PARM_FILE"); -#endif if( !parm_file_name ){ parm_file_name = (char *)calloc(240,sizeof(char)); if(!parm_file_name)fatal("can't get memory for parm_file_name"); @@ -467,21 +465,12 @@ void fill_atomic_parms(atoms,num_atoms,infile,parm_file_name) bzero(custom_atoms,MAX_CUSTOM_ATOMS*sizeof(atom_type)); /* make sure that it opened, but don't exit if not... */ -#ifndef USING_THE_MAC if(!parmfile){ safe_strcpy(err_string,"Can't open parameter file: "); strcat(err_string,parm_file_name); strcat(err_string," using default data in eht_parms.h..."); error(err_string); } -#else -#include "Mac_Fopen.h" - if( !parmfile ){ - error("Can't open parm file, please specify a name"); - parmfile = choose_mac_file(parm_file_name,MAC_FOPEN_OPEN_NOCD); - if( !parmfile ) fatal("Still can't do it."); - } -#endif /* loop over the atoms and get the parameters */ num_custom = 0; for(i=0;ifilename); -#ifndef USING_THE_MAC overlap_file = open(tempfilename, O_RDWR|O_TRUNC|O_APPEND|O_CREAT,S_IRUSR|S_IWUSR); -#else - overlap_file = open(tempfilename,O_RDWR|O_TRUNC|O_APPEND|O_CREAT); -#endif if( overlap_file == -1 ){ fatal("Can't open .OV file for binary I/O"); @@ -298,12 +294,9 @@ void loop_over_k_points(cell,details,overlapR,hamilR,overlapK,hamilK, /* if this is the first call, the open the file */ if(i==0){ sprintf(tempfilename,"%s.HAM",details->filename); -#ifndef USING_THE_MAC hamil_file = open(tempfilename, O_RDWR|O_APPEND|O_CREAT,S_IRUSR|S_IWUSR); -#else - hamil_file = open(tempfilename,O_RDWR|O_APPEND|O_CREAT); -#endif + if( hamil_file == -1 ){ fatal("Can't open .HAM file for binary I/O"); } diff --git a/tightbind/main.c b/tightbind/main.c index e44c3d72..b43a648e 100644 --- a/tightbind/main.c +++ b/tightbind/main.c @@ -60,18 +60,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. FILE *COHP_file; const char greetings[]="Welcome to the 10th Anniversary edition of YAeHMOP!\n"; -#ifdef USING_THE_MAC -extern FILE *choose_mac_file(char *,char); -#include "Mac_Fopen.h" -#endif - -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { FILE *temp_file; char file_name[80],err_string[240]; @@ -83,28 +74,7 @@ char test_string[80]; FILE *the_file=0; int walsh_step; bool use_stdin_stdout = false; -#ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting bind.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } else{ - argc = 2; - strcpy(file_name,argv[1]); - } - - /* get the command line arguments */ -// argc = ccommand(&argv); -#endif if( argc == 2 && strcmp(argv[1], "-v") == 0){ fprintf(stdout, "version: %s\n", VERSION_STRING); exit(0); diff --git a/tightbind/new3_fileio.c b/tightbind/new3_fileio.c index 4526a821..83303697 100644 --- a/tightbind/new3_fileio.c +++ b/tightbind/new3_fileio.c @@ -78,13 +78,6 @@ void read_NEW3file(cell,details,infile,parm_file_name) int temp; p_DOS_type *p_DOS,*temp_p_dos; -#ifdef USING_THE_MAC - fprintf(stderr,"That doesn't look like a bind input file. This version\n \ - of bind makes no attempt to read in new3 input files, so we're going to\n \ - error out now and let you try another input file\n"); - fatal("Bogus input file\n"); - -#else /* if we made it this far, the title of the file has already been read in.... */ @@ -289,5 +282,4 @@ contributions."); details->num_KPOINTS = 1; details->K_POINTS = points; } -#endif } diff --git a/tightbind/postprocess.c b/tightbind/postprocess.c index 23dd348b..f5ca37cd 100644 --- a/tightbind/postprocess.c +++ b/tightbind/postprocess.c @@ -315,11 +315,7 @@ void postprocess_FCO(cell,details,overlapR,hamilR,overlapK,hamilK, *******/ if(!FCO_file){ sprintf(FCO_filename,"%s.FCO",details->filename); -#ifndef USING_THE_MAC FCO_file = open(FCO_filename,O_RDWR|O_TRUNC|O_CREAT,S_IRUSR|S_IWUSR); -#else - FCO_file = open(FCO_filename,O_RDWR|O_APPEND|O_CREAT); -#endif if( FCO_file == -1 ){ fatal("Can't open .FCO file for binary I/O"); } diff --git a/tightbind/prototypes.h b/tightbind/prototypes.h index 63495777..d0c8058b 100644 --- a/tightbind/prototypes.h +++ b/tightbind/prototypes.h @@ -371,6 +371,3 @@ extern int zheev_ PROTO((char *jobz, char *uplo, integer *n, doublecomplex *a, integer *lwork, doublereal *rwork, integer *info)); #endif -#ifdef USING_THE_MAC -extern FILE *choose_mac_file(char *file_name, char); -#endif diff --git a/tightbind/utils/Mac_Fopen.c b/tightbind/utils/Mac_Fopen.c deleted file mode 100644 index a357459e..00000000 --- a/tightbind/utils/Mac_Fopen.c +++ /dev/null @@ -1 +0,0 @@ -/******************************************************* Copyright (C) 1995 Greg Landrum All rights reserved This file is part of yaehmop. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ********************************************************************/ /************************* this has the files for doing file opening/choosing on the Macintosh created by greg Landrum January 22, 1996 *************************/ #include "Mac_Fopen.h" #include extern FILE *fopen_mac ( short vRefNum , long parID , char * fileName , char * mode, char action ); FILE *choose_mac_file(char *file_name,char action) { StandardFileReply reply; SFTypeList type_list; short num_types; FILE *the_file; /* start out by using StandardGetFile to get the file name and stuff */ num_types = -1; type_list[0] = 'YhMp'; StandardGetFile(nil, num_types, type_list, &reply); if (!reply.sfGood) { strcpy(file_name,"User Cancelled"); return 0; } /* now open the file */ strcpy(file_name,(char *)reply.sfFile.name); PtoCstr((unsigned char *)file_name); the_file = fopen_mac(reply.sfFile.vRefNum,reply.sfFile.parID, file_name,(char *)"r",action); return the_file; } FILE * fopen_mac ( short vRefNum , long parID , char * fileName , char * mode, char action ) { short oldVol ; short aVol ; long aDir , aProc ; FILE * ret = NULL ; /* change to the proper disk and directory */ if ( GetVol ( NULL , & oldVol ) ) { return NULL ; } if ( GetWDInfo ( oldVol , & aVol , & aDir , & aProc ) ) { return NULL ; } if ( HSetVol ( NULL , vRefNum , parID ) ) { return NULL ; } if( action == MAC_FOPEN_OPEN_CD || action == MAC_FOPEN_OPEN_NOCD ){ ret = fopen ( fileName , mode ) ; } else{ ret = 0; } /* this doesn't seem to work the way I want it to... */ if( action == MAC_FOPEN_OPEN_NOCD || action == MAC_FOPEN_NOOPEN_NOCD ){ if ( HSetVol ( NULL, aVol , aDir ) ) { /* an error we can't currently handle */ } if ( SetVol ( NULL, oldVol ) ) { /* an error we can't currently handle */ } } return ret ; } \ No newline at end of file diff --git a/tightbind/utils/Mac_Fopen.h b/tightbind/utils/Mac_Fopen.h deleted file mode 100644 index 55ce20c2..00000000 --- a/tightbind/utils/Mac_Fopen.h +++ /dev/null @@ -1 +0,0 @@ -/******************************************************* Copyright (C) 1995 Greg Landrum All rights reserved This file is part of yaehmop. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ********************************************************************/ /************** these are used in the Mac file browsing stuff **************/ #ifdef USING_THE_MAC #ifndef _MAC_FOPEN_ #define _MAC_FOPEN_ /* open the file and change dirs to the right disk/folder */ #define MAC_FOPEN_OPEN_CD 1 /* open the file without changing dirs */ #define MAC_FOPEN_OPEN_NOCD 2 /* don't open it, but change dirs */ #define MAC_FOPEN_NOOPEN_CD 3 /* don't open or change dirs */ #define MAC_FOPEN_NOOPEN_NOCD 4 #endif #endif \ No newline at end of file diff --git a/tightbind/utils/add_dos.c b/tightbind/utils/add_dos.c index fbcceeb2..93a60900 100644 --- a/tightbind/utils/add_dos.c +++ b/tightbind/utils/add_dos.c @@ -39,13 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************/ #include "fit_props.h" -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int i,j,k; FILE *infile1,*infile2,*outfile, *the_file; @@ -58,34 +54,6 @@ void main() int curve1,curve2; real val1, val2; char window_by_hand; - #ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting bind.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } - the_file = choose_mac_file(argv[2],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled second file open"); - } - - printf("Enter the name of the output file: "); - scanf("%s",argv[3]); - - argc = 4; - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif - /* open the files */ if( argc < 4 ){ diff --git a/tightbind/utils/cooperate.c b/tightbind/utils/cooperate.c index 2e149258..d7c3be91 100644 --- a/tightbind/utils/cooperate.c +++ b/tightbind/utils/cooperate.c @@ -36,13 +36,9 @@ int sort_distances_helper(dist1,dist2) else return( 0 ); } -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { FILE *the_file; int infile; @@ -58,28 +54,6 @@ void main() int num_so_far; int curr_type; char *dummies; -#ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting cooperate.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } else{ - argc = 2; - } - - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif - if(argc < 2){ fatal("Usage: cooperate infile [min_dist max_dist tolerance]"); @@ -101,11 +75,7 @@ void main() } /* open the file */ -#ifndef USING_THE_MAC infile = open(argv[1],O_RDONLY,"r"); -#else - infile = open(argv[1],O_RDONLY); -#endif if( infile == -1 ){ fatal("Can't open file for binary I/O."); } diff --git a/tightbind/utils/dumb_walsh.c b/tightbind/utils/dumb_walsh.c index bcd914ca..4d0ca018 100644 --- a/tightbind/utils/dumb_walsh.c +++ b/tightbind/utils/dumb_walsh.c @@ -323,13 +323,9 @@ void extract_walsh_data(infile,p_points,p_xvals,p_tot_E,p_num_orbs,p_num_symm, *p_num_steps = num_steps; } -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int i,j,k; FILE *infile,*outfile,*the_file; @@ -343,28 +339,6 @@ void main() int num_orbs; int num_steps,num_symm,step; -#ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting dumb_walsh.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } else{ - argc = 2; - } - - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif - /* open the files */ if( argc < 2 ){ fprintf(stderr,"Usage: fit_walsh \n"); diff --git a/tightbind/utils/fit_FCO.c b/tightbind/utils/fit_FCO.c index acd6088c..2409f4c4 100644 --- a/tightbind/utils/fit_FCO.c +++ b/tightbind/utils/fit_FCO.c @@ -85,13 +85,9 @@ int sort_FCO_helper(const void *p1,const void *p2) -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int FCO_file; int test_int; @@ -117,27 +113,6 @@ void main() int which_frag,orbs_this_frag; long int calls_to_exp = 0; - #ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting fit_FCO.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } else{ - argc = 2; - } - - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif if(argc < 2){ fatal("Usage: fit_FCO "); @@ -146,11 +121,8 @@ long int calls_to_exp = 0; /* open the input file */ sprintf(filename,"%s.FCO",argv[1]); -#ifndef USING_THE_MAC FCO_file = open(filename,O_RDONLY,"r"); -#else - FCO_file = open(filename,O_RDONLY); -#endif + if( FCO_file == -1 ){ error("Can't open file for binary I/O."); return; diff --git a/tightbind/utils/fit_FCO.orig.c b/tightbind/utils/fit_FCO.orig.c index 6c594538..d51446ce 100644 --- a/tightbind/utils/fit_FCO.orig.c +++ b/tightbind/utils/fit_FCO.orig.c @@ -111,13 +111,9 @@ int sort_FCO_helper(const void *p1,const void *p2) -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int FCO_file; int test_int; @@ -139,27 +135,6 @@ void main() int which_frag,orbs_this_frag; long int calls_to_exp = 0; - #ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting fit_FCO.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } else{ - argc = 2; - } - - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif if(argc < 2){ fatal("Usage: fit_FCO "); @@ -168,11 +143,7 @@ long int calls_to_exp = 0; /* open the input file */ sprintf(filename,"%s.FCO",argv[1]); -#ifndef USING_THE_MAC FCO_file = open(filename,O_RDONLY,"r"); -#else - FCO_file = open(filename,O_RDONLY); -#endif if( FCO_file == -1 ){ error("Can't open file for binary I/O."); return; diff --git a/tightbind/utils/fit_coop.c b/tightbind/utils/fit_coop.c index 4a5ba9b0..52af659a 100644 --- a/tightbind/utils/fit_coop.c +++ b/tightbind/utils/fit_coop.c @@ -8,13 +8,9 @@ ************************************************************************/ #include "fit_props.h" -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int i,j,k; FILE *infile,*outfile,*the_file; @@ -36,27 +32,6 @@ void main() int num_walsh_steps; int which_walsh_step; int temp; -#ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting fit_coop.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } else{ - argc = 2; - } - - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif /* open the files */ if( argc < 2 ){ diff --git a/tightbind/utils/fit_dos.c b/tightbind/utils/fit_dos.c index 970d8775..e47aa596 100644 --- a/tightbind/utils/fit_dos.c +++ b/tightbind/utils/fit_dos.c @@ -40,13 +40,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "fit_props.h" -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int i,j,k; FILE *infile,*outfile,*the_file; @@ -72,29 +68,6 @@ void main() int which_walsh_step; int temp; -#ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting fit_dos.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } else{ - argc = 2; - } - - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif - - /* open the files */ if( argc < 2 ){ fprintf(stderr,"Usage: fit_dos \n"); diff --git a/tightbind/utils/fit_props.h b/tightbind/utils/fit_props.h index 8b5a8f01..be310743 100644 --- a/tightbind/utils/fit_props.h +++ b/tightbind/utils/fit_props.h @@ -37,12 +37,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#ifdef USING_THE_MAC -#include -extern FILE *choose_mac_file(char *, char); -#include "Mac_Fopen.h" -#endif - /****** These are used by the fileio routines. *******/ diff --git a/tightbind/utils/matrix_view.c b/tightbind/utils/matrix_view.c index 493e5a24..236679f4 100644 --- a/tightbind/utils/matrix_view.c +++ b/tightbind/utils/matrix_view.c @@ -29,13 +29,9 @@ real tic_values[] = {3.0,2.5,2.0,1.5,1.0,0.5,0.25,0.1,0.05,-1.0}; -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int infile; FILE *psfile,*the_file; @@ -49,30 +45,7 @@ void main() real mag,max_mag; real gray; int tot_cells, cells_written; -#ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting matrix_view.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } - printf("Enter name of output (PS) file: "); - scanf("%s",argv[2]); - argc = 3; - - - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif if(argc < 3){ fatal("Usage: matrix_view infile outfile"); } @@ -81,11 +54,8 @@ void main() else draw_grid = 0; /* open the file */ -#ifndef USING_THE_MAC infile = open(argv[1],O_RDONLY,"r"); -#else - infile = open(argv[1],O_RDONLY); -#endif + if( infile == -1 ){ error("Can't open file for binary I/O."); return; diff --git a/tightbind/utils/sub_dos.c b/tightbind/utils/sub_dos.c index 75e2c731..60cea7aa 100644 --- a/tightbind/utils/sub_dos.c +++ b/tightbind/utils/sub_dos.c @@ -39,13 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************/ #include "fit_props.h" -#ifndef USING_THE_MAC void main(argc, argv) int argc; char **argv; -#else -void main() -#endif { int i,j,k; FILE *infile1,*infile2,*outfile,*the_file; @@ -59,34 +55,6 @@ void main() real val1, val2; char window_by_hand; -#ifdef USING_THE_MAC - int argc; - char argv[4][80]; - - /* set up some stuff for Sioux */ - //SIOUXSettings.standalone = FALSE; - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.autocloseonquit = FALSE; - printf("Starting bind.\n"); - - the_file = choose_mac_file(argv[1],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled intial file open"); - } - the_file = choose_mac_file(argv[2],MAC_FOPEN_OPEN_CD); - if( !the_file ) { - fatal("User cancelled second file open"); - } - - printf("Enter the name of the output file: "); - scanf("%s",argv[3]); - - argc = 4; - /* get the command line arguments */ -// argc = ccommand(&argv); - -#endif - /* open the files */ if( argc < 4 ){ fprintf(stderr,"Usage: sub_dos input_file1 input_file2 output_file\n");