Salome HOME
Initialisation de la base KERNEL avec la version operationnelle de KERNEL_SRC issue...
[modules/kernel.git] / src / HDFPersist / HDFnObjects.c
1 #include "hdfi.h"
2 #include <stdlib.h>
3
4 /*
5  * - Name : HDFnObjects
6  * - Description : returns the number of HDF objets in a HDF group
7  * - Parameters :
8  *     - fid     (IN)     : HDF file ID
9  *     - path    (IN)     : acces path to the HDF group in the HDF file
10  * - Results :
11  *     - if success : number of objects
12  *     - if failure : -1 
13  */ 
14
15 hdf_err Num(hdf_idt id,const char *name, void *data);
16
17 hdf_err
18 HDFnObjects(hdf_idt fid,char *path,int *n)
19 {
20   int idx;
21   int m = 0;
22
23   if ((idx  = H5Giterate(fid,path,NULL,Num,(void*)&m)) < 0)
24     return -1;
25
26   *n = (int) m;
27
28   return 0;
29 }
30
31 hdf_err Num(hdf_idt id,const char *name, void *data)
32 {
33   int *count;
34   
35   count = (int *) data;
36   (*count)++;
37
38   return 0;
39 }
40