1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * Copyright by the Board of Trustees of the University of Illinois.         *
4  * All rights reserved.                                                      *
5  *                                                                           *
6  * This file is part of HDF.  The full HDF copyright notice, including       *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the COPYING file, which can be found at the root of the source code       *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF/releases/.  *
10  * If you do not have access to either file, you may request a copy from     *
11  * help@hdfgroup.org.                                                        *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /* $Id$ */
15 
16 #ifndef _H_PROTO
17 #define _H_PROTO
18 
19 #include "H4api_adpt.h"
20 
21 /* Usefull macros, which someday might become actual functions */
22 /* Wrappers for Hinquire. feb-2-92 */
23 #define HQueryfileid(aid, fileid)     \
24   (Hinquire ((int32)   aid,  (int32*) fileid, (uint16*) NULL,\
25              (uint16*) NULL, (int32*) NULL,   (int32*)  NULL,\
26              (int32*)  NULL, (int16*) NULL,   (int16*)  NULL))
27 
28 #define HQuerytagref(aid, tag, ref) \
29   (Hinquire ((int32)   aid,  (int32*) NULL,   (uint16*) tag,\
30              (uint16*) ref,  (int32*) NULL,   (int32*)  NULL,\
31              (int32*)  NULL, (int16*) NULL,   (int16*)  NULL))
32 
33 #define HQuerylength(aid, length)     \
34   (Hinquire ((int32)    aid, (int32*) NULL, (uint16*) NULL,   \
35              (uint16*) NULL, (int32*) length,   (int32*)  NULL,   \
36              (int32*)  NULL, (int16*) NULL, (int16*)  NULL))
37 
38 #define HQueryoffset(aid, offset)     \
39   (Hinquire ((int32)    aid, (int32*) NULL, (uint16*) NULL,   \
40              (uint16*) NULL, (int32*) NULL,     (int32*)  offset, \
41              (int32*)  NULL, (int16*) NULL,     (int16*)  NULL))
42 
43 #define HQueryposition(aid, position) \
44   (Hinquire ((int32)    aid, (int32*) NULL, (uint16*) NULL,   \
45              (uint16*) NULL, (int32*) NULL, (int32*)  NULL,   \
46              (int32*) position, (int16*) NULL,  (int16*)  NULL))
47 
48 #define HQueryaccess(aid, access)     \
49   (Hinquire ((int32)    aid,    (int32*) NULL,   (uint16*) NULL,  \
50              (uint16*) NULL,    (int32*) NULL,   (int32*)  NULL,  \
51              (int32*)   NULL,   (int16*) access, (int16*)  NULL))
52 
53 #define HQueryspecial(aid, special) \
54   (Hinquire ((int32)    aid,    (int32*) NULL,  (uint16*) NULL,   \
55              (uint16*) NULL,    (int32*) NULL,  (int32*)  NULL,   \
56              (int32*)   NULL,   (int16*) NULL,  (int16*)  special))
57 
58 
59 #if defined c_plusplus || defined __cplusplus
60 extern      "C"
61 {
62 #endif                          /* c_plusplus || __cplusplus */
63 
64 /*
65    ** from hfile.c
66  */
67     HDFLIBAPI int32 Hopen
68                 (const char *path, intn acc_mode, int16 ndds);
69 
70     HDFLIBAPI intn Hclose
71                 (int32 file_id);
72 
73     HDFLIBAPI int32 Hstartread
74                 (int32 file_id, uint16 tag, uint16 ref);
75 
76     HDFLIBAPI intn Hnextread
77                 (int32 access_id, uint16 tag, uint16 ref, intn origin);
78 
79     HDFLIBAPI intn Hexist
80                 (int32 file_id, uint16 search_tag, uint16 search_ref);
81 
82     HDFLIBAPI intn Hinquire
83                 (int32 access_id, int32 * pfile_id, uint16 * ptag,
84           uint16 * pref, int32 * plength, int32 * poffset,
85         int32 * pposn, int16 * paccess, int16 * pspecial);
86 
87     HDFLIBAPI int32 Hstartwrite
88                 (int32 file_id, uint16 tag, uint16 ref, int32 length);
89 
90     HDFLIBAPI int32 Hstartaccess
91                 (int32 file_id, uint16 tag, uint16 ref, uint32 flags);
92 
93     HDFLIBAPI intn Hsetlength
94                 (int32 file_id, int32 length);
95 
96     HDFLIBAPI intn Happendable
97                 (int32 aid);
98 
99     HDFLIBAPI intn HPisappendable
100                 (int32 aid);
101 
102     HDFLIBAPI intn HPregister_term_func
103                 (hdf_termfunc_t term_func);
104 
105     HDFLIBAPI intn Hseek
106                 (int32 access_id, int32 offset, intn origin);
107 
108     HDFLIBAPI int32 Htell
109                 (int32 access_id);
110 
111     HDFLIBAPI int32 Hread
112                 (int32 access_id, int32 length, void * data);
113 
114     HDFLIBAPI int32 Hwrite
115                 (int32 access_id, int32 length, const void * data);
116 
117     HDFLIBAPI int32 Htrunc
118                 (int32 access_id, int32 trunc_len);
119 
120     HDFLIBAPI intn Hendaccess
121                 (int32 access_id);
122 
123     HDFLIBAPI intn HDgetc
124                 (int32 access_id);
125 
126     HDFLIBAPI intn HDputc
127                 (uint8 c, int32 access_id);
128 
129     HDFLIBAPI int32 Hgetelement
130                 (int32 file_id, uint16 tag, uint16 ref, uint8 * data);
131 
132     HDFLIBAPI int32 Hputelement
133                 (int32 file_id, uint16 tag, uint16 ref, const uint8 * data, int32 length);
134 
135     HDFLIBAPI int32 Hlength
136                 (int32 file_id, uint16 tag, uint16 ref);
137 
138     HDFLIBAPI int32 Hoffset
139                 (int32 file_id, uint16 tag, uint16 ref);
140 
141     HDFLIBAPI intn Hsync
142                 (int32 file_id);
143 
144     HDFLIBAPI intn Hcache
145                 (int32 file_id, intn cache_on);
146 
147     HDFLIBAPI intn Hgetlibversion
148                 (uint32 * majorv, uint32 * minorv,
149                  uint32 * releasev, char * string);
150 
151     HDFLIBAPI intn Hgetfileversion
152                 (int32 file_id, uint32 * majorv, uint32 * minorv,
153                  uint32 * release, char * string);
154 
155     HDFLIBAPI intn Hsetaccesstype(int32 access_id, uintn accesstype);
156 
157     HDFLIBAPI uint16 HDmake_special_tag
158                 (uint16 tag);
159 
160     HDFLIBAPI intn HDis_special_tag
161                 (uint16 tag);
162 
163     HDFLIBAPI uint16 HDbase_tag
164                 (uint16 tag);
165 
166     HDFLIBAPI int  HDerr
167                 (int32 file_id);
168 
169     HDFLIBAPI intn HDvalidfid
170                 (int32 file_id);
171 
172     HDFLIBAPI const char *HDgettagdesc
173                 (uint16 tag);
174 
175     HDFLIBAPI char *HDgettagsname
176                 (uint16 tag);
177 
178     HDFLIBAPI intn HDgettagnum
179                 (const char *tag_name);
180 
181     HDFLIBAPI char *HDgetNTdesc
182                 (int32 nt);
183 
184     HDFLIBAPI const char *HDfidtoname
185                 (int32 fid);
186 
187     HDFLIBAPI intn Hgetntinfo
188                 (int32 numbertype, hdf_ntinfo_t *nt_info);
189 
190     HDFLIBAPI intn Hishdf
191                 (const char * filename);
192 
193     HDFLIBAPI intn Hfidinquire
194                 (int32 file_id, char ** fname, intn * acc_mode,
195                  intn * attach);
196 
197     HDFLIBAPI intn Hshutdown(void);
198 
199     HDFLIBAPI void HPend(void);
200 
201     HDFLIBAPI intn HDdont_atexit(void);
202 
203 /*
204    ** from hfiledd.c
205  */
206 /******************************************************************************
207  NAME
208      Hdupdd - Duplicate a data descriptor
209 
210  DESCRIPTION
211     Duplicates a data descriptor so that the new tag/ref points to the
212     same data element pointed to by the old tag/ref.  Return FAIL if
213     the given tag/ref are already in use.
214 
215  RETURNS
216     returns SUCCEED (0) if successful, FAIL (-1) otherwise
217 
218 *******************************************************************************/
219 HDFLIBAPI intn Hdupdd(int32 file_id,      /* IN: File ID the tag/refs are in */
220         uint16 tag,             /* IN: Tag of new tag/ref */
221         uint16 ref,             /* IN: Ref of new tag/ref */
222         uint16 old_tag,         /* IN: Tag of old tag/ref */
223         uint16 old_ref          /* IN: Ref of old tag/ref */
224 );
225 
226 /******************************************************************************
227  NAME
228      Hnumber - Determine the number of objects of a given type
229 
230  DESCRIPTION
231     Determine how many objects of the given tag are in the file.
232     tag may be set to DFTAG_WILDCARD to get back the total number
233     of objects in the file.
234 
235     Note, a return value of zero is not a fail condition.
236 
237  RETURNS
238     the number of objects of type 'tag' else FAIL
239 
240 *******************************************************************************/
241 HDFLIBAPI int32 Hnumber(int32 file_id,    /* IN: File ID the tag/refs are in */
242         uint16 tag              /* IN: Tag to count */
243 );
244 
245 /******************************************************************************
246  NAME
247      Hnewref - Returns a ref that is guaranteed to be unique in the file
248 
249  DESCRIPTION
250     Returns a ref number that can be used with any tag to produce a
251     unique tag/ref.  Successive calls to Hnewref will generate a
252     strictly increasing sequence until the highest possible ref had been
253     returned, then Hnewref will return unused ref's starting from 1.
254 
255  RETURNS
256     returns the ref number, 0 otherwise
257 
258 *******************************************************************************/
259 HDFLIBAPI uint16 Hnewref(int32 file_id        /* IN: File ID the tag/refs are in */
260 );
261 
262 /******************************************************************************
263  NAME
264     Htagnewref  - returns a ref that is unique in the file for a given tag
265 
266  DESCRIPTION
267     Returns a ref number that can be used with any tag to produce a
268     unique tag/ref.  Successive calls to Hnewref will generate a
269     strictly increasing sequence until the highest possible ref had been
270     returned, then Hnewref will return unused ref's starting from 1.
271 
272  RETURNS
273     returns the ref number, 0 otherwise
274 
275 *******************************************************************************/
276 HDFLIBAPI uint16 Htagnewref(int32 file_id,    /* IN: File ID the tag/refs are in */
277         uint16 tag                  /* IN: Tag to search for a new ref for */
278 );
279 
280 /******************************************************************************
281  NAME
282     Hfind - locate the next object of a search in an HDF file
283 
284  DESCRIPTION
285     Searches for the `next' DD that fits the search tag/ref.  Wildcards
286     apply.  If origin is DF_FORWARD, search from current position forwards
287     in the file, otherwise DF_BACKWARD searches backward from the current
288     position in the file.  If *find_tag and *find_ref are both set to
289     0, this indicates the beginning of a search, and the search will
290     start from the beginning of the file if the direction is DF_FORWARD
291     and from the and of the file if the direction is DF_BACKWARD.
292 
293  RETURNS
294     returns SUCCEED (0) if successful and FAIL (-1) otherwise
295 
296 *******************************************************************************/
297 HDFLIBAPI intn Hfind(int32 file_id,       /* IN: file ID to search in */
298         uint16 search_tag,      /* IN: the tag to search for (can be DFTAG_WILDCARD) */
299         uint16 search_ref,      /* IN: ref to search for (can be DFREF_WILDCARD) */
300         uint16 *find_tag,       /* IN: if (*find_tag==0) and (*find_ref==0) then start search */
301                                 /* OUT: tag matching the search tag */
302         uint16 *find_ref,       /* IN: if (*find_tag==0) and (*find_ref==0) then start search */
303                                 /* OUT: ref matching the search ref */
304         int32 *find_offset,     /* OUT: offset of the data element found */
305         int32 *find_length,     /* OUT: length of the data element found */
306         intn direction          /* IN: Direction to search in: */
307                                 /*  DF_FORWARD searches forward from the current location */
308                                 /*  DF_BACKWARD searches backward from the current location */
309 );
310 
311 
312 /******************************************************************************
313  NAME
314      HDcheck_tagref - Checks to see if tag/ref is in DD list i.e. created already
315 
316  DESCRIPTION
317      Routine checks to see if tag/ref exists in the DD list i.e. has
318      been created.
319 
320  RETURNS
321      0-> tag/ref does not exist
322      1-> tag/ref exists
323     -1-> function failed
324 
325 *******************************************************************************/
326 HDFLIBAPI intn
327 HDcheck_tagref(int32  file_id, /* IN: id of file */
328                uint16 tag,     /* IN: Tag to check */
329                uint16 ref      /* IN: ref to check */);
330 
331 /************************************************************************
332 NAME
333    HDreuse_tagref -- reuse a data descriptor preserving tag/ref
334 
335 DESCRIPTION
336    Reuses the data descriptor of tag/ref in the dd list of the file.
337    The tag/ref must already exist in the DD list.
338    This routine is unsafe and may leave a file in a condition that is
339    not usable by some routines.  Use with care. Not valid for
340    special elments right now. Used for allowing the data to change
341    and move somewhere else in the file for non-special elements.
342    Must be carefully if apply to higher-level objects like GR's and SDS
343    that are comprised of other objects.
344    Usefull when re-writing simple elements whose size changes while
345    preserving the original tag/ref of the element since other elements
346    might refer to this element by tag/ref e.g. in a Vgroup.
347 
348 RETURNS
349    returns SUCCEED (0) if successful, FAIL (-1) otherwise
350 ************************************************************************/
351 HDFLIBAPI intn
352 HDreuse_tagref(int32 file_id, /* IN: id of file */
353                uint16 tag,    /* IN: tag of data descriptor to reuse */
354                uint16 ref     /* IN: ref of data descriptor to reuse */ );
355 
356 /******************************************************************************
357  NAME
358      Hdeldd - Delete a data descriptor
359 
360  DESCRIPTION
361     Deletes a data descriptor of tag/ref from the dd list of the file.
362     This routine is unsafe and may leave a file in a condition that is
363     not usable by some routines.  Use with care.
364     For example, if this element is contained in a Vgroup, that group
365     will *NOT* get updated to reflect that this element has been deleted.
366 
367  RETURNS
368     returns SUCCEED (0) if successful, FAIL (-1) otherwise
369 
370 *******************************************************************************/
371 HDFLIBAPI intn Hdeldd(int32 file_id,      /* IN: File ID the tag/refs are in */
372         uint16 tag,             /* IN: Tag of tag/ref to delete */
373         uint16 ref              /* IN: Ref of tag/ref to delete */
374 );
375 
376 /*
377    ** from hdfalloc.c
378  */
379 
380     HDFLIBAPI void * HDmemfill
381                 (void * dest, const void * src, uint32 item_size, uint32 num_items);
382 
383     HDFLIBAPI char *HIstrncpy
384                 (char * dest, const char * source, intn len);
385 
386     HDFLIBAPI int32 HDspaceleft
387                 (void);
388 
389 #if defined(MALLOC_CHECK)
390     HDFPUBLIC void * HDmalloc
391                 (uint32 qty);
392 
393     HDFPUBLIC void * HDrealloc
394                 (void * where, uint32 qty);
395 
396     HDFPUBLIC void * HDcalloc
397                 (uint32 n, uint32 size);
398 
399     HDFPUBLIC void HDfree
400                 (void * ptr);
401 
402 #endif /* defined MALLOC_CHECK */
403 
404     HDFPUBLIC char *HDstrdup
405                 (const char *s);
406 
407     HDFLIBAPI intn HDc2fstr
408                 (char * str, intn len);
409 
410     HDFLIBAPI char *HDf2cstring
411                 (_fcd fdesc, intn len);
412 
413     HDFLIBAPI intn HDflush
414                 (int32 file_id);
415 
416     HDFLIBAPI intn HDpackFstring
417                 (char * src, char * dest, intn len);
418 
419 /*
420    ** from hblocks.c
421  */
422     HDFLIBAPI int32 HLcreate
423                 (int32 file_id, uint16 tag, uint16 ref, int32 block_length,
424                  int32 number_blocks);
425 
426     HDFLIBAPI intn HLconvert
427                 (int32 aid, int32 block_length, int32 number_blocks);
428 
429     HDFLIBAPI int  HDinqblockinfo
430                 (int32 aid, int32 *length, int32 *first_length, int32 *block_length,
431                  int32 *number_blocks);
432 
433     HDFLIBAPI intn HLsetblockinfo
434                 (int32 aid, int32 block_size, int32 num_blocks);
435 
436     HDFLIBAPI intn HLgetblockinfo
437                 (int32 aid, int32* block_size, int32* num_blocks);
438 
439     HDFLIBAPI intn HLgetdatainfo
440         (int32 file_id, uint8 *buf, uintn start_block,
441         uintn info_count, int32 *offsetarray, int32 *lengtharray);
442 
443 
444 /*
445    ** from hextelt.c
446  */
447     HDFLIBAPI int32 HXcreate
448                 (int32 file_id, uint16 tag, uint16 ref, const char * extern_file_name,
449                  int32 offset, int32 start_len);
450 
451     HDFLIBAPI intn HXsetcreatedir
452                 (const char *dir);
453 
454     HDFLIBAPI intn HXsetdir
455                 (const char *dir);
456 
457 /*
458    ** from hcomp.c
459  */
460     HDFLIBAPI int32 HCcreate
461                 (int32 file_id, uint16 tag, uint16 ref,
462                  comp_model_t model_type, model_info * m_info,
463                  comp_coder_t coder_type, comp_info * c_info);
464 
465     HDFLIBAPI intn HCPgetcompress
466                 (int32 file_id, uint16 data_tag, uint16 data_ref,
467         comp_coder_t *coder_type, comp_info * c_info);
468 
469     HDFLIBAPI intn HCPgetcompinfo
470                 (int32 file_id, uint16 data_tag, uint16 data_ref,
471         comp_coder_t *coder_type, comp_info * c_info);
472 
473     HDFLIBAPI intn HCPgetcomptype
474                 (int32 file_id, uint16 data_tag, uint16 data_ref,
475         comp_coder_t *coder_type);
476 
477     HDFLIBAPI intn HCPgetdatasize
478                 (int32 file_id, uint16 data_tag, uint16 data_ref,
479         int32* comp_size, int32* orig_size);
480 
481     HDFPUBLIC intn HCget_config_info ( comp_coder_t coder_type, uint32 *compression_config_info);
482 
483     HDFLIBAPI int32 HCPquery_encode_header(comp_model_t model_type, model_info * m_info,
484              comp_coder_t coder_type, comp_info * c_info);
485 
486     HDFLIBAPI intn HCPencode_header(uint8 *p, comp_model_t model_type, model_info * m_info,
487              comp_coder_t coder_type, comp_info * c_info);
488 
489     HDFLIBAPI intn HCPdecode_header(uint8 *p, comp_model_t *model_type, model_info * m_info,
490              comp_coder_t *coder_type, comp_info * c_info);
491 
492 /*
493    ** from cszip.c
494  */
495 
496      HDFLIBAPI intn HCPsetup_szip_parms ( comp_info *c_info, int32 nt, int32 ncomp, int32 ndims, int32 *dims, int32 *cdims);
497 /*
498    ** from hbuffer.c
499  */
500     HDFLIBAPI intn HBconvert
501                 (int32 aid);
502 
503 /*
504    ** from hcompri.c
505  */
506     HDFLIBAPI int32 HRPconvert
507                 (int32 fid, uint16 tag, uint16 ref, int32 xdim, int32 ydim,int16 scheme, comp_info *cinfo, uintn pixel_size);
508 
509 
510 /*
511    ** from herr.c
512  */
513     HDFLIBAPI const char *HEstring
514                 (hdf_err_code_t error_code);
515 
516     HDFLIBAPI void HEpush
517                 (hdf_err_code_t error_code, const char * function_name,
518                  const char * file_name, intn line);
519 
520     HDFLIBAPI void HEreport
521                 (const char *,...);
522 
523     HDFLIBAPI void HEprint
524                 (FILE * stream, int32 print_level);
525 
526     HDFLIBAPI int16 HEvalue
527                 (int32 level);
528 
529     HDFLIBAPI void HEPclear
530                 (void);
531 
532     HDFLIBAPI intn HEshutdown(void);
533 
534 /*
535    ** from hbitio.c
536  */
537     HDFLIBAPI int32 Hstartbitread
538                 (int32 file_id, uint16 tag, uint16 ref);
539 
540     HDFLIBAPI int32 Hstartbitwrite
541                 (int32 file_id, uint16 tag, uint16 ref, int32 length);
542 
543     HDFLIBAPI intn Hbitappendable
544                 (int32 bitid);
545 
546     HDFLIBAPI intn Hbitwrite
547                 (int32 bitid, intn count, uint32 data);
548 
549     HDFLIBAPI intn Hbitread
550                 (int32 bitid, intn count, uint32 *data);
551 
552     HDFLIBAPI intn Hbitseek
553                 (int32 bitid, int32 byte_offset, intn bit_offset);
554 
555     HDFLIBAPI intn Hgetbit
556                 (int32 bitid);
557 
558     HDFLIBAPI int32 Hendbitaccess
559                 (int32 bitfile_id, intn flushbit);
560 
561     HDFLIBAPI intn HPbitshutdown(void);
562 
563 /*
564  ** from dfutil.c
565  */
566     HDFLIBAPI uint16 DFfindnextref
567                 (int32 file_id, uint16 tag, uint16 lref);
568 
569 /*
570    ** from dfcomp.c
571  */
572     HDFLIBAPI intn DFputcomp
573                 (int32 file_id, uint16 tag, uint16 ref, const uint8 * image,
574         int32 xdim, int32 ydim, uint8 * palette, uint8 * newpal,
575                  int16 scheme, comp_info * cinfo);
576 
577     HDFLIBAPI int  DFgetcomp
578                 (int32 file_id, uint16 tag, uint16 ref, uint8 * image,
579                  int32 xdim, int32 ydim, uint16 scheme);
580 
581 /*
582    ** from dfrle.c
583  */
584     HDFLIBAPI int32 DFCIrle
585                 (const void * buf, void * bufto, int32 len);
586 
587     HDFLIBAPI int32 DFCIunrle
588                 (uint8 * buf, uint8 *bufto, int32 outlen, int resetsave);
589 
590 /*
591    ** from dfimcomp.c
592  */
593     HDFLIBAPI void DFCIimcomp
594                 (int32 xdim, int32 ydim, const uint8 *in, uint8 out[],
595                  uint8 in_pal[], uint8 out_pal[], int mode);
596 
597     HDFLIBAPI void DFCIunimcomp
598                 (int32 xdim, int32 ydim, uint8 in[], uint8 out[]);
599 
600 /*
601    ** from dfjpeg.c
602  */
603 
604     HDFLIBAPI intn DFCIjpeg
605                 (int32 file_id, uint16 tag, uint16 ref, int32 xdim, int32 ydim,
606                  const void * image, int16 scheme, comp_info * scheme_info);
607 
608 /*
609    ** from dfunjpeg.c
610  */
611 
612     HDFLIBAPI intn DFCIunjpeg
613                 (int32 file_id, uint16 tag, uint16 ref, void * image, int32 xdim,
614                  int32 ydim, int16 scheme);
615 
616 /*
617    ** from dfgroup.c
618  */
619     HDFLIBAPI int32 DFdiread
620                 (int32 file_id, uint16 tag, uint16 ref);
621 
622     HDFLIBAPI intn DFdiget
623                 (int32 list, uint16 * ptag, uint16 * pref);
624 
625     HDFLIBAPI intn DFdinobj
626                 (int32 list);
627 
628     HDFLIBAPI int32 DFdisetup
629                 (int maxsize);
630 
631     HDFLIBAPI intn DFdiput
632                 (int32 list, uint16 tag, uint16 ref);
633 
634     HDFLIBAPI intn DFdiwrite
635                 (int32 file_id, int32 list, uint16 tag, uint16 ref);
636 
637     HDFLIBAPI void DFdifree
638                 (int32 groupID);
639 
640 /*
641    ** from dfp.c
642  */
643     HDFLIBAPI intn DFPgetpal
644                 (const char * filename, void * palette);
645 
646     HDFLIBAPI intn DFPputpal
647                 (const char * filename, const void * palette, intn overwrite, const char * filemode);
648 
649     HDFLIBAPI intn DFPaddpal
650                 (const char * filename, const void * palette);
651 
652     HDFLIBAPI intn DFPnpals
653                 (const char * filename);
654 
655     HDFLIBAPI intn DFPreadref
656                 (const char * filename, uint16 ref);
657 
658     HDFLIBAPI intn DFPwriteref
659                 (const char * filename, uint16 ref);
660 
661     HDFLIBAPI intn DFPrestart
662                 (void);
663 
664     HDFLIBAPI uint16 DFPlastref
665                 (void);
666 
667 /*
668    ** from dfr8.c
669  */
670     HDFLIBAPI int  DFR8setcompress
671                 (int32 scheme, comp_info * cinfo);
672 
673     HDFLIBAPI intn DFR8getdims
674                 (const char * filename, int32 * pxdim, int32 * pydim,
675                  int * pispal);
676 
677     HDFLIBAPI intn DFR8getimage
678                 (const char * filename, uint8 * image, int32 xdim, int32 ydim,
679                  uint8 * pal);
680 
681     HDFLIBAPI intn DFR8setpalette
682                 (uint8 * pal);
683 
684     HDFLIBAPI intn DFR8putimage
685                 (const char * filename, const void * image, int32 xdim, int32 ydim, uint16 compress);
686 
687     HDFLIBAPI intn DFR8addimage
688                 (const char * filename, const void * image, int32 xdim, int32 ydim, uint16 compress);
689 
690     HDFLIBAPI intn DFR8nimages
691                 (const char * filename);
692 
693     HDFLIBAPI intn DFR8readref
694                 (const char * filename, uint16 ref);
695 
696     HDFLIBAPI intn DFR8writeref
697                 (const char * filename, uint16 ref);
698 
699     HDFLIBAPI intn DFR8restart
700                 (void);
701 
702     HDFLIBAPI uint16 DFR8lastref
703                 (void);
704 
705     HDFLIBAPI intn DFR8getpalref(uint16 *pal_ref);
706 
707     HDFLIBAPI intn DFR8Pshutdown(void);
708 
709 /*
710    ** from dfgr.c
711  */
712     HDFLIBAPI intn DFGRgetlutdims
713                 (const char * filename, int32 * pxdim, int32 * pydim,
714                  intn * pncomps, intn * pil);
715 
716     HDFLIBAPI intn DFGRreqlutil
717                 (intn il);
718 
719     HDFLIBAPI intn DFGRgetlut
720                 (const char * filename, void * lut, int32 xdim, int32 ydim);
721 
722     HDFLIBAPI intn DFGRgetimdims
723                 (const char * filename, int32 * pxdim, int32 * pydim,
724                  intn * pncomps, intn * pil);
725 
726     HDFLIBAPI intn DFGRreqimil
727                 (intn il);
728 
729     HDFLIBAPI intn DFGRgetimage
730                 (const char * filename, void * image, int32 xdim, int32 ydim);
731 
732     HDFLIBAPI intn DFGRsetcompress
733                 (int32 scheme, comp_info * cinfo);
734 
735     HDFLIBAPI intn DFGRsetlutdims
736                 (int32 xdim, int32 ydim, intn ncomps, intn il);
737 
738     HDFLIBAPI intn DFGRsetlut
739                 (void * lut, int32 xdim, int32 ydim);
740 
741     HDFLIBAPI intn DFGRaddlut
742                 (const char * filename, void * lut, int32 xdim, int32 ydim);
743 
744     HDFLIBAPI intn DFGRsetimdims
745                 (int32 xdim, int32 ydim, intn ncomps, intn il);
746 
747     HDFLIBAPI intn DFGRaddimage
748                 (const char * filename, void * image, int32 xdim, int32 ydim);
749 
750     HDFLIBAPI intn DFGRputimage
751                 (const char * filename, void * image, int32 xdim, int32 ydim);
752 
753     HDFLIBAPI intn DFGRreadref
754                 (const char * filename, uint16 ref);
755 
756     HDFLIBAPI uint16 DFGRIlastref
757                 (void);
758 
759     HDFLIBAPI intn DFGRIgetdims
760                 (const char * filename, int32 * pxdim, int32 * pydim,
761                  intn * pncomps, intn * pil, intn type);
762 
763     HDFLIBAPI intn DFGRIreqil
764                 (intn il, intn type);
765 
766     HDFLIBAPI intn DFGRIgetimlut
767                 (const char * filename, void * imlut, int32 xdim, int32 ydim, intn type,
768                  intn isfortran, int *compressed, uint16 *compr_type, int *has_pal);
769 
770     HDFLIBAPI intn DFGRIsetdims
771                 (int32 xdim, int32 ydim, intn ncomps, intn type);
772 
773     HDFLIBAPI intn DFGRIsetil
774                 (intn il, intn type);
775 
776     HDFLIBAPI intn DFGRIrestart
777                 (void);
778 
779     HDFLIBAPI intn DFGRIaddimlut
780                 (const char * filename, const void * imlut, int32 xdim, int32 ydim, intn type,
781                  intn isfortran, intn newfile);
782 
783     HDFLIBAPI intn DFGRPshutdown(void);
784 
785 /*
786    ** from df24.c
787  */
788     HDFLIBAPI intn DF24getdims
789                 (const char * filename, int32 * pxdim, int32 * pydim,
790                  intn * pil);
791 
792     HDFLIBAPI intn DF24reqil
793                 (intn il);
794 
795     HDFLIBAPI intn DF24getimage
796                 (const char * filename, void * image, int32 xdim, int32 ydim);
797 
798     HDFLIBAPI intn DF24setdims
799                 (int32 xdim, int32 ydim);
800 
801     HDFLIBAPI intn DF24setil
802                 (intn il);
803 
804     HDFLIBAPI intn DF24setcompress
805                 (int32 type, comp_info * cinfo);
806 
807     HDFLIBAPI intn DF24restart
808                 (void);
809 
810     HDFLIBAPI intn DF24addimage
811                 (const char * filename, const void * image, int32 xdim, int32 ydim);
812 
813     HDFLIBAPI intn DF24putimage
814                 (const char * filename, const void * image, int32 xdim, int32 ydim);
815 
816     HDFLIBAPI intn DF24nimages
817                 (const char * filename);
818 
819     HDFLIBAPI intn DF24readref
820                 (const char * filename, uint16 ref);
821 
822     HDFLIBAPI uint16 DF24lastref
823                 (void);
824 
825 /*
826    ** from dfan.c
827  */
828 
829     HDFLIBAPI int32 DFANgetlablen
830                 (const char * filename, uint16 tag, uint16 ref);
831 
832     HDFLIBAPI intn DFANgetlabel
833                 (const char * filename, uint16 tag, uint16 ref, char * label,
834                  int32 maxlen);
835 
836     HDFLIBAPI int32 DFANgetdesclen
837                 (const char * filename, uint16 tag, uint16 ref);
838 
839     HDFLIBAPI intn DFANgetdesc
840                 (const char * filename, uint16 tag, uint16 ref, char * desc,
841                  int32 maxlen);
842 
843     HDFLIBAPI int32 DFANgetfidlen
844                 (int32 file_id, intn isfirst);
845 
846     HDFLIBAPI int32 DFANgetfid
847                 (int32 file_id, char * id, int32 maxlen, intn isfirst);
848 
849     HDFLIBAPI int32 DFANgetfdslen
850                 (int32 file_id, intn isfirst);
851 
852     HDFLIBAPI int32 DFANgetfds
853                 (int32 file_id, char * desc, int32 maxlen, intn isfirst);
854 
855     HDFLIBAPI intn DFANputlabel
856                 (const char * filename, uint16 tag, uint16 ref, char * label);
857 
858     HDFLIBAPI intn DFANputdesc
859                 (const char * filename, uint16 tag, uint16 ref, char * desc,
860                  int32 desclen);
861 
862     HDFLIBAPI intn DFANaddfid
863                 (int32 file_id, char * id);
864 
865     HDFLIBAPI intn DFANaddfds
866                 (int32 file_id, char * desc, int32 desclen);
867 
868     HDFLIBAPI uint16 DFANlastref
869                 (void);
870 
871     HDFLIBAPI intn DFANlablist
872                 (const char * filename, uint16 tag, uint16 reflist[],
873          char * labellist, intn listsize, intn maxlen, intn startpos);
874 
875     HDFLIBAPI intn DFANclear
876                 (void);
877 
878     HDFLIBAPI intn DFANIclear
879                 (void);
880 
881     HDFLIBAPI uint16 DFANIlocate
882                 (int32 file_id, int type, uint16 tag, uint16 ref);
883 
884     HDFLIBAPI int  DFANIaddentry
885                 (int type, uint16 annref, uint16 datatag, uint16 dataref);
886 
887     HDFLIBAPI int32 DFANIgetannlen
888                 (const char * filename, uint16 tag, uint16 ref, int type);
889 
890     HDFLIBAPI intn DFANIgetann
891                 (const char * filename, uint16 tag, uint16 ref, uint8 * ann,
892                  int32 maxlen, int type, int isfortran);
893 
894     HDFLIBAPI intn DFANIputann
895                 (const char * filename, uint16 tag, uint16 ref, uint8 * ann,
896                  int32 annlen, int type);
897 
898     HDFLIBAPI int  DFANIlablist
899                 (const char * filename, uint16 tag, uint16 reflist[],
900             uint8 * labellist, int listsize, int maxlen, int startpos,
901                  int isfortran);
902 
903     HDFLIBAPI int  DFANIaddfann
904                 (int32 file_id, char * ann, int32 annlen, int type);
905 
906     HDFLIBAPI int32 DFANIgetfannlen
907                 (int32 file_id, int type, int isfirst);
908 
909     HDFLIBAPI int32 DFANIgetfann
910                 (int32 file_id, char * ann, int32 maxlen, int type, int isfirst);
911 
912     HDFLIBAPI intn DFANPshutdown(void);
913 
914 /*
915    ** from dfsd.c
916  */
917 
918     HDFLIBAPI int  DFSDgetdims
919                 (const char * filename, intn * prank, int32 sizes[], intn maxrank);
920 
921     HDFLIBAPI int  DFSDgetdatastrs
922                 (char * label, char * unit, char * format, char * coordsys);
923 
924     HDFLIBAPI int  DFSDgetdimstrs
925                 (int dim, char * label, char * unit, char * format);
926 
927     HDFLIBAPI int  DFSDgetdatalen
928                 (int * llabel, int * lunit, int * lformat, int * lcoordsys);
929 
930     HDFLIBAPI int  DFSDgetdimlen
931                 (int dim, int * llabel, int * lunit, int * lformat);
932 
933     HDFLIBAPI int  DFSDgetdimscale
934                 (intn dim, int32 maxsize, void * scale);
935 
936     HDFLIBAPI int  DFSDgetrange
937                 (void * pmax, void * pmin);
938 
939     HDFLIBAPI int  DFSDgetdata
940                 (const char * filename, intn rank, int32 maxsizes[], void * data);
941 
942     HDFLIBAPI int  DFSDsetlengths
943                 (int maxlen_label, int maxlen_unit, int maxlen_format,
944                  int maxlen_coordsys);
945 
946     HDFLIBAPI int  DFSDsetdims
947                 (intn rank, int32 dimsizes[]);
948 
949     HDFLIBAPI int  DFSDsetdatastrs
950                 (const char * label, const char * unit, const char * format, const char * coordsys);
951 
952     HDFLIBAPI int  DFSDsetdimstrs
953                 (int dim, const char * label, const char * unit, const char * format);
954 
955     HDFLIBAPI int  DFSDsetdimscale
956                 (intn dim, int32 dimsize, void * scale);
957 
958     HDFLIBAPI int  DFSDsetrange
959                 (void * maxi, void * mini);
960 
961     HDFLIBAPI int  DFSDputdata
962                 (const char * filename, intn rank, int32 dimsizes[], void * data);
963 
964     HDFLIBAPI int  DFSDadddata
965                 (const char * filename, intn rank, int32 dimsizes[], void * data);
966 
967     HDFLIBAPI int  DFSDrestart
968                 (void);
969 
970     HDFLIBAPI int32 DFSDndatasets
971                 (char * filename);
972 
973     HDFLIBAPI int  DFSDclear
974                 (void);
975 
976     HDFLIBAPI uint16 DFSDlastref
977                 (void);
978 
979     HDFLIBAPI int  DFSDreadref
980                 (char * filename, uint16 ref);
981 
982     HDFLIBAPI int  DFSDgetslice
983                 (const char * filename, int32 winst[], int32 windims[], void * data,
984                  int32 dims[]);
985 
986     HDFLIBAPI int  DFSDstartslice
987                 (const char * filename);
988 
989     HDFLIBAPI int  DFSDputslice
990                 (int32 winend[], void * data, int32 dims[]);
991 
992     HDFLIBAPI int  DFSDendslice
993                 (void);
994 
995     HDFLIBAPI int  DFSDsetNT
996                 (int32 numbertype);
997 
998     HDFLIBAPI int  DFSDsetorder
999                 (int arrayorder);
1000 
1001     HDFLIBAPI int  DFSDgetNT
1002                 (int32 * pnumbertype);
1003 
1004     HDFLIBAPI intn DFSDpre32sdg
1005                 (char * filename, uint16 ref, intn * ispre32);
1006 
1007     HDFLIBAPI int  DFSDsetcal
1008                 (float64 cal, float64 cal_err, float64 ioff,
1009                  float64 ioff_err, int32 cal_nt);
1010 
1011     HDFLIBAPI int  DFSDgetcal
1012                 (float64 * pcal, float64 * pcal_err, float64 * pioff,
1013                  float64 * pioff_err, int32 * cal_nt);
1014 
1015     HDFLIBAPI int  DFSDwriteref
1016                 (const char * filename, uint16 ref);
1017 
1018     HDFLIBAPI int  DFSDsetfillvalue
1019                 (void * fill_value);
1020 
1021     HDFLIBAPI int  DFSDgetfillvalue
1022                 (void * fill_value);
1023 
1024     HDFLIBAPI int  DFSDstartslab
1025                 (const char * filename);
1026 
1027     HDFLIBAPI int  DFSDwriteslab
1028                 (int32 start[], int32 stride[], int32 count[],
1029                  void * data);
1030 
1031     HDFLIBAPI int  DFSDendslab
1032                 (void);
1033 
1034     HDFLIBAPI int  DFSDreadslab
1035                 (const char *filename, int32 start[], int32 slab_size[],
1036              int32 stride[], void * buffer, int32 buffer_size[]);
1037 
1038     HDFLIBAPI intn DFSDPshutdown(void);
1039 
1040 /*
1041    ** from dfconv.c
1042  */
1043 
1044     HDFLIBAPI int  DFKNTsize
1045                 (int32 number_type);
1046 
1047     HDFLIBAPI int32 DFKisnativeNT
1048                 (int32 numbertype);
1049 
1050     HDFLIBAPI int32 DFKislitendNT
1051                 (int32 numbertype);
1052 
1053     HDFLIBAPI int8 DFKgetPNSC
1054                 (int32 numbertype, int32 machinetype);
1055 
1056     HDFLIBAPI intn DFKsetNT
1057                 (int32 ntype);
1058 
1059     HDFLIBAPI int32 DFKconvert
1060                 (void * source, void * dest, int32 ntype, int32 num_elm,
1061                  int16 acc_mode, int32 source_stride, int32 dest_stride);
1062 
1063 /*
1064    ** from dfknat.c
1065  */
1066 
1067     HDFLIBAPI intn DFKnb1b
1068                 (void * s, void * d, uint32 num_elm, uint32 source_stride, uint32 dest_stride);
1069 
1070     HDFLIBAPI intn DFKnb2b
1071                 (void * s, void * d, uint32 num_elm, uint32 source_stride, uint32 dest_stride);
1072 
1073     HDFLIBAPI intn DFKnb4b
1074                 (void * s, void * d, uint32 num_elm, uint32 source_stride, uint32 dest_stride);
1075 
1076     HDFLIBAPI intn DFKnb8b
1077                 (void * s, void * d, uint32 num_elm, uint32 source_stride, uint32 dest_stride);
1078 
1079 /*
1080    ** from dfkswap.c
1081  */
1082 
1083     HDFLIBAPI intn DFKsb2b
1084                 (void * s, void * d, uint32 num_elm, uint32 source_stride, uint32 dest_stride);
1085 
1086     HDFLIBAPI intn DFKsb4b
1087                 (void * s, void * d, uint32 num_elm, uint32 source_stride, uint32 dest_stride);
1088 
1089     HDFLIBAPI intn DFKsb8b
1090                 (void * s, void * d, uint32 num_elm, uint32 source_stride, uint32 dest_stride);
1091 
1092 
1093 /* Multi-file Annotation C-routines found in mfan.c */
1094 HDFLIBAPI int32 ANstart(int32 file_id);
1095 
1096 HDFLIBAPI intn  ANfileinfo(int32 an_id, int32 *n_file_label, int32 *n_file_desc,
1097                         int32 *n_obj_label, int32 *n_obj_desc);
1098 
1099 HDFLIBAPI int32 ANend(int32 an_id);
1100 
1101 HDFLIBAPI int32 ANcreate(int32 an_id, uint16 elem_tag, uint16 elem_ref,
1102                       ann_type type);
1103 
1104 HDFLIBAPI int32 ANcreatef(int32 an_id, ann_type type);
1105 
1106 HDFLIBAPI int32 ANselect(int32 an_id, int32 idx, ann_type type);
1107 
1108 HDFLIBAPI intn  ANnumann(int32 an_id, ann_type type, uint16 elem_tag,
1109                       uint16 elem_ref);
1110 
1111 HDFLIBAPI intn  ANannlist(int32 an_id, ann_type type, uint16 elem_tag,
1112                        uint16 elem_ref, int32 ann_list[]);
1113 
1114 HDFLIBAPI int32 ANannlen(int32 ann_id);
1115 
1116 HDFLIBAPI int32 ANwriteann(int32 ann_id, const char *ann, int32 annlen);
1117 
1118 HDFLIBAPI int32 ANreadann(int32 ann_id, char *ann, int32 maxlen);
1119 
1120 HDFLIBAPI intn  ANendaccess(int32 ann_id);
1121 
1122 HDFLIBAPI int32 ANget_tagref(int32 an_id, int32 idx, ann_type type,
1123                           uint16 *ann_tag, uint16 *ann_ref);
1124 
1125 HDFLIBAPI int32 ANid2tagref(int32 an_id, uint16 *ann_tag, uint16 *ann_ref);
1126 
1127 HDFLIBAPI int32 ANtagref2id(int32 an_id, uint16 ann_tag, uint16 ann_ref);
1128 
1129 HDFLIBAPI uint16 ANatype2tag(ann_type atype);
1130 
1131 HDFLIBAPI ann_type ANtag2atype(uint16 atag);
1132 
1133 /* BMR: Removed because this function is meant to be private.
1134 HDFLIBAPI intn ANdestroy(void); */
1135 
1136 /* Multi-file Raster C-routines found in mfgr.c */
1137 HDFLIBAPI intn rigcompare(void * k1, void * k2, intn cmparg);
1138 
1139 HDFLIBAPI int32 GRstart(int32 hdf_file_id);
1140 
1141 HDFLIBAPI intn GRfileinfo(int32 grid,int32 *n_datasets,int32 *n_attrs);
1142 
1143 HDFLIBAPI intn GRend(int32 grid);
1144 
1145 HDFLIBAPI int32 GRcreate(int32 grid,const char *name,int32 ncomp,int32 nt,int32 il,
1146     int32 dimsizes[2]);
1147 
1148 HDFLIBAPI int32 GRselect(int32 grid,int32 idx);
1149 
1150 HDFLIBAPI int32 GRnametoindex(int32 grid,const char *name);
1151 
1152 HDFLIBAPI intn GRgetiminfo(int32 riid,char *name,int32 *ncomp,int32 *nt,int32 *il,
1153     int32 dimsizes[2],int32 *n_attr);
1154 
1155 HDFLIBAPI intn GRgetnluts(int32 riid);
1156 
1157 HDFLIBAPI intn GRwriteimage(int32 riid,int32 start[2],int32 stride[2],
1158     int32 count[2],void * data);
1159 
1160 HDFLIBAPI intn GRreadimage(int32 riid,int32 start[2],int32 stride[2],
1161     int32 count[2],void * data);
1162 
1163 HDFLIBAPI intn GRendaccess(int32 riid);
1164 
1165 HDFLIBAPI uint16 GRidtoref(int32 riid);
1166 
1167 HDFLIBAPI int32 GRreftoindex(int32 grid,uint16 ref);
1168 
1169 HDFLIBAPI intn GRreqlutil(int32 riid,intn il);
1170 
1171 HDFLIBAPI intn GRreqimageil(int32 riid,intn il);
1172 
1173 HDFLIBAPI int32 GRgetlutid(int32 riid,int32 idx);
1174 
1175 HDFLIBAPI uint16 GRluttoref(int32 lutid);
1176 
1177 HDFLIBAPI intn GRgetlutinfo(int32 riid,int32 *ncomp,int32 *nt,
1178     int32 *il,int32 *nentries);
1179 
1180 HDFLIBAPI intn GRwritelut(int32 riid,int32 ncomps,int32 nt,
1181     int32 il,int32 nentries,void * data);
1182 
1183 HDFLIBAPI intn GRreadlut(int32 lutid,void * data);
1184 
1185 HDFLIBAPI intn GRsetexternalfile(int32 riid,const char *filename,int32 offset);
1186 
1187 HDFLIBAPI intn GRsetaccesstype(int32 riid,uintn accesstype);
1188 
1189 HDFLIBAPI intn GRsetcompress(int32 riid,comp_coder_t comp_type,comp_info *cinfo);
1190 
1191 HDFLIBAPI intn GRgetcompress(int32 riid,comp_coder_t* comp_type,comp_info *cinfo);
1192 
1193 HDFLIBAPI intn GRgetcompinfo(int32 riid,comp_coder_t* comp_type,comp_info *cinfo);
1194 
1195 HDFLIBAPI intn GRsetattr(int32 id,const char *name,int32 attr_nt,int32 count,const void * data);
1196 
1197 HDFLIBAPI intn GRattrinfo(int32 id,int32 idx,char *name,int32 *attr_nt,int32 *count);
1198 
1199 HDFLIBAPI intn GRgetattr(int32 id,int32 idx,void * data);
1200 
1201 HDFLIBAPI int32 GRfindattr(int32 id,const char *name);
1202 
1203 HDFLIBAPI intn GRgetcomptype (int32 riid, comp_coder_t *comp_type);
1204 
1205 HDFLIBAPI intn GRPshutdown(void);
1206 
1207 /* This function was added for hmap project only.  Feb-25-2011 */
1208 HDFLIBAPI intn GR2bmapped(int32 riid, intn *tobe_mapped, intn *created_byGR);
1209 
1210 /*=== HDF_CHUNK_DEF same as in mfhdf.h - moved here  ====*/
1211 
1212 /* Bit flags used for SDsetchunk(), SDgetchunkinfo()
1213    GRsetchunk() and GRgetchunkinfo(). Note that GRs do not support NBIT */
1214 #define HDF_NONE    0x0
1215 #define HDF_CHUNK   0x1
1216 #define HDF_COMP    0x3
1217 #define HDF_NBIT    0x5
1218 
1219 /* Cache flags */
1220 #define HDF_CACHEALL 0x1
1221 
1222 /* Chunk Defintion, Note that GRs need only 2 dimensions for the chunk_lengths */
1223 typedef union hdf_chunk_def_u
1224 {
1225     /* Chunk Lengths only */
1226     int32   chunk_lengths[H4_MAX_VAR_DIMS]; /* chunk lengths along each dimension */
1227 
1228     struct
1229     {   /* For Compression info */
1230         int32      chunk_lengths[H4_MAX_VAR_DIMS]; /* chunk lengths along each dimension */
1231         int32      comp_type;    /* Compression type */
1232         int32      model_type;   /* Compression model type */
1233         comp_info  cinfo;        /* Compression info struct */
1234         model_info minfo;        /* Compression model info struct */
1235     }comp;
1236 
1237     struct
1238     { /* For NBIT, Used by SDS and not by GR */
1239         int32 chunk_lengths[H4_MAX_VAR_DIMS]; /* chunk lengths along each dimension */
1240         intn  start_bit; /* offset of the start bit in the data */
1241         intn  bit_len;   /* number of bits to store */
1242         intn  sign_ext;  /* whether to sign extend or not */
1243         intn  fill_one;  /* whether to fill with 1's or not (0's) */
1244     } nbit;
1245 
1246 } HDF_CHUNK_DEF;
1247 
1248 /*=== GR Chunking Routines  ====*/
1249 
1250 /******************************************************************************
1251  NAME
1252       GRsetchunk   -- make GR a chunked GR
1253 
1254  DESCRIPTION
1255       This routine makes the GR a chunked GR according to the chunk
1256       definition passed in.
1257 
1258       The image currently cannot be special already.  i.e. NBIT,
1259       COMPRESSED, or EXTERNAL. This is an Error.
1260 
1261       The defintion of the HDF_CHUNK_DEF union with relvant fields is:
1262 
1263       typedef union hdf_chunk_def_u
1264       {
1265          int32   chunk_lengths[2];  Chunk lengths along each dimension
1266 
1267          struct
1268           {
1269             int32     chunk_lengths[2]; Chunk lengths along each dimension
1270             int32     comp_type;                   Compression type
1271             comp_info cinfo;                       Compression info struct
1272           }comp;
1273 
1274       } HDF_CHUNK_DEF
1275 
1276       The simplist is the 'chunk_lengths' array specifiying chunk
1277       lengths for each dimension where the 'flags' argument set to
1278       'HDF_CHUNK';
1279 
1280       COMPRESSION is set by using the 'HDF_CHUNK_DEF' structure to set the
1281       appropriate compression information along with the required chunk lengths
1282       for each dimension. The compression information is the same as
1283       that set in 'SDsetcompress()'. The bit-or'd'flags' argument' is set to
1284       'HDF_CHUNK | HDF_COMP'.
1285 
1286       See the example in pseudo-C below for further usage.
1287 
1288       The maximum number of Chunks in an HDF file is 65,535.
1289 
1290       The performance of the GRxxx interface with chunking is greatly
1291       affected by the users access pattern over the image and by
1292       the maximum number of chunks set in the chunk cache. The cache contains
1293       the Least Recently Used(LRU cache replacment policy) chunks. See the
1294       routine GRsetchunkcache() for further info on the chunk cache and how
1295       to set the maximum number of chunks in the chunk cache. A default chunk
1296       cache is always created.
1297 
1298       The following example shows the organization of chunks for a 2D iamge.
1299       e.g. 4x4 image with 2x2 chunks. The array shows the layout of
1300            chunks in the chunk array.
1301 
1302             4 ---------------------
1303               |         |         |
1304         Y     |  (0,1)  |  (1,1)  |
1305         ^     |         |         |
1306         |   2 ---------------------
1307         |     |         |         |
1308         |     |  (0,0)  |  (1,0)  |
1309         |     |         |         |
1310         |     ---------------------
1311         |     0         2         4
1312         ---------------> X
1313 
1314         --Without compression--:
1315         {
1316         HDF_CHUNK_DEF chunk_def;
1317 
1318         .......
1319         -- Set chunk lengths --
1320         chunk_def.chunk_lengths[0]= 2;
1321         chunk_def.chunk_lengths[1]= 2;
1322 
1323         -- Set Chunking --
1324         GRsetchunk(riid, chunk_def, HDF_CHUNK);
1325          ......
1326         }
1327 
1328         --With compression--:
1329         {
1330         HDF_CHUNK_DEF chunk_def;
1331 
1332         .......
1333         -- Set chunk lengths first --
1334         chunk_def.chunk_lengths[0]= 2;
1335         chunk_def.chunk_lengths[1]= 2;
1336 
1337         -- Set compression --
1338         chunk_def.comp.cinfo.deflate.level = 9;
1339         chunk_def.comp.comp_type = COMP_CODE_DEFLATE;
1340 
1341         -- Set Chunking with Compression --
1342         GRsetchunk(riid, chunk_def, HDF_CHUNK | HDF_COMP);
1343          ......
1344         }
1345 
1346  RETURNS
1347         SUCCEED/FAIL
1348 ******************************************************************************/
1349 HDFLIBAPI intn GRsetchunk
1350     (int32 riid,             /* IN: raster access id */
1351      HDF_CHUNK_DEF chunk_def, /* IN: chunk definition */
1352      int32 flags              /* IN: flags */);
1353 
1354 /******************************************************************************
1355  NAME
1356      GRgetchunkinfo -- get Info on GR
1357 
1358  DESCRIPTION
1359      This routine gets any special information on the GR. If its chunked,
1360      chunked and compressed or just a regular GR. Currently it will only
1361      fill the array of chunk lengths for each dimension as specified in
1362      the 'HDF_CHUNK_DEF' union. You can pass in a NULL for 'chunk_def'
1363      if don't want the chunk lengths for each dimension.
1364      Additionaly if successfull it will return a bit-or'd value in 'flags'
1365      indicating if the GR is:
1366 
1367      Chunked                  -> flags = HDF_CHUNK
1368      Chunked and compressed   -> flags = HDF_CHUNK | HDF_COMP
1369      Non-chunked              -> flags = HDF_NONE
1370 
1371      e.g. 4x4 array - Pseudo-C
1372      {
1373      int32   rcdims[3];
1374      HDF_CHUNK_DEF rchunk_def;
1375      int32   cflags;
1376      ...
1377      rchunk_def.chunk_lengths = rcdims;
1378      GRgetchunkinfo(riid, &rchunk_def, &cflags);
1379      ...
1380      }
1381 
1382  RETURNS
1383         SUCCEED/FAIL
1384 ******************************************************************************/
1385 HDFLIBAPI intn GRgetchunkinfo
1386     (int32 riid,              /* IN: Raster access id */
1387      HDF_CHUNK_DEF *chunk_def, /* IN/OUT: chunk definition */
1388      int32 *flags              /* IN/OUT: flags */);
1389 
1390 
1391 /******************************************************************************
1392  NAME
1393      GRwritechunk  -- write the specified chunk to the GR
1394 
1395  DESCRIPTION
1396      This routine writes a whole chunk of data to the chunked GR
1397      specified by chunk 'origin' for the given GR and can be used
1398      instead of GRwriteimage() when this information is known. This
1399      routine has less overhead and is much faster than using GRwriteimage().
1400 
1401      Origin specifies the co-ordinates of the chunk according to the chunk
1402      position in the overall chunk array.
1403 
1404      'datap' must point to a whole chunk of data.
1405 
1406      See GRsetchunk() for a description of the organization of chunks in an GR.
1407 
1408  RETURNS
1409         SUCCEED/FAIL
1410 ******************************************************************************/
1411 HDFLIBAPI intn GRwritechunk
1412     (int32 riid,      /* IN: raster access id */
1413      int32 *origin,    /* IN: origin of chunk to write */
1414      const void *datap /* IN: buffer for data */);
1415 
1416 /******************************************************************************
1417  NAME
1418      GRreadchunk   -- read the specified chunk to the GR
1419 
1420  DESCRIPTION
1421      This routine reads a whole chunk of data from the chunked GR
1422      specified by chunk 'origin' for the given GR and can be used
1423      instead of GRreadimage() when this information is known. This
1424      routine has less overhead and is much faster than using GRreadimage().
1425 
1426      Origin specifies the co-ordinates of the chunk according to the chunk
1427      position in the overall chunk array.
1428 
1429      'datap' must point to a whole chunk of data.
1430 
1431      See GRsetchunk() for a description of the organization of chunks in an GR.
1432 
1433  RETURNS
1434         SUCCEED/FAIL
1435 ******************************************************************************/
1436 HDFLIBAPI intn GRreadchunk
1437     (int32 riid,      /* IN: raster access id */
1438      int32 *origin,    /* IN: origin of chunk to read */
1439      void  *datap      /* IN/OUT: buffer for data */);
1440 
1441 
1442 /******************************************************************************
1443 NAME
1444      GRsetchunkcache -- maximum number of chunks to cache
1445 
1446 DESCRIPTION
1447      Set the maximum number of chunks to cache.
1448 
1449      The cache contains the Least Recently Used(LRU cache replacment policy)
1450      chunks. This routine allows the setting of maximum number of chunks that
1451      can be cached, 'maxcache'.
1452 
1453      The performance of the GRxxx interface with chunking is greatly
1454      affected by the users access pattern over the image and by
1455      the maximum number of chunks set in the chunk cache. The number chunks
1456      that can be set in the cache is process memory limited. It is a good
1457      idea to always set the maximum number of chunks in the cache as the
1458      default heuristic does not take into account the memory available for
1459      the application.
1460 
1461      By default when the GR is promoted to a chunked element the
1462      maximum number of chunks in the cache 'maxcache' is set to the number of
1463      chunks along the last dimension.
1464 
1465      The values set here affects the current object's caching behaviour.
1466 
1467      If the chunk cache is full and 'maxcache' is greater then the
1468      current 'maxcache' value, then the chunk cache is reset to the new
1469      'maxcache' value, else the chunk cache remains at the current
1470      'maxcache' value.
1471 
1472      If the chunk cache is not full, then the chunk cache is set to the
1473      new 'maxcache' value only if the new 'maxcache' value is greater than the
1474      current number of chunks in the cache.
1475 
1476      Use flags argument of 'HDF_CACHEALL' if the whole object is to be cached
1477      in memory, otherwise pass in zero(0). Currently you can only
1478      pass in zero.
1479 
1480     See GRsetchunk() for a description of the organization of chunks in an GR.
1481 
1482 RETURNS
1483      Returns the 'maxcache' value for the chunk cache if successful
1484      and FAIL otherwise
1485 ******************************************************************************/
1486 HDFLIBAPI intn GRsetchunkcache
1487     (int32 riid,     /* IN: raster access id */
1488      int32 maxcache,  /* IN: max number of chunks to cache */
1489      int32 flags      /* IN: flags = 0, HDF_CACHEALL */);
1490 
1491 
1492 #ifdef HAVE_FMPOOL
1493 /******************************************************************************
1494 NAME
1495      Hmpset - set pagesize and maximum number of pages to cache on next open/create
1496 
1497 DESCRIPTION
1498      Set the pagesize and maximum number of pages to cache on the next
1499      open/create of a file. A pagesize that is a power of 2 is recommended.
1500 
1501      The values set here only affect the next open/creation of a file and
1502      do not change a particular file's paging behaviour after it has been
1503      opened or created. This maybe changed in a later release.
1504 
1505      Use flags arguement of 'MP_PAGEALL' if the whole file is to be cached
1506      in memory otherwise passs in zero.
1507 
1508 RETURNS
1509      Returns SUCCEED if successful and FAIL otherwise
1510 
1511 NOTE
1512      This calls the real routine MPset().
1513      Currently 'maxcache' has to be greater than 1. Maybe use special
1514      case of 0 to specify you want to turn page buffering off or use
1515      the flags arguement.
1516 
1517 ******************************************************************************/
1518 HDFLIBAPI int  Hmpset(int pagesize, /* IN: pagesize to use for next open/create */
1519                    int maxcache, /* IN: max number of pages to cache */
1520                    int flags     /* IN: flags = 0, MP_PAGEALL */);
1521 
1522 /******************************************************************************
1523 NAME
1524      Hmpget - get last pagesize and max number of pages cached for open/create
1525 
1526 DESCRIPTION
1527      This gets the last pagesize and maximum number of pages cached for
1528      the last open/create of a file.
1529 
1530 RETURNS
1531      Returns SUCCEED.
1532 
1533 NOTES
1534      This routine calls the real routine MPget().
1535 ******************************************************************************/
1536 HDFLIBAPI int  Hmpget(int *pagesize, /*OUT: pagesize to used in last open/create */
1537                    int *maxcache, /*OUT: max number of pages cached in last open/create */
1538                    int flags      /* IN: */);
1539 
1540 #endif /* HAVE_FMPOOL */
1541 
1542 /* Vset interface functions (used to be in vproto.h) */
1543 
1544 /* Useful macros, which someday might become actuall functions */
1545 /*
1546  * macros for VSinquire
1547  * all these macros should be public for users
1548  */
1549 #define VSQuerycount(vs, count) \
1550         (VSinquire (vs, (int32 *) count, (int32*) NULL, (char*) NULL, (int32*) NULL, (char*) NULL))
1551 
1552 #define VSQueryinterlace(vs, intr) \
1553         (VSinquire (vs, (int32 *) NULL, (int32*) intr, (char*) NULL, (int32*) NULL, (char*) NULL))
1554 
1555 #define VSQueryfields(vs, flds) \
1556         (VSinquire (vs, (int32 *) NULL, (int32*) NULL, (char*) flds, (int32*) NULL, (char*) NULL))
1557 
1558 #define VSQueryvsize(vs, size) \
1559         (VSinquire (vs, (int32 *) NULL, (int32*) NULL, (char*) NULL, (int32*) size, (char*) NULL))
1560 
1561 #define VSQueryname(vs, name) \
1562         (VSinquire (vs, (int32 *) NULL, (int32*) NULL, (char*) NULL, (int32*) NULL, (char*) name))
1563 
1564 /*
1565    ** from vattr.c
1566  */
1567    HDFLIBAPI intn Vsetattr
1568                 (int32 vgid,  const char *attrname, int32 datatype,
1569                  int32 count, const void * values);
1570    HDFLIBAPI intn Vnattrs
1571                 (int32 vgid);
1572    HDFLIBAPI intn Vnattrs2
1573                 (int32 vgid);
1574    HDFLIBAPI intn Vnoldattrs
1575                 (int32 vgid);
1576    HDFLIBAPI intn Vfindattr
1577                 (int32 vgid, const char *attrname);
1578    HDFLIBAPI intn Vattrinfo
1579                 (int32 vgid, intn attrindex, char *name,
1580                  int32 *datatype, int32 *count, int32 *size);
1581    HDFLIBAPI intn Vattrinfo2 /* copy of Vattrinfo for old attributes */
1582                 (int32 vgid, intn attrindex, char *name, int32 *datatype,
1583         int32 *count, int32 *size, int32 *nfields, uint16 *refnum);
1584    HDFLIBAPI intn Vgetattr
1585                 (int32 vgid, intn attrindex, void * values);
1586    HDFLIBAPI intn Vgetattr2 /* copy of Vgetattr for old attributes */
1587                 (int32 vgid, intn attrindex, void * values);
1588    HDFLIBAPI int32 Vgetversion
1589                 (int32 vgid);
1590    HDFLIBAPI intn VSfindex
1591                  (int32 vsid, const char *fieldname, int32 *fldindex);
1592    HDFLIBAPI intn VSsetattr
1593                 (int32 vsid, int32 findex, const char *attrname,
1594                  int32 datatype, int32 count, const void * values);
1595    HDFLIBAPI intn VSnattrs
1596                 (int32 vsid);
1597    HDFLIBAPI intn VSfnattrs
1598                 (int32 vsid, int32 findex);
1599    HDFLIBAPI intn VSfindattr
1600                 (int32 vsid, int32 findex, const char *attrname);
1601    HDFLIBAPI intn VSattrinfo
1602                 (int32 vsid, int32 findex, intn attrindex,
1603                  char *name, int32 *datatype, int32 *count,
1604                  int32 *size);
1605    HDFLIBAPI intn VSgetattr
1606                 (int32 vsid, int32 findex, intn attrindex,
1607                   void * values);
1608    HDFLIBAPI intn VSisattr
1609                 (int32 vsid);
1610 /*
1611    ** from vconv.c
1612  */
1613     HDFLIBAPI int32 vicheckcompat
1614                 (HFILEID f);
1615 
1616     HDFLIBAPI int32 vimakecompat
1617                 (HFILEID f);
1618 
1619     HDFLIBAPI int32 vcheckcompat
1620                 (char  * fs);
1621 
1622     HDFLIBAPI int32 vmakecompat
1623                 (char  * fs);
1624 
1625 /*
1626    ** from vg.c
1627  */
1628     HDFLIBAPI int32 VSelts
1629                 (int32 vkey);
1630 
1631     HDFLIBAPI int32 VSgetinterlace
1632                 (int32 vkey);
1633 
1634     HDFLIBAPI intn VSsetinterlace
1635                 (int32 vkey, int32 interlace);
1636 
1637     HDFLIBAPI int32 VSgetfields
1638                 (int32 vkey, char  * fields);
1639 
1640     HDFLIBAPI intn VSfexist
1641                 (int32 vkey, char  * fields);
1642 
1643     HDFLIBAPI int32 VSsizeof
1644                 (int32 vkey, char  * fields);
1645 
1646     HDFLIBAPI void VSdump
1647                 (int32 vkey);
1648 
1649     HDFLIBAPI int32 VSsetname
1650                 (int32 vkey, const char  * vsname);
1651 
1652     HDFLIBAPI int32 VSsetclass
1653                 (int32 vkey, const char  * vsclass);
1654 
1655     HDFLIBAPI int32 VSgetname
1656                 (int32 vkey, char  * vsname);
1657 
1658     HDFLIBAPI int32 VSgetclass
1659                 (int32 vkey, char  * vsclass);
1660 
1661     HDFLIBAPI intn VSinquire
1662                 (int32 vkey, int32  * nelt, int32  * interlace,
1663            char  * fields, int32  * eltsize, char  * vsname);
1664 
1665     HDFLIBAPI intn VSisinternal
1666                 (const char  *vsclass);
1667 
1668     HDFLIBAPI int32 VSlone
1669                 (HFILEID f, int32  * idarray, int32 asize);
1670 
1671     HDFLIBAPI int32 Vlone
1672                 (HFILEID f, int32  * idarray, int32 asize);
1673 
1674     HDFLIBAPI int32 Vfind
1675                 (HFILEID f, const char  * vgname);
1676 
1677     HDFLIBAPI int32 VSfind
1678                 (HFILEID f, const char  * vsname);
1679 
1680     HDFLIBAPI int32 Vfindclass
1681                 (HFILEID f, const char  * vgclass);
1682 
1683     HDFLIBAPI int32 VSfindclass
1684                 (HFILEID f, const char  * vsclass);
1685 
1686     HDFLIBAPI intn VSofclass
1687                 (int32 id, const char *vsclass, uintn start_vd,
1688                  uintn array_size, uint16 *refarray);
1689 
1690     HDFLIBAPI intn VSgetvdatas
1691                 (int32 id, uintn start_vd, uintn array_size, uint16 *refarray);
1692 
1693     HDFLIBAPI intn VSsetblocksize
1694                 (int32 vkey, int32 block_size);
1695 
1696     HDFLIBAPI intn VSsetnumblocks
1697                 (int32 vkey, int32 num_blocks);
1698 
1699     HDFLIBAPI intn VSgetblockinfo
1700                 (int32 vkey, int32* block_size, int32* num_blocks);
1701 
1702     HDFLIBAPI void Vsetzap
1703                 (void);
1704 
1705 /*
1706    ** from vgp.c
1707  */
1708     HDFLIBAPI intn vcompare
1709                 (void * k1, void * k2, intn cmparg);
1710 
1711     HDFLIBAPI intn vcompareref
1712                 (void * k1, void * k2, intn cmparg);
1713 
1714     HDFLIBAPI void vdestroynode
1715                 (void * n);
1716 
1717     HDFLIBAPI void vtfreekey
1718                 (void * k);
1719 
1720     HDFLIBAPI intn Vinitialize
1721                 (HFILEID f);
1722 
1723     HDFLIBAPI intn Vfinish
1724                 (HFILEID f);
1725 
1726     HDFLIBAPI HFILEID Vopen
1727                 (char *path, intn acc_mode, int16 ndds);
1728 
1729     HDFLIBAPI intn Vclose
1730                 (HFILEID f);
1731 
1732     HDFLIBAPI int32 vexistvg
1733                 (HFILEID f, uint16 vgid);
1734 
1735     HDFLIBAPI int32 Vattach
1736                 (HFILEID f, int32 vgid, const char  * accesstype);
1737 
1738     HDFLIBAPI int32 Vdetach
1739                 (int32 vkey);
1740 
1741     HDFLIBAPI int32 Vinsert
1742                 (int32 vkey, int32 vskey);
1743     /* note: 2nd arg of Vinsert can also be (VGROUP *) */
1744 
1745     HDFLIBAPI int32 Vflocate
1746                 (int32 vkey, char  * field);
1747 
1748     HDFLIBAPI intn Vinqtagref
1749                 (int32 vkey, int32 tag, int32 ref);
1750 
1751     HDFLIBAPI int32 Vntagrefs
1752                 (int32 vkey);
1753 
1754     HDFLIBAPI int32 Vnrefs
1755                 (int32 vkey,int32 tag);
1756 
1757     HDFLIBAPI int32 Vgettagrefs
1758                 (int32 vkey, int32  tagarray[], int32  refarray[], int32 n);
1759 
1760     HDFLIBAPI int32 Vgetuservgs
1761                 (int32 id, int32 start_ref, int32 n_vgs, int32 *refarray);
1762 
1763     HDFLIBAPI intn Vgettagref
1764                 (int32 vkey, int32 which, int32  * tag, int32  * ref);
1765 
1766     HDFLIBAPI int32 VQueryref
1767                 (int32 vkey);
1768 
1769     HDFLIBAPI int32 VQuerytag
1770                 (int32 vkey);
1771 
1772     HDFLIBAPI int32 Vaddtagref
1773                 (int32 vkey, int32 tag, int32 ref);
1774 
1775     HDFLIBAPI int32 Ventries
1776                 (HFILEID f, int32 vgid);
1777 
1778     HDFLIBAPI int32 Vsetname
1779                 (int32 vkey, const char  * vgname);
1780 
1781     HDFLIBAPI int32 Vsetclass
1782                 (int32 vkey, const char  * vgclass);
1783 
1784     HDFLIBAPI intn Visvg
1785                 (int32 vkey, int32 id);
1786 
1787     HDFLIBAPI intn Visvs
1788                 (int32 vkey, int32 id);
1789 
1790     HDFLIBAPI int32 Vgetid
1791                 (HFILEID f, int32 vgid);
1792 
1793     HDFLIBAPI int32 Vgetnext
1794                 (int32 vkey, int32 id);
1795 
1796     HDFLIBAPI int32 Vgetname
1797                 (int32 vkey, char  * vgname);
1798 
1799     HDFLIBAPI int32 Vgetnamelen
1800                 (int32 vkey, uint16 * name_len);
1801 
1802     HDFLIBAPI int32 Vgetclassnamelen
1803                 (int32 vkey, uint16 * classname_len);
1804 
1805     HDFLIBAPI int32 Vgetclass
1806                 (int32 vkey, char  * vgclass);
1807 
1808     HDFLIBAPI intn Vinquire
1809                 (int32 vkey, int32  * nentries, char  * vgname);
1810 
1811     HDFLIBAPI int32 Vdelete
1812                 (int32 f, int32 ref);
1813 
1814     HDFLIBAPI intn Vgisinternal
1815         (int32 vkey);
1816 
1817     HDFLIBAPI intn Visinternal    /* this function is replaced by Vgisinternal */
1818         (const char *classname);
1819 
1820     HDFLIBAPI intn Vgetvgroups
1821         (int32 id, uintn start_vg, uintn n_vgs, uint16 *refarray);
1822 
1823 
1824 /*******************************************************************************
1825 NAME
1826    Vdeletetagref - delete tag/ref pair in Vgroup
1827 
1828 DESCRIPTION
1829     Deletes the given tag/ref pair from the Vgroup.  If the given tag/ref pair
1830     does not exist in the vgroup the routine will return FAIL. Users should use
1831     Vinqtagref() to check if the tag/ref pair exists before deleting.
1832 
1833 RETURNS
1834     Returns SUCCEED if the tag/ref pair is deleted from Vgroup and
1835     FAIL if unsuccessful.
1836 
1837 *******************************************************************************/
1838 HDFLIBAPI intn
1839 Vdeletetagref(int32 vkey, /* IN: vgroup key */
1840               int32 tag,  /* IN: tag to delete in vgroup */
1841               int32 ref   /* IN: ref to delete in vgroup */);
1842 
1843     HDFLIBAPI intn VPshutdown(void);
1844 
1845 /*
1846    ** from vparse.c
1847  */
1848     HDFLIBAPI int32 scanattrs
1849                 (const char  * attrs, int32  * attrc, char  *** attrv);
1850 
1851 /*
1852    ** from vhi.c
1853  */
1854     HDFLIBAPI int32 VHstoredata
1855                 (HFILEID f, const char  * field, const uint8  *buf, int32 n, int32 datatype,
1856                  const char  * vsname, const char  * vsclass);
1857 
1858     HDFLIBAPI int32 VHstoredatam
1859                 (HFILEID f, const char * field, const uint8  *buf, int32 n, int32 datatype,
1860                  const char  * vsname, const char  * vsclass, int32 order);
1861 
1862     HDFLIBAPI int32 VHmakegroup
1863                 (HFILEID f, int32  tagarray[], int32  refarray[], int32 n,
1864                     const char * vgname, const char  * vgclass);
1865 
1866 /*
1867    ** from vio.c
1868  */
1869 
1870     HDFLIBAPI intn VSPhshutdown(void);
1871 
1872     HDFLIBAPI int32 vexistvs
1873                 (HFILEID f, uint16 vsref);
1874 
1875     HDFLIBAPI void vsdestroynode
1876                 (void * n);
1877 
1878     HDFLIBAPI void vfdestroynode
1879                 (void * n);
1880 
1881     HDFLIBAPI int32 VSattach
1882                 (HFILEID f, int32 vsref, const char  * accesstype);
1883 
1884     HDFLIBAPI int32 VSdetach
1885                 (int32 vkey);
1886 
1887     HDFLIBAPI int32 VSQuerytag
1888                 (int32 vkey);
1889 
1890     HDFLIBAPI int32 VSQueryref
1891                 (int32 vkey);
1892 
1893     HDFLIBAPI int32 VSgetid
1894                 (HFILEID f, int32 vsref);
1895 
1896     HDFLIBAPI int32 VSgetversion
1897                 (int32 vkey);
1898 
1899     HDFLIBAPI int32 VSdelete
1900                 (int32 f, int32 ref);
1901 
1902     HDFLIBAPI int32 VSappendable
1903                 (int32 vkey, int32 blk);
1904 
1905 /*
1906    ** from vsfld.c
1907  */
1908 
1909     HDFLIBAPI intn VSsetfields
1910                 (int32 vkey, const char  * fields);
1911 
1912     HDFLIBAPI intn VSfdefine
1913                 (int32 vkey, const char  * field, int32 localtype, int32 order);
1914 
1915     HDFLIBAPI int32 VFnfields
1916                 (int32 vkey);
1917 
1918     HDFLIBAPI char *VFfieldname
1919                 (int32 vkey, int32 idx);
1920 
1921     HDFLIBAPI int32 VFfieldtype
1922                 (int32 vkey, int32 idx);
1923 
1924     HDFLIBAPI int32 VFfieldisize
1925                 (int32 vkey, int32 idx);
1926 
1927     HDFLIBAPI int32 VFfieldesize
1928                 (int32 vkey, int32 idx);
1929 
1930     HDFLIBAPI int32 VFfieldorder
1931                 (int32 vkey, int32 idx);
1932 
1933     HDFLIBAPI intn VSsetexternalfile
1934         (int32 vkey, const char *filename, int32 offset);
1935 
1936     HDFLIBAPI intn VSgetexternalfile
1937         (int32 vkey, uintn name_len, char *filename, int32* offset);
1938 
1939     HDFLIBAPI intn VSgetexternalinfo
1940         (int32 vkey, uintn name_len, char *filename, int32* offset,
1941         int32* length);
1942 
1943     HDFLIBAPI intn VSfpack
1944                 (int32 vsid, intn packtype, const char *fields_in_buf,
1945                 void * buf, intn bufsz, intn n_records,
1946                 const char *fields, void * fldbufpt[]);
1947 
1948 /*
1949    ** from vrw.c
1950  */
1951     HDFLIBAPI intn VSPshutdown(void);
1952 
1953     HDFLIBAPI int32 VSseek
1954                 (int32 vkey, int32 eltpos);
1955 
1956     HDFLIBAPI int32 VSread
1957                 (int32 vkey, uint8  buf[], int32 nelt, int32 interlace);
1958 
1959     HDFLIBAPI int32 VSwrite
1960                 (int32 vkey, const uint8  buf[], int32 nelt, int32 interlace);
1961 
1962 
1963 #if defined c_plusplus || defined __cplusplus
1964 }
1965 #endif                          /* c_plusplus || __cplusplus */
1966 
1967 #endif                          /* _H_PROTO */
1968 
1969