summaryrefslogtreecommitdiffstats
path: root/src/H5M.c
blob: 31a5bd4d9b9ca552a967ad2988b8561f41197409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
/****************************************************************************
* NCSA HDF								   *
* Software Development Group						   *
* National Center for Supercomputing Applications			   *
* University of Illinois at Urbana-Champaign				   *
* 605 E. Springfield, Champaign IL 61820				   *
*									   *
* For conditions of distribution and use, see the accompanying		   *
* hdf/COPYING file.							   *
*									   *
****************************************************************************/

#ifdef RCSID
static char RcsId[] = "@(#)$Revision$";
#endif

/* $Id$ */

/*LINTLIBRARY */
/*+
   FILE
       hdf5meta.c
   HDF5 "Meta-Object" routines

   EXPORTED ROUTINES
       H5Maccess    -- Start access to an existing object
       H5Mcopy	    -- Copy an object
       H5Mopen 	    -- Find an object by name
       H5Mname_len  -- Get the length of an object's name
       H5Mget_name  -- Get an object's name
       H5Mset_name  -- Set an object's name
       H5Msearch    -- Wildcard search for an object by name
       H5Mindex	    -- Get an object by index
       H5Mflush	    -- Flush an object out to disk
       H5Mdelete    -- Delete an object from disk
       H5Mget_file  -- Get the file ID for an object
       H5Mget_file  -- Get the parent ID for an object
       H5Mclose   -- Release access to an object

   LIBRARY-SCOPED ROUTINES

   LOCAL ROUTINES
       H5M_init_interface    -- initialize the interface
   + */

#include <H5private.h>	/* Generic functions */
#include <H5Cprivate.h>	  /* Template interface */
#include <H5Dprivate.h> /* Dataset interface */
#include <H5Eprivate.h>	 /*error handling */
#include <H5Pprivate.h> /* Dataspace functions */
#include <H5Tprivate.h>	  /* Datatype interface */
#include <H5Mprivate.h> /* Meta-object interface */
#include <H5Cprivate.h>	  /* Template interface */

#define PABLO_MASK	H5M_mask

/*--------------------- Locally scoped variables -----------------------------*/

static meta_func_t meta_func_arr[]={
    {	/* Template object meta-functions (defined in H5C.c) */
	H5_TEMPLATE_0,		/* File-Creation Template Type ID */
	NULL,			/* File-Creation Template Create */
	NULL,			/* File-Creation Template Access */
	H5Ccopy,		/* File-Creation Template Copy */
	NULL,			/* File-Creation Template FindName */
	NULL,			/* File-Creation Template NameLen */
	NULL,			/* File-Creation Template GetName */
	NULL,			/* File-Creation Template SetName */
	NULL,			/* File-Creation Template Search */
	NULL,			/* File-Creation Template Index */
	NULL,			/* File-Creation Template Flush */
	NULL,			/* File-Creation Template Delete */
	NULL,			/* File-Creation Template GetParent */
	NULL,			/* File-Creation Template GetFile */
	H5Cclose		/* File-Creation Template Release */
    },
    {	/* Datatype object meta-functions (defined in H5T.c) */
	H5_DATATYPE,		/* Datatype Type ID */
	NULL,			/* Datatype Create */
	NULL,			/* Datatype Access */
	H5Tcopy,		/* Dataspace Copy */
	NULL,			/* Datatype FindName */
	NULL,			/* Datatype NameLen */
	NULL,			/* Datatype GetName */
	NULL,			/* Datatype SetName */
	NULL,			/* Datatype Search */
	NULL,			/* Datatype Index */
	NULL,			/* Datatype Flush */
	NULL,			/* Datatype Delete */
	NULL,			/* Datatype GetParent */
	NULL,			/* Datatype GetFile */
	H5Tclose		/* Datatype Release */
    },
    {	/* Dimensionality object meta-functions (defined in H5P.c) */
	H5_DATASPACE,		/* Dimensionality Type ID */
	NULL,			/* Dimensionality Create */
	NULL,			/* Dimensionality Access */
	NULL,			/* Dimensionality Copy */
	NULL,			/* Dimensionality FindName */
	NULL,			/* Dimensionality NameLen */
	NULL,			/* Dimensionality GetName */
	NULL,			/* Dimensionality SetName */
	NULL,			/* Dimensionality Search */
	NULL,			/* Dimensionality Index */
	NULL,			/* Dimensionality Flush */
	NULL,			/* Dimensionality Delete */
	NULL,			/* Dimensionality GetParent */
	NULL,			/* Dimensionality GetFile */
	H5Pclose		/* Dimensionality Release */
    },
    {	/* Dataset object meta-functions (defined in H5D.c) */
	H5_DATASET,		/* Dataset Type ID */
	NULL,			/* Dataset Create */
	NULL,			/* Dataset Access */
	NULL,			/* Dataset Copy */
	H5D_find_name,		/* Dataset FindName */
	NULL,			/* Dataset NameLen */
	NULL,			/* Dataset GetName */
	NULL,			/* Dataset SetName */
	NULL,			/* Dataset Search */
	NULL,			/* Dataset Index */
	NULL,			/* Dataset Flush */
	NULL,			/* Dataset Delete */
	NULL,			/* Dataset GetParent */
	NULL,			/* Dataset GetFile */
	H5Dclose		/* Dataset Release */
    },
  };

/* Interface initialization */
static intn interface_initialize_g = FALSE;
#define INTERFACE_INIT	H5M_init_interface
static herr_t H5M_init_interface(void);

/*--------------------------------------------------------------------------
NAME
   H5M_init_interface -- Initialize interface-specific information
USAGE
    herr_t H5M_init_interface()
   
RETURNS
   SUCCEED/FAIL
DESCRIPTION
    Initializes any interface-specific data or routines.

MODIFICATIONS
    Robb Matzke, 4 Aug 1997
    Changed the FUNC variable value to H5M_init_interface.

--------------------------------------------------------------------------*/
static herr_t H5M_init_interface(void)
{
    herr_t ret_value = SUCCEED;
    FUNC_ENTER (H5M_init_interface, FAIL);

    FUNC_LEAVE(ret_value);
}	/* H5M_init_interface */

/*--------------------------------------------------------------------------
 NAME
    H5M_find_type
 PURPOSE
    Find the type of meta-object to issue a method call on
 USAGE
    intn H5M_find_type(type)
	hobjtype_t type;	IN: Type of object to create
 RETURNS
     Returns the index of the type in the array of methods on success, or FAIL 
	on failure.
 DESCRIPTION
	This function performs a search to find the index of the type of a 
    meta-object in the array of function pointers.
--------------------------------------------------------------------------*/
static intn
H5M_find_type (group_t type)
{
    intn i;	    /* local counting variable */
    intn ret_value = FAIL;

    FUNC_ENTER(H5M_find_type, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;

    /*
     * Currently this uses a stright linear search, which can easily be changed
     * to a binary search when it becomes too slow.
     */
    for(i=0; i<(sizeof(meta_func_arr)/sizeof(meta_func_t)); i++)
	if(type==meta_func_arr[i].type)
	    HGOTO_DONE(i);

done:
    if(ret_value == FAIL)   
      { /* Error condition cleanup */

      } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5M_find_type() */

/*--------------------------------------------------------------------------
 NAME
    H5Maccess
 PURPOSE
    Start access to an existing HDF5 object.
 USAGE
    hid_t H5Maccess(owner_id)
	hid_t oid;	 IN: OID of the object to access.
 RETURNS
    Returns ID (atom) on success, FAIL on failure
 DESCRIPTION
	This function re-directs the object's access into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Maccess(hid_t oid)
{
    group_t	   group;
    intn i;	    /* local counting variable */
    hid_t	 ret_value = SUCCEED;

    FUNC_ENTER(H5Maccess, FAIL);

    /* Atom group for incoming object */
    group = H5Aatom_group (oid);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].access==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
		    "no access method");
    ret_value=(meta_func_arr[i].access)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Maccess() */

/*--------------------------------------------------------------------------
 NAME
    H5Mcopy
 PURPOSE
    Copy an HDF5 object.
 USAGE
    hid_t H5Mcopy(oid)
	hid_t oid;	 IN: Object to copy
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's copy into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mcopy(hid_t oid)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    herr_t	  ret_value = SUCCEED;

    FUNC_ENTER(H5Mcopy, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].copy==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no copy method");
    ret_value=(meta_func_arr[i].copy)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mcopy() */

/*--------------------------------------------------------------------------
 NAME
    H5Mfind_name
 PURPOSE
    Find an HDF5 object by name.
 USAGE
    hid_t H5Mfind_name(owner_id, type, name)
	hid_t owner_id;	      IN: Group/file in which to search
	hobjtype_t type;	IN: Type of object to search names of
	const char *name;	IN: Name of the object to search for
 RETURNS
    Returns ID (atom) on success, FAIL on failure
 DESCRIPTION
	This function re-directs the object's "find name" into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t
H5Mfind_name (hid_t owner_id, group_t type, const char *name)
{
#ifdef OLD_WAY
    group_t group=H5Aatom_group(owner_id);   /* Atom group for incoming object */
#endif /* OLD_WAY */
    intn i;	    /* local counting variable */
    hid_t	 ret_value = SUCCEED;

    FUNC_ENTER(H5Mfind_name, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
#ifdef OLD_WAY
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);

    i=H5M_find_type(group);
#else /* OLD_WAY */
    if(type<=BADGROUP || type>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(type);
#endif /* OLD_WAY */
    if(meta_func_arr[i].find_name==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no open method");
    ret_value=(meta_func_arr[i].find_name)(owner_id,type,name);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mfind_name() */

/*--------------------------------------------------------------------------
 NAME
    H5Mname_len
 PURPOSE
    Determine the length of the name of an HDF5 object.
 USAGE
    uint32 H5Mname_len(oid)
	hid_t oid;	 IN: Object to get name's length
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's "name length" into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
uint32 H5Mname_len(hid_t oid)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    herr_t	  ret_value = SUCCEED;

    FUNC_ENTER(H5Mname_len, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].name_len==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no name_len method");
    ret_value=(meta_func_arr[i].name_len)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mname_len() */

/*--------------------------------------------------------------------------
 NAME
    H5Mget_name
 PURPOSE
    Get the name of an HDF5 object.
 USAGE
    herr_t H5Mget_name(oid, name)
	hid_t oid;	      IN: Object to retreive name of
	char *name;		OUT: Buffer to place object's name in
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's "get name" into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
herr_t H5Mget_name(hid_t oid, char *name)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    hid_t	 ret_value = SUCCEED;

    FUNC_ENTER(H5Mget_name, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].get_name==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
		    "no get_name method");
    ret_value=(meta_func_arr[i].get_name)(oid,name);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mget_name() */

/*--------------------------------------------------------------------------
 NAME
    H5Mset_name
 PURPOSE
    Set the name of an HDF5 object.
 USAGE
    herr_t H5Mget_name(oid, name)
	hid_t oid;	      IN: Object to set name of
	const char *name;	IN: Name to use for object
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's "set name" into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
herr_t H5Mset_name(hid_t oid, const char *name)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    hid_t	 ret_value = SUCCEED;

    FUNC_ENTER(H5Mset_name, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].set_name==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
		    "no set_name method");
    ret_value=(meta_func_arr[i].set_name)(oid,name);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mset_name() */

/*--------------------------------------------------------------------------
 NAME
    H5Msearch
 PURPOSE
    Wildcard search for an HDF5 object by name.
 USAGE
    hid_t H5Mfind_name(owner_id, type, name)
	hid_t owner_id;	      IN: Group/file in which to search
	hobjtype_t type;	IN: Type of object to search names of
	const char *name;	IN: Name of the object to search for
 RETURNS
    Returns ID (atom) on success, FAIL on failure
 DESCRIPTION
	This function re-directs the object's "search" into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t
H5Msearch (hid_t oid, group_t type, const char *name)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    hid_t	 ret_value = SUCCEED;

    FUNC_ENTER(H5Msearch, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].search==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no search method");
    ret_value=(meta_func_arr[i].search)(oid,type,name);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Msearch() */

/*--------------------------------------------------------------------------
 NAME
    H5Mindex
 PURPOSE
    Get an HDF5 object by index.
 USAGE
    hid_t H5Mindex(oid, type, idx)
	hid_t oid;	      IN: Group/file in which to find items
	hobjtype_t type;	IN: Type of object to get
	uint32 idx;		IN: Index of the object to get
 RETURNS
    Returns ID (atom) on success, FAIL on failure
 DESCRIPTION
	This function re-directs the object's "index" into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t
H5Mindex (hid_t oid, group_t type, uint32 idx)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    hid_t	 ret_value = SUCCEED;

    FUNC_ENTER(H5Mindex, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL,  "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].index==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no index method");
    ret_value=(meta_func_arr[i].index)(oid,type,idx);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mindex() */

/*--------------------------------------------------------------------------
 NAME
    H5Mflush
 PURPOSE
    Flush an HDF5 object out to a file.
 USAGE
    hid_t H5Mflush(oid)
	hid_t oid;	 IN: Object to flush
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's flush into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mflush(hid_t oid)
{
    group_t group;   /* Atom group for incoming object */
    intn i;	    /* local counting variable */
    herr_t	  ret_value = SUCCEED;

    FUNC_ENTER(H5Mflush, FAIL); /* Insert function initialization code and variables */

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    group=H5Aatom_group(oid);	/* look up group for incoming object */
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    /* Find correct function pointer set from static array */
    i=H5M_find_type(group);
    if(meta_func_arr[i].flush==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no flush method");
    ret_value=(meta_func_arr[i].flush)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);  /* Insert function prologue code */
} /* end H5Mflush() */

/*--------------------------------------------------------------------------
 NAME
    H5Mdelete
 PURPOSE
    Delete an HDF5 object from a file.
 USAGE
    herr_t H5Mdelete(oid)
	hid_t oid;	 IN: Object to delete
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's delete into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h.  Deleting
    an object implicitly ends access to it.
--------------------------------------------------------------------------*/
herr_t H5Mdelete(hid_t oid)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    herr_t	  ret_value = SUCCEED;

    FUNC_ENTER(H5Mdelete, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].delete==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no delete method");
    ret_value=(meta_func_arr[i].delete)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mdelete() */

/*--------------------------------------------------------------------------
 NAME
    H5Mget_parent
 PURPOSE
    Get the parent ID an HDF5 object.
 USAGE
    hid_t H5Mget_parent(oid)
	hid_t oid;	 IN: Object to query
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's query into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mget_parent(hid_t oid)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    herr_t	  ret_value = SUCCEED;

    FUNC_ENTER(H5Mget_parent, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].get_parent==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
		    "no get_parent method");
    ret_value=(meta_func_arr[i].get_parent)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mget_parent() */

/*--------------------------------------------------------------------------
 NAME
    H5Mget_file
 PURPOSE
    Get the file ID an HDF5 object.
 USAGE
    hid_t H5Mget_file(oid)
	hid_t oid;	 IN: Object to query
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's query into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mget_file(hid_t oid)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    herr_t	  ret_value = SUCCEED;

    FUNC_ENTER(H5Mget_file, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].get_file==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
		    "no get_file method");
    ret_value=(meta_func_arr[i].get_file)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
} /* end H5Mget_file() */

/*--------------------------------------------------------------------------
 NAME
    H5Mclose
 PURPOSE
    Release access to an HDF5 object.
 USAGE
    herr_t H5Mclose(oid)
	hid_t oid;	 IN: Object to release access to
 RETURNS
    SUCCEED/FAIL
 DESCRIPTION
	This function re-directs the object's release into the appropriate
    interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
herr_t H5Mclose(hid_t oid)
{
    group_t group=H5Aatom_group(oid);	/* Atom group for incoming object */
    intn i;	    /* local counting variable */
    herr_t	  ret_value = SUCCEED;

    FUNC_ENTER(H5Mclose, FAIL);

    /* Clear errors and check args and all the boring stuff. */
    H5ECLEAR;
    if(group<=BADGROUP || group>=MAXGROUP)
	HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");

    i=H5M_find_type(group);
    if(meta_func_arr[i].close==NULL)
	HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no close method");
    ret_value=(meta_func_arr[i].close)(oid);

done:
  if(ret_value == FAIL)	  
    { /* Error condition cleanup */

    } /* end if */

    /* Normal function cleanup */

    FUNC_LEAVE(ret_value);
}