• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IOLOG_ERROR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IOLOG_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ IOLOG_ERROR函数的具体用法?C++ IOLOG_ERROR怎么用?C++ IOLOG_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IOLOG_ERROR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: addMatchingNotification

// ======================================================================
bool
org_pqrs_driver_Karabiner::initialize_notification(void)
{
  notifier_hookKeyboard_ = addMatchingNotification(gIOMatchedNotification,
                                                   serviceMatching("IOHIKeyboard"),
                                                   org_pqrs_Karabiner::Core::IOHIKeyboard_gIOMatchedNotification_callback,
                                                   this, NULL, 0);
  if (notifier_hookKeyboard_ == NULL) {
    IOLOG_ERROR("initialize_notification notifier_hookKeyboard_ == NULL\n");
    return false;
  }

  notifier_unhookKeyboard_ = addMatchingNotification(gIOTerminatedNotification,
                                                     serviceMatching("IOHIKeyboard"),
                                                     org_pqrs_Karabiner::Core::IOHIKeyboard_gIOTerminatedNotification_callback,
                                                     this, NULL, 0);
  if (notifier_unhookKeyboard_ == NULL) {
    IOLOG_ERROR("initialize_notification notifier_unhookKeyboard_ == NULL\n");
    return false;
  }

  // ----------------------------------------
  notifier_hookPointing_ = addMatchingNotification(gIOMatchedNotification,
                                                   serviceMatching("IOHIPointing"),
                                                   org_pqrs_Karabiner::Core::IOHIPointing_gIOMatchedNotification_callback,
                                                   this, NULL, 0);
  if (notifier_hookPointing_ == NULL) {
    IOLOG_ERROR("initialize_notification notifier_hookPointing_ == NULL\n");
    return false;
  }

  notifier_unhookPointing_ = addMatchingNotification(gIOTerminatedNotification,
                                                     serviceMatching("IOHIPointing"),
                                                     org_pqrs_Karabiner::Core::IOHIPointing_gIOTerminatedNotification_callback,
                                                     this, NULL, 0);
  if (notifier_unhookPointing_ == NULL) {
    IOLOG_ERROR("initialize_notification notifier_unhookPointing_ == NULL\n");
    return false;
  }

  return true;
}
开发者ID:Brijen,项目名称:Karabiner,代码行数:43,代码来源:Driver.cpp


示例2: IOLOG_ERROR

void Config::set_essential_config(const int32_t* newvalues, size_t num) {
  if (num != BRIDGE_ESSENTIAL_CONFIG_INDEX__END__) {
    IOLOG_ERROR("Config::set_essential_config wrong 'num' parameter. (%d)\n", static_cast<int>(num));
    load_essential_config_default();

  } else {
    for (int i = 0; i < BRIDGE_ESSENTIAL_CONFIG_INDEX__END__; ++i) {
      essential_config_[i] = newvalues[i];
    }
  }
}
开发者ID:11liju,项目名称:Karabiner,代码行数:11,代码来源:Config.cpp


示例3: switch

    void
    DropScrollWheel::add(unsigned int datatype, unsigned int newval)
    {
      switch (datatype) {
        case BRIDGE_DATATYPE_OPTION:
        {
          Option option(newval);
          if (Option::DROPSCROLLWHEEL_DROP_HORIZONTAL_SCROLL == option) {
            dropHorizontalScroll_ = true;
          } else {
            IOLOG_ERROR("DropScrollWheel::add unknown option:%d\n", newval);
          }
          break;
        }

        default:
          IOLOG_ERROR("DropScrollWheel::add invalid datatype:%d\n", datatype);
          break;
      }
    }
开发者ID:Maseli,项目名称:KeyRemap4MacBook,代码行数:20,代码来源:DropScrollWheel.cpp


示例4: switch

    void
    DropScrollWheel::add(AddDataType datatype, AddValue newval)
    {
      switch (datatype) {
        case BRIDGE_DATATYPE_OPTION:
        {
          Option option(newval);
          if (Option::DROPSCROLLWHEEL_DROP_HORIZONTAL_SCROLL == option) {
            dropHorizontalScroll_ = true;
          } else {
            IOLOG_ERROR("DropScrollWheel::add unknown option:%u\n", static_cast<unsigned int>(newval));
          }
          break;
        }

        default:
          IOLOG_ERROR("DropScrollWheel::add invalid datatype:%u\n", static_cast<unsigned int>(datatype));
          break;
      }
    }
开发者ID:MOODOO-SH,项目名称:KeyRemap4MacBook,代码行数:20,代码来源:DropScrollWheel.cpp


示例5: FromEvent

 FromEvent(AddDataType datatype, AddValue v) : isPressing_(false) {
   switch (datatype) {
     case BRIDGE_DATATYPE_KEYCODE:         type_ = Type::KEY;             key_      = KeyCode(v);         break;
     case BRIDGE_DATATYPE_CONSUMERKEYCODE: type_ = Type::CONSUMER_KEY;    consumer_ = ConsumerKeyCode(v); break;
     case BRIDGE_DATATYPE_POINTINGBUTTON:  type_ = Type::POINTING_BUTTON; button_   = PointingButton(v);  break;
     default:
       IOLOG_ERROR("Unknown datatype: %u\n", static_cast<unsigned int>(datatype));
       type_ = Type::NONE;
       break;
   }
 }
开发者ID:kurobeniq,项目名称:KeyRemap4MacBook,代码行数:11,代码来源:FromEvent.hpp


示例6: IOLOG_ERROR

  bool
  Config::set_essential_config_one(uint32_t index, int32_t value)
  {
    if (index >= BRIDGE_ESSENTIAL_CONFIG_INDEX__END__) {
      IOLOG_ERROR("Config::set_essential_config_one wrong 'index' parameter. (%d)\n", static_cast<int>(index));
      return false;
    }

    essential_config_[index] = value;
    return true;
  }
开发者ID:MOODOO-SH,项目名称:KeyRemap4MacBook,代码行数:11,代码来源:Config.cpp


示例7: ToEvent

 ToEvent(unsigned int datatype, unsigned int v) {
   switch (datatype) {
     case BRIDGE_DATATYPE_KEYCODE:         type_ = Type::KEY;             key_      = KeyCode(v);         break;
     case BRIDGE_DATATYPE_CONSUMERKEYCODE: type_ = Type::CONSUMER_KEY;    consumer_ = ConsumerKeyCode(v); break;
     case BRIDGE_DATATYPE_POINTINGBUTTON:  type_ = Type::POINTING_BUTTON; button_   = PointingButton(v);  break;
     default:
       IOLOG_ERROR("Unknown datatype: %d\n", datatype);
       type_ = Type::NONE;
       break;
   }
 }
开发者ID:MOODOO-SH,项目名称:KeyRemap4MacBook,代码行数:11,代码来源:ToEvent.hpp


示例8: IOLOG_ERROR

IOReturn
org_pqrs_driver_KeyRemap4MacBook_UserClient_kext::callback_open(void)
{
  if (provider_ == NULL || isInactive()) {
    // Return an error if we don't have a provider. This could happen if the user process
    // called callback_open without calling IOServiceOpen first. Or, the user client could be
    // in the process of being terminated and is thus inactive.
    IOLOG_ERROR("UserClient_kext::callback_open kIOReturnNotAttached\n");
    return kIOReturnNotAttached;
  }

  if (! provider_->open(this)) {
    // The most common reason this open call will fail is because the provider is already open
    // and it doesn't support being opened by more than one client at a time.
    IOLOG_ERROR("UserClient_kext::callback_open kIOReturnExclusiveAccess\n");
    return kIOReturnExclusiveAccess;
  }

  return kIOReturnSuccess;
}
开发者ID:Haccci,项目名称:KeyRemap4MacBook,代码行数:20,代码来源:UserClient_kext.cpp


示例9: IOLOG_ERROR

// ============================================================
// initWithTask is called as a result of the user process calling IOServiceOpen.
bool USERCLIENT_KEXT_CLASSNAME::initWithTask(task_t owningTask, void* securityToken, UInt32 type) {
  if (clientHasPrivilege(owningTask, kIOClientPrivilegeLocalUser) != KERN_SUCCESS) {
    IOLOG_ERROR("UserClient_kext::initWithTask clientHasPrivilege failed\n");
    return false;
  }

  if (!super::initWithTask(owningTask, securityToken, type)) {
    IOLOG_ERROR("UserClient_kext::initWithTask super::initWithTask failed\n");
    return false;
  }

  provider_ = nullptr;

  // Don't change static values here. (For example, notification_enabled_)
  // initWithTask is called by each IOServiceOpen.
  //
  // If IOService is opened, other client will be failed.
  // Changing static values by other IOServiceOpen may destroy the current connection.

  return true;
}
开发者ID:bsingr,项目名称:Seil,代码行数:23,代码来源:UserClient_kext.cpp


示例10: switch

    void
    FlipScrollWheel::add(unsigned int datatype, unsigned int newval)
    {
      switch (datatype) {
        case BRIDGE_DATATYPE_OPTION:
        {
          /*  */ if (Option::FLIPSCROLLWHEEL_HORIZONTAL == newval) {
            flipHorizontalScroll_ = true;
          } else if (Option::FLIPSCROLLWHEEL_VERTICAL == newval) {
            flipVerticalScroll_ = true;
          } else {
            IOLOG_ERROR("FlipScrollWheel::add unknown option:%d\n", newval);
          }
          break;
        }

        default:
          IOLOG_ERROR("FlipScrollWheel::add invalid datatype:%d\n", datatype);
          break;
      }
    }
开发者ID:Bilalh,项目名称:KeyRemap4MacBook,代码行数:21,代码来源:FlipScrollWheel.cpp


示例11: IOLOG_ERROR

  void
  RemapClass::Item::append_filter(const unsigned int* vec, size_t length)
  {
    // ------------------------------------------------------------
    // check parameters.
    //
    if (! vec || length <= 0) {
      IOLOG_ERROR("RemapClass::Item::append_filter invalid parameter.\n");
      return;
    }

    // ------------------------------------------------------------
    // append to filters_.
    //
    RemapFilter::FilterUnion* newp = new RemapFilter::FilterUnion(vec, length);
    if (! newp) {
      IOLOG_ERROR("RemapClass::Item::append_filter failed to allocate.\n");
      return;
    }

    filters_.push_back(newp);
  }
开发者ID:JanBe,项目名称:KeyRemap4MacBook,代码行数:22,代码来源:RemapClass.cpp


示例12: switch

    void
    FlipPointingRelative::add(AddDataType datatype, AddValue newval)
    {
      switch (datatype) {
        case BRIDGE_DATATYPE_OPTION:
        {
          Option option(newval);
          /*  */ if (Option::FLIPPOINTINGRELATIVE_HORIZONTAL == option) {
            flipHorizontal_ = true;
          } else if (Option::FLIPPOINTINGRELATIVE_VERTICAL == option) {
            flipVertical_ = true;
          } else {
            IOLOG_ERROR("FlipPointingRelative::add unknown option:%u\n", static_cast<unsigned int>(newval));
          }
          break;
        }

        default:
          IOLOG_ERROR("FlipPointingRelative::add invalid datatype:%u\n", static_cast<unsigned int>(datatype));
          break;
      }
    }
开发者ID:MOODOO-SH,项目名称:KeyRemap4MacBook,代码行数:22,代码来源:FlipPointingRelative.cpp


示例13: switch

    void
    FlipScrollWheel::add(AddDataType datatype, AddValue newval)
    {
      switch (datatype) {
        case BRIDGE_DATATYPE_OPTION:
        {
          Option option(newval);
          /*  */ if (Option::FLIPSCROLLWHEEL_HORIZONTAL == option) {
            flipHorizontalScroll_ = true;
          } else if (Option::FLIPSCROLLWHEEL_VERTICAL == option) {
            flipVerticalScroll_ = true;
          } else {
            IOLOG_ERROR("FlipScrollWheel::add unknown option:%u\n", static_cast<unsigned int>(newval));
          }
          break;
        }

        default:
          IOLOG_ERROR("FlipScrollWheel::add invalid datatype:%u\n", static_cast<unsigned int>(datatype));
          break;
      }
    }
开发者ID:MOODOO-SH,项目名称:KeyRemap4MacBook,代码行数:22,代码来源:FlipScrollWheel.cpp


示例14: switch

unsigned int
DependingPressingPeriodKeyToKey::PeriodMS::get(PeriodMS::Type::Value type) {
  if (overwritten_value_[mode_][type] >= 0) {
    return overwritten_value_[mode_][type];
  }

  switch (mode_) {
  case Mode::HOLDING_KEY_TO_KEY:
    switch (type) {
    case Type::SHORT_PERIOD:
      return Config::get_holdingkeytokey_wait();
    case Type::LONG_LONG_PERIOD:
      return 0;
    case Type::PRESSING_TARGET_KEY_ONLY:
      return 0;
    case Type::__END__:
      return 0;
    }

  case Mode::KEY_OVERLAID_MODIFIER:
    switch (type) {
    case Type::SHORT_PERIOD:
      return Config::get_keyoverlaidmodifier_initial_modifier_wait();
    case Type::LONG_LONG_PERIOD:
      return 0;
    case Type::PRESSING_TARGET_KEY_ONLY:
      return Config::get_keyoverlaidmodifier_timeout();
    case Type::__END__:
      return 0;
    }

  case Mode::KEY_OVERLAID_MODIFIER_WITH_REPEAT:
    switch (type) {
    case Type::SHORT_PERIOD:
      return Config::get_keyoverlaidmodifier_initial_modifier_wait();
    case Type::LONG_LONG_PERIOD:
      return Config::get_keyoverlaidmodifier_initial_wait();
    case Type::PRESSING_TARGET_KEY_ONLY:
      return Config::get_keyoverlaidmodifier_timeout();
    case Type::__END__:
      return 0;
    }

  case Mode::NONE:
  case Mode::__END__:
    IOLOG_ERROR("Invalid DependingPressingPeriodKeyToKey::PeriodMS::get\n");
    return 0;
  }

  return 0;
}
开发者ID:JoyJava,项目名称:Karabiner,代码行数:51,代码来源:DependingPressingPeriodKeyToKey.cpp


示例15: refresh_timer_callback

    // ======================================================================
    static void
    refresh_timer_callback(OSObject* owner, IOTimerEventSource* sender)
    {
      if (! remapclasses_) {
        IOLOG_ERROR("RemapClassManager::refresh_core remapclasses_ == NULL.\n");
        return;
      }

      // ----------------------------------------
      if (enabled_remapclasses_) {
        delete enabled_remapclasses_;
      }
      enabled_remapclasses_ = new Vector_RemapClassPointer();
      if (! enabled_remapclasses_) return;

      // ----------------------------------------
      KeyboardRepeat::cancel();

      statusmessage_[0] = '\0';

      isEventInputQueueDelayEnabled_ = false;

      for (size_t i = 0; i < remapclasses_->size(); ++i) {
        RemapClass* p = (*remapclasses_)[i];
        if (! p) continue;

        if (p->enabled()) {
          enabled_remapclasses_->push_back(p);

          const char* msg = p->get_statusmessage();
          if (msg) {
            strlcat(statusmessage_, msg, sizeof(statusmessage_));
            strlcat(statusmessage_, " ", sizeof(statusmessage_));
          }

          if (p->is_simultaneouskeypresses()) {
            isEventInputQueueDelayEnabled_ = true;
          }
        }
      }

      if (strcmp(statusmessage_, lastmessage_) != 0) {
        strlcpy(lastmessage_, statusmessage_, sizeof(lastmessage_));

        int index = BRIDGE_USERCLIENT_STATUS_MESSAGE_EXTRA;
        CommonData::clear_statusmessage(index);
        CommonData::append_statusmessage(index, statusmessage_);
        CommonData::send_notification_statusmessage(index);
      }
    }
开发者ID:007hacky007,项目名称:KeyRemap4MacBook,代码行数:51,代码来源:RemapClass.cpp


示例16: IOLOG_ERROR

  // ======================================================================
  void
  ListHookedConsumer::Item::apply(const Params_KeyboardSpecialEventCallback& params)
  {
    if (params.key >= ConsumerKeyCode::VK__BEGIN__) {
      // Invalid keycode
      IOLOG_ERROR("%s invalid key:%d\n", __PRETTY_FUNCTION__, params.key.get());
      return;
    }
    if (params.flags.isVirtualModifiersOn()) {
      IOLOG_ERROR("%s invalid flags:%d\n", __PRETTY_FUNCTION__, params.flags.get());
      return;
    }

    // ------------------------------------------------------------
    KeyboardSpecialEventCallback callback = orig_keyboardSpecialEventAction_;
    if (! callback) return;

    OSObject* target = orig_keyboardSpecialEventTarget_;
    if (! target) return;

    OSObject* sender = OSDynamicCast(OSObject, device_);
    if (! sender) return;

    const AbsoluteTime& ts = CommonData::getcurrent_ts();
    OSObject* refcon = NULL;

    Params_KeyboardSpecialEventCallback::log(false, params.eventType, params.flags, params.key,
                                             params.flavor, params.guid, params.repeat);
    {
      // We need to unlock the global lock while we are calling the callback function.
      // For more information, See ListHookedKeyboard::Item::apply(const Params_KeyboardEventCallBack& params)
      GlobalLock::ScopedUnlock lk;
      callback(target, params.eventType.get(), params.flags.get(), params.key.get(),
               params.flavor, params.guid, params.repeat, ts, sender, refcon);
    }
  }
开发者ID:CharlseLee,项目名称:KeyRemap4MacBook,代码行数:37,代码来源:ListHookedConsumer.cpp


示例17: isEnabled

    bool
    isEnabled(size_t configindex)
    {
      if (! remapclasses_) return false;

      if (configindex >= remapclasses_->size()) {
        IOLOG_ERROR("RemapClass::isEnabled invalid configindex.\n");
        return false;
      }

      RemapClass* p = (*remapclasses_)[configindex];
      if (! p) return false;

      return p->enabled();
    }
开发者ID:007hacky007,项目名称:KeyRemap4MacBook,代码行数:15,代码来源:RemapClass.cpp


示例18: switch

    bool
    InputModeFilter::isblocked(void)
    {
      if (! targets_) return false;

      unsigned int current = 0;
      switch (type_) {
        case BRIDGE_FILTERTYPE_INPUTMODE_NOT:
        case BRIDGE_FILTERTYPE_INPUTMODE_ONLY:
          current = CommonData::getcurrent_workspacedata().inputmode;
          break;

        case BRIDGE_FILTERTYPE_INPUTMODEDETAIL_NOT:
        case BRIDGE_FILTERTYPE_INPUTMODEDETAIL_ONLY:
          current = CommonData::getcurrent_workspacedata().inputmodedetail;
          break;
      }

      switch (type_) {
        case BRIDGE_FILTERTYPE_INPUTMODE_NOT:
        case BRIDGE_FILTERTYPE_INPUTMODEDETAIL_NOT:
        {
          for (size_t i = 0; i < targets_->size(); ++i) {
            if ((*targets_)[i] == current) {
              return true;
            }
          }
          return false;
        }

        case BRIDGE_FILTERTYPE_INPUTMODE_ONLY:
        case BRIDGE_FILTERTYPE_INPUTMODEDETAIL_ONLY:
        {
          for (size_t i = 0; i < targets_->size(); ++i) {
            if ((*targets_)[i] == current) {
              return false;
            }
          }
          return true;
        }

        default:
          IOLOG_ERROR("InputModeFilter::isblocked unknown type_(%d)\n", type_);
          break;
      }

      return false;
    }
开发者ID:Hacci,项目名称:NewMicroTRON-Layout,代码行数:48,代码来源:InputModeFilter.cpp


示例19: switch

bool
DependingPressingPeriodKeyToKey::PeriodMS::enabled(PeriodMS::Type::Value type) {
  switch (mode_) {
  case Mode::HOLDING_KEY_TO_KEY:
    switch (type) {
    case Type::SHORT_PERIOD:
      return true;
    case Type::LONG_LONG_PERIOD:
      return false;
    case Type::PRESSING_TARGET_KEY_ONLY:
      return false;
    case Type::__END__:
      return false;
    }

  case Mode::KEY_OVERLAID_MODIFIER:
    switch (type) {
    case Type::SHORT_PERIOD:
      return true;
    case Type::LONG_LONG_PERIOD:
      return false;
    case Type::PRESSING_TARGET_KEY_ONLY:
      return true;
    case Type::__END__:
      return false;
    }

  case Mode::KEY_OVERLAID_MODIFIER_WITH_REPEAT:
    switch (type) {
    case Type::SHORT_PERIOD:
      return true;
    case Type::LONG_LONG_PERIOD:
      return true;
    case Type::PRESSING_TARGET_KEY_ONLY:
      return true;
    case Type::__END__:
      return false;
    }

  case Mode::NONE:
  case Mode::__END__:
    IOLOG_ERROR("Invalid DependingPressingPeriodKeyToKey::PeriodMS::enabled\n");
    return false;
  }

  return false;
}
开发者ID:MethodGrab,项目名称:Karabiner,代码行数:47,代码来源:DependingPressingPeriodKeyToKey.cpp


示例20: getModifierFlag

bool VirtualKey::VK_LAZY::handle(const Params_KeyboardEventCallBack& params, AutogenId autogenId, PhysicalEventType physicalEventType) {
  ModifierFlag f = getModifierFlag(params.key);
  if (f == ModifierFlag::ZERO) return false;

  // ----------------------------------------
  if (params.repeat) return true;

  if (params.eventType == EventType::DOWN) {
    FlagStatus::globalFlagStatus().lazy_increase(f);
  } else if (params.eventType == EventType::UP) {
    FlagStatus::globalFlagStatus().lazy_decrease(f);
  } else {
    IOLOG_ERROR("Handle_VK_LAZY invalid EventType.\n");
  }

  return true;
}
开发者ID:Beej126,项目名称:Karabiner,代码行数:17,代码来源:VK_LAZY.cpp



注:本文中的IOLOG_ERROR函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IOLockLock函数代码示例发布时间:2022-05-30
下一篇:
C++ IOHIDManagerScheduleWithRunLoop函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap