"Fossies" - the Fresh Open Source Software Archive

Member "cfitsio-4.0.0/eval_defs.h" (20 May 2021, 4288 Bytes) of package /linux/misc/cfitsio-4.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "eval_defs.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.49_vs_4.0.0.

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