Mail Archives: djgpp-workers/2001/05/31/00:03:38
> From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
> Date: Tue, 29 May 2001 22:14:31 +0200
>
> When looking through the POSIX draft Mark pointed out, I
> saw a pair of functions mentioned that wouldn't be too
> hard to implement, so I did.
Thanks. A few comments:
> --- nul Tue May 29 22:09:11 2001
> +++ radix64.c Tue May 29 22:04:48 2001
Please use /dev/null; nul won't work on Unix.
Also, please divide the source into two separate files. There's no
need to gratuitously bloat user programs with functions they don't
call.
> +#ifdef TEST
> +#include <stdio.h>
> +
> +int
> +main(void)
> +{
> + printf ("a64l(\"/.\") -> %ld\n", a64l("/."));
> + printf ("a64l(\"DJGPP\") -> %ld\n", a64l("DJGPP"));
This is best put on a separate file in the tests directory (to become
part of djtstNNN.zip).
> +The result of @code{a64l()} is undefined if @var{s} is a null pointer, or
> +the string it points to was not generated by a previous call to
> +@code{l64a()}.
At least in the case of a NULL pointer I think the result is pretty
much known in advance. In general, ``result is undefined'' is
lawyerspeak; in our docs I think we should tell what will happen if we
know that.
> +This function takes a @code{long} argument and returns a pointer to its
> +radix-64 representation. The result is undefined if @var{value} is
> +negative.
Same here.
Finally, I'd suggest to mention base-64 somewhere in the docs, since
someone might not realize what are you talking about.
- Raw text -