Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00093
00094
00095
00096 #ifndef __CCP4_Parser__
00097 #define __CCP4_Parser__
00098
00099
00100
00101 #include <stdio.h>
00102 #include"ccp4_utils.h"
00103 #include"ccp4_spg.h"
00104
00105
00106 #ifdef __cplusplus
00107 namespace CCP4 {
00108 extern "C" {
00109 typedef CSym::ccp4_symop ccp4_symop;
00110 #endif
00111
00112
00113
00114
00115 #define CCP4_PARSER_MAXLINELENGTH 200
00116 #define CCP4_PARSER_MAXFILENAMELENGTH 200
00119
00120
00121
00127 typedef struct {
00128 char *fullstring;
00129 char word[5];
00130 double value;
00131 int isstring;
00132 int strlength;
00133 int isnumber;
00134 int intdigits;
00136 int frcdigits;
00138 int isquoted;
00139 int isnull;
00140 int ibeg;
00141 int iend;
00142 } CCP4PARSERTOKEN;
00149 typedef struct {
00150
00151 char keyword[5];
00152 int ntokens;
00153 CCP4PARSERTOKEN *token;
00154
00155 FILE *fp;
00156 int maxtokens;
00157 char *delim;
00158 char *nulldelim;
00159 char *comment;
00160 double max_exponent;
00161 double min_exponent;
00162 } CCP4PARSERARRAY;
00165
00166
00167
00168
00169
00176 CCP4PARSERARRAY* ccp4_parse_start(const int maxtokens);
00177
00183 int ccp4_parse_end(CCP4PARSERARRAY *parsePtr);
00184
00185 int ccp4_parse_init_token(const CCP4PARSERARRAY *parsePtr, const int itok);
00186
00187 int ccp4_parse_delimiters(CCP4PARSERARRAY *parsePtr, const char *delim,
00188 const char *nulldelim);
00189 int ccp4_parse_comments(CCP4PARSERARRAY *parsePtr, const char *comment_chars);
00190
00191 int ccp4_parse_maxmin(CCP4PARSERARRAY *parsePtr, const double max_exponent,
00192 const double min_exponent);
00193 int ccp4_parse_reset(CCP4PARSERARRAY *parsePtr);
00194
00195 int ccp4_parse(const char *line, CCP4PARSERARRAY *parser);
00196
00213 int ccp4_parser(char *line, const int n, CCP4PARSERARRAY *parser,
00214 const int print);
00215
00216
00217
00224 int ccp4_keymatch(const char *keyin1, const char *keyin2);
00225
00226
00227
00233 char *strtoupper (char *str1, const char *str2);
00234
00235 char *strtolower (char *str1, const char *str2);
00236
00237 int strmatch (const char *str1, const char *str2);
00238
00239 int charmatch(const char character, const char *charlist);
00240
00241 int doublefromstr(const char *str, const double max_exp, const double min_exp,
00242 double *valuePtr, double *intvaluePtr, int *intdigitsPtr,
00243 double *frcvaluePtr, int *frcdigitsPtr,
00244 double *expvaluePtr, int *expdigitsPtr);
00245
00252 ccp4_symop symop_to_rotandtrn(const char *symchs_begin, const char *symchs_end);
00253
00263 const char * symop_to_mat4(const char *symchs_begin, const char *symchs_end, float *rot);
00264
00265
00266
00267
00268
00269 ccp4_symop mat4_to_rotandtrn(const float rsm[4][4]);
00270
00271
00272 char *rotandtrn_to_symop(char *symchs_begin, char *symchs_end, const ccp4_symop symop);
00273
00274 void rotandtrn_to_mat4(float rsm[4][4], const ccp4_symop symop);
00275
00285 char *mat4_to_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4]);
00286
00296 char *mat4_to_recip_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4]);
00297
00298 #ifdef __cplusplus
00299 }
00300 }
00301 #endif
00302
00303 #endif
00304
00305
00306
00307
00308
00309