Please, help us to better serve our user community by answering the following short survey: https://www.hdfgroup.org/website-survey/
HDF  4.3.0
API Reference
 
Loading...
Searching...
No Matches
hfile_priv.h File Reference
#include "hdf_priv.h"
#include "hfile.h"
#include "tbbt_priv.h"
#include "bitvect_priv.h"
#include "atom_priv.h"
#include "linklist_priv.h"
#include "dynarray_priv.h"
#include <stdio.h>
#include "hchunks_priv.h"

Data Structures

struct  dd_t
 
struct  version_t
 
struct  ddblock_t
 
struct  tag_info
 
struct  filerec_t
 
struct  accrec_t
 
struct  sp_info_block_t
 
struct  funclist_t
 
struct  functab_t
 

Macros

#define MAGICLEN   4 /* length */
 
#define HDFMAGIC   "\016\003\023\001" /* ^N^C^S^A */
 
#define DD_SZ   12 /* 2+2+4+4 */
 
#define NDDS_SZ   2
 
#define OFFSET_SZ   4
 
#define INVALID_OFFSET   -1
 
#define INVALID_LENGTH   -1
 
#define HI_OPEN(p, a)   (((a)&DFACC_WRITE) ? fopen((p), "rb+") : fopen((p), "rb"))
 
#define HI_CREATE(p)   (fopen((p), "wb+"))
 
#define HI_READ(f, b, n)   (((size_t)(n) == (size_t)fread((b), 1, (size_t)(n), (f))) ? SUCCEED : FAIL)
 
#define HI_WRITE(f, b, n)   (((size_t)(n) == (size_t)fwrite((b), 1, (size_t)(n), (f))) ? SUCCEED : FAIL)
 
#define HI_CLOSE(f)   (((f = ((fclose(f) == 0) ? NULL : f)) == NULL) ? SUCCEED : FAIL)
 
#define HI_FLUSH(f)   (fflush(f) == 0 ? SUCCEED : FAIL)
 
#define HI_SEEK(f, o)   (fseek((f), (long)(o), SEEK_SET) == 0 ? SUCCEED : FAIL)
 
#define HI_SEEK_CUR(f, o)   (fseek((f), (long)(o), SEEK_CUR) == 0 ? SUCCEED : FAIL)
 
#define HI_SEEKEND(f)   (fseek((f), (long)0, SEEK_END) == 0 ? SUCCEED : FAIL)
 
#define HI_TELL(f)   (ftell(f))
 
#define OPENERR(f)   ((f) == (FILE *)NULL)
 
#define DDLIST_DIRTY   0x01 /* mark whether to flush dirty DD blocks */
 
#define FILE_END_DIRTY   0x02 /* indicate that the file needs to be extended */
 
#define FIDTYPE   1
 
#define AIDTYPE   2
 
#define GROUPTYPE   3
 
#define SDSTYPE   4
 
#define DIMTYPE   5
 
#define CDFTYPE   6
 
#define VGIDTYPE   8 /* also defined in vg.h for Vgroups */
 
#define VSIDTYPE   9 /* also defined in vg.h for Vsets */
 
#define BITTYPE   10 /* For bit-accesses */
 
#define GRIDTYPE   11 /* for GR access */
 
#define RIIDTYPE   12 /* for RI access */
 
#define BADFREC(r)   ((r) == NULL || (r)->refcount == 0)
 
#define BASETAG(t)   (uint16)((~(t)&0x8000) ? ((t) & ~0x4000) : (t))
 
#define SPECIALTAG(t)   (uint16)((~(t)&0x8000) && ((t)&0x4000))
 
#define MKSPECIALTAG(t)   (uint16)((~(t)&0x8000) ? ((t) | 0x4000) : DFTAG_NULL)
 

Typedefs

typedef FILE * hdf_file_t
 

Enumerations

enum  fileop_t { H4_OP_UNKNOWN = 0 , H4_OP_SEEK , H4_OP_WRITE , H4_OP_READ }
 

Functions

accrec_tHIget_access_rec (void)
 
void HIrelease_accrec_node (accrec_t *acc)
 
void * HIgetspinfo (accrec_t *access_rec)
 
intn HPcompare_filerec_path (const void *obj, const void *key)
 
intn HPcompare_accrec_tagref (const void *rec1, const void *rec2)
 
int32 HPgetdiskblock (filerec_t *file_rec, int32 block_size, intn moveto)
 
intn HPfreediskblock (filerec_t *file_rec, int32 block_offset, int32 block_size)
 
intn HPisfile_in_use (const char *path)
 
int32 HDcheck_empty (int32 file_id, uint16 tag, uint16 ref, intn *emptySDS)
 
int32 HDget_special_info (int32 access_id, sp_info_block_t *info_block)
 
int32 HDset_special_info (int32 access_id, sp_info_block_t *info_block)
 
intn HP_read (filerec_t *file_rec, void *buf, int32 bytes)
 
intn HPseek (filerec_t *file_rec, int32 offset)
 
intn HP_write (filerec_t *file_rec, const void *buf, int32 bytes)
 
int32 HPread_drec (int32 file_id, atom_t data_id, uint8 **drec_buf)
 
intn tagcompare (void *k1, void *k2, intn cmparg)
 
void tagdestroynode (void *n)
 
int32 HLPstread (accrec_t *access_rec)
 
int32 HLPstwrite (accrec_t *access_rec)
 
int32 HLPseek (accrec_t *access_rec, int32 offset, int origin)
 
int32 HLPread (accrec_t *access_rec, int32 length, void *data)
 
int32 HLPwrite (accrec_t *access_rec, int32 length, const void *data)
 
int32 HLPinquire (accrec_t *access_rec, int32 *pfile_id, uint16 *ptag, uint16 *pref, int32 *plength, int32 *poffset, int32 *pposn, int16 *paccess, int16 *pspecial)
 
intn HLPendaccess (accrec_t *access_rec)
 
int32 HLPcloseAID (accrec_t *access_rec)
 
int32 HLPinfo (accrec_t *access_rec, sp_info_block_t *info_block)
 
int32 HXPstread (accrec_t *rec)
 
int32 HXPstwrite (accrec_t *rec)
 
int32 HXPseek (accrec_t *access_rec, int32 offset, int origin)
 
int32 HXPread (accrec_t *access_rec, int32 length, void *data)
 
int32 HXPwrite (accrec_t *access_rec, int32 length, const void *data)
 
int32 HXPinquire (accrec_t *access_rec, int32 *pfile_id, uint16 *ptag, uint16 *pref, int32 *plength, int32 *poffset, int32 *pposn, int16 *paccess, int16 *pspecial)
 
intn HXPendaccess (accrec_t *access_rec)
 
int32 HXPcloseAID (accrec_t *access_rec)
 
int32 HXPinfo (accrec_t *access_rec, sp_info_block_t *info_block)
 
int32 HXPreset (accrec_t *access_rec, sp_info_block_t *info_block)
 
intn HXPsetaccesstype (accrec_t *access_rec)
 
intn HXPshutdown (void)
 
int32 HCPstread (accrec_t *rec)
 
int32 HCPstwrite (accrec_t *rec)
 
int32 HCPseek (accrec_t *access_rec, int32 offset, int origin)
 
int32 HCPinquire (accrec_t *access_rec, int32 *pfile_id, uint16 *ptag, uint16 *pref, int32 *plength, int32 *poffset, int32 *pposn, int16 *paccess, int16 *pspecial)
 
int32 HCPread (accrec_t *access_rec, int32 length, void *data)
 
int32 HCPwrite (accrec_t *access_rec, int32 length, const void *data)
 
intn HCPendaccess (accrec_t *access_rec)
 
int32 HCPcloseAID (accrec_t *access_rec)
 
int32 HCPinfo (accrec_t *access_rec, sp_info_block_t *info_block)
 
int32 get_comp_len (accrec_t *access_rec)
 
int32 HBPstread (accrec_t *rec)
 
int32 HBPstwrite (accrec_t *rec)
 
int32 HBPseek (accrec_t *access_rec, int32 offset, int origin)
 
int32 HBPinquire (accrec_t *access_rec, int32 *pfile_id, uint16 *ptag, uint16 *pref, int32 *plength, int32 *poffset, int32 *pposn, int16 *paccess, int16 *pspecial)
 
int32 HBPread (accrec_t *access_rec, int32 length, void *data)
 
int32 HBPwrite (accrec_t *access_rec, int32 length, const void *data)
 
intn HBPendaccess (accrec_t *access_rec)
 
int32 HBPcloseAID (accrec_t *access_rec)
 
int32 HBPinfo (accrec_t *access_rec, sp_info_block_t *info_block)
 
int32 HRPstread (accrec_t *rec)
 
int32 HRPstwrite (accrec_t *rec)
 
int32 HRPseek (accrec_t *access_rec, int32 offset, int origin)
 
int32 HRPinquire (accrec_t *access_rec, int32 *pfile_id, uint16 *ptag, uint16 *pref, int32 *plength, int32 *poffset, int32 *pposn, int16 *paccess, int16 *pspecial)
 
int32 HRPread (accrec_t *access_rec, int32 length, void *data)
 
int32 HRPwrite (accrec_t *access_rec, int32 length, const void *data)
 
intn HRPendaccess (accrec_t *access_rec)
 
int32 HRPcloseAID (accrec_t *access_rec)
 
int32 HRPinfo (accrec_t *access_rec, sp_info_block_t *info_block)
 
intn HTPstart (filerec_t *file_rec)
 
intn HTPinit (filerec_t *file_rec, int16 ndds)
 
intn HTPsync (filerec_t *file_rec)
 
intn HTPend (filerec_t *file_rec)
 
atom_t HTPcreate (filerec_t *file_rec, uint16 tag, uint16 ref)
 
atom_t HTPselect (filerec_t *file_rec, uint16 tag, uint16 ref)
 
intn HTPendaccess (atom_t ddid)
 
intn HTPdelete (atom_t ddid)
 
intn HTPupdate (atom_t ddid, int32 new_off, int32 new_len)
 
intn HTPinquire (atom_t ddid, uint16 *tag, uint16 *ref, int32 *off, int32 *len)
 
intn HTPis_special (atom_t ddid)
 
intn HTPdump_dds (int32 file_id, FILE *fout)
 

Macro Definition Documentation

◆ AIDTYPE

#define AIDTYPE   2

◆ BADFREC

#define BADFREC ( r)    ((r) == NULL || (r)->refcount == 0)

◆ BASETAG

#define BASETAG ( t)    (uint16)((~(t)&0x8000) ? ((t) & ~0x4000) : (t))

◆ BITTYPE

#define BITTYPE   10 /* For bit-accesses */

◆ CDFTYPE

#define CDFTYPE   6

◆ DD_SZ

#define DD_SZ   12 /* 2+2+4+4 */

◆ DDLIST_DIRTY

#define DDLIST_DIRTY   0x01 /* mark whether to flush dirty DD blocks */

◆ DIMTYPE

#define DIMTYPE   5

◆ FIDTYPE

#define FIDTYPE   1

◆ FILE_END_DIRTY

#define FILE_END_DIRTY   0x02 /* indicate that the file needs to be extended */

◆ GRIDTYPE

#define GRIDTYPE   11 /* for GR access */

◆ GROUPTYPE

#define GROUPTYPE   3

◆ HDFMAGIC

#define HDFMAGIC   "\016\003\023\001" /* ^N^C^S^A */

◆ HI_CLOSE

#define HI_CLOSE ( f)    (((f = ((fclose(f) == 0) ? NULL : f)) == NULL) ? SUCCEED : FAIL)

◆ HI_CREATE

#define HI_CREATE ( p)    (fopen((p), "wb+"))

◆ HI_FLUSH

#define HI_FLUSH ( f)    (fflush(f) == 0 ? SUCCEED : FAIL)

◆ HI_OPEN

#define HI_OPEN ( p,
a )   (((a)&DFACC_WRITE) ? fopen((p), "rb+") : fopen((p), "rb"))

◆ HI_READ

#define HI_READ ( f,
b,
n )   (((size_t)(n) == (size_t)fread((b), 1, (size_t)(n), (f))) ? SUCCEED : FAIL)

◆ HI_SEEK

#define HI_SEEK ( f,
o )   (fseek((f), (long)(o), SEEK_SET) == 0 ? SUCCEED : FAIL)

◆ HI_SEEK_CUR

#define HI_SEEK_CUR ( f,
o )   (fseek((f), (long)(o), SEEK_CUR) == 0 ? SUCCEED : FAIL)

◆ HI_SEEKEND

#define HI_SEEKEND ( f)    (fseek((f), (long)0, SEEK_END) == 0 ? SUCCEED : FAIL)

◆ HI_TELL

#define HI_TELL ( f)    (ftell(f))

◆ HI_WRITE

#define HI_WRITE ( f,
b,
n )   (((size_t)(n) == (size_t)fwrite((b), 1, (size_t)(n), (f))) ? SUCCEED : FAIL)

◆ INVALID_LENGTH

#define INVALID_LENGTH   -1

◆ INVALID_OFFSET

#define INVALID_OFFSET   -1

◆ MAGICLEN

#define MAGICLEN   4 /* length */

◆ MKSPECIALTAG

#define MKSPECIALTAG ( t)    (uint16)((~(t)&0x8000) ? ((t) | 0x4000) : DFTAG_NULL)

◆ NDDS_SZ

#define NDDS_SZ   2

◆ OFFSET_SZ

#define OFFSET_SZ   4

◆ OPENERR

#define OPENERR ( f)    ((f) == (FILE *)NULL)

◆ RIIDTYPE

#define RIIDTYPE   12 /* for RI access */

◆ SDSTYPE

#define SDSTYPE   4

◆ SPECIALTAG

#define SPECIALTAG ( t)    (uint16)((~(t)&0x8000) && ((t)&0x4000))

◆ VGIDTYPE

#define VGIDTYPE   8 /* also defined in vg.h for Vgroups */

◆ VSIDTYPE

#define VSIDTYPE   9 /* also defined in vg.h for Vsets */

Typedef Documentation

◆ hdf_file_t

typedef FILE* hdf_file_t

Enumeration Type Documentation

◆ fileop_t

enum fileop_t
Enumerator
H4_OP_UNKNOWN 
H4_OP_SEEK 
H4_OP_WRITE 
H4_OP_READ 

Function Documentation

◆ get_comp_len()

int32 get_comp_len ( accrec_t * access_rec)
extern

◆ HBPcloseAID()

int32 HBPcloseAID ( accrec_t * access_rec)
extern

◆ HBPendaccess()

intn HBPendaccess ( accrec_t * access_rec)
extern

◆ HBPinfo()

int32 HBPinfo ( accrec_t * access_rec,
sp_info_block_t * info_block )
extern

◆ HBPinquire()

int32 HBPinquire ( accrec_t * access_rec,
int32 * pfile_id,
uint16 * ptag,
uint16 * pref,
int32 * plength,
int32 * poffset,
int32 * pposn,
int16 * paccess,
int16 * pspecial )
extern

◆ HBPread()

int32 HBPread ( accrec_t * access_rec,
int32 length,
void * data )
extern

◆ HBPseek()

int32 HBPseek ( accrec_t * access_rec,
int32 offset,
int origin )
extern

◆ HBPstread()

int32 HBPstread ( accrec_t * rec)
extern

◆ HBPstwrite()

int32 HBPstwrite ( accrec_t * rec)
extern

◆ HBPwrite()

int32 HBPwrite ( accrec_t * access_rec,
int32 length,
const void * data )
extern

◆ HCPcloseAID()

int32 HCPcloseAID ( accrec_t * access_rec)
extern

◆ HCPendaccess()

intn HCPendaccess ( accrec_t * access_rec)
extern

◆ HCPinfo()

int32 HCPinfo ( accrec_t * access_rec,
sp_info_block_t * info_block )
extern

◆ HCPinquire()

int32 HCPinquire ( accrec_t * access_rec,
int32 * pfile_id,
uint16 * ptag,
uint16 * pref,
int32 * plength,
int32 * poffset,
int32 * pposn,
int16 * paccess,
int16 * pspecial )
extern

◆ HCPread()

int32 HCPread ( accrec_t * access_rec,
int32 length,
void * data )
extern

◆ HCPseek()

int32 HCPseek ( accrec_t * access_rec,
int32 offset,
int origin )
extern

◆ HCPstread()

int32 HCPstread ( accrec_t * rec)
extern

◆ HCPstwrite()

int32 HCPstwrite ( accrec_t * rec)
extern

◆ HCPwrite()

int32 HCPwrite ( accrec_t * access_rec,
int32 length,
const void * data )
extern

◆ HDcheck_empty()

int32 HDcheck_empty ( int32 file_id,
uint16 tag,
uint16 ref,
intn * emptySDS )
extern

◆ HDget_special_info()

int32 HDget_special_info ( int32 access_id,
sp_info_block_t * info_block )
extern

◆ HDset_special_info()

int32 HDset_special_info ( int32 access_id,
sp_info_block_t * info_block )
extern

◆ HIget_access_rec()

accrec_t * HIget_access_rec ( void )
extern

◆ HIgetspinfo()

void * HIgetspinfo ( accrec_t * access_rec)
extern

◆ HIrelease_accrec_node()

void HIrelease_accrec_node ( accrec_t * acc)
extern

◆ HLPcloseAID()

int32 HLPcloseAID ( accrec_t * access_rec)
extern

◆ HLPendaccess()

intn HLPendaccess ( accrec_t * access_rec)
extern

◆ HLPinfo()

int32 HLPinfo ( accrec_t * access_rec,
sp_info_block_t * info_block )
extern

◆ HLPinquire()

int32 HLPinquire ( accrec_t * access_rec,
int32 * pfile_id,
uint16 * ptag,
uint16 * pref,
int32 * plength,
int32 * poffset,
int32 * pposn,
int16 * paccess,
int16 * pspecial )
extern

◆ HLPread()

int32 HLPread ( accrec_t * access_rec,
int32 length,
void * data )
extern

◆ HLPseek()

int32 HLPseek ( accrec_t * access_rec,
int32 offset,
int origin )
extern

◆ HLPstread()

int32 HLPstread ( accrec_t * access_rec)
extern

◆ HLPstwrite()

int32 HLPstwrite ( accrec_t * access_rec)
extern

◆ HLPwrite()

int32 HLPwrite ( accrec_t * access_rec,
int32 length,
const void * data )
extern

◆ HP_read()

intn HP_read ( filerec_t * file_rec,
void * buf,
int32 bytes )
extern

◆ HP_write()

intn HP_write ( filerec_t * file_rec,
const void * buf,
int32 bytes )
extern

◆ HPcompare_accrec_tagref()

intn HPcompare_accrec_tagref ( const void * rec1,
const void * rec2 )
extern

◆ HPcompare_filerec_path()

intn HPcompare_filerec_path ( const void * obj,
const void * key )
extern

◆ HPfreediskblock()

intn HPfreediskblock ( filerec_t * file_rec,
int32 block_offset,
int32 block_size )
extern

◆ HPgetdiskblock()

int32 HPgetdiskblock ( filerec_t * file_rec,
int32 block_size,
intn moveto )
extern

◆ HPisfile_in_use()

intn HPisfile_in_use ( const char * path)
extern

◆ HPread_drec()

int32 HPread_drec ( int32 file_id,
atom_t data_id,
uint8 ** drec_buf )
extern

◆ HPseek()

intn HPseek ( filerec_t * file_rec,
int32 offset )
extern

◆ HRPcloseAID()

int32 HRPcloseAID ( accrec_t * access_rec)
extern

◆ HRPendaccess()

intn HRPendaccess ( accrec_t * access_rec)
extern

◆ HRPinfo()

int32 HRPinfo ( accrec_t * access_rec,
sp_info_block_t * info_block )
extern

◆ HRPinquire()

int32 HRPinquire ( accrec_t * access_rec,
int32 * pfile_id,
uint16 * ptag,
uint16 * pref,
int32 * plength,
int32 * poffset,
int32 * pposn,
int16 * paccess,
int16 * pspecial )
extern

◆ HRPread()

int32 HRPread ( accrec_t * access_rec,
int32 length,
void * data )
extern

◆ HRPseek()

int32 HRPseek ( accrec_t * access_rec,
int32 offset,
int origin )
extern

◆ HRPstread()

int32 HRPstread ( accrec_t * rec)
extern

◆ HRPstwrite()

int32 HRPstwrite ( accrec_t * rec)
extern

◆ HRPwrite()

int32 HRPwrite ( accrec_t * access_rec,
int32 length,
const void * data )
extern

◆ HTPcreate()

atom_t HTPcreate ( filerec_t * file_rec,
uint16 tag,
uint16 ref )

◆ HTPdelete()

intn HTPdelete ( atom_t ddid)

◆ HTPdump_dds()

intn HTPdump_dds ( int32 file_id,
FILE * fout )

◆ HTPend()

intn HTPend ( filerec_t * file_rec)

◆ HTPendaccess()

intn HTPendaccess ( atom_t ddid)

◆ HTPinit()

intn HTPinit ( filerec_t * file_rec,
int16 ndds )

◆ HTPinquire()

intn HTPinquire ( atom_t ddid,
uint16 * tag,
uint16 * ref,
int32 * off,
int32 * len )

◆ HTPis_special()

intn HTPis_special ( atom_t ddid)

◆ HTPselect()

atom_t HTPselect ( filerec_t * file_rec,
uint16 tag,
uint16 ref )

◆ HTPstart()

intn HTPstart ( filerec_t * file_rec)

◆ HTPsync()

intn HTPsync ( filerec_t * file_rec)

◆ HTPupdate()

intn HTPupdate ( atom_t ddid,
int32 new_off,
int32 new_len )

◆ HXPcloseAID()

int32 HXPcloseAID ( accrec_t * access_rec)
extern

◆ HXPendaccess()

intn HXPendaccess ( accrec_t * access_rec)
extern

◆ HXPinfo()

int32 HXPinfo ( accrec_t * access_rec,
sp_info_block_t * info_block )
extern

◆ HXPinquire()

int32 HXPinquire ( accrec_t * access_rec,
int32 * pfile_id,
uint16 * ptag,
uint16 * pref,
int32 * plength,
int32 * poffset,
int32 * pposn,
int16 * paccess,
int16 * pspecial )
extern

◆ HXPread()

int32 HXPread ( accrec_t * access_rec,
int32 length,
void * data )
extern

◆ HXPreset()

int32 HXPreset ( accrec_t * access_rec,
sp_info_block_t * info_block )
extern

◆ HXPseek()

int32 HXPseek ( accrec_t * access_rec,
int32 offset,
int origin )
extern

◆ HXPsetaccesstype()

intn HXPsetaccesstype ( accrec_t * access_rec)
extern

◆ HXPshutdown()

intn HXPshutdown ( void )
extern

◆ HXPstread()

int32 HXPstread ( accrec_t * rec)
extern

◆ HXPstwrite()

int32 HXPstwrite ( accrec_t * rec)
extern

◆ HXPwrite()

int32 HXPwrite ( accrec_t * access_rec,
int32 length,
const void * data )
extern

◆ tagcompare()

intn tagcompare ( void * k1,
void * k2,
intn cmparg )
extern

◆ tagdestroynode()

void tagdestroynode ( void * n)
extern