return bool for GfParmExistsSection and GfParmExistsParam

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7867 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 5fd0ff35b8feadab2f1cec62fe19c9998c0ed501
Former-commit-id: 2ebb861be4223daee34434745d8a91e57c55f66b
This commit is contained in:
iobyte 2022-01-02 22:02:13 +00:00
parent 48605e270b
commit 9111c72a6f
2 changed files with 12 additions and 12 deletions

View file

@ -2418,9 +2418,9 @@ GfParmGetEltNb (void *handle, const char *path)
@ingroup paramsdata
@param handle handle of parameters
@param path path of section
@return 0 if doesn't exist, 1 otherwise.
@return false if doesn't exist, true otherwise.
*/
int
bool
GfParmExistsSection (void *handle, const char *path)
{
struct parmHandle *parmHandle = (struct parmHandle *)handle;
@ -2429,14 +2429,14 @@ GfParmExistsSection (void *handle, const char *path)
if ((parmHandle == NULL) || (parmHandle->magic != PARM_MAGIC)) {
GfLogError ("GfParmExistsSection: bad handle (%p)\n", parmHandle);
return 0;
return false;
}
conf = parmHandle->conf;
section = (struct section *)GfHashGetStr (conf->sectionHash, path);
return section != 0 ? 1 : 0;
return section != 0;
}
/** Check if a parameter exists.
@ -2444,10 +2444,10 @@ GfParmExistsSection (void *handle, const char *path)
@param handle handle of parameters
@param path path of param
@param key key name
@return 1 exists
0 doesn't exist
@return true exists
false doesn't exist
*/
int
bool
GfParmExistsParam(void *handle, const char *path, const char *key)
{
struct parmHandle *parmHandle = (struct parmHandle *)handle;
@ -2456,7 +2456,7 @@ GfParmExistsParam(void *handle, const char *path, const char *key)
if ((parmHandle == NULL) || (parmHandle->magic != PARM_MAGIC)) {
GfLogError ("GfParmExistsParam: bad handle (%p)\n", parmHandle);
return 0;
return false;
}
conf = parmHandle->conf;
@ -2464,10 +2464,10 @@ GfParmExistsParam(void *handle, const char *path, const char *key)
param = getParamByName (conf, path, key, 0);
if (!param)
{
return 0;
return false;
}
return 1;
return true;
}
/** Seek the first sub-section element of a section.

View file

@ -494,9 +494,9 @@ TGF_API int GfParmGetNumBoundaries(void *handle, char *path, char *key, tdble *m
TGF_API void GfParmRemove(void *handle, const char *path, const char *key);
TGF_API int GfParmRemoveSection (void *handle, const char *path);
TGF_API int GfParmExistsSection(void *handle, const char *path);
TGF_API bool GfParmExistsSection(void *handle, const char *path);
TGF_API std::vector<std::string> GfParmListGetSectionNamesList(void *handle);
TGF_API int GfParmExistsParam(void *handle, const char *path, const char *key);
TGF_API bool GfParmExistsParam(void *handle, const char *path, const char *key);
TGF_API int GfParmGetEltNb(void *handle, const char *path);
TGF_API int GfParmListSeekFirst(void *handle, const char *path);
TGF_API int GfParmListSeekNext(void *handle, const char *path);