# HG changeset patch # User Thomas Klausner # Date 1573813755 -3600 # Node ID 357e9cec520f43432baa24e34d677e2c20b37fc6 # Parent 497d926f5e3d6be2de312e73bdd5b1253119e4a4 libfdproto: add fd_fifo_set_max This function sets the maximum size for a FIFO. diff -r 497d926f5e3d -r 357e9cec520f include/freeDiameter/libfdproto.h --- a/include/freeDiameter/libfdproto.h Fri Nov 15 11:28:11 2019 +0100 +++ b/include/freeDiameter/libfdproto.h Fri Nov 15 11:29:15 2019 +0100 @@ -3032,6 +3032,21 @@ int fd_fifo_new ( struct fifo ** queue, int max ); /* + * FUNCTION: fd_fifo_set_max + * + * PARAMETERS: + * queue : The queue for which to set the maximum value + * max : max number of items in the queue. + * + * DESCRIPTION: + * Modify the maximum number of entries in a queue + * + * RETURN VALUE : + * 0 : Success + */ +int fd_fifo_set_max ( struct fifo * queue, int max ); + +/* * FUNCTION: fd_fifo_del * * PARAMETERS: diff -r 497d926f5e3d -r 357e9cec520f libfdproto/fifo.c --- a/libfdproto/fifo.c Fri Nov 15 11:28:11 2019 +0100 +++ b/libfdproto/fifo.c Fri Nov 15 11:29:15 2019 +0100 @@ -117,6 +117,13 @@ return 0; } +int fd_fifo_set_max (struct fifo * queue, int max) +{ + queue->max = max; + return 0; +} + + /* Dump the content of a queue */ DECLARE_FD_DUMP_PROTOTYPE(fd_fifo_dump, char * name, struct fifo * queue, fd_fifo_dump_item_cb dump_item) {