From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44691 invoked by alias); 23 Aug 2015 15:14:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 44681 invoked by uid 89); 23 Aug 2015 15:14:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f169.google.com Received: from mail-pd0-f169.google.com (HELO mail-pd0-f169.google.com) (209.85.192.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 23 Aug 2015 15:14:36 +0000 Received: by pdbmi9 with SMTP id mi9so43590770pdb.3 for ; Sun, 23 Aug 2015 08:14:35 -0700 (PDT) X-Received: by 10.70.129.79 with SMTP id nu15mr36135956pdb.15.1440342875170; Sun, 23 Aug 2015 08:14:35 -0700 (PDT) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by smtp.gmail.com with ESMTPSA id jt3sm14221613pbc.43.2015.08.23.08.14.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Aug 2015 08:14:34 -0700 (PDT) From: Doug Evans To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 17/19] Make the completion API completely opaque. References: <20150806191404.32159.50755.stgit@valrhona.uglyboxes.com> <20150806192109.32159.17384.stgit@valrhona.uglyboxes.com> Date: Sun, 23 Aug 2015 15:14:00 -0000 In-Reply-To: <20150806192109.32159.17384.stgit@valrhona.uglyboxes.com> (Keith Seitz's message of "Thu, 06 Aug 2015 12:21:28 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00656.txt.bz2 Keith Seitz writes: > There are no revisions in this version. > > -- > > Now that the completion API is passing around a structure holding > its internal data, there is no need to expose any of this data and > other settings to other modules. > > This patch removes global access to max_completions and > introduces a new API function, get_maximum_completions (void), which > other modules may use to query the current completion maximum. > > The API will be expanded as necessary in subsequent patches. > > gdb/ChangeLog > > * cli/cli-cmds.c (complete_command): Use get_maximum_completions > instead of accessing the global max_completions. > * completer.c (max_completions): Move definition earlier and > make static. > (get_maximum_completions): New function. > (throw_max_completions_reached_error): Add comment. > * completer.h (max_completions): Remove declaration. > (get_maximum_completions): New declaration. IIUC, we generally don't export accessors for parameters, we just export the parameter. But I don't know if that's a hard and fast rule. It'd be nice if grep max_completions found both the variable and the function. Ok with that change.