source: XIOS/dev/dev_olga/src/extern/src_netcdf4/dceconstraints.h @ 1022

Last change on this file since 1022 was 1022, checked in by mhnguyen, 7 years ago
File size: 3.1 KB
Line 
1/*********************************************************************
2  *   Copyright 1993, UCAR/Unidata
3  *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
4  *********************************************************************/
5/* $Header$ */
6
7#ifndef DCECONSTRAINTS_H
8#define DCECONSTRAINTS_H 1
9
10#include "ceconstraints.h"
11
12/* Provide a universal cast type containing common fields */
13
14/* Define the common "supertype */
15typedef struct DCEnode {
16    CEsort sort;   
17} DCEnode;
18
19/* The slice structure is assumed common to all uses */
20typedef struct DCEslice {
21    DCEnode node;
22    size_t first;
23    size_t count;
24    size_t length; /* count*stride */
25    size_t stride;
26    size_t stop; /* == first + count*/
27    size_t declsize;  /* from defining dimension, if any.*/
28} DCEslice;
29
30typedef struct DCEsegment {
31    DCEnode node;
32    char* name; 
33    int slicesdefined; /*1=>slice counts defined, except declsize*/
34    int slicesdeclized; /*1=>slice declsize defined */
35    size_t rank;
36    DCEslice slices[NC_MAX_VAR_DIMS];   
37    void* annotation;
38} DCEsegment;
39
40typedef struct DCEfcn {
41    DCEnode node;
42    char* name; 
43    NClist* args;
44} DCEfcn;
45
46typedef struct DCEvar {
47    DCEnode node;
48    NClist* segments;
49    void* annotation;
50} DCEvar;
51
52typedef struct DCEconstant {
53    DCEnode node;
54    CEsort discrim;
55    char* text;
56    long long intvalue;
57    double floatvalue;
58} DCEconstant;
59
60typedef struct DCEvalue {
61    DCEnode node;
62    CEsort discrim;
63    /* Do not bother with a union */
64    DCEconstant* constant;
65    DCEvar* var;
66    DCEfcn* fcn;
67} DCEvalue;
68
69typedef struct DCEselection {
70    DCEnode node;
71    CEsort operator;
72    DCEvalue* lhs;
73    NClist* rhs;
74} DCEselection;
75
76typedef struct DCEprojection {
77    DCEnode node;
78    CEsort discrim;
79    /* Do not bother with a union */
80    DCEvar* var;
81    DCEfcn* fcn;
82} DCEprojection;
83
84typedef struct DCEconstraint {
85    DCEnode node;
86    NClist* projections;
87    NClist* selections;
88} DCEconstraint;
89
90
91extern int dceparseconstraints(char* constraints, DCEconstraint* DCEonstraint);
92extern int dceslicemerge(DCEslice* dst, DCEslice* src);
93extern int dcemergeprojectionlists(NClist* dst, NClist* src);
94
95extern DCEnode* dceclone(DCEnode* node);
96extern NClist* dceclonelist(NClist* list);
97
98extern void dcefree(DCEnode* node);
99extern void dcefreelist(NClist* list);
100
101extern char* dcetostring(DCEnode* node);
102extern char* dcelisttostring(NClist* list,char*);
103extern void dcetobuffer(DCEnode* node, NCbytes* buf);
104extern void dcelisttobuffer(NClist* list, NCbytes* buf,char*);
105
106extern NClist* dceallnodes(DCEnode* node, CEsort which);
107
108extern DCEnode* dcecreate(CEsort sort);
109
110extern void dcemakewholeslice(DCEslice* slice, size_t declsize);
111extern void dcemakewholeprojection(DCEprojection*);
112
113extern int dceiswholesegment(DCEsegment*);
114extern int dceiswholeslice(DCEslice*);
115extern int dceiswholeseglist(NClist*);
116extern int dceiswholeprojection(DCEprojection*);
117extern int dcesamepath(NClist* list1, NClist* list2);
118extern int dcemergeprojections(DCEprojection* dst, DCEprojection* src);
119
120extern int dceverbose;
121
122#endif /*DCECONSTRAINTS_H*/
Note: See TracBrowser for help on using the repository browser.