This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 17/19] Make the completion API completely opaque.
- From: Doug Evans <xdje42 at gmail dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 23 Aug 2015 08:13:35 -0700
- Subject: Re: [PATCH v3 17/19] Make the completion API completely opaque.
- Authentication-results: sourceware.org; auth=none
- References: <20150806191404 dot 32159 dot 50755 dot stgit at valrhona dot uglyboxes dot com> <20150806192109 dot 32159 dot 17384 dot stgit at valrhona dot uglyboxes dot com>
Keith Seitz <keiths@redhat.com> 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.