Loading include/cutils/str_parms.h +6 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,12 @@ int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); int str_parms_add_float(struct str_parms *str_parms, const char *key, float value); // Returns non-zero if the str_parms contains the specified key. int str_parms_has_key(struct str_parms *str_parms, const char *key); // Gets value associated with the specified key (if present), placing it in the buffer // pointed to by the out_val parameter. Returns the length of the returned string value. // If 'key' isn't in the parms, then return -ENOENT (-2) and leave 'out_val' untouched. int str_parms_get_str(struct str_parms *str_parms, const char *key, char *out_val, int len); int str_parms_get_int(struct str_parms *str_parms, const char *key, Loading libcutils/str_parms.c +4 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,10 @@ int str_parms_add_float(struct str_parms *str_parms, const char *key, return ret; } int str_parms_has_key(struct str_parms *str_parms, const char *key) { return hashmapGet(str_parms->map, (void *)key) != NULL; } int str_parms_get_str(struct str_parms *str_parms, const char *key, char *val, int len) { Loading Loading
include/cutils/str_parms.h +6 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,12 @@ int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); int str_parms_add_float(struct str_parms *str_parms, const char *key, float value); // Returns non-zero if the str_parms contains the specified key. int str_parms_has_key(struct str_parms *str_parms, const char *key); // Gets value associated with the specified key (if present), placing it in the buffer // pointed to by the out_val parameter. Returns the length of the returned string value. // If 'key' isn't in the parms, then return -ENOENT (-2) and leave 'out_val' untouched. int str_parms_get_str(struct str_parms *str_parms, const char *key, char *out_val, int len); int str_parms_get_int(struct str_parms *str_parms, const char *key, Loading
libcutils/str_parms.c +4 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,10 @@ int str_parms_add_float(struct str_parms *str_parms, const char *key, return ret; } int str_parms_has_key(struct str_parms *str_parms, const char *key) { return hashmapGet(str_parms->map, (void *)key) != NULL; } int str_parms_get_str(struct str_parms *str_parms, const char *key, char *val, int len) { Loading