⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rvloglistener.h

📁 基于h323协议的软phone
💻 H
字号:
/***********************************************************************
Filename   : rvloglistener.h
Description: rvloglistener header file - message log listener
************************************************************************
        Copyright (c) 2001 RADVISION Inc. and RADVISION Ltd.
************************************************************************
NOTICE:
This document contains information that is confidential and proprietary
to RADVISION Inc. and RADVISION Ltd.. No part of this document may be
reproduced in any form whatsoever without written prior approval by
RADVISION Inc. or RADVISION Ltd..

RADVISION Inc. and RADVISION Ltd. reserve the right to revise this
publication and make changes without obligation to notify any person of
such revisions or changes.
***********************************************************************/

#ifndef RV_LOG_LISTENER_H
#define RV_LOG_LISTENER_H


#include "rvccore.h"
#include "rvlog.h"


/* Error checks to make sure configuration has been done properly */
#if !defined(RV_LOGLISTENER_TYPE) || ((RV_LOGLISTENER_TYPE != RV_LOGLISTENER_WIN32) && \
    (RV_LOGLISTENER_TYPE != RV_LOGLISTENER_FILE_AND_TERMINAL) && \
    (RV_LOGLISTENER_TYPE != RV_LOGLISTENER_TERMINAL) && \
    (RV_LOGLISTENER_TYPE != RV_LOGLISTENER_NONE))
#error RV_LOGLISTENER_TYPE not set properly
#endif
/* End of configuration error checks */




/********************************************************************************************
 * RvLogListener
 * Holds information about the listeners supported by the core.
 * This includes only the type of the listener.
 * We allow only one type of each listener to be constructed - this is only the case for the
 * listeners that the core implements. Applications can write their own listeners and use
 * them as desired.
 ********************************************************************************************/
#if (RV_LOGLISTENER_TYPE != RV_LOGLISTENER_NONE)
typedef struct
{
    RvLogMgr*   logMgr; /* Log manager this listener uses */
    int         listenerType; /* Type of listener constructed */
} RvLogListener;

#else

/* Dummy declaration for a log listener, since we're not supporting any */
typedef RvInt RvLogListener;

#endif  /* (RV_LOGLISTENER_TYPE != RV_LOGLISTENER_NONE) */



#if defined(__cplusplus)
extern "C" {
#endif


RvStatus RvLogListenerInit(void);
RvStatus RvLogListenerEnd(void);


#if (RV_LOGLISTENER_TYPE != RV_LOGLISTENER_NONE)

/********************************************************************************************
 * RvLogListenerConstructTerminal
 *
 * purpose : Construct a log listener that sends log messages to the terminal, using
 *           standard output or standard error
 * input   : listener   - Listener to construct
 *           logMgr     - Log manager to listen to
 *           stdOut     - RV_TRUE for stdout, RV_FALSE for stderr
 * output  : None.
 * return  : RV_OK on success, other values on failure
 ********************************************************************************************/
RVCOREAPI
RvStatus RVCALLCONV RvLogListenerConstructTerminal(
    IN  RvLogListener*  listener,
    IN  RvLogMgr*       logMgr,
    IN  RvBool          stdOut);


/********************************************************************************************
 * RvLogListenerDestructTerminal
 *
 * purpose : Destruct the terminal listener
 * input   : listener   - Listener to destruct
 * output  : None.
 * return  : RV_OK on success, other values on failure
 ********************************************************************************************/
RVCOREAPI
RvStatus RVCALLCONV RvLogListenerDestructTerminal(
    IN  RvLogListener*  listener);


/********************************************************************************************
 * RvLogListenerConstructLogfile
 *
 * purpose : Construct a log listener that sends log messages to a file
 * input   : listener           - Listener to construct
 *           logMgr             - Log manager to listen to
 *           fileName           - Name of the logfile
 *           numFiles           - Number of cyclic files to use
 *           fileSize           - Size of each file in cycle in bytes
 *                                This parameter is only applicable if numFiles > 1
 *           flushEachMessage   - RV_TRUE if we want to flush each message written to the
 *                                logfile
 * output  : None.
 * return  : RV_OK on success, other values on failure
 ********************************************************************************************/
RVCOREAPI
RvStatus RVCALLCONV RvLogListenerConstructLogfile(
    IN  RvLogListener*  listener,
    IN  RvLogMgr*       logMgr,
    IN  const RvChar*   fileName,
    IN  RvUint32        numFiles,
    IN  RvUint32        fileSize,
    IN  RvBool          flushEachMessage);


/********************************************************************************************
 * RvLogListenerLogfileGetCurrentFilename
 *
 * purpose : Get the filename of the current file being written.
 * input   : listener       - Listener to check
 *           fileNameLength - Maximum length of filename
 * output  : fileName       - Filename of the current file being written
 * return  : RV_OK on success, other values on failure
 ********************************************************************************************/
RVCOREAPI
RvStatus RVCALLCONV RvLogListenerLogfileGetCurrentFilename(
    IN  RvLogListener*  listener,
    IN  RvUint32        fileNameLength,
    OUT RvChar*         fileName);


/********************************************************************************************
 * RvLogListenerDestructLogfile
 *
 * purpose : Destruct the logfile listener
 * input   : listener   - Listener to destruct
 * output  : None.
 * return  : RV_OK on success, other values on failure
 ********************************************************************************************/
RVCOREAPI
RvStatus RVCALLCONV RvLogListenerDestructLogfile(
    IN  RvLogListener*  listener);


/********************************************************************************************
 * RvLogListenerConstructDebug
 *
 * purpose : Construct a log listener that sends log messages to the debug window of
 *           Visual C.
 * input   : listener   - Listener to construct
 *           logMgr     - Log manager to listen to
 * output  : None.
 * return  : RV_OK on success, other values on failure
 * remarks : This one is only applicable for Win32 applications.
 ********************************************************************************************/
RVCOREAPI
RvStatus RVCALLCONV RvLogListenerConstructDebug(
    IN  RvLogListener*  listener,
    IN  RvLogMgr*       logMgr);


/********************************************************************************************
 * RvLogListenerDestructDebug
 *
 * purpose : Destruct the debug listener
 * input   : listener   - Listener to destruct
 * output  : None.
 * return  : RV_OK on success, other values on failure
 ********************************************************************************************/
RVCOREAPI
RvStatus RVCALLCONV RvLogListenerDestructDebug(
    IN  RvLogListener*  listener);

#else
/* No internal listeners - use macros instead */
#define RvLogListenerConstructTerminal(_listener, _logMgr, _stdOut) (*_listener = RV_OK)
#define RvLogListenerDestructTerminal(_listener) (*_listener = RV_OK)
#define RvLogListenerConstructLogfile(_listener, _logMgr, _fileName, _numFiles, _fileSize, _flushEachMessage) \
    (*_listener = RV_OK)
#define RvLogListenerDestructLogfile(_listener) (*_listener = RV_OK)
#define RvLogListenerConstructDebug(_listener, _logMgr) (*_listener = RV_OK)
#define RvLogListenerDestructDebug(_listener) (*_listener = RV_OK)

#endif  /* (RV_LOGLISTENER_TYPE != RV_LOGLISTENER_NONE) */


#if defined(__cplusplus)
}
#endif /* __cplusplus*/

#endif  /* RV_LOG_LISTENER_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -