Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (26 sloc) 0.746 kb
/********************************************/
/* Programmer: An Dang */
/* */
/* Program : queue_interface.c */
/********************************************/
#include <stdio.h>
#include <stdlib.h>
#include "queue_interface.h"
status push_int( queue *p_Q, int i ){
int *p_I = (int *) malloc( sizeof( int ) ) ;
if ( p_I == NULL )
return ERROR ;
*p_I = i ;
if ( push( p_Q, (generic_ptr) p_I ) == ERROR){
free ( p_I ) ;
return ERROR ;
}
return OK ;
}
status pop_int( queue *p_Q, int *p_I ){
int *p_data ;
if ( pop ( p_Q, ( generic_ptr * ) &p_data ) == ERROR ) return ERROR ;
*p_I = *p_data ;
free ( p_data ) ;
return OK ;
}
Jump to Line
Something went wrong with that request. Please try again.