dtime0(&dnow);
dtime0(&now);
int lookup_attr_cache(Window win, int *cache_index, int *next_index) {	double dnow, t, oldest;	int i, old_index = -1, count = 0;	Window cwin;	*cache_index = -1;	*next_index  = -1;		if (win == None) {		return 0;	}	if (attr_cache_max_age == 0.0) {		return 0;	}	dtime0(&dnow);	for (i=0; i < SCR_ATTR_CACHE; i++) {		cwin = scr_attr_cache[i].win;		t = scr_attr_cache[i].time;		if (dnow > t + attr_cache_max_age) {			/* expire it even if it is the one we want */			scr_attr_cache[i].win = cwin = None;			scr_attr_cache[i].fetched = 0;			scr_attr_cache[i].valid = 0;		}		if (*next_index == -1 && cwin == None) {			*next_index = i;		}		if (*next_index == -1) {			/* record oldest */			if (old_index == -1 || t < oldest) {				oldest = t;				old_index = i;			}		}		if (cwin != None) {			count++;		}		if (cwin == win) {			if (*cache_index == -1) {				*cache_index = i;			} else {				/* remove dups */				scr_attr_cache[i].win = None;				scr_attr_cache[i].fetched = 0;				scr_attr_cache[i].valid = 0;			}		}	}	if (*next_index == -1) {		*next_index = old_index;	}if (0) fprintf(stderr, "lookup_attr_cache count: %d\n", count);	if (*cache_index != -1) {		return 1;	} else {		return 0;	}}