fifoutil.h File Reference


Detailed Description

This interface enables easy passing of fixed size messages between POSIX threads in Linux using first in first out ordering. Only one reader and writer per fifo is supported unless the application serializes the calls.

 * ============================================================================
 * Copyright (c) Texas Instruments Inc 2005
 *
 * Use of this software is controlled by the terms and conditions found in the
 * license agreement under which this software has been supplied or provided.
 * ============================================================================
 * 

#include <unistd.h>

Include dependency graph for fifoutil.h:

Go to the source code of this file.

Data Structures

struct  FifoUtil_Obj
 Object that stores the state of the fifo. More...

Defines

#define FIFOUTIL_SUCCESS   0
 Return values for fifo util API calls.
#define FIFOUTIL_FAILURE   -1

Typedefs

typedef FifoUtil_Obj FifoUtil_Obj
 Object that stores the state of the fifo.
typedef FifoUtil_ObjFifoUtil_Handle
 Pointer to a fifo util object.

Functions

static int FifoUtil_open (FifoUtil_Handle hFifo, size_t size)
 Opens the fifo. Must be called before other API:s on a fifo.
static int FifoUtil_close (FifoUtil_Handle hFifo)
 Closes the fifo. No API calls can be made on this fifo after this.
static int FifoUtil_get (FifoUtil_Handle hFifo, void *buffer)
 Blocking call to get a message from a fifo.
static int FifoUtil_put (FifoUtil_Handle hFifo, void *buffer)
 Put a message on the fifo.


Define Documentation

#define FIFOUTIL_SUCCESS   0
 

Return values for fifo util API calls.

#define FIFOUTIL_FAILURE   -1
 


Typedef Documentation

typedef struct FifoUtil_Obj FifoUtil_Obj
 

Object that stores the state of the fifo.

typedef FifoUtil_Obj* FifoUtil_Handle
 

Pointer to a fifo util object.


Function Documentation

static int FifoUtil_open FifoUtil_Handle  hFifo,
size_t  size
[inline, static]
 

Opens the fifo. Must be called before other API:s on a fifo.

Parameters:
hFifo Pointer to the fifo object to open.
size Size of the messages to be passed through this fifo.
Returns:
FIFOUTIL_SUCCESS for success or FIFOUTIL_FAILURE for failure.

static int FifoUtil_close FifoUtil_Handle  hFifo  )  [inline, static]
 

Closes the fifo. No API calls can be made on this fifo after this.

Parameters:
hFifo Pointer to the fifo object to close.
Returns:
FIFOUTIL_SUCCESS for success or FIFOUTIL_FAILURE for failure.

static int FifoUtil_get FifoUtil_Handle  hFifo,
void *  buffer
[inline, static]
 

Blocking call to get a message from a fifo.

Parameters:
hFifo Pointer to a previously opened fifo object.
buffer A pointer to the buffer which will be copied to the fifo.
Returns:
FIFOUTIL_SUCCESS for success or FIFOUTIL_FAILURE for failure.

static int FifoUtil_put FifoUtil_Handle  hFifo,
void *  buffer
[inline, static]
 

Put a message on the fifo.

Parameters:
hFifo Pointer to a previously opened fifo object.
buffer A pointer to the buffer which will be copied from the fifo.
Returns:
FIFOUTIL_SUCCESS for success or FIFOUTIL_FAILURE for failure.


Copyright 2006, Texas Instruments Incorporated