On Fri, Mar 22, 2013 at 05:56:50AM -0500, Vladimir Támara Patiño wrote: > I reworked collation support based on: > http://marc.info/?l=openbsd-tech&m=136283674512235&w=4 > > Here I'm attaching a first part consisting of: > > * The program colldef based on FreeBSD (similar to mklocale that is > based on NetBSD). This programa generates files LC_COLLATE good > only for single-byte encondings. > * Collation tables based on FreeBSD (similar to ctype case that is > based on NetBSD) for all the single-byte locales that OpenBSD > currently support (and some other that could be added or ignored). > * Header lib/libc/locale/collate.h required by colldef and for next > part of collation support.
Thanks! I've reviewed this but haven't tried running it yet. It looks like a good starting point. The colldef.1 man page contains typos. And it doesn't pass mandoc -Tlint and that alone would break the build. realloc() calls in parse.y violate best practice rules explained in the malloc(3) man page. It seems parse.y also contains some macros to support compilers other than gcc, I don't think it's worth adding these yet. The __printflike() macro should be dropped, it is used to redefine yyerror(). Please change this to look like in other parse.y files in the OpenBSD src tree (e.g. look at bgpd). The parse.y file also contains some indentation style issues, but those can be fixed later. The file share/locale/colldef/Makefile contains comments that explain differences to FreeBSD. Such comments make some sense in email you send to tech@ but they don't need to be in the source code. The file also lists locales which do not have corresponding ctype locale defintions yet. Please do not add them to LC_COLLATE just yet. We can add them later if needed. For now they just clutter your diff and add additional files to the installation sets, which is something we should discuss separately (see the other tech@ discussion about your ctype Makefile diff). Adding new locales and adding support for LC_COLLATE are difference concerns and should be done in separate diffs in my opinion. The collate.h files seems to contain definitions not used by colldef. Can we please start out with a header file that only contains things which are actually used?
