Hello, Bruno Haible napsal(a): > There are probably two uses of the mbchar, mbfile, mbiter, mbuiter modules: > (a) Use them only for MB_CUR_MAX > 1, and use simpler datatypes (just > 'char' and pointers) for MB_CUR_MAX = 1. > (b) Use them always. > > Since the speed difference between both approaches can be considerable, > (a factor of 5 is not unusual), in gnulib we're most often using approach (a). > Whereas your macros appear to be made for case (b) and not well usable for > case (a). Yes, OTOH you can still use them as in (a) without losing anything.
> Also, when MB_CUR_MAX = 1, the 'struct mbchar' can be replaced by a single > 'char' - there is no need for a 'valid' boolean. I have left c_valid to allow implementing the mbfile.h fallback, which needs to distinguish between ELF and other char values. > What do you think? Can this code be useful for you? The macro approach is certainly technically optimal, OTOH I'm not sure what the effect on the info source code would be. It seems quite a few functions would move to such include files, making the source code more difficult to navigate. Karl, what do you think? Mirek