Initializing help system before first use

fgetinfo

fgetinfo


Purpose
Retrieve information about current input, output or error stream.
Synopsis
int fgetinfo(XPRMcontext ctx, int *mode, int *line, int *col, const char **iodrv, const char **filename);
Arguments
ctx 
Mosel's execution context
mode 
Pointer to store mode
line 
Pointer to store current line
col 
Pointer to store current col
iodrv 
Pointer to store IO driver name for this stream
filename 
Pointer to store file name for this stream
Return value
Stream number or -2 if the corresponding stream is not available.
Further information
This function returns information of a stream through its parameters. Parameters may be NULLwhen the corresponding information is not required. The second parameter is used both for input and output: if it is NULL or points to a 0 value, the function returns information for the input stream. If its value is XPRM_F_WRITE, the function returns information for output stream and if its value is XPRM_F_ERROR the information is related to the error stream. This parameter is updated by the function to reflect the actual value of mode for the corresponding stream (see fopen). Note that bit XPRM_F_IOERR is set when an error has been encountered during an IO operation on the corresponding stream. Line and column information are valid only when the stream is read using fgets.
Related topics