diff --git a/include/queue.h b/include/queue.h index 77bfa93cc72c5cbd7de2b90a0bf51426ce330004..7581a5da8eaefa81bcd59208e1f5cc3c31531c27 100644 --- a/include/queue.h +++ b/include/queue.h @@ -27,14 +27,6 @@ typedef struct libhqr_queue_tile_s { } libhqr_queue_tile_t; libhqr_queue_tile_t *libhqr_queue_tile_new (void); -void libhqr_queue_tile_post (libhqr_queue_tile_t ** queue_tile, int numero); -int libhqr_queue_tile_get (libhqr_queue_tile_t ** queue_tile); -void libhqr_queue_tile_delete(libhqr_queue_tile_t ** queue_tile); -void libhqr_queue_tile_first (libhqr_queue_tile_t ** queue_tile); -void libhqr_queue_tile_prev (libhqr_queue_tile_t ** queue_tile); -void libhqr_queue_tile_last (libhqr_queue_tile_t ** queue_tile); -void libhqr_queue_tile_next (libhqr_queue_tile_t ** queue_tile); - void libhqr_queue_tile_push (libhqr_queue_tile_t ** queue_tile, int numero); int libhqr_queue_tile_head (libhqr_queue_tile_t ** queue_tile); int libhqr_queue_tile_pop (libhqr_queue_tile_t ** queue_tile); diff --git a/src/queue.c b/src/queue.c index 322a6aacf621c100313840c8729ec0fbdfd79322..6afbbf7ee9f3965e0e9a6a2fe6c509b93edb33ae 100644 --- a/src/queue.c +++ b/src/queue.c @@ -83,97 +83,3 @@ int libhqr_queue_tile_pop (libhqr_queue_tile_t ** queue_tile) return (ret); } -void libhqr_queue_tile_first (libhqr_queue_tile_t ** queue_tile) -{ - if (queue_tile != NULL && *queue_tile != NULL) - { - while ((*queue_tile)->prev != NULL) - libhqr_queue_tile_prev (queue_tile); - } - return; -} - -void libhqr_queue_tile_prev (libhqr_queue_tile_t ** queue_tile) -{ - if (queue_tile != NULL && *queue_tile != NULL) - *queue_tile = (*queue_tile)->prev; - return; -} - -void libhqr_queue_tile_last (libhqr_queue_tile_t ** queue_tile) -{ - if (queue_tile != NULL && *queue_tile != NULL) - { - while ((*queue_tile)->next != NULL) - libhqr_queue_tile_next (queue_tile); - } - return; -} - -void libhqr_queue_tile_next (libhqr_queue_tile_t ** queue_tile) -{ - if (queue_tile != NULL && *queue_tile != NULL) - *queue_tile = (*queue_tile)->next; - return; -} - -void libhqr_queue_tile_post (libhqr_queue_tile_t ** queue_tile, int numero) -{ - if (queue_tile != NULL) - { - libhqr_queue_tile_t *p_l = NULL; - libhqr_queue_tile_t *p_p = NULL; - - libhqr_queue_tile_first (queue_tile); - p_l = *queue_tile; - p_p = malloc (sizeof (*p_p)); - if (p_p != NULL) - { - p_p->numero = numero; - p_p->next = p_l; - p_p->prev = NULL; - if (p_l != NULL) - p_l->prev = p_p; - *queue_tile = p_p; - } - else - { - fprintf (stderr, "Memoire insuffisante\n"); - exit (EXIT_FAILURE); - } - } - return; -} - -int libhqr_queue_tile_get (libhqr_queue_tile_t ** queue_tile) -{ - int ret; - - if (queue_tile != NULL && *queue_tile != NULL) - { - libhqr_queue_tile_t *p_l = NULL; - libhqr_queue_tile_t *p_p = NULL; - - libhqr_queue_tile_last (queue_tile); - p_l = *queue_tile; - if (p_l != NULL) - p_p = p_l->prev; - ret = p_l->numero; - free (p_l); - p_l = NULL; - if (p_p != NULL) - p_p->next = NULL; - *queue_tile = p_p; - } - return (ret); -} - -void libhqr_queue_tile_delete (libhqr_queue_tile_t ** queue_tile) -{ - if (queue_tile != NULL && *queue_tile != NULL) - { - while (*queue_tile != NULL) - libhqr_queue_tile_get (queue_tile); - } - return; -}