Changeset 3bdaf18 in nscp


Ignore:
Timestamp:
04/16/11 22:51:04 (2 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
7ec3dd1
Parents:
d66ccee
Message:

Tweaks to building on linux, stil need to fix the utf8 issue and some modules...

Files:
41 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    rd66ccee r3bdaf18  
    441441  IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) 
    442442    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC"  ) 
    443     SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} -fPIC"  ) 
     443    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC"  ) 
    444444  ENDIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) 
    445445ENDIF(CMAKE_COMPILER_IS_GNUCXX) 
  • docs/CMakeLists.txt

    rd66ccee r3bdaf18  
    22 
    33MACRO(copy_single_file src destDir) 
    4   GET_FILENAME_COMPONENT(filename ${src} NAME) 
    5   STRING(REPLACE "." "" TARGET ${filename}) 
    6   STRING(REPLACE "/" "" TARGET ${TARGET}) 
    7   ADD_CUSTOM_COMMAND(OUTPUT ${destDir}/${src} 
     4  GET_FILENAME_COMPONENT(TARGET ${src} NAME) 
     5  SET(target_file ${CMAKE_BINARY_DIR}/${destDir}/${TARGET}) 
     6  ADD_CUSTOM_COMMAND(OUTPUT ${target_file} 
     7    DEPENDS ${src} 
    88    COMMAND cmake  
    9     ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${CMAKE_BINARY_DIR}/${destDir}/${src} 
    10     COMMENT Copying ${src} to ${CMAKE_BINARY_DIR}/${destDir}/${src} 
     9    ARGS -E copy ${src} ${target_file} 
     10    COMMENT Copying ${src} to ${target_file} 
    1111    ) 
    12   ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${CMAKE_BINARY_DIR}/${destDir}/${src}) 
    13   SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/doc") 
    14   INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${CMAKE_CURRENT_SOURCE_DIR}/${src})") 
     12  #ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${src}) 
     13  #SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/scripts") 
     14  INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${src})") 
    1515ENDMACRO(copy_single_file) 
    1616 
  • files/CMakeLists.txt

    rd66ccee r3bdaf18  
    22 
    33MACRO(copy_single_file src destDir) 
    4   GET_FILENAME_COMPONENT(filename ${src} NAME) 
    5   STRING(REPLACE "." "" TARGET ${filename}) 
    6   STRING(REPLACE "/" "" TARGET ${TARGET}) 
    7   ADD_CUSTOM_COMMAND(OUTPUT ${destDir}/${src} 
     4  GET_FILENAME_COMPONENT(TARGET ${src} NAME) 
     5  SET(target_file ${CMAKE_BINARY_DIR}/${destDir}/${TARGET}) 
     6  ADD_CUSTOM_COMMAND(OUTPUT ${target_file} 
     7    DEPENDS ${src} 
    88    COMMAND cmake  
    9     ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${CMAKE_BINARY_DIR}/${destDir}/${src} 
    10     COMMENT Copying ${src} to ${CMAKE_BINARY_DIR}/${destDir}/${src} 
     9    ARGS -E copy ${src} ${target_file} 
     10    COMMENT Copying ${src} to ${target_file} 
    1111    ) 
    12   ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${CMAKE_BINARY_DIR}/${destDir}/${src}) 
    13   SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/files") 
    14   INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${CMAKE_CURRENT_SOURCE_DIR}/${src})") 
     12  #ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${src}) 
     13  #SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/scripts") 
     14  INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${src})") 
    1515ENDMACRO(copy_single_file) 
    1616 
     
    1919copy_single_file(old-settings.map .) 
    2020copy_single_file(counters.defs .) 
    21 copy_single_file(../changelog .) 
     21#copy_single_file(../changelog .) 
  • helpers/installer-dlls/main_dll/installer_helper.hpp

    rb7d17f8 r3bdaf18  
    3030 
    3131  std::wstring getTargetPath(std::wstring path) { 
    32     TCHAR tmpBuf[MAX_PATH]; 
     32    wchar_t tmpBuf[MAX_PATH]; 
    3333    DWORD len = 0; 
    3434    if (MsiGetTargetPath(hInstall_ ,path.c_str(), tmpBuf, &len) != ERROR_MORE_DATA) 
     
    5757  } 
    5858  std::wstring getPropery(std::wstring path) { 
    59     TCHAR tmpBuf[MAX_PATH]; 
     59    wchar_t tmpBuf[MAX_PATH]; 
    6060    DWORD len = 0; 
    6161    if (MsiGetProperty(hInstall_ ,path.c_str(), tmpBuf, &len) != ERROR_MORE_DATA) 
     
    7070  } 
    7171  char_buffer getProperyRAW(std::wstring path) { 
    72     TCHAR emptyString[MAX_PATH]; 
     72    wchar_t emptyString[MAX_PATH]; 
    7373    DWORD len = 0; 
    7474    UINT er; 
     
    571571      return used_size() > size; 
    572572    } 
    573     operator const TCHAR* () const { 
     573    operator const wchar_t* () const { 
    574574      return buf_.c_str(); 
    575575    } 
     
    628628    DWORD id = 0; 
    629629    std::list<std::wstring> ret; 
    630     for (int i=0; ::MsiEnumProducts(i, reinterpret_cast<TCHAR*>(&buffer)) == ERROR_SUCCESS; i++) { 
     630    for (int i=0; ::MsiEnumProducts(i, reinterpret_cast<wchar_t*>(&buffer)) == ERROR_SUCCESS; i++) { 
    631631      std::wstring name = getProductName(buffer); 
    632632      ret.push_back(buffer); 
     
    638638    MsiGetProductInfo(code.c_str(), INSTALLPROPERTY_INSTALLEDPRODUCTNAME, NULL, &size); 
    639639    size++; 
    640     TCHAR *buffer = new TCHAR[size+4]; 
     640    wchar_t *buffer = new wchar_t[size+4]; 
    641641    MsiGetProductInfo(code.c_str(), INSTALLPROPERTY_INSTALLEDPRODUCTNAME, buffer, &size); 
    642642    std::wstring ret = buffer; 
  • helpers/installer-dlls/main_dll/main_dll.cpp

    rd66ccee r3bdaf18  
    385385        h.errorMessage(_T("Found old NSClient++/OP5 client installed, will uninstall it now!")); 
    386386        std::wstring command = _T("msiexec /uninstall ") + (*cit); 
    387         TCHAR *cmd = new TCHAR[command.length()+1]; 
     387        wchar_t *cmd = new wchar_t[command.length()+1]; 
    388388        wcsncpy(cmd, command.c_str(), command.length()); 
    389389        cmd[command.length()] = 0; 
  • helpers/settings_manager/CMakeLists.txt

    rd66ccee r3bdaf18  
    2323    ${NSCP_INCLUDEDIR}/charEx.h 
    2424    ${NSCP_INCLUDEDIR}/config.h 
    25     ${NSCP_INCLUDEDIR}/msvc_wrappers.h 
    2625    ${NSCP_INCLUDEDIR}/settings/macros.h 
    2726    ${NSCP_INCLUDEDIR}/settings/settings_ini.hpp 
  • include/Singleton.h

    rdc65e35 r3bdaf18  
    3737  static void destroyInstance() { 
    3838    delete pObject; 
    39     pObject = NULL; 
     39    pObject = 0; 
    4040  } 
    4141}; 
    4242 
    4343template <class T>  
    44 T* Singleton<T>::pObject = NULL; 
     44T* Singleton<T>::pObject = 0; 
    4545 
  • include/dll/impl_unix.hpp

    rc015acc r3bdaf18  
    1515#include <dl.h> 
    1616#endif 
     17 
     18#undef BOOST_FILESYSTEM_NO_DEPRECATED 
     19#include <boost/filesystem.hpp> 
    1720 
    1821namespace dll { 
  • include/nscapi/functions.hpp

    rc391984 r3bdaf18  
    4343namespace nscapi { 
    4444 
     45/* 
     46  class nscapi_exception : public exception { 
     47    std::string what_; 
     48  public: 
     49    nscapi_exception() {} 
     50    nscapi_exception(std::string what) : what_(what) {} 
     51    virtual const char* what() const throw() { 
     52      return what_; 
     53    } 
     54  }; 
     55*/ 
    4556  class functions { 
    4657  public: 
     
    7586 
    7687      if (request_message.payload_size() != 1) { 
    77         throw exception("Whoops, invalid payload size (for now)"); 
     88        throw nscapi_exception(_T("Whoops, invalid payload size (for now)")); 
    7889      } 
    7990      ::PluginCommand::Request payload = request_message.payload().Get(0); 
  • include/nscapi/nscapi_core_wrapper.cpp

    rd66ccee r3bdaf18  
    3232 
    3333#include "../libs/protobuf/plugin.proto.h" 
     34#include "../libs/protobuf/log.proto.h" 
    3435 
    3536using namespace nscp::helpers; 
     
    6768    if ((msgType == NSCAPI::debug) && (!logDebug())) 
    6869      return; 
    69     LogMessage::Message_Level msgType = ::LogMessage::Message_Level::Message_Level_LOG_WARNING; 
     70    LogMessage::Message_Level msgType = ::LogMessage::Message_Level_LOG_WARNING; 
    7071    if (msgType == NSCAPI::warning) 
    71       msgType = ::LogMessage::Message_Level::Message_Level_LOG_WARNING; 
     72      msgType = ::LogMessage::Message_Level_LOG_WARNING; 
    7273    std::string str; 
    7374    try { 
  • include/service/unix_service.hpp

    r64d42de r3bdaf18  
    2929 
    3030namespace service_helper_impl { 
     31  class service_exception { 
     32    std::wstring what_; 
     33  public: 
     34    service_exception(std::wstring what) : what_(what) { 
     35      std::wcout << _T("ERROR:") <<  what; 
     36    } 
     37    std::wstring what() { 
     38      return what_; 
     39    } 
     40  }; 
    3141  /** 
    3242  * @ingroup NSClient++ 
     
    6070 
    6171  public: 
    62     unix_service(std::wstring name) { 
     72    unix_service() { 
    6373    } 
    6474    virtual ~unix_service() { 
     
    7787      TBase::get_global_instance()->stop_service(); 
    7888    } 
    79     void start_and_wait() { 
     89/** start */ 
     90    void start_and_wait(std::wstring name) { 
    8091      is_running_ = true; 
    8192 
     
    8596        handle_error(__LINE__, __FILEW__, _T("Failed to hook SIGTERM!")); 
    8697 
    87       TBase::handle_startup(); 
     98      TBase::handle_startup(_T("TODO")); 
    8899 
    89100      print_debug(_T("Service started waiting for termination event...")); 
     
    95106 
    96107      print_debug(_T("Shutting down...")); 
    97       TBase::handle_shutdown(); 
     108      TBase::handle_shutdown(_T("TODO")); 
    98109      print_debug(_T("Shutting down (down)...")); 
    99110    } 
  • include/service/win32_service.hpp

    r2d69ab6 r3bdaf18  
    130130    } 
    131131 
     132/** start */ 
    132133    void start_and_wait(std::wstring name) { 
    133134      name_ = name; 
  • include/settings/client/settings_client.cpp

    rc760fc9 r3bdaf18  
    1 #pragma once 
    21 
    32#include <settings/client/settings_client.hpp> 
  • include/strEx.h

    rd66ccee r3bdaf18  
    236236 
    237237   
    238   static const __int64 SECS_BETWEEN_EPOCHS = 11644473600; 
    239   static const __int64 SECS_TO_100NS = 10000000; 
     238  static const long long SECS_BETWEEN_EPOCHS = 11644473600; 
     239  static const long long SECS_TO_100NS = 10000000; 
    240240  inline unsigned long long filetime_to_time(unsigned long long filetime) { 
    241241    return (filetime - (SECS_BETWEEN_EPOCHS * SECS_TO_100NS)) / SECS_TO_100NS; 
     
    841841  template<> 
    842842  inline std::string cvt(std::wstring const & str) { 
     843#ifdef WIN32 
    843844    // figure out how many narrow characters we are going to get  
    844845    int nChars = WideCharToMultiByte(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()), NULL, 0, NULL, NULL); 
     
    851852    buf.resize(nChars); 
    852853    WideCharToMultiByte(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()), const_cast<char*>(buf.c_str()), nChars, NULL, NULL); 
    853     return buf ;  
     854    return buf; 
     855#endif 
    854856  } 
    855857 
    856858  template<> 
    857859  inline std::wstring cvt(std::string const & str) { 
     860#ifdef WIN32 
    858861    // figure out how many wide characters we are going to get  
    859862    int nChars = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()), NULL, 0); 
     
    867870    MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()), const_cast<wchar_t*>(buf.c_str()), nChars); 
    868871    return buf; 
     872#endif 
    869873  } 
    870874} 
  • libs/plugin_api/CMakeLists.txt

    rd66ccee r3bdaf18  
    3737ADD_DEFINITIONS(${NSCP_GLOBAL_DEFINES}) 
    3838 
    39 add_library (${TARGET} ${SRCS}) 
    40  
     39add_library(${TARGET} ${SRCS}) 
    4140target_link_libraries(${TARGET} protobuf) 
    4241ADD_DEPENDENCIES(${TARGET} protobuf) 
    4342 
    4443SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "libraries") 
     44IF(CMAKE_COMPILER_IS_GNUCXX) 
     45  IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) 
     46    SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS -fPIC) 
     47  ENDIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) 
     48ENDIF(CMAKE_COMPILER_IS_GNUCXX) 
  • libs/protobuf/CMakeLists.txt

    rd66ccee r3bdaf18  
    2020  ${PROTOBUF_LIBRARY} 
    2121) 
     22IF(CMAKE_COMPILER_IS_GNUCXX) 
     23  IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) 
     24    SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS -fPIC) 
     25  ENDIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) 
     26ENDIF(CMAKE_COMPILER_IS_GNUCXX) 
  • modules/CheckHelpers/CheckHelpers.h

    r7443b58 r3bdaf18  
    5353  NSCAPI::nagiosReturn checkMultiple(const std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    5454  NSCAPI::nagiosReturn checkSimpleStatus(NSCAPI::nagiosReturn status, const std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    55   NSCAPI::nagiosReturn checkSimpleStatus(NSCAPI::nagiosReturn status, const unsigned int argLen, TCHAR **char_args, std::wstring &msg, std::wstring &perf); 
     55  NSCAPI::nagiosReturn checkSimpleStatus(NSCAPI::nagiosReturn status, const unsigned int argLen, wchar_t **char_args, std::wstring &msg, std::wstring &perf); 
    5656  NSCAPI::nagiosReturn timeout(std::list<std::wstring> arguments, std::wstring &msg, std::wstring &perf); 
    5757  NSCAPI::nagiosReturn negate(std::list<std::wstring> arguments, std::wstring &msg, std::wstring &perf); 
  • modules/CheckSystem/CheckSystem.cpp

    rd66ccee r3bdaf18  
    184184} 
    185185 
    186 int CheckSystem::commandLineExec(const TCHAR* command,const unsigned int argLen,TCHAR** args) { 
     186int CheckSystem::commandLineExec(const wchar_t* command,const unsigned int argLen,wchar_t** args) { 
    187187  if (command == NULL) { 
    188188    std::wcerr << _T("Usage: ... CheckSystem <command>") << std::endl; 
  • modules/CheckSystem/CheckSystem.h

    r7443b58 r3bdaf18  
    7777  bool hasMessageHandler(); 
    7878  NSCAPI::nagiosReturn handleCommand(const std::wstring command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    79   int commandLineExec(const TCHAR* command,const unsigned int argLen,TCHAR** args); 
     79  int commandLineExec(const wchar_t* command,const unsigned int argLen,wchar_t** args); 
    8080 
    8181  NSCAPI::nagiosReturn checkCPU(std::list<std::wstring> arguments, std::wstring &msg, std::wstring &perf); 
  • modules/CheckTaskSched/CheckTaskSched.cpp

    rd66ccee r3bdaf18  
    148148  return NSCAPI::returnIgnored; 
    149149} 
    150 int CheckTaskSched::commandLineExec(const TCHAR* command, const unsigned int argLen, TCHAR** char_args) { 
     150int CheckTaskSched::commandLineExec(const wchar_t* command, const unsigned int argLen, wchar_t** char_args) { 
    151151//  std::wstring query = command; 
    152152//  query += _T(" ") + arrayBuffer::arrayBuffer2string(char_args, argLen, _T(" ")); 
  • modules/CheckTaskSched/CheckTaskSched.h

    r7443b58 r3bdaf18  
    5252  bool hasMessageHandler(); 
    5353  NSCAPI::nagiosReturn handleCommand(const std::wstring command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    54   int CheckTaskSched::commandLineExec(const TCHAR* command,const unsigned int argLen,TCHAR** args); 
     54  int CheckTaskSched::commandLineExec(const wchar_t* command,const unsigned int argLen,wchar_t** args); 
    5555 
    5656  // Check commands 
  • modules/CheckTaskSched2/CheckTaskSched2.cpp

    rd66ccee r3bdaf18  
    148148  return NSCAPI::returnIgnored; 
    149149} 
    150 int CheckTaskSched2::commandLineExec(const TCHAR* command, const unsigned int argLen, TCHAR** char_args) { 
     150int CheckTaskSched2::commandLineExec(const wchar_t* command, const unsigned int argLen, wchar_t** char_args) { 
    151151//  std::wstring query = command; 
    152152//  query += _T(" ") + arrayBuffer::arrayBuffer2string(char_args, argLen, _T(" ")); 
  • modules/CheckTaskSched2/CheckTaskSched2.h

    r7443b58 r3bdaf18  
    5252  bool hasMessageHandler(); 
    5353  NSCAPI::nagiosReturn handleCommand(const std::wstring command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    54   int commandLineExec(const TCHAR* command,const unsigned int argLen,TCHAR** args); 
     54  int commandLineExec(const wchar_t* command,const unsigned int argLen,wchar_t** args); 
    5555 
    5656  // Check commands 
  • modules/CheckWMI/CheckWMI.cpp

    rd66ccee r3bdaf18  
    274274  return NSCAPI::returnIgnored; 
    275275} 
    276 int CheckWMI::commandLineExec(const TCHAR* command, const unsigned int argLen, TCHAR** char_args) { 
     276int CheckWMI::commandLineExec(const wchar_t* command, const unsigned int argLen, wchar_t** char_args) { 
    277277  //WMIQuery wmiQuery; 
    278278  std::wstring query = command; 
  • modules/CheckWMI/CheckWMI.h

    r7443b58 r3bdaf18  
    5151  bool hasMessageHandler(); 
    5252  NSCAPI::nagiosReturn handleCommand(const std::wstring command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    53   int CheckWMI::commandLineExec(const TCHAR* command,const unsigned int argLen,TCHAR** args); 
     53  int CheckWMI::commandLineExec(const wchar_t* command,const unsigned int argLen,wchar_t** args); 
    5454 
    5555  // Check commands 
  • modules/CheckWMI/WMIQuery.cpp

    r1fc246c r3bdaf18  
    2727 
    2828std::wstring WMIQuery::sanitize_string(LPTSTR in) { 
    29   TCHAR *p = in; 
     29  wchar_t *p = in; 
    3030  while (*p) { 
    3131    if (p[0] < ' ' || p[0] > '}') 
  • modules/FileLogger/FileLogger.cpp

    rd66ccee r3bdaf18  
    6969#ifdef WIN32 
    7070    if (key == _T("local-app-data")) { 
    71       TCHAR buf[MAX_PATH+1]; 
     71      wchar_t buf[MAX_PATH+1]; 
    7272      _SHGetSpecialFolderPath(NULL, buf, CSIDL_COMMON_APPDATA, FALSE); 
    7373      return buf; 
  • modules/FileLogger/FileLogger.h

    rd66ccee r3bdaf18  
    5858  bool hasMessageHandler(); 
    5959  void handleMessage(int msgType, const std::string file, int line, std::string message); 
    60   int handleCommand(TCHAR* command, TCHAR **argument, TCHAR *returnBuffer, int returnBufferLen); 
     60  int handleCommand(wchar_t* command, wchar_t **argument, wchar_t *returnBuffer, int returnBufferLen); 
    6161  //void writeEntry(std::wstring line); 
    6262 
  • modules/LUAScript/LUAScript.h

    r7443b58 r3bdaf18  
    7373  bool loadScript(const std::wstring script); 
    7474  NSCAPI::nagiosReturn handleCommand(const std::wstring command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    75   //NSCAPI::nagiosReturn RunLUA(const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf); 
     75  //NSCAPI::nagiosReturn RunLUA(const unsigned int argLen, wchar_t **char_args, std::wstring &message, std::wstring &perf); 
    7676  //NSCAPI::nagiosReturn extract_return(Lua_State &L, int arg_count,  std::wstring &message, std::wstring &perf); 
    7777 
  • modules/NRPEClient/NRPEClient.cpp

    rd66ccee r3bdaf18  
    181181} 
    182182 
    183 int NRPEClient::commandLineExec(const unsigned int argLen, TCHAR** args) { 
     183int NRPEClient::commandLineExec(const unsigned int argLen, wchar_t** args) { 
    184184  try { 
    185185 
  • modules/NRPEClient/NRPEClient.h

    r7443b58 r3bdaf18  
    123123  bool hasMessageHandler(); 
    124124  NSCAPI::nagiosReturn handleCommand(const std::wstring command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    125   int commandLineExec(const unsigned int argLen,TCHAR** args); 
     125  int commandLineExec(const unsigned int argLen,wchar_t** args); 
    126126  std::wstring getConfigurationMeta(); 
    127127 
  • modules/NRPEServer/NRPEServer.h

    r5e12ba6 r3bdaf18  
    6666  bool hasCommandHandler(); 
    6767  bool hasMessageHandler(); 
    68   NSCAPI::nagiosReturn handleCommand(const strEx::blindstr command, const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf); 
     68  NSCAPI::nagiosReturn handleCommand(const strEx::blindstr command, const unsigned int argLen, wchar_t **char_args, std::wstring &message, std::wstring &perf); 
    6969  std::wstring getConfigurationMeta(); 
    7070  boost::shared_ptr<nrpe::server::server> server_; 
  • modules/NSCAAgent/NSCAThread.cpp

    r5735dda r3bdaf18  
    104104  } 
    105105  if (hostname_.empty()) { 
    106     TCHAR *buf = new TCHAR[MAX_COMPUTERNAME_LENGTH + 2]; 
     106    wchar_t *buf = new wchar_t[MAX_COMPUTERNAME_LENGTH + 2]; 
    107107    DWORD size = MAX_COMPUTERNAME_LENGTH+1; 
    108108    if (!GetComputerName(buf, &size)) { 
  • modules/NSCAAgent/stdafx.h

    rcad08fb r3bdaf18  
    2525 
    2626#include <iostream> 
    27 //#include <tchar.h> 
    2827#include <string> 
    2928#include <hash_map> 
  • scripts/CMakeLists.txt

    rd66ccee r3bdaf18  
    33 
    44MACRO(copy_single_file src destDir) 
    5   GET_FILENAME_COMPONENT(filename ${src} NAME) 
    6   STRING(REPLACE "." "" TARGET ${filename}) 
    7   STRING(REPLACE "/" "" TARGET ${TARGET}) 
    8   ADD_CUSTOM_COMMAND(OUTPUT ${destDir}/${src} 
     5  GET_FILENAME_COMPONENT(TARGET ${src} NAME) 
     6  SET(target_file ${CMAKE_BINARY_DIR}/${destDir}/${TARGET}) 
     7  ADD_CUSTOM_COMMAND(OUTPUT ${target_file} 
     8    DEPENDS ${src} 
    99    COMMAND cmake  
    10     ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${CMAKE_BINARY_DIR}/${destDir}/${src} 
    11     COMMENT Copying ${src} to ${CMAKE_BINARY_DIR}/${destDir}/${src} 
     10    ARGS -E copy ${src} ${target_file} 
     11    COMMENT Copying ${src} to ${target_file} 
    1212    ) 
    13   ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${CMAKE_BINARY_DIR}/${destDir}/${src}) 
    14   SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/scripts") 
    15   INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${CMAKE_CURRENT_SOURCE_DIR}/${src})") 
     13  #ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${src}) 
     14  #SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/scripts") 
     15  INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${src})") 
    1616ENDMACRO(copy_single_file) 
    17  
    1817 
    1918FILE (GLOB scripts_BAT "*.bat") 
  • service/CMakeLists.txt

    rd66ccee r3bdaf18  
    5757    ${NSCP_INCLUDEDIR}/charEx.h 
    5858    ${NSCP_INCLUDEDIR}/config.h 
    59     ${NSCP_INCLUDEDIR}/msvc_wrappers.h 
    6059    ${NSCP_INCLUDEDIR}/com_helpers.hpp 
    6160    ${NSCP_INCLUDEDIR}/dll/dll.hpp 
  • service/NSClient++.h

    r2d69ab6 r3bdaf18  
    9696  //boost::shared_mutex m_mutexRWcmdDescriptions; 
    9797  //cmdMap cmdDescriptions_; 
    98   typedef enum log_status {log_unknown, log_looking, log_debug, log_nodebug }; 
     98  enum log_status {log_unknown, log_looking, log_debug, log_nodebug }; 
    9999  log_status debug_; 
    100100  std::wstring context_; 
  • service/cli_parser.hpp

    r2d69ab6 r3bdaf18  
    213213      } 
    214214 
    215       std::wstringstream ss; 
    216       ss << _T("run: ") << vm.count("run"); 
    217       ss << _T(", name: ") << vm.count("name"); 
    218       ss << _T(", info: ") << vm.count("info"); 
    219  
    220       std::wstring s = ss.str(); 
    221       OutputDebugString(s.c_str()); 
    222       std::wcout << s << std::endl; 
    223  
    224215      if (vm.count("run")) { 
    225216        try { 
  • service/logger.hpp

    rc391984 r3bdaf18  
    218218#else 
    219219        if (!console_log_) 
    220           std::wcout << _T("BROKEN MESSAGE: ") << message << std::endl; 
     220          std::cout << "BROKEN MESSAGE: " << message << std::endl; 
    221221#endif 
    222222      } 
     
    281281 
    282282      void log(std::string data) { 
    283         OutputDebugString(strEx::string_to_wstring(strEx::strip_hex(data)).c_str()); 
    284283        if (!mq_) { 
    285284          log_fatal_error("Failed to send to logging queue: " + data); 
  • service/service_manager.hpp

    r2d69ab6 r3bdaf18  
    9595    class service_manager { 
    9696    public: 
    97       service_manager(int argc, wchar_t* argv[]) {} 
     97      service_manager(std::wstring service_name) {} 
    9898      int unsupported() { 
    9999        std::wcout << _T("Service management is not supported on non Windows operating systems...") << std::endl; 
    100100        return -1; 
    101101      } 
    102       int install() { 
     102      int install(std::wstring service_description) { 
    103103        return unsupported(); 
    104104      } 
  • tools/error_reporter/reporter.cpp

    r87cf3c4 r3bdaf18  
    1919int restart(std::wstring service); 
    2020 
    21 int _tmain(int argc, _TCHAR* argv[]) { 
     21int _tmain(int argc, wchar_t* argv[]) { 
    2222  if (argc > 1) { 
    2323    if (wcsicmp(argv[1], _T("restart"))==0 && argc > 2) { 
Note: See TracChangeset for help on using the changeset viewer.