/* File driven I/O (may yield better performance than using the streamXXX functions) */
//Creation & Destruction
CdiIterator*cdiIterator_new(constchar*path);//Requires a subsequent call to cdiIteratorNextField() to point the iterator at the first field.
CdiIterator*cdiIterator_clone(CdiIterator*me);
char*cdiIterator_serialize(CdiIterator*me);//Returns a malloc'ed string.
CdiIterator*cdiIterator_deserialize(constchar*description);//description is a string that was returned by cdiIteratorSerialize(). Returns a copy of the original iterator.
CdiIterator*cdiIterator_new(constchar*path);//Requires a subsequent call to cdiIteratorNextField() to point the iterator at the first field.
CdiIterator*cdiIterator_clone(CdiIterator*me);
char*cdiIterator_serialize(CdiIterator*me);//Returns a malloc'ed string.
CdiIterator*cdiIterator_deserialize(constchar*description);//description is a string that was returned by cdiIteratorSerialize(). Returns a copy of the original iterator.
intcdiIterator_nextField(CdiIterator*me);//Points the iterator at the next field, returns CDI_EEOF if there are no more fields in the file.
intcdiIterator_nextField(CdiIterator*me);//Points the iterator at the next field, returns CDI_EEOF if there are no more fields in the file.
//Introspecting metadata
//All outXXX arguments to these functions may be NULL.
char*cdiIterator_inqStartTime(CdiIterator*me);//Returns the (start) time as an ISO-8601 coded string. The caller is responsible to free() the returned string.
char*cdiIterator_inqEndTime(CdiIterator*me);//Returns the end time of an integration period as an ISO-8601 coded string, or NULL if there is no end time. The caller is responsible to free() the returned string.
char*cdiIterator_inqVTime(CdiIterator*me);//Returns the validity date as an ISO-8601 coded string. The caller is responsible to free() the returned string.
intcdiIterator_inqLevelType(CdiIterator*me,intlevelSelector,char**outName,char**outLongName,char**outStdName,char**outUnit);//callers are responsible to free() strings that they request
intcdiIterator_inqLevel(CdiIterator*me,intlevelSelector,double*outValue1,double*outValue2);//outValue2 is only written to if the level is a hybrid level
intcdiIterator_inqLevelUuid(CdiIterator*me,int*outVgridNumber,int*outLevelCount,unsignedchar(*outUuid)[CDI_UUID_SIZE]);//outUuid must point to a buffer of 16 bytes, returns an error code if no generalized zaxis is used.
CdiParamcdiIterator_inqParam(CdiIterator*me);
intcdiIterator_inqDatatype(CdiIterator*me);
intcdiIterator_inqTsteptype(CdiIterator*me);
char*cdiIterator_inqVariableName(CdiIterator*me);//The caller is responsible to free() the returned buffer.
intcdiIterator_inqGridId(CdiIterator*me);//The returned id is only valid until the next call to cdiIteratorNextField().
char*cdiIterator_inqStartTime(CdiIterator*me);//Returns the (start) time as an ISO-8601 coded string. The caller is responsible to free() the returned string.
char*cdiIterator_inqEndTime(CdiIterator*me);//Returns the end time of an integration period as an ISO-8601 coded string, or NULL if there is no end time. The caller is responsible to free() the returned string.
char*cdiIterator_inqVTime(CdiIterator*me);//Returns the validity date as an ISO-8601 coded string. The caller is responsible to free() the returned string.
intcdiIterator_inqLevelType(CdiIterator*me,intlevelSelector,char**outName,char**outLongName,char**outStdName,char**outUnit);//callers are responsible to free() strings that they request
intcdiIterator_inqLevel(CdiIterator*me,intlevelSelector,double*outValue1,double*outValue2);//outValue2 is only written to if the level is a hybrid level
intcdiIterator_inqLevelUuid(CdiIterator*me,int*outVgridNumber,int*outLevelCount,unsignedchar(*outUuid)[CDI_UUID_SIZE]);//outUuid must point to a buffer of 16 bytes, returns an error code if no generalized zaxis is used.
CdiParamcdiIterator_inqParam(CdiIterator*me);
intcdiIterator_inqDatatype(CdiIterator*me);
intcdiIterator_inqTsteptype(CdiIterator*me);
char*cdiIterator_inqVariableName(CdiIterator*me);//The caller is responsible to free() the returned buffer.
intcdiIterator_inqGridId(CdiIterator*me);//The returned id is only valid until the next call to cdiIteratorNextField().
longcdiGribIterator_inqLongValue(CdiGribIterator*me,constchar*key);//Aborts on failure to fetch the given key.
longcdiGribIterator_inqLongDefaultValue(CdiGribIterator*me,constchar*key,longdefaultValue);//Returns the default value if the given key is not present.
doublecdiGribIterator_inqDoubleValue(CdiGribIterator*me,constchar*key);//Aborts on failure to fetch the given key.
doublecdiGribIterator_inqDoubleDefaultValue(CdiGribIterator*me,constchar*key,doubledefaultValue);//Returns the default value if the given key is not present.
char*cdiGribIterator_inqStringValue(CdiGribIterator*me,constchar*key);//Returns a malloc'ed string.
longcdiGribIterator_inqLongValue(CdiGribIterator*me,constchar*key);//Aborts on failure to fetch the given key.
longcdiGribIterator_inqLongDefaultValue(CdiGribIterator*me,constchar*key,longdefaultValue);//Returns the default value if the given key is not present.
doublecdiGribIterator_inqDoubleValue(CdiGribIterator*me,constchar*key);//Aborts on failure to fetch the given key.
doublecdiGribIterator_inqDoubleDefaultValue(CdiGribIterator*me,constchar*key,doubledefaultValue);//Returns the default value if the given key is not present.
char*cdiGribIterator_inqStringValue(CdiGribIterator*me,constchar*key);//Returns a malloc'ed string.