Mail Archives: djgpp-workers/1998/03/10/07:27:12
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> On Mon, 9 Mar 1998, Salvador Eduardo Tropea (SET) wrote:
>
> > > > And perhaps (if no so much overhead is involved) we can even have both
> > > > errno styles selectable through some variable.
> > >
> > > Is there really a need for this option? If we have both errno and
> > > _dos_errno, an application could test both of them if it needs.
> > > Portability (both to Posix and DOS compilers) is served well by having
> > > both of these separate.
> >
> > Yes, but a program designed to be compiled on both: DOS/UNIX can't get any
> > direct advantage. The program must have your own code to solve it, that's all.
>
> Perhaps I misunderstand what you mean. Could you please show an
> example of code which uses the facility that you are suggesting?
> Thanks.
The idea is:
All the current UNIX and old programs works just like we spect.
But if you have a program that needs more errno values and hence will be able
to pass these values to the function that translates the number into a message
you just use:
// here or better in the gccflags of the makefile
#define USE_EXTENDED_ERROR
#define INIT_EXTENDED
#include <errno.h>
// ones
INIT_EXTENDED
rest of code without changes if you don't check for some particular errno
value. The program will behave just fine and will report accurate errors
without changing a line.
Another way can be just have a flag to make perror report a more exact error,
so the user can get a better description. The only thing is complex is how to
deal with sys_errlist[];
My idea is to enable programs (like RHIDE) to report a better message without
touching a line.
I don't know if that's good or not, is just an idea. The DOS specific thing is
good, but needs some special code for DOS and that normally makes less readable
the programs.
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -