| 1 |
$Id$ |
|---|
| 2 |
|
|---|
| 3 |
Credits |
|---|
| 4 |
======= |
|---|
| 5 |
|
|---|
| 6 |
The vast majority of PDCLib is original work by me. I felt it was the only way |
|---|
| 7 |
to ensure that the code was indeed free of third-party rights, and thus free to |
|---|
| 8 |
be released into the Public Domain. |
|---|
| 9 |
|
|---|
| 10 |
Another issue was that of coding style, quality and stability of the code, and |
|---|
| 11 |
the urge to really understand every miniscule part of the code as to be able to |
|---|
| 12 |
maintain it well once v1.0 has been released. |
|---|
| 13 |
|
|---|
| 14 |
That is not to say there are no credits to be given. To the contrary: |
|---|
| 15 |
|
|---|
| 16 |
Paul Edwards (author of the PDPCLIB), for inspirational code fragments, thanks. |
|---|
| 17 |
|
|---|
| 18 |
P.J. Plauger (author of "The Standard C Library"), for a book without which I |
|---|
| 19 |
would not have been able to create PDCLib at this quality, thanks. |
|---|
| 20 |
|
|---|
| 21 |
Paul Bourke (author of mathlib), for allowing me access to a complete math |
|---|
| 22 |
library under public domain terms so I could use it as a reference, thanks. |
|---|
| 23 |
|
|---|
| 24 |
Peter ("Candy") Bindels (netizen of osdev.org), who located a copy of Cody |
|---|
| 25 |
& Waite's "Software Manual for the Elementary Functions" for me and saved me |
|---|
| 26 |
serious cash in the process, thanks. |
|---|
| 27 |
|
|---|
| 28 |
Michael Moody, who contributed the generic implementation for <stdarg.h> to |
|---|
| 29 |
the Public Domain which can now be found in <_PDCLIB_config.h>, thanks. |
|---|
| 30 |
|
|---|
| 31 |
Rod Pemberton, for pointing out several flaws in early versions of PDCLib and |
|---|
| 32 |
giving other valuable hints, thanks. |
|---|
| 33 |
|
|---|
| 34 |
Brian Damgaard, for a very friendly exchange over the fine details of the |
|---|
| 35 |
Quicksort algorithm and its implementation in PDCLib, thanks. |
|---|
| 36 |
|
|---|
| 37 |
Everyone involved in the first, "public" attempt at PDCLib, for bearing with me |
|---|
| 38 |
when I restarted from scratch, thanks. |
|---|
| 39 |
|
|---|
| 40 |
Everyone bearing with me during the "stdio block", a period of many years in |
|---|
| 41 |
which PDCLib received not a single update because I was stuck and could not |
|---|
| 42 |
find the time and energy to work it out. |
|---|
| 43 |
|
|---|
| 44 |
Lennart Frid�n and Sammy Nordstr�m, who have been great pals even after I sunk |
|---|
| 45 |
some other project that had eaten countless hours of work between the three of |
|---|
| 46 |
us, thanks. |
|---|
| 47 |
|
|---|
| 48 |
My wife, daughter, and son for sharing husband and daddy with this strange |
|---|
| 49 |
machine, thanks. |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
Style |
|---|
| 53 |
===== |
|---|
| 54 |
|
|---|
| 55 |
I followed a set of guidelines in creating PDCLib. If you find some piece that |
|---|
| 56 |
does not adhere to them, that's a bug worth reporting. I mean it. I am a bit |
|---|
| 57 |
obsessive when it comes to coding style. ;-) |
|---|
| 58 |
|
|---|
| 59 |
- All the stuff that is not part of the standard specification is "hidden" in |
|---|
| 60 |
the _PDCLIB_* namespace - functions, variables, macros, files, directories. |
|---|
| 61 |
This is to make it easier to distinguish between what the standard dictates |
|---|
| 62 |
and what I added to make PDCLib work. |
|---|
| 63 |
|
|---|
| 64 |
- Any internal includes (i.e. those not specified by the standard) have their |
|---|
| 65 |
header guards defined in the *including* file, for a tiny bit of compile-time |
|---|
| 66 |
performance. |
|---|
| 67 |
|
|---|
| 68 |
- I always try to minimize the use of local variables. Wherever possible I used |
|---|
| 69 |
parameters passed by-value directly, and deferred declaration of locals to the |
|---|
| 70 |
innermost block of statements, in hopes that it might reduce memory footprint |
|---|
| 71 |
when the library is compiled with a compiler that is not that great at |
|---|
| 72 |
optimization. |
|---|
| 73 |
|
|---|
| 74 |
- Every function, every static data item that could possibly be shared, got its |
|---|
| 75 |
own implementation file. This means the library itself is probably larger than |
|---|
| 76 |
strictly necessary, and might take a couple of clock cycles longer to link, |
|---|
| 77 |
but it reduces size of object files and executables. |
|---|
| 78 |
|
|---|
| 79 |
- Where possible, I tried to share functionality between similar functions (as |
|---|
| 80 |
can be seen in the atoi() and strtol() function families). This means one or |
|---|
| 81 |
two additional function calls, but again reduces memory footprint and eases |
|---|
| 82 |
maintenance of the library. |
|---|
| 83 |
|
|---|
| 84 |
- Function arguments are named exactly as in the standard document. |
|---|
| 85 |
|
|---|
| 86 |
- The standard is taken quite literally in places. For example, the default |
|---|
| 87 |
implementations of memcpy() really copies char-wise. This runs contrary to |
|---|
| 88 |
earlier claims of performance, but is consistent with the *letter* of the |
|---|
| 89 |
standard, and you will probably use your compiler builtins (through a platform |
|---|
| 90 |
overlay) anyhow. |
|---|
| 91 |
|
|---|
| 92 |
- Every file has an Id tag, so that it is on file for *every* code file. |
|---|
| 93 |
|
|---|
| 94 |
- PDCLib code has no bias towards POSIX; indeed the absence of POSIX tidbits is |
|---|
| 95 |
one of its hallmarks. However, PDCLib also has no bias *against* POSIX, and |
|---|
| 96 |
when one platform abstraction is as good as another, I chose the POSIX one for |
|---|
| 97 |
sheer familiarity. (This is mainly referring to naming and parameter lists of |
|---|
| 98 |
OS "glue" functions.) |
|---|
| 99 |
|
|---|
| 100 |
- Identifiers are tersely named, but not cryptically abbreviated, and should be |
|---|
| 101 |
intuitive enough to allow easy understanding of PDCLib inner workings. |
|---|
| 102 |
|
|---|
| 103 |
- I disagree with the notion that good code needs no comments. Code tells you |
|---|
| 104 |
*how*, but not the *why*, and you have to figure out the *what* yourself. So |
|---|
| 105 |
I added comments to every nontrivial piece of code explaining my motives and |
|---|
| 106 |
hopefully keeping overly ambitious editors from repeating my mistakes. The |
|---|
| 107 |
header files especially should be self-documenting to the point of being a |
|---|
| 108 |
suitable replacement for any library reference book you might be using. |
|---|
| 109 |
|
|---|