This is an archive of the discontinued LLVM Phabricator instance.

[libc.search] [PATCH 3/6] add `search.h` specifications
Needs ReviewPublic

Authored by SchrodingerZhu on Oct 21 2022, 1:30 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This patch initiates definitions for search.h as specified in POSIX.1-2001. Because this patch means to
be a part of a larger patch of hashtable implementation, the header definition is not complete,
only hsearch, hdelete, hcreate, ACTION, ENTRY (POSIX standards), and hsearch_r, hdetele_r, hcreate_r,
struct hsearch_data (GNU extensions) are added.

Diff Detail

Event Timeline

SchrodingerZhu created this revision.Oct 21 2022, 1:30 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 21 2022, 1:30 PM
SchrodingerZhu requested review of this revision.Oct 21 2022, 1:30 PM
SchrodingerZhu edited the summary of this revision. (Show Details)Oct 21 2022, 1:39 PM

@sivachandra

Hi,

I have two more questions regarding this:

  • typedef enum { FIND, ENTER } ACTION; What should I do with a type-defined enum. I mean, should I trait it as a type or an enum (which seems to be distinguished in the header name such as enum_action.h and action.h)? Same question also applies to the situation of struct_action vs action.
  • Should I ping the reviewers at each patch of the stacked series?

Best,
Yifan