missing project/build files
[client-tools.git] / src / external / 3rd / library / vivoxSharedWrapper / Eq2Vivox.h
blobe992222164dc5884d83e29121cf99fd44f79b2c3
1 #ifndef EQ2VIVOX_H
2 #define EQ2VIVOX_H
4 #include "Platform.hpp"
5 #include "Vivox.h"
6 #include "SharedString.hpp"
7 #include "VeLog.hpp"
8 #include "EqLog.h"
9 #include "VeUtil.hpp"
10 #include "Verify.hpp"
12 struct Eq2VivoxGlue
14 static void log( VivoxLogSeverity severity, const char* pattern, ... )
16 va_list valist;
17 va_start( valist, pattern );
18 unsigned uFlags = 0;
19 switch ( severity )
21 case VLS_CRITICAL: // Maps to error
22 case VLS_ERROR: uFlags = EqLog::ERR; break;
23 case VLS_INFO: uFlags = EqLog::INF; break;
24 case VLS_WARN: uFlags = EqLog::WRN; break;
26 VeLog::log_va( "VIVOX", uFlags, pattern, valist );
27 va_end( valist );
30 static uns64 getTimeMS()
32 return VeUtil::getGameTimeMilliseconds();
35 static void sleep( unsigned ms )
37 VeUtil::sleep( ms );
40 static void warning( const char* sFile, int iLine, const char* pattern, ... )
42 va_list valist;
43 va_start( valist, pattern );
44 char buffer[1024];
45 _vsnprintf( buffer, sizeof(buffer), pattern, valist );
46 buffer[sizeof(buffer) - 1] = '\0';
47 Verify( sFile, iLine ).alrt( buffer );
48 va_end( valist );
51 static void fatal( const char* sFile, int iLine, const char* pattern, ... )
53 va_list valist;
54 va_start( valist, pattern );
55 char buffer[1024];
56 _vsnprintf( buffer, sizeof(buffer), pattern, valist );
57 buffer[sizeof(buffer) - 1] = '\0';
58 Verify( sFile, iLine ).ver( false, buffer );
59 va_end( valist );
62 static const char* getGameName()
64 return "EverQuest2";
67 static int getLogLevel()
69 // From Eq2VivoxClient.cpp
70 extern int vivox_loglevel;
71 return vivox_loglevel;
75 typedef Vivox< CharString, Eq2VivoxGlue > Eq2Vivox;
77 #endif