bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Typo in quote.h


From: Akim Demaille
Subject: Re: Typo in quote.h
Date: Sun, 1 Nov 2020 10:11:11 +0100

Hi Bruno, Paul and Reuben,

> Le 31 oct. 2020 à 20:41, Bruno Haible <bruno@clisp.org> a écrit :\
> 
> You are right that there is a problem here: On 2012-03-07 this patch [1]
> from Akim did a good thing — it made the quote.h functions' effect more
> customizable — and a not so good thing: it combined the implementations
> of two modules.

Yes, the point was to keep the struct truly private, unreachable.

I see gnulib already has both -private.h and -internal.h files.  I don't know 
if this is a case where we'd want to create such a file.

> Here are three proposed patches. Paul and Akim, is this OK?
> 
> 
> 2020-10-31  Bruno Haible  <bruno@clisp.org>
> 
>       quote: Don't mix with the implementation of module 'quotearg'.
>       * lib/quote.c: New file, extracted from lib/quotearg.c.
>       * lib/quotearg.c: Don't include quote.h.
>       (quote_quoting_options, quote_n_mem, quote_mem, quote_n, quote): Remove.
>       * modules/quote (Files): Add lib/quote.c.
>       (Depends-on): Add stdint.
>       (Makefile.am): Compile quote.c.
>       * modules/quotearg (Files): Remove lib/quote.h.
> 
> 2020-10-31  Bruno Haible  <bruno@clisp.org>
> 
>       quotearg: Export quotearg_slot_n_mem.
>       * lib/quotearg.h (quotearg_buffer, quotearg_alloc_mem): Write SIZE_MAX
>       instead of -1.
>       (quotearg_slot_n_mem): New declaration.
>       * lib/quotearg.c (quotearg_slot_n_mem): Renamed from quotearg_n_options.
>       Use default_quoting_options if the options argument is NULL.
> 
> 2020-10-31  Bruno Haible  <bruno@clisp.org>
> 
>       quotearg: Allow static init of 'struct quoting_options' variables.
>       * lib/quotearg.h: Include <limits.h>.
>       (struct quoting_options): Move to here from lib/quotearg.c. Use
>       INT_WIDTH instead of INT_BITS.
>       (QUOTING_OPTIONS_INIT): New macro.
>       * lib/quotearg.c (INT_BITS): Remove macro. Use INT_WIDTH instead.
>       (default_quoting_options, quote_quoting_options): Use
>       QUOTING_OPTIONS_INIT.
>       * modules/quotearg (Depends-on): Add limits-h.

I'm fine with these changes, thanks!

> The fields of this struct are considered private.  Instead of accessing
> them directly, use the accessors

I would be more imperative

> The fields of this struct are private.  Don't access them directly, use the 
> accessors Luke

Cheers!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]