Purpose: Open a LogChannel to use a file regime

Return TypeFunction nameArguments
hzEcodehzLogger::OpenFile(const char*,hzLogRotate,)

Declared in file: hzProcess.h
Defined in file : hzLogger.cpp

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:items 5:unknown 6:m_Base 7:cpCWD 8:unknown 9:* items m_Base 10:m_nSessID m_eRotate m_pDataPtr 11:Return E_OK

Function body:

hzEcode hzLogger::OpenFile (const char* fpath)hzLogRotate eRotate, 
{
   //  Purpose: Open a LogChannel to use a file regime
   //  
   //  Arguments: 1) fpath  The logfile's base name or path
   //     2) eRotate  The log rotate edict
   //  
   //  Returns: E_ARGUMENT If no file path is supplied
   //     E_INITDUP If logger already open
   //     E_OK  If channel opened OK
   _hzfunc("hzLogger::OpenFile") ;
   char    cvDir   [HZ_MAXPATHLEN] ;   //  Current working directory
   char*   cpCWD ;                     //  Path iterator
   if (!fpath || !fpath[0])
       hzexit(E_ARGUMENT, "No path supplied") ;
   if (IsOpen())
       hzexit(E_INITDUP, "%s: This log channel is already open", fpath) ;
   if (fpath[0]== CHAR_FWSLASH)
       m_Base = fpath ;
   else
   {
       cpCWD = getcwd(cvDir, HZ_MAXPATHLEN) ;
       for (; *cpCWD ; cpCWD++) ;
       *cpCWD++ = CHAR_FWSLASH ;
       strcpy(cpCWD, fpath) ;
       m_Base = cvDir ;
   }
   //  Set this to non zero to indicate channel open
   m_nSessID = 0;
   //  Set rotate edict
   m_eRotate = eRotate ;
   //  Set data pointer
   m_pDataPtr = m_cvData ;
   return E_OK ;
}