Esempio n. 1
0
static Queue *queue_new()
{
    Queue *q = mem_alloc(sizeof(Queue));
    q->head = NULL;
    q->tail = NULL;
    q->mon = mon_new();

    return q;
}
Esempio n. 2
0
int monitorAdd(lua_State *L, GLFWmonitor *monitor)
    {
    mon_t *mon = mon_first(0);
    while(mon)
        {
        if(mon->monitor == monitor) /* already in */
            return mon->id;
        mon = mon_next(mon);
        }
    /* not found */
    mon = mon_new();
    if(!mon)
        return luaL_error(L, "cannot create monitor entry");
    mon->monitor = monitor;
    return mon->id;
    }