Candy wrote:I'm a bit worried it'll be too strictly C compliant not allowing for my OS design (which is of course entirely selfish).
That's always a problem of course. As the author of PDCLib, I only have two options: Making the lib 100% standard compliant, or making things "better" resulting in a C lib that is only
almost compliant and does place restrictions on the underlying OS that are not part of the standard... you know which I'll chose.
I'm going to nearly require unicode for anything and everything except possibly exporting to file and importing from file.
C99 does have support for wide-character and multibyte strings / I/O. printf(), for example, is specified to be multibyte-aware.
All programs should use solely unicode internally etc. That might make quite a bit of libc impossible or clumsy to write/handle.
I don't think so. There will be a couple of "dead" functions in the lib, which would lead to "bad behaviour" if used. (The non-wide/multibyte I/O functions, mainly.) But as long as you have a function for reading /writing a file byte-wise, I don't see a problem ATM.
Especially mapping filenames to/from any non-unicode chartype is a nontrivial and nonreversible thing to do...
What you pass to fopen() for a filename is "implementation-defined", and PDCLib passes it verbatim to whatever file-opening system call your OS provides. Nowhere does it say in the standard that this may
not be a multibyte-encoded Unicode string...
Anyway, the abort thing is by it using something that I don't have.
You will have to have some system call to raise signals, and you will have to have a signal to terminate the calling process. Later, I will implement raise() as a wrapper for that system call, and SIGABRT will be defined to whatever integer your system call uses for an equivalent; until then, either you throw abort() out before compiling, or you provide a pseudo-raise() specialized for this case yourself.
Is there a document somewhere that indicates the top-level side of pdclib, IE, what the OS dever has to supply for the default files to just compile and work?
Inspect what is in ./platform/example, and probably tweak it to suit your OS / hardware / tastes.
I'll extend the Makefile at some later point, so that with a source tree like ./platform/MyOS_1.0, ./platform/OtherOS_2.0 etc., all you have to do is a "make MyOS_1.0" to get a library package for your OS. (Right now, the Makefile is aimed at
development convenience.) A release version of the PDCLib will also include example configurations for as many platforms as I can get my hands on for testing.