-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
options/glibc: Add hashmap extension stubs to search.h
Add hsearch_r, hcreate_r and hdestroy_r stubs.
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <bits/glibc/glibc_search.h> | ||
#include <bits/ensure.h> | ||
|
||
int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *) { | ||
__ensure(!"Not implemented"); | ||
__builtin_unreachable(); | ||
} | ||
|
||
int hcreate_r(size_t, struct hsearch_data *) { | ||
__ensure(!"Not implemented"); | ||
__builtin_unreachable(); | ||
} | ||
|
||
void hdestroy_r(struct hsearch_data *) { | ||
__ensure(!"Not implemented"); | ||
__builtin_unreachable(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef _GLIBC_SEARCH_H | ||
#define _GLIBC_SEARCH_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <bits/size_t.h> | ||
|
||
typedef enum { | ||
FIND, | ||
ENTER | ||
} ACTION; | ||
|
||
typedef struct entry { | ||
char *key; | ||
void *data; | ||
} ENTRY; | ||
|
||
struct _ENTRY; | ||
|
||
struct hsearch_data { | ||
struct _ENTRY *table; | ||
unsigned int size; | ||
unsigned int filled; | ||
}; | ||
|
||
#ifndef __MLIBC_ABI_ONLY | ||
|
||
int hsearch_r(ENTRY item, ACTION action, ENTRY **ret, struct hsearch_data *htab); | ||
int hcreate_r(size_t num_elements, struct hsearch_data *htab); | ||
void hdestroy_r(struct hsearch_data *htab); | ||
|
||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _GLIBC_SEARCH_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters