示例#1
0
static Queue *queue_new()
{
    Queue *q = mem_alloc(sizeof(Queue));
    q->head = NULL;
    q->tail = NULL;
    q->mon = mon_new();

    return q;
}
示例#2
0
文件: monitor.c 项目: stetre/moonglfw
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;
    }