[PATCH v3 17/19] Make the completion API completely opaque.
Doug Evans
xdje42@gmail.com
Sun Aug 23 15:14:00 GMT 2015
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.
More information about the Gdb-patches
mailing list