SDL_net one more!

Excuseme to have open an other tread but this argument is completely
different from the first one.

I wanted to ask to Sam lantinga the mantainer of the SDL_net:

I wanted to add some functions lacking, type:
inet_ntoa
ntohs
etc…

Because I have found them, in writing a my program truly essential of chat
with log, and they have to me obliged under win32 taking parts of the
winsock (than already it would have to use SDL_net).

Then also I have noticed the impossible to create one listening on a
specific IP of the server, this is the essential in a multi machine IP in
which it wants bind a sure service only to a sure IP, therefore would have
to be changed the already existing structure of the “SDLNet_ResolveHost” or
the “SDLNet_TCP_Open” (for hour has only used the TCP like test).

I know of being enough inexpert, and for hour I have the possibility to only
add these codes for win32, a platform that I know enough, therefore I don’t
know if these functionalities also present in other platforms can be added
support to you or if instead they are from thinking not implemented because
not compatible with all the platforms.

If you can makes to know something me, they are an Italian young boy that it
is beginning to program, therefore I ask forgiveness if they are appeared
arrogant or if my English makes disgusting (i use a translator for first
translate, but however I do not succeed to correct the mangled well).

good bye

I wanted to add some functions lacking, type:
inet_ntoa
ntohs
etc…

You can use the functions in SDL_endian.h, which are usually equivalent.

Then also I have noticed the impossible to create one listening on a
specific IP of the server, this is the essential in a multi machine IP in
which it wants bind a sure service only to a sure IP, therefore would have
to be changed the already existing structure of the “SDLNet_ResolveHost” or
the “SDLNet_TCP_Open” (for hour has only used the TCP like test).

That’s planned for the next revision of the SDL_net API.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

“Sam Lantinga” ha scritto nel messaggio
news:E19p8PW-0003Gi-00 at twomix.devolution.com

I wanted to add some functions lacking, type:
inet_ntoa
ntohs
etc…

You can use the functions in SDL_endian.h, which are usually equivalent.

yes for ntohs … but inet_ntoa is absolutly usefull for uman like readable
string,
for hour if it is had need of such function or is used from the lib winsock
or must rewrite it by hand, seems a useless redundancy to me inasmuch as
already other library of net supply it.

Thanks

“Sam Lantinga” ha scritto nel messaggio
news:E19p8PW-0003Gi-00 at twomix.devolution.com

I wanted to add some functions lacking, type:
inet_ntoa
ntohs
etc…

You can use the functions in SDL_endian.h, which are usually equivalent.

yes for ntohs … but inet_ntoa is absolutly usefull for uman like readable
string,
for hour if it is had need of such function or is used from the lib winsock
or must rewrite it by hand, seems a useless redundancy to me inasmuch as
already other library of net supply it.

Good point, I’ll add it to the TODO list.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

“Sam Lantinga” ha scritto nel messaggio
news:E19pLTg-0005Ex-00 at twomix.devolution.com

yes for ntohs … but inet_ntoa is absolutly usefull for uman like
readable

string,
for hour if it is had need of such function or is used from the lib
winsock

or must rewrite it by hand, seems a useless redundancy to me inasmuch as
already other library of net supply it.

Good point, I’ll add it to the TODO list.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

if you want add the win32 version:

// another function not thread safe
/SDL_net manual copied text: The returned pointer is not to be freed. Each
time you call this
function the previous pointer’s data will change to the new value, so you
may have to copy
it into a local buffer to keep it around longer.
/
char *SDLNet_inet_ntoa(IPaddress *ip)
{
in_addr address;
address.s_addr = ip->host;
return inet_ntoa(address);
}