WSReleaseDomainNameList (C Function)

void WSReleaseDomainNameList(WSENV env,char **l,int n)

frees the memory allocated by WSGetDomainNameList() stored in list l of length n.

Details

  • WSReleaseDomainNameList() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

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

void f(WSENV env)
{
    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);
    }
}