From patchwork Fri Sep 9 10:22:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Robert P. J. Day" X-Patchwork-Id: 667958 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sVtZ26zqjz9ryr for ; Fri, 9 Sep 2016 20:22:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D5784B811; Fri, 9 Sep 2016 12:22:48 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lgL2CjsejGKW; Fri, 9 Sep 2016 12:22:48 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F6734B68A; Fri, 9 Sep 2016 12:22:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B15964B68A for ; Fri, 9 Sep 2016 12:22:42 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OW21we6JgPIW for ; Fri, 9 Sep 2016 12:22:42 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp485.redcondor.net (smtp485.redcondor.net [208.80.204.85]) by theia.denx.de (Postfix) with ESMTPS id 0C27F4B660 for ; Fri, 9 Sep 2016 12:22:38 +0200 (CEST) Received: from astoria.ccjclearline.com ([64.235.106.9]) by smtp485.redcondor.net ({3be039ea-4351-44b0-a8af-642c38b25916}) via TCP (outbound) with ESMTPS id 20160909102234634_0485 for ; Fri, 09 Sep 2016 10:22:34 +0000 X-RC-FROM: X-RC-RCPT: Received: from [216.191.234.70] (port=53397 helo=crashcourse.ca) by astoria.ccjclearline.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1biIz3-0000Tu-7S for u-boot@lists.denx.de; Fri, 09 Sep 2016 06:24:33 -0400 Date: Fri, 9 Sep 2016 06:22:10 -0400 (EDT) From: "Robert P. J. Day" X-X-Sender: rpjday@ca624034.mitel.com To: U-Boot list Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 X-MAG-OUTBOUND: ccj.redcondor.net@64.235.106.9/32 Subject: [U-Boot] [PATCH] search.h: Numerous grammatical fixes, comment updates X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Tweaks (no functional changes) to include/search.h, including: * use standard multiple inclusion check * fix spelling mistakes * have comments match actual names in function prototypes * remove obsolete reference to "do_apply" * replace "hashing table" with "hash table" Signed-off-by: Robert P. J. Day --- compile-tested, should be no functional changes. rday diff --git a/include/search.h b/include/search.h index 343dbc3..402dfd8 100644 --- a/include/search.h +++ b/include/search.h @@ -12,8 +12,8 @@ * Copyright (C) 2010-2013 Wolfgang Denk */ -#ifndef _SEARCH_H -#define _SEARCH_H 1 +#ifndef _SEARCH_H_ +#define _SEARCH_H_ #include @@ -25,7 +25,7 @@ enum env_op { env_op_overwrite, }; -/* Action which shall be performed in the call the hsearch. */ +/* Action which shall be performed in the call to hsearch. */ typedef enum { FIND, ENTER @@ -45,7 +45,7 @@ struct _ENTRY; /* * Family of hash table handling functions. The functions also * have reentrant counterparts ending with _r. The non-reentrant - * functions all work on a signle internal hashing table. + * functions all work on a single internal hash table. */ /* Data type for reentrant functions. */ @@ -55,38 +55,38 @@ struct hsearch_data { unsigned int filled; /* * Callback function which will check whether the given change for variable - * "item" to "newval" may be applied or not, and possibly apply such change. + * "__item" to "newval" may be applied or not, and possibly apply such change. * When (flag & H_FORCE) is set, it shall not print out any error message and * shall force overwriting of write-once variables. -.* Must return 0 for approval, 1 for denial. + * Must return 0 for approval, 1 for denial. */ int (*change_ok)(const ENTRY *__item, const char *newval, enum env_op, int flag); }; -/* Create a new hashing table which will at most contain NEL elements. */ +/* Create a new hash table which will contain at most "__nel" elements. */ extern int hcreate_r(size_t __nel, struct hsearch_data *__htab); -/* Destroy current internal hashing table. */ +/* Destroy current internal hash table. */ extern void hdestroy_r(struct hsearch_data *__htab); /* - * Search for entry matching ITEM.key in internal hash table. If + * Search for entry matching __item.key in internal hash table. If * ACTION is `FIND' return found entry or signal error by returning * NULL. If ACTION is `ENTER' replace existing data (if any) with - * ITEM.data. + * __item.data. * */ extern int hsearch_r(ENTRY __item, ACTION __action, ENTRY ** __retval, struct hsearch_data *__htab, int __flag); /* - * Search for an entry matching `MATCH'. Otherwise, Same semantics + * Search for an entry matching "__match". Otherwise, Same semantics * as hsearch_r(). */ extern int hmatch_r(const char *__match, int __last_idx, ENTRY ** __retval, struct hsearch_data *__htab); -/* Search and delete entry matching ITEM.key in internal hash table. */ +/* Search and delete entry matching "__key" in internal hash table. */ extern int hdelete_r(const char *__key, struct hsearch_data *__htab, int __flag); @@ -97,8 +97,6 @@ extern ssize_t hexport_r(struct hsearch_data *__htab, /* * nvars: length of vars array * vars: array of strings (variable names) to import (nvars == 0 means all) - * do_apply: whether to call callback function to check the new argument, - * and possibly apply changes (false means accept everything) */ extern int himport_r(struct hsearch_data *__htab, const char *__env, size_t __size, const char __sep, @@ -123,4 +121,4 @@ extern int hwalk_r(struct hsearch_data *__htab, int (*callback)(ENTRY *)); #define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from setenv() */ #define H_ORIGIN_FLAGS (H_INTERACTIVE | H_PROGRAMMATIC) -#endif /* search.h */ +#endif /* _SEARCH_H_ */