unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

log.cpp
Go to the documentation of this file.
1#include "rar.hpp"
2
3
4static wchar LogName[NM];
6
7void InitLogOptions(const wchar *LogFileName,RAR_CHARSET CSet)
8{
9 wcsncpyz(LogName,LogFileName,ASIZE(LogName));
10 LogCharset=CSet;
11}
12
13
14#ifndef SILENT
15void Log(const wchar *ArcName,const wchar *fmt,...)
16{
17 // Preserve the error code for possible following system error message.
19
21
22 // This buffer is for format string only, not for entire output,
23 // so it can be short enough.
24 wchar fmtw[1024];
25 PrintfPrepareFmt(fmt,fmtw,ASIZE(fmtw));
26
27 safebuf wchar Msg[2*NM+1024];
28 va_list arglist;
29 va_start(arglist,fmt);
30 vswprintf(Msg,ASIZE(Msg),fmtw,arglist);
31 va_end(arglist);
32 eprintf(L"%ls",Msg);
34}
35#endif
36
37
ErrorHandler ErrHandler
int GetSystemErrorCode()
Definition: errhnd.cpp:403
void SetSystemErrorCode(int Code)
Definition: errhnd.cpp:413
void eprintf(const wchar *fmt,...)
Definition: consio.cpp:135
static wchar LogName[2048]
Definition: log.cpp:4
void InitLogOptions(const wchar *LogFileName, RAR_CHARSET CSet)
Definition: log.cpp:7
void Log(const wchar *ArcName, const wchar *fmt,...)
Definition: log.cpp:15
static RAR_CHARSET LogCharset
Definition: log.cpp:5
RAR_CHARSET
Definition: options.hpp:51
@ RCH_DEFAULT
Definition: options.hpp:51
#define safebuf
Definition: os.hpp:235
#define ASIZE(x)
Definition: rardefs.hpp:10
wchar_t wchar
Definition: rartypes.hpp:13
void wcsncpyz(wchar *dest, const wchar *src, size_t maxlen)
Definition: strfn.cpp:275
void PrintfPrepareFmt(const wchar *Org, wchar *Cvt, size_t MaxSize)
Definition: strfn.cpp:415
void uiAlarm(UIALARM_TYPE Type)
Definition: uiconsole.cpp:413
@ UIALARM_ERROR
Definition: ui.hpp:94