globus_fifo(3)

πŸ“¦
version 18.15 Β· 6 versions
, in epel 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ‘‘ NAME πŸ‘‘

bestie welcome to globus_fifo β€” it's the FIFO Queue πŸ’–

  • FIFO Queue Implementation.

so like… first in, first out, the way a boba line works. no cutting, no drama. 🌸


✨ SYNOPSIS ✨

πŸŽ€ Typedefs

  • typedef struct globus_fifo_s * globus_fifo_t

🫢 Functions

int globus_fifo_init (globus_fifo_t *fifo)
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)

quick little tour of what each one does, since Doxygen listed them all up top:

  • globus_fifo_init β€” Initialize the fifo structure.
  • globus_fifo_destroy β€” nukes the fifo 🧨
  • globus_fifo_destroy_all β€” nukes the fifo and all its leftover stuff
  • globus_fifo_empty β€” is it empty tho
  • globus_fifo_size β€” how many things are in there
  • globus_fifo_enqueue β€” add to the back
  • globus_fifo_copy β€” make a whole copy
  • globus_fifo_peek β€” look at the front, no touching
  • globus_fifo_tail_peek β€” look at the back, no touching
  • globus_fifo_remove β€” yank one specific datum out from wherever it is
  • globus_fifo_dequeue β€” take the front one out
  • globus_fifo_move β€” pour one queue into another
  • globus_fifo_convert_to_list β€” glow-up into a list

πŸ’– Detailed Description πŸ’–

FIFO Queue Implementation.

that's it, that's the whole vibe. it's a queue. first in, first out. iconic. πŸ’…


πŸ¦‹ Typedef Documentation πŸ¦‹

typedef struct globus_fifo_s* globus_fifo_t

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

literally every single function in this whole page talks in this type, so get comfy with it 🫢


🌸 Function Documentation 🌸

globus_list_t * globus_fifo_convert_to_list (globus_fifo_t * fifo) [extern]

Convert the fifo into a list.

glow-up complete. she's a list now. ✨


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.

ok so real talk bestie β€” you get a brand new pointer back and you are responsible for it. call globus_fifo_destroy() on that returned pointer or the memory just sits there forever. no cap. 🫠

void * globus_fifo_dequeue (globus_fifo_t * fifo) [extern]

dequeue the element at the front of the queue.

front of the line, you're up 🎀


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()

pairing rule fr fr: one globus_fifo_init() = one globus_fifo_destroy(). don't leave her hanging. πŸ’€

void globus_fifo_destroy_all (globus_fifo_t * fifo, void(* datum_free )(void *))

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()

so this one is the deluxe version 🧚 β€” it doesn't just bin the fifo, it runs datum_free() on every single node still chilling in the queue. same rule applies though: one globus_fifo_init() = one 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.

vibe check: is the queue empty or not. πŸ“


int globus_fifo_enqueue (globus_fifo_t * fifo, void * datum) [extern]

Add data to the back of the queue.

no cutting the line, you go to the back like everyone else πŸ’œ


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.

⚠️ bestie this is step ONE. do not pass go, do not call literally any other function, until you've done this. she is not ready otherwise. 😭

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.

packing up the whole queue and moving it in. main character energy πŸššπŸ‘‘


void * globus_fifo_peek (globus_fifo_t * fifo) [extern]

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

just looking respectfully πŸ‘€ front of the queue only.


void * globus_fifo_remove (globus_fifo_t * headp, void * datum) [extern]

remove datum from anywhere in the queue.

not just the front β€” anywhere. she will find it. πŸ”₯


int globus_fifo_size (const globus_fifo_t * fifo) [extern]

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

headcount time πŸ“‹


void * globus_fifo_tail_peek (globus_fifo_t * fifo) [extern]

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

looking at the back of the line this time. still just looking. πŸ‘€βœ¨


🌈 Author 🌈

Generated automatically by Doxygen for globus_common from the source code.


and that's the whole page, bestie πŸŽ€ this was globus_fifo(3) from the Library Functions Manual, brought to you by globus_common, Version 18.15. go forth and queue responsibly πŸ’–πŸ¦‹πŸŒΈ