CPXXgetlogfilename and CPXgetlogfilename
The routine CPXXgetlogfilename/CPXgetlogfilename
accesses the name of the current logfile.
int CPXXgetlogfilename( CPXCENVptr env, char * buf_str, CPXSIZE bufspace, CPXSIZE * surplus_p )
int CPXgetlogfilename( CPXCENVptr env, char * buf_str, int bufspace, int * surplus_p )
Description
The routine
CPXXgetlogfilename/CPXgetlogfilename
accesses the name of the current log file, as set by
CPXXsetlogfilename and CPXsetlogfilename.
If no logfile is set, this routine returns an empty string as the name.
Note:
Independent of the settings of the CPLEX parameters
API string encoding switch
and file encoding switch,
the name returned by this function is always a
null-terminated C-style string.
It is, in fact, a deep copy of the value that was passed to
CPXXsetlogfilename and CPXsetlogfilename
when that routine created the log file.
Arguments
- env
-
A pointer to the CPLEX environment as returned by
CPXXopenCPLEX/CPXopenCPLEX. - buf_str
-
A pointer to a buffer of size
bufspace. This argument can be NULL ifbufspaceis 0 (zero). The name of the logfile is returned in this buffer as a null-terminated C-style string. - bufspace
-
An integer specifying the length of the array
buf_str. May be 0 (zero). - surplus_p
-
A pointer to an integer to contain the difference between
bufspaceand the amount of memory required to store the logfile name (including the terminating NULL character). A nonnegative value ofsurplus_pspecifies that the length of the arraybuf_strwas sufficient. A negative value specifies that the length of the array was insufficient and that the routine could not complete its task. In this case,CPXXgetlogfilename/CPXgetlogfilenamereturns the valueCPXERR_NEGATIVE_SURPLUS, and the negative value ofsurplus_pspecifies an upper limit on the amount of insufficient space in the arraybuf_str.
Return
The routine returns 0 (zero) if successful and nonzero if an error
occurs. The value
CPXERR_NEGATIVE_SURPLUS
specifies that insufficient space was available in the
buf_str array to hold the
problem name.
Example
char logfilename[1024];
status = CPXgetlogfilename (env, logfilename, sizeof(logfilename),
&surplus);