VOID insa_icon(LONG tree, WORD obj, WORD nicon, ICONBLK *pic, BYTE *ptext) { memcpy(pic, &G.g_iblist[nicon], sizeof(ICONBLK)); pic->ib_ptext = ADDR( ptext ); LWSET(OB_TYPE(obj), G_ICON); LLSET(OB_SPEC(obj), ADDR(pic)); }
void Entry_dealloc(Entry *self) { Py_DECREF(self->name); Py_DECREF(self->contents); OB_TYPE(self)->tp_free(self); }
void EntryIterator_dealloc(EntryIterator *self) { // We clean up the iterator before decrementing the reference count of // the reader. If we hold the last reference, we'd deallocate the corpus // reader, while the iterator could still hold resources. CorpusReader *reader = self->reader; if (self->interruptThread != 0) { interruptBoostThread(self->interruptThread); deleteBoostThread(self->interruptThread); } delete self->iter; OB_TYPE(self)->tp_free(self); Py_DECREF(reader); }
/* ** Description ** Set window widget colour */ static void set_widget_colour(WINDOW_STRUCT * win, WORD widget, WORD top, WORD untop) { U_OB_SPEC * obspec; WORD object = 0; WORD new_colour; if(win->tree) { object = widgetmap[widget]; if(OB_FLAGS(&win->tree[object]) & INDIRECT) { obspec = ((U_OB_SPEC *)OB_SPEC(&win->tree[object])); } else { obspec = &win->tree[object].ob_spec; } if(win->status & WIN_TOPPED) { new_colour = top; } else { new_colour = untop; } switch(OB_TYPE(&win->tree[object]) & 0xff) { case G_BOX: case G_IBOX: case G_BOXCHAR: obspec->index = HL_TO_CL((CL_TO_HL(obspec->index) & 0xffff0000) | (new_colour & 0x0000ffff)); break; case G_TEXT: case G_BOXTEXT: case G_FTEXT: case G_FBOXTEXT: TE_COLOR_PUT(CL_TO_HL(obspec->tedinfo), new_colour); break; case G_IMAGE: BI_COLOR_PUT(CL_TO_HL(obspec->bitblk), new_colour); break; case G_BUTTON: case G_PROGDEF: case G_STRING: case G_TITLE: return; default: DEBUG1("Unsupported type %d in set_widget_colour, widget %d", OB_TYPE(&win->tree[object]), widget); return; } } }
void CorpusReader_dealloc(CorpusReader *self) { delete self->reader; OB_TYPE(self)->tp_free(self); }