1 #ifndef DYNAMITEwisefileHEADERFILE 2 #define DYNAMITEwisefileHEADERFILE 3 #ifdef _cplusplus 4 extern "C" { 5 #endif 6 #include "wisebase.h" 7 8 #ifndef MAXPATHLEN 9 #define MAXPATHLEN 1024 10 #endif 11 12 #ifdef FILE_DEBUG 13 #define fclose myfclose 14 #endif 15 16 /* define here for the moment, as we always compile 17 with it */ 18 19 #define NOERROR 20 21 #ifdef NOERROR 22 #define ERRORSTR "No error available" 23 #else 24 #define ERRORSTR strerror(errno) 25 #endif 26 27 28 29 /***************************************************/ 30 /* Callable functions */ 31 /* These are the functions you are expected to use */ 32 /***************************************************/ 33 34 35 36 /* Function: set_config_dir(path,*path) 37 * 38 * Descrip: Programmatically set systemconfigdir to override 39 * any value set (or not) by env.var. WISECONFIGDIR. 40 * 41 * Added by arve. 42 * 43 * 44 * Arg: path [UNKN ] path that WISECONFIGDIR is set to [NullString] 45 * Arg: *path [UNKN ] Undocumented argument [char] 46 * 47 */ 48 void Wise2_set_config_dir(char *path) ; 49 #define set_config_dir Wise2_set_config_dir 50 51 52 /* Function: myfclose(ofp) 53 * 54 * Descrip: reports the fclose type etc 55 * 56 * 57 * Arg: ofp [UNKN ] Undocumented argument [FILE *] 58 * 59 * Return [UNKN ] Undocumented return value [int] 60 * 61 */ 62 int Wise2_myfclose(FILE * ofp); 63 #define myfclose Wise2_myfclose 64 65 66 /* Function: remove_file(filename) 67 * 68 * Descrip: silly function to provide a boolean wrapper 69 * around remove. 70 * 71 * 72 * Arg: filename [UNKN ] Undocumented argument [char *] 73 * 74 * Return [UNKN ] Undocumented return value [boolean] 75 * 76 */ 77 boolean Wise2_remove_file(char * filename); 78 #define remove_file Wise2_remove_file 79 80 81 /* Function: move_file(from,to) 82 * 83 * Descrip: silly function to provide a boolean wrapper 84 * around rename 85 * 86 * 87 * Arg: from [UNKN ] Undocumented argument [char *] 88 * Arg: to [UNKN ] Undocumented argument [char *] 89 * 90 * Return [UNKN ] Undocumented return value [boolean] 91 * 92 */ 93 boolean Wise2_move_file(char * from,char * to); 94 #define move_file Wise2_move_file 95 96 97 /* Function: touchfile(filename) 98 * 99 * Descrip: sees if filename exists 100 * 101 * 102 * Arg: filename [UNKN ] Undocumented argument [char *] 103 * 104 * Return [UNKN ] Undocumented return value [boolean] 105 * 106 */ 107 boolean Wise2_touchfile(char * filename); 108 #define touchfile Wise2_touchfile 109 110 111 /* Function: openfile(filename,passedprot) 112 * 113 * Descrip: Every file open goes through this. 114 * 115 * It opens for reading in the following order 116 * . 117 * WISEPERSONALDIR 118 * WISECONFIGDIR 119 * 120 * For writing it opens in . 121 * 122 * Filenames with ~'s are expanded to HOME/filename 123 * 124 * 125 * Arg: filename [UNKN ] filename to open for read/writing [const char *] 126 * Arg: passedprot [UNKN ] string representing standard fopen attributes [const char *] 127 * 128 * Return [UNKN ] open'd filehandle, NULL on error [FILE *] 129 * 130 */ 131 FILE * Wise2_openfile(const char * filename,const char * passedprot); 132 #define openfile Wise2_openfile 133 134 135 /* Function: envopenfile(envname,filename,name,env) 136 * 137 * Descrip: This function basically mirrors the function in file.c 138 * in HMMer2. You call it as 139 * 140 * fp = Envfile(filename,envname); 141 * 142 * where envname looks like "BLASTDB" etc. 143 * 144 * 145 * 146 * Arg: envname [READ ] enviroment variable to read from [NullString] 147 * Arg: filename [UNKN ] Undocumented argument [char *] 148 * Arg: name [READ ] filename to open [NullString] 149 * Arg: env [UNKN ] Undocumented argument [char *] 150 * 151 * Return [UNKN ] a valid file pointer or NULL [FILE *] 152 * 153 */ 154 FILE * Wise2_envopenfile(char * filename,char * env); 155 #define envopenfile Wise2_envopenfile 156 157 158 /* Unplaced functions */ 159 /* There has been no indication of the use of these functions */ 160 161 162 /***************************************************/ 163 /* Internal functions */ 164 /* you are not expected to have to call these */ 165 /***************************************************/ 166 void Wise2_try_to_load(void); 167 #define try_to_load Wise2_try_to_load 168 boolean Wise2_append_file_to_path(char * buffer,int len,const char * file,char * path); 169 #define append_file_to_path Wise2_append_file_to_path 170 171 #ifdef _cplusplus 172 } 173 #endif 174 175 #endif 176