MLStopLoggingStream (C 函数)

MLStopLoggingStream 已经被 WSStopLoggingStream 所取代.

int MLStopLoggingStream(MLINK l)

disables all logging activity for the MathLink connection specified by l.

更多信息

  • MLStopLoggingStream() terminates all logging operations and closes all open log files.
  • MLStopLoggingStream() has the side effect of disabling any enabled link locks for l.
  • MLStopLoggingStream() returns 0 in the event of an error and a nonzero value on success.
  • MLStopLoggingStream() is declared in the MathLink header file mathlink.h.

范例

基本范例  (1)

#include "mathlink.h"

int main(int argc, char **argv)
{
    MLENV env;
    MLINK link;
    int error;
    int apiResult;

    env = MLInitialize((MLEnvironmentParameter)0);
    if(env == (MLENV)0)
    { /* Unable to create MathLink environment object */ }

    link = MLOpenArgcArgv(env, argc, argv, &error);
    if(link == (MLINK)0 || error != MLEOK)
    { /* Unable to create MathLink link object */ }

    MLActivate(link);

    apiResult = MLLogStreamToFile(link, "/tmp/link.log");
    { /* Unable to log to link.log */ }

    /* ... */

    apiResult = MLStopLoggingStream(link);
    { /* Error while shutting down logging. */ }

    MLClose(link);
    MLDeinitialize(env);
}