Misc tweaks

This commit is contained in:
Aaron Culliney 2016-02-25 21:04:23 -08:00
parent 6e978810db
commit 0663141589
2 changed files with 10 additions and 5 deletions

View File

@ -94,6 +94,10 @@ int json_createFromFile(const char *filePath, INOUT JSON_s *parsedData) {
char *jsonString = NULL;
do {
if (!filePath) {
break;
}
if (!parsedData) {
break;
}
@ -241,7 +245,7 @@ bool json_mapCopyStringValue(const JSON_s *map, const char *key, INOUT char **va
return foundMatch;
}
bool json_mapParseLongValue(const JSON_s *map, const char *key, INOUT long *val, const int base) {
bool json_mapParseLongValue(const JSON_s *map, const char *key, INOUT long *val, const long base) {
bool foundMatch = false;
do {

View File

@ -33,8 +33,8 @@ int json_createFromFile(const char *filePath, INOUT JSON_s *parsedData);
// get string value for key in map JSON, returns true upon success and strdup()'d value in *val
bool json_mapCopyStringValue(const JSON_s *map, const char *key, INOUT char **val);
// get int value for key in map JSON, returns true upon success
bool json_mapParseLongValue(const JSON_s *dict, const char *key, INOUT long *val, const int base);
// get long value for key in map JSON, returns true upon success
bool json_mapParseLongValue(const JSON_s *dict, const char *key, INOUT long *val, const long base);
// get float value for key in map JSON, returns true upon success
bool json_mapParseFloatValue(const JSON_s *dict, const char *key, INOUT float *val);
@ -42,10 +42,11 @@ bool json_mapParseFloatValue(const JSON_s *dict, const char *key, INOUT float *v
// ----------------------------------------------------------------------------
// array functions
//bool json_arrayCopytStringValueAtIndex(const JSON_s *array, unsigned long index, INOUT const char **val);
//bool json_arrayParseIntValueAtIndex(const JSON_s *array, unsigned long index, INOUT const int *val);
//bool json_arrayCopyStringValueAtIndex(const JSON_s *array, unsigned long index, INOUT const char **val);
//bool json_arrayParseLongValueAtIndex(const JSON_s *array, unsigned long index, INOUT const long *val);
//bool json_arrayParseFloatValueAtIndex(const JSON_s *array, unsigned long index, INOUT const float *val);
// ----------------------------------------------------------------------------
// destroys internal allocated memory (if any)
void json_destroy(JSON_s *parsedData);