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

void WSReleaseNetworkAddressList(WSENV e, char **l, int n)
frees the memory allocated by WSGetNetworkAddressList() stored in list l of length n.

DetailsDetails

  • WSReleaseNetworkAddressList() 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 IP addresses available on a machine */

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

    theList = WSGetNetworkAddressList(env, &length);

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

        WSReleaseNetworkAddressList(env, theList, length);
    }
}