WSGetDomainNameList()
This feature is not supported on the Wolfram Cloud.

char ** WSGetDomainNameList(WSENV e, unsigned long *s)
returns a list of ASCII strings containing the domain names available on the machine and the length of the list in s.

DetailsDetails

  • WSGetDomainNameList() loads the DNS domain names for each active network interface available on the machine.
  • WSGetDomainNameList() allocates memory to store the domain names that must be released. To release the memory allocated by WSGetDomainNameList(), call WSReleaseDomainNameList() on the list returned by WSGetDomainNameList().
  • WSGetDomainNameList() returns NULL on failure.
  • WSGetDomainNameList() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* A function that reads the domain names available on a machine */

void f(MLENV e)
{
    char **theList = NULL;
    char *tmp;
    unsigned long length;

    theList = WSGetDomainNameList(env, &length);

    if(length > 0 && theList != (char **)0)
    {
        while((tmp = *theList++) != (char *)0)
        {
            /* ... */
        }

        WSReleaseDomainNameList(env, theList, length);
    }
}