From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117224 invoked by alias); 21 May 2015 23:52:20 -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 117215 invoked by uid 89); 21 May 2015 23:52:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ig0-f202.google.com Received: from mail-ig0-f202.google.com (HELO mail-ig0-f202.google.com) (209.85.213.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 21 May 2015 23:52:18 +0000 Received: by igdh15 with SMTP id h15so1634066igd.1 for ; Thu, 21 May 2015 16:52:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:message-id:date:subject:from:to:cc :content-type; bh=+fR/cU6+Ov289qRtKfp/Ul/QzEifvEgw1+B7w9Z3XSg=; b=bUEKn6swHDrFTtS4J2J0QqfUI5uWB7i/8rvw35vGrGXmiPkojosOIOuN6xmfpEBbxF /OczvhKyA9grZZxmU2HoQd4E3XmWpMGwV7A8ZPry7sjBsZIvXmmQyxUt2Rm1UD1NOy5c mcm3WE88i5FOkzkGiwY6mesLTtQhQ8oHsXROdDsdjSSr+oz62xXZbqLiLCXeWSoNRiIH h2BcAJMLqNOWsJQeYkSAWm9n2mmbngtSI4bp/vIND3JUyDVjeFU6GVX3MIroy6T/NcXs KslclIpIUpaQ3ygVMI6grm12Uo7HLkV0fDMVrYgkEBVhYJwsSkVbhGWVDmrCefoAAETL DuuA== X-Gm-Message-State: ALoCoQk+gYE74toCwGyjtUfAmMEj0e4A7xrGUAYYtLsQ49ej00KzlyE77LFQt5tlVKIMO4SBW1Tv MIME-Version: 1.0 X-Received: by 10.42.106.197 with SMTP id a5mr7416967icp.30.1432252336927; Thu, 21 May 2015 16:52:16 -0700 (PDT) Message-ID: <20cf303ea8cac5a2fe0516a03b87@google.com> Date: Thu, 21 May 2015 23:52:00 -0000 Subject: Re: [PATCH v2 16/18] Make the completion API completely opaque. From: Doug Evans To: Keith Seitz Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00584.txt.bz2 Keith Seitz writes: > 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. LGTM. Note though that it's not uncommon to expose gdb parameters via a global.