MLGetDomainNameList (C Function)

MLGetDomainNameList has been replaced by WSGetDomainNameList.

char ** MLGetDomainNameList(MLENV env,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.

Details

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

Examples

Basic Examples  (1)

#include "mathlink.h"

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

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

    theList = MLGetDomainNameList(env, &length);

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

        MLReleaseDomainNameList(env, theList, length);
    }
}