changeset 1393:357e9cec520f

libfdproto: add fd_fifo_set_max This function sets the maximum size for a FIFO.
author Thomas Klausner <tk@giga.or.at>
date Fri, 15 Nov 2019 11:29:15 +0100
parents 497d926f5e3d
children f17a56536790
files include/freeDiameter/libfdproto.h libfdproto/fifo.c
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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:
--- 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)
 {
"Welcome to our mercurial repository"