Mobil_surveillance_system 1
Defines | Typedefs | Functions
FIFO.h File Reference

FIFO container header file. More...

Go to the source code of this file.

Typedefs

typedef unsigned char tBoolean

Functions

tBoolean FIFO_isBufferFull (unsigned int *pulRead, unsigned int *pulWrite, unsigned int ulSize)
tBoolean FIFO_isBufferEmpty (unsigned int *pulRead, unsigned int *pulWrite)
unsigned int FIFO_getBufferCount (unsigned int *pulRead, unsigned int *pulWrite, unsigned int ulSize)

Detailed Description

FIFO container header file.

This file contains the prototypes the basic functions of the FIFO data stucture.

Definition in file FIFO.h.


Typedef Documentation

typedef unsigned char tBoolean

bool type defination

Definition at line 21 of file FIFO.h.


Function Documentation

unsigned int FIFO_getBufferCount ( unsigned int *  pulRead,
unsigned int *  pulWrite,
unsigned int  ulSize 
)
Parameters:
pulRead
pulWrite
ulSize
Returns:

Definition at line 37 of file FIFO.c.

{
    return ( ( *pulWrite >= *pulRead ) ? ( *pulWrite - *pulRead ) : ( ulSize - ( *pulRead - *pulWrite ) ) );
}
tBoolean FIFO_isBufferEmpty ( unsigned int *  pulRead,
unsigned int *  pulWrite 
)
Parameters:
pulRead
pulWrite
Returns:

Definition at line 28 of file FIFO.c.

{
    // if the number of the read characters are the same as the written the fifo is empty
    return ( ( *pulWrite  == *pulRead ) ? 1 : 0 );
}
tBoolean FIFO_isBufferFull ( unsigned int *  pulRead,
unsigned int *  pulWrite,
unsigned int  ulSize 
)
Parameters:
pulRead
pulWrite
ulSize
Returns:

Definition at line 19 of file FIFO.c.

{
    //  if the writing pointer catch up the read pointer the fifo is full
    return ( ( ( ( *pulWrite + 1 ) % ulSize ) == *pulRead ) ? 1 : 0 );
}
 All Data Structures Files Functions Variables Typedefs Enumerations Defines