---
name: "globus_fifo"
section: "3"
platform: "linux"
package: "libglobus-common-doc"
version: "18.14-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_fifo"
---

# globus\_fifo(3)

FIFO Queue - FIFO Queue Implementation.

## NAME

globus\_fifo - FIFO Queue

 \- FIFO Queue Implementation.

## SYNOPSIS

### Typedefs

typedef struct globus\_fifo\_s \* **globus\_fifo\_t**\

### Functions

int **globus\_fifo\_init** (**globus\_fifo\_t** \*fifo)\
 Initialize the fifo structure.  void **globus\_fifo\_destroy** (**globus\_fifo\_t** \*fifo)\
 void **globus\_fifo\_destroy\_all** (**globus\_fifo\_t** \*fifo, void(\*datum\_free)(void \*))\
 int **globus\_fifo\_empty** (const **globus\_fifo\_t** \*fifo)\
 int **globus\_fifo\_size** (const **globus\_fifo\_t** \*fifo)\
 int **globus\_fifo\_enqueue** (**globus\_fifo\_t** \*fifo, void \*datum)\
 **globus\_fifo\_t** \* **globus\_fifo\_copy** (const **globus\_fifo\_t** \*fifo)\
 void \* **globus\_fifo\_peek** (**globus\_fifo\_t** \*fifo)\
 void \* **globus\_fifo\_tail\_peek** (**globus\_fifo\_t** \*fifo)\
 void \* **globus\_fifo\_remove** (**globus\_fifo\_t** \*headp, void \*datum)\
 void \* **globus\_fifo\_dequeue** (**globus\_fifo\_t** \*fifo)\
 int **globus\_fifo\_move** (**globus\_fifo\_t** \*fifo\_dest, **globus\_fifo\_t** \*fifo\_src)\
 **globus\_list\_t** \* **globus\_fifo\_convert\_to\_list** (**globus\_fifo\_t** \*fifo)\

## Detailed Description

FIFO Queue Implementation.

## Typedef Documentation

### typedef struct globus\_fifo\_s\* globus\_fifo\_t

Data type used in all function calls to manipulate a Globus FIFO

## Function Documentation

### globus\_list\_t \* globus\_fifo\_convert\_to\_list (globus\_fifo\_t \* fifo)` [extern]`

Convert the fifo into a list.

### globus\_fifo\_t \* globus\_fifo\_copy (const globus\_fifo\_t \* fifo)` [extern]`

Make a copy of the fifo. **globus\_fifo\_destroy()** must be called the returned pointer to free memory associated with it.

### void \* globus\_fifo\_dequeue (globus\_fifo\_t \* fifo)` [extern]`

dequeue the element at the front of the queue.

### void globus\_fifo\_destroy (globus\_fifo\_t \* fifo)` [extern]`

Destroy the fifo data structure.

This function destroys the memory associate with the fifo data structure. For every call to **globus\_fifo\_init()** there must be a corresponding call to **globus\_fifo\_destroy()**

### void globus\_fifo\_destroy\_all (globus\_fifo\_t \* fifo, void(\*)(void \*) datum\_free)

Destroy the fifo data structure.

This function destroys the memory associate with the fifo data structure. It calls datum\_free() on behalf of all remaining nodes in the queue. For every call to **globus\_fifo\_init()** there must be a corresponding call to **globus\_fifo\_destroy()**

### int globus\_fifo\_empty (const globus\_fifo\_t \* fifo)` [extern]`

This function returns a boolean indicating whether or not the fifo is empty.

### int globus\_fifo\_enqueue (globus\_fifo\_t \* fifo, void \* datum)` [extern]`

Add data to the back of the queue.

### int globus\_fifo\_init (globus\_fifo\_t \* fifo)` [extern]`

Initialize the fifo structure. This function initializes the fifo data structure. The structure must be initialized before it can be used with any other function.

### int globus\_fifo\_move (globus\_fifo\_t \* fifo\_dest, globus\_fifo\_t \* fifo\_src)` [extern]`

Move the queue from fifo\_src pointer to fifo\_dest pointer.

### void \* globus\_fifo\_peek (globus\_fifo\_t \* fifo)` [extern]`

get a pointer to the element at the front of the queue.

### void \* globus\_fifo\_remove (globus\_fifo\_t \* headp, void \* datum)` [extern]`

remove datum from anywhere in the queue.

### int globus\_fifo\_size (const globus\_fifo\_t \* fifo)` [extern]`

This function returns a integer representing the number of elements in the queue.

### void \* globus\_fifo\_tail\_peek (globus\_fifo\_t \* fifo)` [extern]`

Get a pointer to the element at the back of the queue.

## Author

Generated automatically by Doxygen for globus\_common from the source code.
