DtMsgLogOpenFile man page on HP-UX

Printed from http://www.polarhome.com/service/man/?qf=DtMsgLogOpenFile&af=0&tf=2&of=HP-UX

DtMsgLogOpenFile(library call)			DtMsgLogOpenFile(library call)

NAME
       DtMsgLogOpenFile — opens a log file

SYNOPSIS
       #include <Dt/MsgLog.h>
       FILE* DtMsgLogOpenFile(
       const char* type,
       char** filename_return);

DESCRIPTION
       The  DtMsgLogOpenFile function calls fopen to open a log file with type
       open mode. If fopen opens a log file successfully and  returns  a  non-
       NULL  filename_return,  DtMsgLogOpenFile calls malloc to allocate space
       for filename_return.  DtMsgLogOpenFile then copies the log file name to
       filename_return.

       The  caller  must  use the free function to release the space allocated
       for filename_return, if it is not NULL. The caller must also close  the
       file  pointer  returned	by DtMsgLogOpenFile. Use caution in doing this
       because stderr may be returned.

       For a description of the algorithm used to determine the	 log  file  to
       open, see DtMsgLogMessage(3). Note that if a log file cannot be opened,
       filename_return will be set to NULL.

ARGUMENTS
       type	 Specifies the file open flag. See fopen(3) for more  informa‐
		 tion.

       filename_return
		 Specifies the variable to receive the returned log file name.

ENVIRONMENT VARIABLES
       None.

RESOURCES
       None.

ACTIONS/MESSAGES
       None.

ERRORS/WARNINGS
       None.

EXAMPLES
       The following code fragment opens the log file, logs the log file name,
       closes the file, and frees the space allocated for the file name.

       char * log_file;
       FILE * fp = DtMsgLogOpenFile ("a+", &log_file);

       if (log_file) {
	   DtMsgLogMessage (argv[0], DtMsgLogInformation,
		 "The log file name is: %s", log_file);
	   free (log_file);
       }
       if (fp && fp != stderr)
	    fclose (fp);

RETURN VALUE
       If DtMsgLogMessage completes successfully, it returns a pointer to  the
       opened log file.	 If it cannot open a log file, it returns stderr.

FILES
       None.

SEE ALSO
       DtMsgLogMessage(3), DtMsgLogSetHandler(3)

						DtMsgLogOpenFile(library call)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net