occontent.h 1.3 KB

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