Re: new module 'freadptr'

2008-02-28 Thread Bruno Haible
Eric Blake wrote: > > Here's one more module in the "stdio internals" series. freadptr (stream) > > returns a pointer to the read buffer of stream. > > Nice idea - I can already envision using it in M4 Yes, me too ;-) This is what triggered me to create this API. > > fseek (fp, nl

Re: new module 'freadptr'

2008-02-28 Thread Eric Blake
Bruno Haible clisp.org> writes: > > Hi, > > Here's one more module in the "stdio internals" series. freadptr (stream) > returns a pointer to the read buffer of stream. Nice idea - I can already envision using it in M4 (more on that on the m4- patches list in response to your recent proposed pa

Re: new module 'freadptr'

2008-02-28 Thread Bruno Haible
What happens with freadahead() and freadptr() after ungetc? In theory it is possible that an implementation stores the bytes pushed-back by ungetc in a location that freadahead() does not see. The implementations that I tested don't do this, but the API should support this. I can see three possibl

Re: __func__

2008-02-28 Thread Bruno Haible
Simon Josefsson wrote: > If there are other pre-C99 compilers that use other ways of printing the > function name, I suppose the module could be extended with those. According to boost/current_function.hpp, it appears that - GNU C is not the only compiler to support __PRETTY_FUNCTION__; Metr

Re: __func__

2008-02-28 Thread Eric Blake
Simon Josefsson josefsson.org> writes: > The __func__ module will add the block above to config.h, to make sure > that __func__ is usable. > > If there are other pre-C99 compilers that use other ways of printing the > function name, I suppose the module could be extended with those. > > What do

Re: __func__

2008-02-28 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bruno Haible wrote: > Simon Josefsson wrote: >> # define __func__ "" > > Some packages use >#define __func__ __FILE__ > in this case. Not perfect, but still more informative than "". But, wouldn't one normally include __FILE__ in diagno

Re: __func__

2008-02-28 Thread Bruno Haible
Simon Josefsson wrote: > # define __func__ "" Some packages use #define __func__ __FILE__ in this case. Not perfect, but still more informative than "". Bruno

Re: __func__

2008-02-28 Thread Bruno Haible
Hi Simon, > What do you think? The module is a worthy addition. > I was unsure where to document this, it isn't either a function or > header file, strictly speaking. I would put its documentation in chapter "Particular modules". If/when the 'inline' module gets documented, one might combine th

__func__

2008-02-28 Thread Simon Josefsson
>From the gcc manual: `__FUNCTION__' is another name for `__func__'. Older versions of GCC recognize only this name. However, it is not standardized. For maximum portability, we recommend you use `__func__', but provide a fallback definition with the preprocessor: #if __STDC_V

Re: Configurable source_base et al. in bootstrap

2008-02-28 Thread Sergey Poznyakoff
Hello, In the absense of any objections, I have installed the following changes: 2008-02-28 Sergey Poznyakoff <[EMAIL PROTECTED]> * build-aux/bootstrap (source_base, m4_base) (doc_base, tests_base): New variables. (gnulib_tool_options): Do not hardcode base

Re: [Libvir] [Q] gnulib comment

2008-02-28 Thread Bruno Haible
Jim Meyering wrote: > Thank you for the patch. That is indeed a typo. > I've attached a patch adding a ChangeLog entry, > for application to gnulib's git repository. Thanks, applied. > [Bruno, to apply this, you can remove the two '>' and then > run "git am THIS_MESSAGE". ] Which '>' should I

Re: new module 'freadptr'

2008-02-28 Thread Bruno Haible
Jim Meyering wrote: > Looks useful. It's useful in few cases, to get the ultimate performance. getc_unlocked is already quite good in performance. > > const char *nl = (const char *) memchr (buf, '\n', n); > > Surely you meant this: > > const char *nl = (const char *) memc

Re: new module 'freadptr'

2008-02-28 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Hi, > > Here's one more module in the "stdio internals" series. freadptr (stream) > returns a pointer to the read buffer of stream. > > For example, if you want to read the contents of the stream up to but not > including the next newline into an obstack, h

new module 'freadptr'

2008-02-28 Thread Bruno Haible
Hi, Here's one more module in the "stdio internals" series. freadptr (stream) returns a pointer to the read buffer of stream. For example, if you want to read the contents of the stream up to but not including the next newline into an obstack, here's the naïve code: struct obstack *obs = ...;

Re: [Libvir] [Q] gnulib comment

2008-02-28 Thread Jim Meyering
Atsushi SAKAI <[EMAIL PROTECTED]> wrote: > Hi, Jim > > I have two questions on gnulib in libvirt. > > 1)tupe is typo?(I attach a patch.) > (I do not guess the correct words, it is jargon?) Hi Atsushi, Thank you for the patch. That is indeed a typo. I've attached a patch adding a ChangeLog entr