static void prv_handle_outbox_failed(DictionaryIterator *iterator, AppMessageResult reason, void *context) { struct failed args = { .iterator = iterator, .reason = reason, }; linked_list_foreach(s_handler_list, prv_each_outbox_failed, &args); }
void localize_deinit(){ if(s_root){ linked_list_foreach(s_root, prv_destroy_element, NULL); linked_list_clear(s_root); free(s_root); } s_previous_locale = 0; }
void localize_init(uint32_t resource_locale) { if(s_previous_locale == resource_locale) return; if(s_root == NULL){ s_root = linked_list_create_root(); } else { linked_list_foreach(s_root, prv_destroy_element, NULL); linked_list_clear(s_root); } s_previous_locale = resource_locale; }
static void prv_handle_state_change(BatteryChargeState state) { linked_list_foreach(s_handler_list, prv_each_state_change, &state); }
static void prv_handle_did_focus(bool did_focus) { linked_list_foreach(s_handler_list, prv_each_did_focus, (void *)did_focus); }
static void prv_handle_will_focus(bool in_focus) { linked_list_foreach(s_handler_list, prv_each_will_focus, (void *)in_focus); }
static void prv_handle_inbox_dropped(AppMessageResult reason, void *context) { linked_list_foreach(s_handler_list, prv_each_inbox_dropped, (void *)reason); }
static void prv_handle_inbox_received(DictionaryIterator *iterator, void *context) { linked_list_foreach(s_handler_list, prv_each_inbox_received, iterator); }
static void prv_handle_outbox_sent(DictionaryIterator *iterator, void *context) { linked_list_foreach(s_handler_list, prv_each_outbox_sent, iterator); }