Jim Meyering wrote:
> > Jim, maybe it would be an idea to merge this program with the 'hostname'
> > from coreutils. What's your stand on it?
>
> Good idea.
> I'd welcome the addition.
That means that you want me to do the work, I guess? OK, here's the program,
consisting of
- a patch to lib/gethostname.c to add Woe32 support,
- a new src/hostname.c,
- some autoconf macros that you can add to configure.ac or where it fits.
If that's OK, I can also go out and write the documentation update.
2004-01-18 Bruno Haible <address@hidden>
* gethostname.c: Add support for Windows. Include <string.h>.
(gethostname): On Windows, use GetComputerName().
2004-01-18 Bruno Haible <address@hidden>
* hostname.c: Include getopt.h, not long-options.h.
Include headers for using IPv6. Include xgethostname.h.
(xgethostname): Remove declaration.
(AUTHORS): Add me.
(format): New variable.
(ipv4_ntop, ipv6_ntop): New macros.
(print_hostname): New function.
(sethostname): Provide a fallback definition that just signals an
error.
(long_options): New variable.
(usage): Document new options -s, -f, -i, -h, -V.
(main): Use getopt_long instead of parse_long_options. Initialize
'format'. Invoke print_hostname.