WSReleaseNetworkAddressList (C 函数)

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

释放储存在长度为 n 的列表 l,由 WSGetNetworkAddressList() 分配的内存.

更多信息

  • WSTP 的标头文件 wstp.h. 已对 WSReleaseNetworkAddressList() 作出声明.

范例

基本范例  (1)

#include "wstp.h"

/* A function that reads the IP addresses available on a machine */

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