Skip to content

Commit

Permalink
lib: Discourage usage of deprecated data structures
Browse files Browse the repository at this point in the history
Put some verbiage in place to warn people that we
are actively discouraging new development that uses
an older data structure.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed May 31, 2024
1 parent cdc964c commit fe4e184
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
extern "C" {
#endif

/*
* NOTICE:
*
* If you are reading this file in an effort to add a new hash structure
* this is the wrong place to be using it. Please see the typesafe
* data structures, or ask one of the other developers.
*
* If you are reading this file as a way to update an existing usage
* of this data structure, please consider just converting the data
* structure to one of the typesafe data structures instead.
*/

/* Default hash table size. */
#define HASH_INITIAL_SIZE 256
/* Expansion threshold */
Expand Down
12 changes: 12 additions & 0 deletions lib/linklist.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
extern "C" {
#endif

/*
* NOTICE:
*
* If you are reading this file in an effort to add a new list structure
* this is the wrong place to be using it. Please see the typesafe
* data structures, or ask one of the other developers.
*
* If you are reading this file as a way to update an existing usage
* of this data structure, please consider just converting the data
* structure to one of the typesafe data structures instead.
*/

/* listnodes must always contain data to be valid. Adding an empty node
* to a list is invalid
*/
Expand Down
12 changes: 12 additions & 0 deletions lib/openbsd-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
extern "C" {
#endif

/*
* NOTICE:
*
* If you are reading this file in an effort to add a new queue structure
* this is the wrong place to be using it. Please see the typesafe
* data structures, or ask one of the other developers.
*
* If you are reading this file as a way to update an existing usage
* of this data structure, please consider just converting the data
* structure to one of the typesafe data structures instead.
*/

/*
* This file defines five types of data structures: singly-linked lists,
* lists, simple queues, tail queues and XOR simple queues.
Expand Down
11 changes: 11 additions & 0 deletions lib/openbsd-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
#ifdef __cplusplus
extern "C" {
#endif
/*
* NOTICE:
*
* If you are reading this file in an effort to add a new tree structure
* this is the wrong place to be using it. Please see the typesafe
* data structures, or ask one of the other developers.
*
* If you are reading this file as a way to update an existing usage
* of this data structure, please consider just converting the data
* structure to one of the typesafe data structures instead.
*/

/*
* This file defines data structures for different types of trees:
Expand Down

0 comments on commit fe4e184

Please sign in to comment.