These are due to:
- differences between module and file names.
- redundant imports
- the recent change from math.domain_error -> exception.domain_error.
benchmarks/*/*.m:
extras/*/*.m:
As above.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
Add a Mercury interface to the C function getaddrinfo. getaddrinfo
superceeds gethostbyname and getservbyname. It is reenterant and also makes
it easier to support IPv6 amoung other things. Other predicates in netdb.m
should be written in terms of getaddrinfo.
extras/net/getaddrinfo.m:
As above.
extras/net/netdb.m:
Add predicates that use getaddrinfo to perform lookups.
extras/net/types.m:
Add predicates to convert to and from the raw values for family and
socktype.
extras/net/test_lookups.m:
extras/net/Makefile:
Add a test program.
.gitignore:
This .gitignore file was causing git to ignore the Mercury.options file
in net/extras. A leading slash in .gitignore patterns matches the start
of a path, this allows us to ignore these patterns when they're only in
the root directory.
extras/net/Mercury.options:
Work around a Mercury bug.
Add this missing file.
Move type definitions from netdb.m and sockets.m to types.m. This makes the
coupling between these modules looser.
netdb.m:
Move port type to types.m
sockets.m:
Move family and socktype types into types.m
types.m:
Add the above types.
types.m:
MSVC doesn't know that abort() cannot return, so add a return statement.
Use inet_pton rather than inet_aton.
sockets.m:
Sockets are not file descriptors on windows, so we cannot use read and
write system calls. Instead use recv and send.
netdb.m:
Windows doesn't provide getprotobyname_r() so use getprotobyname() on
Windows.
To make winsock2.h useable we have to include mercury_windows first,
which includes windows.h in such a way as not to include the conflicting
winsock.h.
Julien caught this bug in my previous commit. Thanks.
extras/net/netdb.m:
extras/net/sockets.m:
extras/net/tcp.m:
extras/net/types.m:
As above.
extras/net/netdb.m:
extras/net/sockets.m:
extras/net/tcp.m:
extras/net/types.m:
Include the correct header files.
Fix the order of statements in a code block.
Workarround the missing SHUT_RDWR macro on windows.
Avoid use of socklen_t.
This library had been neglected for a while and came to my attention when it
used deprecated (or at least old) C interfaces rather than newer reentrant
ones. I've started to improve this library by giving a more typesafe and
Mercury-esque API, using only reentrant C functions, and eventually adding
support for more protocols, (eg: IPv6 and UDP) better integration with
Mercury's io module and generally making it easier to use.
What's working now:
+ creating sockets,
+ binding and listening,
+ connecting (untested),
+ accepting,
+ closing.
+ The interface is generally more type-safe, using new types suck as
"socket" and "address" rather than "int" and "c_pointer".
What's not working/incomplete:
+ I havn't yet touched the tcp.m module, but I intend to remove it and
create a new high-level interface for various protocols.
+ Any kind of reading / writing over sockets at all.
+ Name lookups.
+ A lot of the interface is incomplete / missing useful functions and
predicates.
This is a work in progress.
Makefile:
New Makefile.
README.md:
New Readme file.
net.m:
net is now a module containing the other modules as submodules.
sockets.m:
Many changes as described above.
netdb.m:
This new module contains host and other name lookups. Only service
lookups are currently implemented.
types.m:
Types shared by sockets.m and netdb.m.
echo.m:
An example echo server.
errno.m:
strerror functionality.
tcp.m:
Conform to changes in net.m.