Loading libcutils/properties.c +19 −10 Original line number Diff line number Diff line Loading @@ -52,19 +52,28 @@ int property_get(const char *key, char *value, const char *default_value) return len; } int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) struct property_list_callback_data { void (*propfn)(const char *key, const char *value, void *cookie); void *cookie; }; static void property_list_callback(const prop_info *pi, void *cookie) { char name[PROP_NAME_MAX]; char value[PROP_VALUE_MAX]; const prop_info *pi; unsigned n; struct property_list_callback_data *data = cookie; for(n = 0; (pi = __system_property_find_nth(n)); n++) { __system_property_read(pi, name, value); propfn(name, value, cookie); data->propfn(name, value, data->cookie); } return 0; int property_list( void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) { struct property_list_callback_data data = { propfn, cookie }; return __system_property_foreach(property_list_callback, &data); } #elif defined(HAVE_SYSTEM_PROPERTY_SERVER) Loading Loading
libcutils/properties.c +19 −10 Original line number Diff line number Diff line Loading @@ -52,19 +52,28 @@ int property_get(const char *key, char *value, const char *default_value) return len; } int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) struct property_list_callback_data { void (*propfn)(const char *key, const char *value, void *cookie); void *cookie; }; static void property_list_callback(const prop_info *pi, void *cookie) { char name[PROP_NAME_MAX]; char value[PROP_VALUE_MAX]; const prop_info *pi; unsigned n; struct property_list_callback_data *data = cookie; for(n = 0; (pi = __system_property_find_nth(n)); n++) { __system_property_read(pi, name, value); propfn(name, value, cookie); data->propfn(name, value, data->cookie); } return 0; int property_list( void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) { struct property_list_callback_data data = { propfn, cookie }; return __system_property_foreach(property_list_callback, &data); } #elif defined(HAVE_SYSTEM_PROPERTY_SERVER) Loading