queue.c
/*
 * Create empty queue.
 * Return NULL if could not allocate space.
 */
Create empty queue.
Return NULL if could not allocate space.
Create empty queue . Return NULL if could not allocate space .
struct list_head *q_new()
{
    struct list_head *new = malloc(sizeof(struct list_head));
    if (!new)
        return NULL;
    else {
        INIT_LIST_HEAD(new);
        return new;
    }
}
struct list_head * q_new ( ) { struct list_head * new = malloc ( sizeof ( struct list_head ) ) ; if ( ! new ) return NULL ; else { INIT_LIST_HEAD ( new ) ; return new ; } }
Create empty queue.
Create empty queue .
// check if malloc success