当前位置: 首页>>代码示例>>C++>>正文


C++ IOLOG_ERROR函数代码示例

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


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


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