//=========================================================================== void MessageManager_Register(HWND hwnd, const UINT* messages, bool add) { UINT msg; while (0 != (msg = *messages++)) { struct MsgMap *mm = (struct MsgMap *)assoc(msgs, (void*)msg); if (mm) { if (remove_assoc(&mm->winmap, hwnd)) --mm->count; } else if (add) { mm = c_new(struct MsgMap); mm->msg = msg; append_node (&msgs, mm); // these are the messages that expect return values and // are handled differently in 'MessageManager_Send()' mm->send_mode = BB_DRAGTODESKTOP == msg || BB_GETBOOL == msg; } if (add) { struct winmap *w = c_new(struct winmap); w->hwnd = hwnd; cons_node(&mm->winmap, w); ++mm->count; dbg_msg("add", hwnd, msg); } else if (mm) { if (NULL == mm->winmap) remove_item(&msgs, mm); dbg_msg("del", hwnd, msg); } }
/*! \brief Removes the given symbol from the layer Removes the given symbol from the layer */ static inline void symb_layer_remove_symbol(SymbLayer_ptr self, const node_ptr sym) { unsigned int pos = NODE_TO_INT(remove_assoc(self->symbol2position, sym)); nusmv_assert(0 != pos); /* Remove from the list */ self->symbols[pos - 1] = Nil; self->symbols_empty++; symb_layer_check_and_shrink_symbols(self); }