Interface f2¶
Enumerate F2 Flags¶
F2F_NONE |
0x0000 |
Empty flag |
F2F_ALL |
0xFFFF |
Set all flag |
F2F_OPENUPDATE |
0x0001 |
Open file for update |
F2F_OPENCREATE |
0x0002 |
Open new file |
F2F_OPENMEMORY |
0x0004 |
Open memory driver |
F2F_FOLLOWLINKS |
0x0008 |
Follow links while reading |
F2F_MERGELINKS |
0x0010 |
Merge links while writing |
F2F_COMPRESS |
0x0020 |
Compress data |
F2F_CHECK |
0x0040 |
Force checks |
F2F_OWNDATA |
0x0080 |
Force data ownership |
F2F_OWNARGS |
0x0100 |
|
F2F_NODEFAULT |
0x0200 |
|
F2F_RECURSIVEPATTERN |
0x0400 |
|
F2F_NOUPDATE |
0x0800 |
|
F2F_ALLINCACHE |
0x1000 |
|
F2F_HASEXTFLAGS |
0x2000 |
|
F2F_DEBUG |
0x4000 |
Set debug prints |
F2F_TRACE |
0x8000 |
End user trace |
F2F_DEFAULT |
0x9109 |
Enumerate None values¶
F2Z_INT |
(int)-1 |
not significant integer |
F2Z_HID |
(hid_t)-1 |
not an hid_t |
F2Z_LID |
(hid_t*)NULL |
null hid_t |
F2Z_STR |
(char*)NULL |
null str |
F2Z_CTX |
(F2_Context_t*)NULL |
null context (F2) |
F2T_MT |
0 |
no data (or unknown) |
F2T_C1 |
1 |
char |
F2T_I4 |
2 |
simple integer |
F2T_I8 |
3 |
double integer |
F2T_R4 |
4 |
simple float |
F2T_R8 |
5 |
double float |
Interface F2¶
F2_open¶
filename |
char* |
HDF5 file to open (use empty if rootid set) |
flags |
long |
Flags to set |
rootid |
int |
existing HDF5 hid_t to use instead of file |
ctxt |
int* |
user int used as output for fortran interface |
Return The id of the context, -1 if fail
Remarks The context id is the parameter to all functions
API C int F2_open(char* filename,long flags,int rootid,int *ctxt);
F2_ndim¶
ctxt |
int |
id of the context to use |
node |
int |
id of the target node (hid_t) |
ndim |
int* |
number of dims of the shape of the node (return) |
Return Status
Remarks Max dims is 12
API C int F2_ndim(int ctxt,int node,int *ndim);
F2_cleardims¶
dims |
int* |
array dim to set |
Return Status
Remarks All 12 entries of the dims arrays are set to -1
API C int F2_cleardims(int *dims);
F2_create¶
ctxt |
int |
id of the context to use |
parentid |
int |
id of the parent node (hid_t) |
name |
char* |
name of the new child to create |
sidstype |
int |
enumerate of the SIDS type of the node (label) |
datatype |
int |
enumerate of the data type of the node |
shape |
int* |
array of dimensions of data (last is -1) |
newid |
int* |
returned new child id (hid_t) |
Return Status
Remarks SIDStype is F2E_SIDStypes, data type is F2T_*int F2_create(int ctxtid,int parentid, .. raw:: html
<hr>
F2_pathFromId¶
ctxt |
int |
id of the context to use |
node |
int |
id of the target node (hid_t) |
path |
char** |
pointer to string to use or to allocate if NULL |
Return Status
Remarks On NULL path new memory is returned, the user has to release it
API C int F2_pathFromId(int ctxt,int node,char** path);
F2_idFromPath¶
ctxt |
int |
id of the context to use |
path |
char* |
path of the target node |
Return The id of the node (hid_t) -1 if fail
Remarks No Wildward resolution in the path, only plain path
API C int F2_idFromPath(int ctxt,char* path);
F2_stackFetch¶
ctxt |
int |
id of the context to use |
stack |
int |
id of the stack to clear and to fill with results |
Return The number of entries in the stack
Remarks See Path patterns
API C int F2_stackFetch(int ctxt,int stack,char* path);
F2_stackFetchByInt¶
ctxt |
int |
id of the context to use |
stack |
int |
id of the stack to clear and to fill with results |
value |
int |
the path is selected if its data equals to this value |
Return The number of entries in the stack
Remarks The first cell of 1D arrays is compared to value
API C int F2_stackFetchByInt(int ctxt,int stack,char* path,int value);
F2_stackFetchByLong¶
ctxt |
int |
id of the context to use |
stack |
int |
id of the stack to clear and to fill with results |
value |
long |
path is selected if its data equals to this value |
Return The number of entries in the stack
Remarks The first cell of 1D arrays is compared to value
API C int F2_stackFetchByLong(int ctxt,int stack,char* path,long value);
F2_stackFetchByFloat¶
ctxt |
int |
id of the context to use |
stack |
int |
id of the stack to clear and to fill with results |
value |
float |
path is selected if its data equals to this value |
Return The number of entries in the stack
Remarks The first cell of 1D arrays is compared to value
API Fortran F2_stackFetchByFloat(integer ctxt,integer stack,char(*) path,real value)
API C int F2_stackFetchByFloat(int ctxt,int stack,char* path,float value);
F2_stackFetchByDouble¶
ctxt |
int |
id of the context to use |
stack |
int |
id of the stack to clear and to fill with results |
value |
double |
path is selected if its data equals to this value |
Return The number of entries in the stack
Remarks The first cell of 1D arrays is compared to value
API C int F2_stackFetchByDouble(int ctxt,int stack,char* path,double value);
F2_stackFetchByString¶
ctxt |
int |
id of the context to use |
stack |
int |
id of the stack to clear and to fill with results |
value |
char* |
path is selected if its data equals to this value |
Return The number of entries in the stack
Remarks The first cell of 1D arrays is compared to value
API C int F2_stackFetchByString(int ctxt,int stack,char* path,char *value);
F2_stackRead¶
ctxt |
int |
id of the context to use |
stack |
int |
id of the stack to clear and to fill with results |
index |
int |
entry of the stack to get |
path |
char** |
the string to fill with the path if not NULL |
Return The path found for the stack entry at index
Remarks On NULL path new memory is returned, the user has to release it
API C char* F2_stackRead(int ctxtid,int stack,int index,char **path);
F2_shape¶
node |
int |
hid_t of the target node |
Return Dimension array of the node
Remarks Max dims is 12, unused dims are set to -1
API C int* F2_shape(int node);
F2_datatype¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the target node |
Return Datatype of the array items of the node as integer
Remarks See enums
API C int F2_datatype(int ctxtid,int node);
F2_setdata¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the target node |
datatype |
int |
data type to use |
data |
void* |
Array to set as node data (copy) |
Return Status
Remarks Cannot be used in fortran, preffered use for C code using void*
API C int F2_setdata(int ctxt,int node,int datatype,const void *data);
F2_sidstype¶
node |
int |
hid_t of the target node |
Return Datatype of the array items of the node as integer
Remarks See enums
API C int F2_sidstype(int node);
F2_datafloat¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the target node |
data |
float* |
Array to fill with node data |
Return Status
Remarks If data if NULL it is allocated, NULL is returned if error
API C int F2_datafloat(int ctxt,int node,float *data);
F2_datafloat¶
node |
int |
hid_t of the target node |
data |
float* |
Array to fill with node data |
Return Node data as float array
Remarks If data if NULL it is allocated, NULL is returned if error
API C float* F2_datafloatcontiguous(int node,int stack,float *data);
F2_datadouble¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the target node |
data |
double* |
Array to fill with node data |
Return Status
Remarks If data if NULL it is allocated, NULL is returned if error
API C int F2_datadouble(int ctxt,int node,double *data);
F2_dataint¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the target node |
data |
int* |
Array ptr to fill with node data |
Return Status
Remarks Function copies data into arg pointeur
API C int F2_dataint(int ctxt,int node,int *data);
F2_setdataint¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the target node |
data |
int* |
Array to set as node data (copy) |
Return Status
Remarks
API C int F2_setdataint(int ctxt,int node,const int *data);
F2_setdatachar¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the target node |
data |
char* |
Array to set as node data (copy) |
Return Status
Remarks
API C int F2_setdatachar(int ctxt,int node,const char *data);
F2_datalong¶
node |
int |
hid_t of the target node |
data |
long* |
Array to fill with node data |
Return Node data as long array
Remarks If data if NULL it is allocated, NULL is returned if error
API C long* F2_datalong(int node,long *data);
F2_datachar¶
node |
int |
hid_t of the target node |
data |
char* |
Array to fill with node data |
Return Status
Remarks
API C int F2_datachar(int ctxt, int node,char *data);
F2_setshape¶
ctxt |
int |
id of the context to use |
node |
int |
hid_t of the node to change |
shape |
int* |
new shape to set |
Remarks Node unchanged if error
API C void F2_setshape(int node,int* shape);
F2_getChildCount¶
ctxtid |
int |
id of the context to use |
parentid |
int |
hid_t of the parent |
childid |
int |
hid_t of the child |
filter |
int |
type of filter to use (enum) |
count |
int* |
number of children |
Remarks Filter is F2X_*int F2_getChildCount(int ctxtid,int parentid,int childid,int filter, .. raw:: html
<hr>
F2_getChildCreateIndex¶
ctxtid |
int |
id of the context to use |
parentid |
int |
hid_t of the parent |
childid |
int |
hid_t of the child |
filter |
int |
type of filter to use (enum) |
index |
int* |
index of the child |
Remarks Retrieve the index creation of the arg child, from 0 to N-1 for N childrenFilter is F2X_*int F2_getChildCreateIndex(int ctxtid,int parentid,int childid,int filter, .. raw:: html
<hr>
F2_getChildFromIndex¶
ctxtid |
int |
id of the context to use |
parentid |
int |
hid_t of the parent |
index |
int |
rank of the child to find |
sidstype |
int |
enumerate, SIDS type of the nodes to count |
name |
char* |
name of the child (copy into) |
Remarks int F2_getChildFromIndex(int ctxtid,int parentid,int index,int sidstype, .. raw:: html
<hr>
Error Codes
2000
- [Name] attribute not found while DataArray_t creation
2001
- [DataType] attribute not found while DataArray_t creation
2002
- [DataDimension] attribute not found while DataArray_t creation
2003
- [DataPointer] attribute not found while DataArray_t <<datatype>> creation
2004
- [DataPointer] attribute bad DataType <<unswitched enumerate>> while DataArray_t creation
2005
- [Name] attribute not found while UserDefinedData_t creation
2006
- [Name] attribute not found while GridCoordinates_t creation
2007
- [Name] attribute not found while Descriptor_t creation
2008
- [Name] attribute not found while DataClass_t creation
2009
- [Name] attribute not found while DimensionalUnits_t creation
2010
- [Name] attribute not found while Zone_t creation
2011
- [ZoneType] attribute not found while Zone_t creation
2012
- [ZoneDimensionSize] attribute not found while Zone_t creation
2013
- [ZoneDimension] attribute not found while Zone_t creation
2014
- [Name] attribute not found while GridLocation_t creation
2015
- [GridLocation] attribute not found while GridLocation_t creation
2016
- [Name] attribute not found while ElementType_t creation
2017
- [GridLocation] attribute not found while ElementType_t creation
2018
- [GridLocation] attribute not found while ElementType_t creation
2019
- [Name] attribute not found while Axisymmetry_t creation
2020
- [Descriptor] attribute not found while Descriptor_t creation
2021
- [DataClass] attribute not found while DataClass_t creation
2100
- [HDF5] Bad node id