1 | /* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. |
---|
2 | See the COPYRIGHT file for more information. */ |
---|
3 | |
---|
4 | #ifndef OCCONTENT_H |
---|
5 | #define OCCONTENT_H |
---|
6 | |
---|
7 | /*! Specifies the OCcontent*/ |
---|
8 | typedef struct OCcontent { |
---|
9 | unsigned int magic; |
---|
10 | OCmode mode; |
---|
11 | struct OCstate* state; |
---|
12 | struct OCnode* node; |
---|
13 | struct OCtree* tree; |
---|
14 | int packed; /* track OC_Char and OC_Byte specially*/ |
---|
15 | struct OCCACHE { |
---|
16 | int valid; |
---|
17 | ocindex_t index; /* index corresponding to offset */ |
---|
18 | ocindex_t maxindex; /* max allowable index, if known0 => max unknown */ |
---|
19 | ocoffset_t offset; /* location of this content in the xdr data */ |
---|
20 | } cache; /* track last xdr position and index of this content */ |
---|
21 | struct OCcontent* next; |
---|
22 | } OCcontent; |
---|
23 | |
---|
24 | extern OCcontent* ocnewcontent(OCstate* state); |
---|
25 | extern void ocfreecontent(OCstate* state, OCcontent* content); |
---|
26 | extern OCmode ocgetmode(OCcontent* content); |
---|
27 | |
---|
28 | extern int ocdataith(struct OCstate*, OCcontent*, size_t, OCcontent*); |
---|
29 | extern int ocdatacount(struct OCstate*, OCcontent*, size_t*); |
---|
30 | |
---|
31 | extern int ocrootdata(struct OCstate*, struct OCnode*, struct OCcontent*); |
---|
32 | extern int ocgetcontent(struct OCstate*, struct OCcontent*, void* memory, |
---|
33 | size_t memsize, size_t start, size_t count); |
---|
34 | |
---|
35 | #endif /*OCCONTENT_H*/ |
---|