[net] Impement a Mercury interface to getaddrinfo

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.
This commit is contained in:
Paul Bone
2015-03-15 23:08:25 +11:00
parent cbf0975e9e
commit 3c9ebf0969
8 changed files with 607 additions and 23 deletions

22
.gitignore vendored
View File

@@ -1,7 +1,7 @@
README
INSTALL
TODO
WORK_IN_PROGRESS
/README
/INSTALL
/TODO
/WORK_IN_PROGRESS
configure
config.cache
config.status
@@ -10,15 +10,15 @@ configure.log
configure.help
confdefs.h
so_locations
/Mercury.options
Mmake.common
Mmake.params
Mmake.stage.params
stage1
stage2
stage3
install_grade_dir.*
Mercury.options
/stage1
/stage2
/stage3
/install_grade_dir.*
autom4te.cache
aclocal.m4
.configured_library_grades
main.o
/.configured_library_grades
/main.o