home *** CD-ROM | disk | FTP | other *** search
- 4.2 NCSA HDF Vset
-
-
- Vgroup Routine Descriptions 4.1
-
-
- National Center for Supercomputing Applications
-
- November 1990
-
-
-
-
-
-
-
- 4.1 NCSA HDF Vset
-
- Vgroup Routine Descriptions 4.1
-
- National Center for Supercomputing Applications
-
- November 1990
-
-
-
- March 1990
-
-
-
-
- Chapter 4 Vgroup Routine Descriptions
-
-
-
- Chapter Overview
- Vattach
- Vdetach
- Vgetclass
- Vgetid
- Vgetname
- Vgetnext
- Vinquire
- Vinsert
- Visvg
- Visvs
- Vlone
- Vsetclass
- Vsetname
-
- Chapter Overview
-
- This chapter describes the vgroup routines in the C library in
- detail.
-
- Vattach
- (VGROUP*) Vattach ( f, vgid, access)
-
- DF *f;
- int vgid;
- char *access; [either "r" or "w"]
-
- Purpose: This access routine attachs to a vgroup having id vgid,
- and then returns a pointer to that group.
-
- Specifics:
-
- f is a pointer to an opened HDF file.
- vgid specifies which vgroup in the HDF file to attach to:
-
- Ñ if vgid = -1, a new vgroup is created.
-
- Ñ if vgid is +ve, the vgroup corresponding to the vgid is
- attached.
-
- (The access argument currently is not used; all vgroups are
- attached with both read and write access.)
-
- Return value: Upon a successful attach, a vgroup pointer is
- returned. Otherwise, NULL is returned.
-
-
- Vdetach
- (void) Vdetach (vg)
-
- VGROUP *vg;
-
-
- Purpose: This access routine detaches vg, the vgroup that was
- currently attached, terminating further access to that vgroup.
-
- Specifics: All space associated with that vgroup will be freed. All
- vgroups should be detached using this routine before closing the
- file. Vdetach also updates the vgroup information in the HDF file
- if any changes occur.
-
- Return value: None.
-
-
- Vgetclass
- (void) Vgetclass (vg,vgclass)
-
- VDATA *vs;
- char *vsclass;
-
- Purpose: This specify routine returns, in the variable vgclass, the
- class field name (if any) of the vdata vg.
-
- Return value: None.
-
-
- Vgetid
- int Vgetid (f, vgid)
-
- DF *f;
- int vgid;
-
- Purpose: This search routine searches through the HDF file and
- returns the id of the next VGROUP following the vgroup that has id
- vgid.
-
- Specifics: To initiate a search, call this routine with a value of -1
- for vgid. This will return the id of the first vdata in the file.
-
- Return value: Upon success, the id (0 or the integer) of the next
- vdata is returned; on error, or when there are no more vgroups, -1
- is returned.
-
-
- Vgetname
- (void) Vgetname (vg, vgname)
-
- VGROUP *vg;
- char *vgname;
-
- Purpose: This inquiry routine returns, in the variable vgname, the
- name of the vgroup vg.
-
- Return value: None.
-
-
- Vgetnext
- int Vgetnext (vg, id)
-
- VGROUP *vg;
- int id;
-
- Purpose: This search routine is used to sequence through a vgroup.
- It searches the vgroup vg and returns the id of the next entity
- (vgroup or vdata) after the entity that has id, id.
-
- Specifics: Note that the entity may be either a vdata or another
- vgroup. To initiate a search, call this routine with -1 as argument
- for id. This action will return the id of the first entity in vg.
-
- Return value: Upon success, the id of the vgroup or vdata is
- returned. If there is an error, or when there are no more entities in
- that vgroup, -1 is returned.
-
-
- Vinquire
- Vinquire (vs, nentries, vgname)
-
- VGROUP *vg;
- char *vgname;
- int *nentries;
-
- Purpose: This is the general vgroup inquiry routine.
-
- Specifics: Given a vgroup vg, Vinquire returns the following:
-
- Ñnentries the number of entries (i.e., the total number
- of vgroups and vdatas) in this vgroup.
-
- Ñvgname the name (if any) of the vgroup. Otherwise,
- NULL is returned.
-
- Return value: Upon success, 1 is returned; otherwise, -1.
-
-
- Vinsert
- int Vinsert (vg, v)
-
- VGROUP *vg;
- VDATA *v; [or VGROUP *v;]
- int n;
-
- Purpose: This linkage routine establishes a link from the vgroup
- vg to either another vgroup or to a vdata v.
-
- Specifics: Essentially, Vinsert allows vgroups or vdatas to belong
- to a vgroup. The routine does not check for any cycles that may
- result.
-
- Return value: Upon success, the position of the inserted entity
- (vgroup or vdata) within the vgroup vg is returned (0 or a +ve
- integer); upon error, -1.
-
-
- Visvg
- int Visvg (vg, id)
-
- VGROUP *vg;
- int id;
-
- Purpose: This inquiry routine tests whether an entity (vgroup or
- vdata) having id, id in a vgroup vg is a vgroup. Id is any valid id
- returned by Vgetnext.
-
- Return value: If id indeed refers to a vgroup within the vgroup vg,
- 1 is returned; otherwise, 0 is returned.
-
-
- Visvs
- int Visvs (vg, id)
-
- VGROUP *vg;
- int id;
-
- Purpose: This inquiry routine tests whether an entity (vgroup or
- vdata) having id, id in a vgroup vg is a vdata. Id is any valid id
- returned by VSgetnext.
-
- Return value: If id indeed refers to a vdata within the vgroup vg, 1
- is returned; otherwise 0 is returned.
-
-
- Vlone
- int Vlone (f, idarray, asize)
-
- DF *f;
- int idarray [];
- int asize;
-
- Purpose: This inquiry routine returns an array of reference
- numbers of all vgroups that are not linked to any vgroup in the
- HDF file.
-
- Specifics: You must provide the integer array idarray, and you
- must specify the integer size of the array in the argument asize.
- The return value from this function will be the total number of
- VGROUPS that are not linked to any vgroup in the file. But at most
- asize reference numbers will be returned in idarray.
-
- An array size of 65000 integers for idarray will be usually more
- than adequate. To use dynamic memory instead, first call Vlone
- with a small value (e.g. 0 or 1) for asize, and then use the returned
- value to allocate memory for idarray to be passed to a subsequent
- call to Vlone.
-
- Return value: If there is an error, the return value is -1.
- Otherwise, it returns the total number of all vgroups in the file that
- are not linked to any vgroup.
-
-
- Vsetclass
- (void) Vsetclass (vg,vgclass)
-
- VGROUP *vg;
- char *vgclass;
-
- Purpose: This specify routine associates the class fieldname
- vgclass with the vdata vg.
-
- Specifics: Vgroups initially have a class name of NULL. The
- class name may be set more than once.
-
- Return value: None.
-
-
- Vsetname
- (void) Vsetname (vg, vgname)
-
- VGROUP *vg;
- char *vgname;
-
- Purpose: This specify routine associates the vgroup vg with the
- name vgname.
-
- Specifics: Vgroups each initially have a vgname of NULL, and
- may be renamed more than once. Note that the routine does NOT
- check for uniqueness of vgroup names.
-
- Return values: None.
-
-
-