MLReleaseDomainNameList (C 函数)

MLReleaseDomainNameList 已经被 WSReleaseDomainNameList 所取代.

void MLReleaseDomainNameList(MLENV e, char **l, int n)

释放储存在长度为 n 的列表 l 中的 MLGetDomainNameList() 分配的内存.

更多信息

  • 在 MathLink 标头文件 mathlink.h.中声明 MLReleaseDomainNameList().

范例

基本范例  (1)

#include "mathlink.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 = MLGetDomainNameList(env, &length);

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

        MLReleaseDomainNameList(env, theList, length);
    }
}