/* Return a new, zeroed, stream. You must set its cookie and io_mode. The first operation will give it a buffer unless you do. It will also give it the default functions unless you set the `seen' flag. Returns NULL if a stream can't be created. */ FILE * __newstream (void) { register FILE *stream; stream = __stdio_head; while (__validfp (stream)) stream = stream->__next; if (stream == NULL) { /* None to reuse. */ stream = (FILE *) malloc (sizeof (FILE)); if (stream == NULL) return NULL; stream->__next = __stdio_head; __stdio_head = stream; } __invalidate (stream); stream->__magic = _IOMAGIC; stream->__offset = (fpos_t) -1; stream->__target = (fpos_t) -1; stream->__flags = 0; return stream; }
static void __session_periodic_cb(struct ev_loop *loop, struct ev_periodic *w, int revents) { GtkWidget *wgt = w->data; printf("%s:%d\n", __FUNCTION__, __LINE__); while (gdk_events_pending()) { GdkEvent *ev = gdk_event_get(); if (ev) { on_mainwin_frame_event(GTK_WINDOW(wgt), ev, NULL); gdk_event_free(ev); } } __invalidate(wgt, NULL, wgt); }
void gfxengine_t::invalidate(SDL_Rect *rect, window_t *window) { switch(_pages) { case -1: if(_doublebuf) __invalidate(1, rect, window); __invalidate(0, rect, window); break; case 0: __invalidate(0, NULL, NULL); break; case 3: __invalidate(2, rect, window); // Fallthrough! case 2: __invalidate(1, rect, window); // Fallthrough! case 1: __invalidate(0, rect, window); break; } }
static void invalidate(auto_zone_t *zone, void* ptr, void *context) { __invalidate(ptr, NULL); }