00001 /* 00002 ccp4_general.h: header for general library functions and utilities. 00003 Copyright (C) 2001 CCLRC, Peter Briggs et al 00004 00005 This library is free software and is distributed under the terms and 00006 conditions of the CCP4 licence agreement as `Part 0' (Annex 2) 00007 software, which is version 2.1 of the GNU Lesser General Public 00008 Licence (LGPL) with the following additional clause: 00009 00010 `You may also combine or link a "work that uses the Library" to 00011 produce a work containing portions of the Library, and distribute 00012 that work under terms of your choice, provided that you give 00013 prominent notice with each copy of the work that the specified 00014 version of the Library is used in it, and that you include or 00015 provide public access to the complete corresponding 00016 machine-readable source code for the Library including whatever 00017 changes were used in the work. (i.e. If you make changes to the 00018 Library you must distribute those, but you do not need to 00019 distribute source or object code to those portions of the work 00020 not covered by this licence.)' 00021 00022 Note that this clause grants an additional right and does not impose 00023 any additional restriction, and so does not affect compatibility 00024 with the GNU General Public Licence (GPL). If you wish to negotiate 00025 other terms, please contact the maintainer. 00026 00027 You can redistribute it and/or modify the library under the terms of 00028 the GNU Lesser General Public License as published by the Free Software 00029 Foundation; either version 2.1 of the License, or (at your option) any 00030 later version. 00031 00032 This library is distributed in the hope that it will be useful, but 00033 WITHOUT ANY WARRANTY; without even the implied warranty of 00034 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00035 Lesser General Public License for more details. 00036 00037 You should have received a copy of the CCP4 licence and/or GNU 00038 Lesser General Public License along with this library; if not, write 00039 to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK. 00040 The GNU Lesser General Public can also be obtained by writing to the 00041 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00042 MA 02111-1307 USA 00043 */ 00044 00045 /* ccp4_general.c 00046 00047 Header file for CCP4 library clones 00048 Peter Briggs et al CCP4 April 2001 00049 */ 00050 00051 /*------------------------------------------------------------------*/ 00052 00053 /* Macro definitions */ 00054 00055 /*------------------------------------------------------------------*/ 00056 00057 #ifndef __CCPGeneral__ 00058 #define __CCPGeneral__ 00059 00060 static char rcsidhl[] = "$Id: ccp4__general_8h-source.html,v 1.8 2004/07/05 14:36:54 mdw Exp $"; 00061 00062 /* note order: this must be outside CCP4 namespace */ 00063 #include "ccp4_parser.h" 00064 00065 #ifdef __cplusplus 00066 namespace CCP4 { 00067 extern "C" { 00068 #endif 00069 00070 /* MAXLINE = maximum number of characters in lines read 00071 from environ.def and default.def files (ccp4fyp) 00072 MAXTOKS = maximum number of tokens in lines read from 00073 environ.def and default.def files (ccp4fyp) 00074 MAXNAMES = maximum number of logical names that can be 00075 read and stored from environ.def (ccp4fyp) 00076 */ 00077 #define CCP4_MAXLINE 200 00078 #define CCP4_MAXTOKS 3 00079 #define CCP4_MAXNAMES 150 00080 #define CCP4_MODULO 100000 00081 00082 /* stuff for error reporting */ 00083 #define CGEN_ERRNO(n) (CCP4_ERR_GEN | (n)) 00084 00085 /* error defs */ 00086 #define CGENERR_Ok 0 00087 #define CGENERR_AllocFail 1 00088 #define CGENERR_CantSetEnvironment 2 00089 #define CGENERR_MaxNamesExceeded 3 00090 #define CGENERR_EOptionUseError 4 00091 #define CGENERR_DOptionUseError 5 00092 #define CGENERR_LogicalNameUseError 6 00093 #define CGENERR_CantOpenEnvFile 7 00094 #define CGENERR_CantOpenDefFile 8 00095 #define CGENERR_ParseEnvFail 9 00096 #define CGENERR_ParseDefFail 10 00097 #define CGENERR_CantFindInFile 11 00098 #define CGENERR_EnvPathFail 12 00099 #define CGENERR_DefPathFail 13 00100 #define CGENERR_CantGetClibd 14 00101 #define CGENERR_CantGetCcp4Scr 15 00102 00103 /*------------------------------------------------------------------*/ 00104 00105 /* Structures and typedefs */ 00106 00107 /*------------------------------------------------------------------*/ 00108 00109 /* <None declared> */ 00110 00111 /*------------------------------------------------------------------*/ 00112 00113 /* Function Prototypes */ 00114 00115 /*------------------------------------------------------------------*/ 00116 00117 void ccp4f_mem_tidy(void); 00118 00119 int ccperror(int ierr, const char *message); 00120 00121 int ccperror_noexit(int ierr, const char *message); 00122 00123 int ccp4printf(int level, char *format, ...); 00124 00125 int ccp4fyp(int argc, char **argv); 00126 00127 int ccp4fyp_cleanup(int ienv, char **envname, char **envtype, char **envext, 00128 char *logical_name, char *file_name, char *file_type, 00129 char *file_ext, char *env_file, char *def_file, 00130 char *dir, CCP4PARSERARRAY *parser); 00131 00132 int ccp4setenv(char *logical_name, char* value, char **envname, 00133 char **envtype, char **envext, int *ienv, int no_overwrt); 00134 00135 int ccp4setenv_cleanup(char *file_ext, char *file_root, char *file_path, 00136 char *file_name); 00137 00138 int ccpexists(char *filename); 00139 00140 int ccpputenv(char *logical_name, char *file_name); 00141 00142 void ccp4_banner(void); 00143 00144 #ifdef __cplusplus 00145 } 00146 } 00147 #endif 00148 00149 #endif /* __CCPGeneral__ */