update keylist to use bool and stdint value for key not found. (#572)

* Updated keylist to use bool and stdint value for key not found.

* Added Keylist_Index_Key to deprecate Keylist_Key function

* Changed the deprecated Keylist_Key API to Keylist_Index_Key

* Added unit test for Keylist_Index_Key API
This commit is contained in:
Steve Karg
2024-02-12 17:35:15 -06:00
committed by GitHub
parent 7eedaa406d
commit 190183966c
16 changed files with 143 additions and 55 deletions
+10 -1
View File
@@ -25,6 +25,7 @@
#define KEYLIST_H
#include "bacnet/bacnet_stack_exports.h"
#include "bacnet/basic/sys/platform.h"
#include "bacnet/basic/sys/key.h"
/* This is a key sorted linked list data library that */
@@ -104,12 +105,20 @@ extern "C" {
OS_Keylist list,
int index);
/* return the key at the given index */
/* returns the node key specified by the index */
BACNET_STACK_DEPRECATED("Use Keylist_Index_Key() instead")
BACNET_STACK_EXPORT
KEY Keylist_Key(
OS_Keylist list,
int index);
/* returns the node key specified by the index */
BACNET_STACK_EXPORT
bool Keylist_Index_Key(
OS_Keylist list,
int index,
KEY *pKey);
/* returns the next empty key from the list */
BACNET_STACK_EXPORT
KEY Keylist_Next_Empty_Key(