+bool
+IOEventSource::init(OSObject *inOwner,
+ Action inAction)
+{
+ if (!inOwner) {
+ return false;
+ }
+
+ owner = inOwner;
+
+ if (!super::init()) {
+ return false;
+ }
+
+ (void) setAction(inAction);
+ enabled = true;
+
+ if (!reserved) {
+ reserved = IONew(ExpansionData, 1);
+ if (!reserved) {
+ return false;
+ }
+ }
+
+ IOStatisticsRegisterCounter();
+
+ return true;
+}
+
+void
+IOEventSource::free( void )
+{
+ IOStatisticsUnregisterCounter();
+
+ if ((kActionBlock & flags) && actionBlock) {
+ Block_release(actionBlock);
+ }
+
+ if (reserved) {
+ IODelete(reserved, ExpansionData, 1);
+ }
+
+ super::free();
+}
+
+void
+IOEventSource::setRefcon(void *newrefcon)
+{
+ refcon = newrefcon;
+}
+
+void *
+IOEventSource::getRefcon() const
+{
+ return refcon;
+}
+
+IOEventSource::Action
+IOEventSource::getAction() const
+{
+ if (kActionBlock & flags) {
+ return NULL;
+ }
+ return action;
+}
+
+IOEventSource::ActionBlock
+IOEventSource::getActionBlock(ActionBlock) const
+{
+ if (kActionBlock & flags) {
+ return actionBlock;
+ }
+ return NULL;
+}
+
+void
+IOEventSource::setAction(Action inAction)
+{
+ if ((kActionBlock & flags) && actionBlock) {
+ Block_release(actionBlock);
+ }
+ action = inAction;
+}
+
+void
+IOEventSource::setActionBlock(ActionBlock block)
+{
+ if ((kActionBlock & flags) && actionBlock) {
+ Block_release(actionBlock);
+ }
+ actionBlock = Block_copy(block);
+ flags |= kActionBlock;
+}
+
+IOEventSource *
+IOEventSource::getNext() const
+{
+ return eventChainNext;
+};
+
+void
+IOEventSource::setNext(IOEventSource *inNext)