1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#if defined(__sgi) || defined(__hpux)
#include <alloca.h>
#endif
#ifdef sparc
#include <malloc.h>
#endif
#include "fitsio2.h"
#ifndef FFBISON
#include "eval_tab.h"
#endif
#define MAXDIMS 5
#define MAXSUBS 10
#define MAXVARNAME 80
#define CONST_OP -1000
#define pERROR -1
typedef struct {
char name[MAXVARNAME+1];
int type;
long nelem;
int naxis;
long naxes[MAXDIMS];
char *undef;
void *data;
} DataInfo;
typedef struct {
long nelem;
int naxis;
long naxes[MAXDIMS];
char *undef;
union {
double dbl;
long lng;
char log;
char str[256];
double *dblptr;
long *lngptr;
char *logptr;
char **strptr;
void *ptr;
} data;
} lval;
typedef struct Node {
int operation;
void (*DoOp)(struct Node *this);
int nSubNodes;
int SubNodes[MAXSUBS];
int type;
lval value;
} Node;
typedef struct {
fitsfile *def_fptr;
int (*getData)( char *dataName, void *dataValue );
int (*loadData)( int varNum, long fRow, long nRows,
void *data, char *undef );
int compressed;
int timeCol;
int parCol;
int valCol;
char *expr;
int index;
int is_eobuf;
Node *Nodes;
int nNodes;
int nNodesAlloc;
int resultNode;
long firstRow;
long nRows;
int nCols;
iteratorCol *colData;
DataInfo *varData;
PixelFilter *pixFilter;
long firstDataRow;
long nDataRows;
long totalRows;
int datatype;
int hdutype;
int status;
} ParseData;
typedef enum {
rnd_fct = 1001,
sum_fct,
nelem_fct,
sin_fct,
cos_fct,
tan_fct,
asin_fct,
acos_fct,
atan_fct,
sinh_fct,
cosh_fct,
tanh_fct,
exp_fct,
log_fct,
log10_fct,
sqrt_fct,
abs_fct,
atan2_fct,
ceil_fct,
floor_fct,
round_fct,
min1_fct,
min2_fct,
max1_fct,
max2_fct,
near_fct,
circle_fct,
box_fct,
elps_fct,
isnull_fct,
defnull_fct,
gtifilt_fct,
regfilt_fct,
ifthenelse_fct,
row_fct,
null_fct,
median_fct,
average_fct,
stddev_fct,
nonnull_fct,
angsep_fct,
gasrnd_fct,
poirnd_fct
} funcOp;
extern ParseData gParse;
#ifdef __cplusplus
extern "C" {
#endif
int ffparse(void);
int fflex(void);
void ffrestart(FILE*);
void Evaluate_Parser( long firstRow, long nRows );
#ifdef __cplusplus
}
#endif
|