MLLogFileNameForLink (C Function)
MLLogFileNameForLink has been replaced by WSLogFileNameForLink.
int MLLogFileNameForLink( MLINK l , const char ** name )
computes a suitable name and (optionally) a location in the file system for a log file to log the MathLink data stream in the MathLink connection specified by l and stores the name in name.
Details
- MLLogFileNameForLink() allocates memory for the name of the log file that must be released by calling MLReleaseLogFileNameForLink(). If MLLogFileNameForLink() fails and returns an error, do not use MLReleaseLogFileNameForLink() to release the contents of name.
- MLLogFileNameForLink() returns 1 on success and 0 on failure.
- MLLogFileNameForLink() is declared in the MathLink header file mathlink.h.
Examples
Basic Examples (1)
#include "mathlink.h"
int main(int argc, char **argv)
{
MLENV env;
MLINK link;
int error;
const char *logFileName;
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 link object */ }
MLActivate(link);
/* ... */
apiResult = MLLogFileNameForLink(link, &logFileName);
if(! apiResult =)
{ /* Unable to generate a file name */ }
apiResult = MLLogStreamToFile(link, logFileName);
{ /* unable to log to logFileName */ }
MLReleaseLogFileNameForLink(link, logFileName);
/* ... */
MLClose(link);
MLDeinitialize(env);
return 0;
}