Changeset 367bf20 in nscp for modules/LUAScript


Ignore:
Timestamp:
04/03/08 19:47:01 (5 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
9567d4b, eb30340
Parents:
b7ed6ac
Message:

2008-04-03 MickeM

  • Moved COM init to "core" (from WMI module) + Added new Check command: CheckTaskSched Use like so:

CheckTaskSched +filter-exit-code==1 ShowAll MaxWarn=1 MaxCrit=1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/LUAScript/script_wrapper.hpp

    rb7ed6ac r367bf20  
    5757  } 
    5858  std::wstring extract_string(lua_State *L) { 
    59     return strEx::string_to_wstring(lua_tostring( L, lua_gettop( L ) )); 
     59    int top = lua_gettop(L); 
     60    if (lua_isstring(L, top)) 
     61      return strEx::string_to_wstring(lua_tostring( L, lua_gettop( L ) )); 
     62    return _T("<NOT_A_STRING>"); 
    6063  } 
    6164  std::wstring pop_string(lua_State *L) { 
    62     std::wstring ret = strEx::string_to_wstring(lua_tostring( L, lua_gettop( L ) )); 
     65    std::wstring ret; 
     66    int top = lua_gettop(L); 
     67    if (lua_isstring(L, top)) 
     68      ret = strEx::string_to_wstring(lua_tostring( L, top)); 
     69    else if (lua_isnil(L, top)) 
     70      ret = _T("<NIL>"); 
     71    else if (lua_istable(L, top)) 
     72      ret = _T("<TABLE>"); 
     73    else if (lua_isnumber(L, top)) 
     74      ret = _T("<NUMBER>"); 
     75    else if (lua_iscfunction(L, top)) 
     76      ret = _T("<C-FUNCTION>"); 
     77    else 
     78      ret = _T("<UNKNOWN>"); 
    6379    lua_pop(L, 1); 
    6480    return ret; 
Note: See TracChangeset for help on using the changeset viewer.