pike.git / src / modules / FSEvents / fsevents.cmod

version» Context lines:

pike.git/src/modules/FSEvents/fsevents.cmod:237:    *! If a value was supplied for the since_when parameter then "historical" events will be sent via    *! your callback first, then a HistoryDone event, then "contemporary" events will be sent on    *! an ongoing basis.    */   PIKEFUN void start()   {    FSEventStreamContext context;       if(THIS->isRunning)    { -  Pike_error("monitor is already running.\n"); +  Pike_error("EventStream: monitor is already running.\n");    }    -  +  if(!THIS->_paths) +  Pike_error("EventStream: no paths.\n"); +  +  if(!THIS->_sinceWhen) +  Pike_error("EventStream: no startdate.\n"); +  +  if(!THIS->_latency) +  Pike_error("EventStream: no latency.\n"); +     if(CFArrayGetCount(THIS->_paths))    {    THIS->runLoop = CFRunLoopGetCurrent();    CFRetain(THIS->runLoop);       context.version = 0;    context.info = THIS;    context.retain = NULL;    context.release = NULL;    context.copyDescription = NULL;    -  if(!THIS->_paths) -  Pike_error("no paths.\n"); -  -  if(!THIS->_sinceWhen) -  Pike_error("no startdate.\n"); -  -  if(!THIS->_latency) -  Pike_error("no latency.\n"); -  +     THIS->stream = FSEventStreamCreate(kCFAllocatorDefault,    &event_callback,    &context,    THIS->_paths,    THIS->_sinceWhen,    THIS->_latency,    THIS->_flags |    kFSEventStreamCreateFlagUseCFTypes    );       THIS->isRunning = 1;    FSEventStreamScheduleWithRunLoop(THIS->stream, THIS->runLoop, kCFRunLoopDefaultMode);    FSEventStreamStart(THIS->stream);    }    else    { -  Pike_error("No paths registered for monitoring.\n"); +  Pike_error("EventStream: No paths registered for monitoring.\n");    }   }      /*! @decl void stop()    *! Stops watching for new events.    */   PIKEFUN void stop()   {    low_stop();   }