Date: Tue, 04 May 1999 21:11:45 +0400 From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> To: "G. Adam Stanislav" <adam@whizkidtech.net> Cc: freebsd-hackers@freebsd.org Subject: Re: wc* routines Message-ID: <199905041711.VAA04689@tejblum.dnttm.rssi.ru> In-Reply-To: Your message of "Mon, 03 May 1999 11:36:48 CDT."
next in thread | raw e-mail | index | archive | help
Well, just several comments (all IMO). > At the present, the page contains some introduction to what wc* routines are > for, as well as the headers <wchar.h> and <wctype.h>. I also created an > additional, system specific, header which I called <machine/wcdef.h>. I would > like your input on whether the contents of this header belong there, or should > be moved to <machine/ansi.h>, or perhaps whether its name should be changed, > and such. Well, not bad. Still, your headers apparently have too much namespace pollution. Your <wchar.h> include <machine/varargs.h>. Apparently, to get definition of va_list. First, the modern definition of va_list is in <stdarg.h> (symlink to <machine/stdarg.h>, conflict with <varargs.h>), second, you should not include any of them, you should use _BSD_VA_LIST_, just like <stdio.h>. Likewise, you should not include <stdio.h>. Try use some similar trick. In general, everything more than <sys/cdefs.h> and <machine/ansi.h> is too much. <machine/wcdef.h> should not exist. _BSD* macros missng from <machine/ansi.h> should be added there. WCS* macros have unknown purpose and pollute the namespace, therefore they should not exist. In general, headers under machine/ should be machine-depended :-). I don't like your idea that WEOF == INT_MIN. Apparently, everyone else have WEOF == -1 (== EOF), and there is no reason why we should not too. I don't know about "debugging purposes". WEOF == EOF should allow more code sharing with existing libc. Note that FreeBSD already have some very sparse and nonstandard (but functional) wchar support. > I started with the headers because it does not seem to make much sense to me > to work on the code without good headers. Well, but implementation is also important ;-). Unimplemented headers are somewhat confusing when committed into the tree - we already have examples... > Also, what belongs inside those > headers is pretty much defined by standards, so they were fairly easy to > write. :-) Note that a major portion of <wctype.h> already almost implemented in FreeBSD: plain ctype functions work with wide characters. So it should be fairly easy to write an almost working <wctype.h>. (BTW, it is somewhere on my ToDo list for quite some time, but now not that far from the top). Good luck. Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905041711.VAA04689>