コード例 #1
0
ファイル: rkom_conf.c プロジェクト: Belgarion/rkom
u_int32_t
rk_next_unread(u_int32_t conf, u_int32_t uid)
{
	struct rk_conference *c;
	struct rk_membership *m;
	int highest, last;

	if ((c = rk_confinfo(conf)) == NULL)
		return 0;
	highest = c->rc_first_local_no + c->rc_no_of_texts - 1;
	if ((m = rk_membership(uid, conf)) == NULL)
		return 0;

back:	last = m->rm_last_text_read;
	if (highest <= last)
		return 0;
	last = next_local(conf, last + 1);
	if (last == 0) {
		rk_mark_read(conf, m->rm_last_text_read + 1);
		goto back;
	}
	if (is_read(conf, last, uid)) {
		m->rm_last_text_read = last;
		goto back;
	}

	if (last > highest)
		return 0;
	else
		return last;
}
コード例 #2
0
ファイル: xqueue.c プロジェクト: sylware/lboxwm
static gboolean event_read(GSource *source, GSourceFunc callback, gpointer data)
{
	XEvent ev;
	(void)source;
	(void)callback;
	(void)data;
	while(next_local(&ev)) {
		guint i;
		for(i = 0; i < n_callbacks; ++i)
			callbacks[i].func(&ev, callbacks[i].data);
	}
	return TRUE;
}