Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
17 user(s) are online (13 user(s) are browsing Forums)

Members: 1
Guests: 16

davebraco, more...

Support us!

Headlines

 
  Register To Post  

« 1 (2)
Re: unix like "netstat" tool for os4, v1.1
Home away from home
Home away from home


See User information
@kas1e
Just checked your sources. While most of if it is very good already some suggestions to make it more AmigaOS like and more user friendly:
- Replace your custom parse_args() function using the usual AmigaOS dos.library ReadArgs() function for parsing shell command arguments. Even if it's not the usual AmigaOS syntax, a template like "-a=--all/S,-l=--listening/S,-n=--numeric/S,..." is of course possible as well. And maybe even more important: A probably less known feature of ReadArgs() is that the first "foobar ?" displays the template of the command, but entering "?" again at that prompt can display additional information/help for the command, or even a complete man page of it.
- Your sources include several
"IDOS->Printf("Error: ...: %d\n", ISocket->Errno());
lines, which is very good, but only usable for people like you and me who know those error codes inside out. For casual users something like
"int32 en = ISocket->Errno(); IDOS->Printf("Error: ...: %d,%s\n", en, strerror(en));
instead might be of some additional help.

At least newlib includes the strerror() and _strerror_r() functions, and of course the AmigaOS port uses the same errno ENUMs as bsdsocket.library does, but I guess it's the same for the AmigaOS 4.x versions of the clib2, clib4, ixemul, libnix and vclib C libraries as well.

Edit: Additional problem:
IDOS->Printf("whatever %d"int32_arg);
can't work!
Like all printf-like functions in AmigaOS it's based on the IExec->RawDoFmt() function, or after locale.library was loaded by it's ILocale->FormatString() replacent (not by it's Ilocale->FormatString32() function!).
For compatibility to AmigaOS <= 3.x/m68k software all integer arguments on the stack of RawDoFmt(), and any functions using it, are interpreted like on real m68k CPUs: %d = 16 bit (int16/uint16), for 32 bit integers (int32/uint32) you have to use %ld instead of %d to make it work.


Edited by joerg on 2025/5/29 18:05:05
Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project