gpp4  1.3.1
ccp4_general.h
Go to the documentation of this file.
1 /*
2  ccp4_general.h: header for general library functions and utilities.
3  Copyright (C) 2001 CCLRC, Peter Briggs et al
4 
5  This library is free software: you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation, either
8  version 3 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with This library. If not, see
17  <http://www.gnu.org/licenses/>.
18 
19 */
20 
26 /* Macro definitions */
27 
28 
29 #ifndef __CCPGeneral__
30 #define __CCPGeneral__
31 
32 
33 /* note order: this must be outside CCP4 namespace */
34 #include "ccp4_parser.h"
35 
36 #ifdef __cplusplus
37 namespace CCP4 {
38 extern "C" {
39 #endif
40 
43 #define CCP4_MAXLINE 200
44 
47 #define CCP4_MAXTOKS 3
48 
51 #define CCP4_MAXNAMES 150
52 
55 #define CCP4_MODULO 100000
56 
57 /* stuff for error reporting */
58 #define CGEN_ERRNO(n) (CCP4_ERR_GEN | (n))
59 
60 /* error defs */
61 #define CGENERR_Ok 0
62 #define CGENERR_AllocFail 1
63 #define CGENERR_CantSetEnvironment 2
64 #define CGENERR_MaxNamesExceeded 3
65 #define CGENERR_EOptionUseError 4
66 #define CGENERR_DOptionUseError 5
67 #define CGENERR_LogicalNameUseError 6
68 #define CGENERR_CantOpenEnvFile 7
69 #define CGENERR_CantOpenDefFile 8
70 #define CGENERR_ParseEnvFail 9
71 #define CGENERR_ParseDefFail 10
72 #define CGENERR_CantFindInFile 11
73 #define CGENERR_EnvPathFail 12
74 #define CGENERR_DefPathFail 13
75 #define CGENERR_CantGetClibd 14
76 #define CGENERR_CantGetCcp4Scr 15
77 
78 /*------------------------------------------------------------------*/
79 
80 /* Structures and typedefs */
81 
82 /*------------------------------------------------------------------*/
83 
84 /* <None declared> */
85 
86 /*------------------------------------------------------------------*/
87 
88 /* Function Prototypes */
89 
90 /*------------------------------------------------------------------*/
91 
92 void ccp4f_mem_tidy(void);
93 
94 int ccperror(int ierr, const char *message);
95 
96 int ccperror_noexit(int ierr, const char *message);
97 
98 int ccp4printf(int level, char *format, ...);
99 
100 int ccp4fyp(int argc, char **argv);
101 
102 int ccp4fyp_cleanup(int ienv, char **envname, char **envtype, char **envext,
103  char *logical_name, char *file_name, char *file_type,
104  char *file_ext, char *env_file, char *def_file,
105  char *dir, CCP4PARSERARRAY *parser);
106 
107 int ccp4setenv(char *logical_name, char* value, char **envname,
108  char **envtype, char **envext, int *ienv, int no_overwrt);
109 
110 int ccp4setenv_cleanup(char *file_ext, char *file_root, char *file_path,
111  char *file_name);
112 
113 int ccpexists(char *filename);
114 
115 int ccpputenv(char *logical_name, char *file_name);
116 
117 void ccp4_banner(void);
118 
119 #ifdef __cplusplus
120 }
121 }
122 #endif
123 
124 #endif /* __CCPGeneral__ */
125 
126 /*
127  Local variables:
128  mode: font-lock
129  End:
130 */
ccp4_signal
void ccp4_signal(const int, const char *const, void(*)())
Definition: library_err.c:278
ccp4_banner
void ccp4_banner(void)
Definition: ccp4_general.c:1370
ccp4_utils_username
char * ccp4_utils_username(void)
Definition: library_utils.c:449
ccp4_utils.h
Utility functions.
ccp4ProgramName
char * ccp4ProgramName(const char *progname)
Definition: ccp4_program.c:65
ccp4_general.h
Header file for CCP4 library clones.
ccp4fyp
int ccp4fyp(int argc, char **argv)
Definition: ccp4_general.c:284
CCP4PARSERARRAY::token
CCP4PARSERTOKEN * token
Definition: ccp4_parser.h:153
csymlib.h
C-level library for symmetry information.
ccperror
int ccperror(int ierr, const char *message)
Definition: ccp4_general.c:67
ccp4_utils_extension
char * ccp4_utils_extension(const char *filename)
Definition: library_utils.c:526
ccp4_fortran.h
Header file for Fortran APIs.
ccpputenv
int ccpputenv(char *logical_name, char *file_name)
Definition: ccp4_general.c:1339
ccpexists
int ccpexists(char *filename)
Definition: ccp4_general.c:1309
summary_output
int summary_output(int isumm_in)
Definition: ccp4_program.c:275
ccp4_parse_reset
int ccp4_parse_reset(CCP4PARSERARRAY *parsePtr)
Definition: ccp4_parser.c:214
ccp4_utils_malloc
void * ccp4_utils_malloc(size_t)
Definition: library_utils.c:401
strmatch
int strmatch(const char *str1, const char *str2)
Definition: ccp4_parser.c:1094
ccp4_utils_basename
char * ccp4_utils_basename(const char *filename)
Definition: library_utils.c:472
ccp4printf
int ccp4printf(int level, char *format,...)
Definition: ccp4_general.c:182
ccperror_noexit
int ccperror_noexit(int ierr, const char *message)
Definition: ccp4_general.c:95
ccp4ProgramTime
void ccp4ProgramTime(int init)
Definition: ccp4_program.c:149
CCP4_MODULO
#define CCP4_MODULO
Definition: ccp4_general.h:55
CCP4_MAXNAMES
#define CCP4_MAXNAMES
Definition: ccp4_general.h:51
ccpexists
int ccpexists(char *filename)
Definition: ccp4_general.c:1309
ccp4_parse_start
CCP4PARSERARRAY * ccp4_parse_start(const int maxtokens)
Definition: ccp4_parser.c:71
ccp4_program.h
Header file for utilies to set and fetch program information.
ccp4_parse_delimiters
int ccp4_parse_delimiters(CCP4PARSERARRAY *parsePtr, const char *delim, const char *nulldelim)
Definition: ccp4_parser.c:241
html_log_output
int html_log_output(int ihtml_in)
Definition: ccp4_program.c:261
ccp4_banner
void ccp4_banner(void)
Definition: ccp4_general.c:1370
strtoupper
char * strtoupper(char *str1, const char *str2)
Definition: ccp4_parser.c:1056
ccp4VerbosityLevel
int ccp4VerbosityLevel(int level)
Definition: ccp4_program.c:176
CCP4_MAXTOKS
#define CCP4_MAXTOKS
Definition: ccp4_general.h:47
ccperror
int ccperror(int ierr, const char *message)
Definition: ccp4_general.c:67
ccp4_utils_setenv
int ccp4_utils_setenv(char *)
Definition: library_utils.c:138
ccp4_parser.h
Functions to read in and "parse" CCP4-style keyworded input.
ccp4_parse
int ccp4_parse(const char *line, CCP4PARSERARRAY *parser)
Definition: ccp4_parser.c:411
CCP4_MAXLINE
#define CCP4_MAXLINE
Definition: ccp4_general.h:43
ccp4f_mem_tidy
void ccp4f_mem_tidy(void)
Definition: ccp4_general_f.c:44
ccp4fyp
int ccp4fyp(int argc, char **argv)
Definition: ccp4_general.c:284
CCP4PARSERTOKEN::fullstring
char * fullstring
Definition: ccp4_parser.h:128
ccp4printf
int ccp4printf(int level, char *format,...)
Definition: ccp4_general.c:182
ccperror_noexit
int ccperror_noexit(int ierr, const char *message)
Definition: ccp4_general.c:95
GPP4_VERSION_NO
#define GPP4_VERSION_NO
Definition: ccp4_program.h:46
CCP4PARSERARRAY
CCP4 Parser array Construct to hold the information about a parsed line.
Definition: ccp4_parser.h:149
ccp4_prog_vers
char * ccp4_prog_vers(const char *progvers)
Definition: ccp4_program.c:42
ccp4_errno.h
Header file for error handling routines Error codes based on system errors.
CCP4_PATCH_LEVEL
#define CCP4_PATCH_LEVEL
Definition: ccp4_program.h:43
cmtzlib.h
C-level library for input, output and manipulation of MTZ files.
ccp4_parse_end
int ccp4_parse_end(CCP4PARSERARRAY *parsePtr)
Definition: ccp4_parser.c:143
ccpputenv
int ccpputenv(char *logical_name, char *file_name)
Definition: ccp4_general.c:1339
ccp4_utils_pathname
char * ccp4_utils_pathname(const char *filename)
Definition: library_utils.c:503
ccp4_utils_joinfilenames
char * ccp4_utils_joinfilenames(char *dir, char *file)
Definition: library_utils.c:554
MAX
#define MAX(x, y)
A macro that returns the maximum of x and y.
Definition: ccp4_types.h:103
ccp4_utils_realloc
void * ccp4_utils_realloc(void *, size_t)
Definition: library_utils.c:416