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 Jun 19, 2024
1 parent 64112ed commit 69b36cd
Show file tree
Hide file tree
Showing 4 changed files with 55 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
16 changes: 16 additions & 0 deletions lib/openbsd-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
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. However,
* among converting datastrucutres, the the BSD ones are the lowest
* priority / should be converted last. They are already typesafe and
* use inline linking nodes, so the only gain is consistency. Please
* convert uses of linklist.h and hash.h first.
*/

/*
* This file defines five types of data structures: singly-linked lists,
* lists, simple queues, tail queues and XOR simple queues.
Expand Down
15 changes: 15 additions & 0 deletions lib/openbsd-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@
#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. However,
* among converting datastrucutres, the the BSD ones are the lowest
* priority / should be converted last. They are already typesafe and
* use inline linking nodes, so the only gain is consistency. Please
* convert uses of linklist.h and hash.h first.
*/

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

0 comments on commit 69b36cd

Please sign in to comment.