digitalmars.D - Phobos SysError...
- Regan Heath (10/10) Jul 22 2004 I just noticed the undocumented? SysError class in phobos. It appears to...
- Regan Heath (13/23) Jul 22 2004 I forgot to mention, the Windows functions I needed (FormatMessageA and
-
Regan Heath
(7/33)
Jul 22 2004
I always forget to polish my code.. this version has a few fixes, li... - Matthew (4/30) Jul 23 2004 They're included with WindowsException (with various useful techniques f...
- Kris (5/15) Jul 22 2004 Nice. Do you mind if I pop this into Mango until the 'official' version
- Regan Heath (6/28) Jul 22 2004 Not at all, go right ahead.
I just noticed the undocumented? SysError class in phobos. It appears to be for getting the OS error message associated with an error code. It is currently a switch statement with some errno constants and constant strings. I think it should be updated to call FormatMessage on windows and strerror on *NIX. Attached is my attempt at it, if it meets aproval pls consider it for inclusion in Phobos. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 22 2004
I forgot to mention, the Windows functions I needed (FormatMessageA and LocalFree) are not declared in std.c.windows.windows, or aywhere else I could find. Is this because they are defined in winbase.h and no-one has done a D stub for that yet? I have declared them in the attached syserror.d but they should be moved. The attached file may not work on *NIX it may require something like extern (C) char *strerror(int errnum); I'm not sure. Regan On Fri, 23 Jul 2004 00:33:48 +1200, Regan Heath <regan netwin.co.nz> wrote:I just noticed the undocumented? SysError class in phobos. It appears to be for getting the OS error message associated with an error code. It is currently a switch statement with some errno constants and constant strings. I think it should be updated to call FormatMessage on windows and strerror on *NIX. Attached is my attempt at it, if it meets aproval pls consider it for inclusion in Phobos. Regan.-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 22 2004
<g> I always forget to polish my code.. this version has a few fixes, like the removal of the newline from the error string, and the addition of the extern (C) char *strerror(int) etc. Regan On Fri, 23 Jul 2004 00:40:53 +1200, Regan Heath <regan netwin.co.nz> wrote:I forgot to mention, the Windows functions I needed (FormatMessageA and LocalFree) are not declared in std.c.windows.windows, or aywhere else I could find. Is this because they are defined in winbase.h and no-one has done a D stub for that yet? I have declared them in the attached syserror.d but they should be moved. The attached file may not work on *NIX it may require something like extern (C) char *strerror(int errnum); I'm not sure. Regan On Fri, 23 Jul 2004 00:33:48 +1200, Regan Heath <regan netwin.co.nz> wrote:-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/I just noticed the undocumented? SysError class in phobos. It appears to be for getting the OS error message associated with an error code. It is currently a switch statement with some errno constants and constant strings. I think it should be updated to call FormatMessage on windows and strerror on *NIX. Attached is my attempt at it, if it meets aproval pls consider it for inclusion in Phobos. Regan.
Jul 22 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opsbjhifhn5a2sq9 digitalmars.com...I forgot to mention, the Windows functions I needed (FormatMessageA and LocalFree) are not declared in std.c.windows.windows, or aywhere else I could find.They're included with WindowsException (with various useful techniques for loading string messages from different modules), which Walter's been hanging onto for several months, but is still not in Phobos. I'm still waiting ... sigh ...Is this because they are defined in winbase.h and no-one has done a D stub for that yet? I have declared them in the attached syserror.d but they should be moved. The attached file may not work on *NIX it may require something like extern (C) char *strerror(int errnum); I'm not sure.Regan On Fri, 23 Jul 2004 00:33:48 +1200, Regan Heath <regan netwin.co.nz> wrote:I just noticed the undocumented? SysError class in phobos. It appears to be for getting the OS error message associated with an error code. It is currently a switch statement with some errno constants and constant strings. I think it should be updated to call FormatMessage on windows and strerror on *NIX. Attached is my attempt at it, if it meets aproval pls consider it for inclusion in Phobos. Regan.-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 23 2004
Nice. Do you mind if I pop this into Mango until the 'official' version appears? (with credit of course). - Kris "Regan Heath" <regan netwin.co.nz> wrote in message news:opsbjg6mt85a2sq9 digitalmars.com...I just noticed the undocumented? SysError class in phobos. It appears to be for getting the OS error message associated with an error code. It is currently a switch statement with some errno constants and constant strings. I think it should be updated to call FormatMessage on windows and strerror on *NIX. Attached is my attempt at it, if it meets aproval pls consider it for inclusion in Phobos. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 22 2004
Not at all, go right ahead. :) On Thu, 22 Jul 2004 10:15:18 -0700, Kris <someidiot earthlink.dot.dot.dot.net> wrote:Nice. Do you mind if I pop this into Mango until the 'official' version appears? (with credit of course). - Kris "Regan Heath" <regan netwin.co.nz> wrote in message news:opsbjg6mt85a2sq9 digitalmars.com...-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/I just noticed the undocumented? SysError class in phobos. It appears to be for getting the OS error message associated with an error code. It is currently a switch statement with some errno constants and constant strings. I think it should be updated to call FormatMessage on windows and strerror on *NIX. Attached is my attempt at it, if it meets aproval pls consider it for inclusion in Phobos. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 22 2004