def examine_rootdir(self,
                        on_new_doc,
                        on_doc_modified,
                        on_doc_deleted,
                        on_doc_unchanged,
                        progress_cb=dummy_progress_cb):
        """
        Examine the rootdir.
        Calls on_new_doc(doc), on_doc_modified(doc), on_doc_deleted(docid)
        every time a new, modified, or deleted document is found
        """

        count = self.docsearch.index.start_examine_rootdir()

        progress = 0
        while True:
            (status, doc) = self.docsearch.index.continue_examine_rootdir()
            if status == 'end':
                break
            elif status == 'modified':
                on_doc_modified(doc)
            elif status == 'unchanged':
                on_doc_unchanged(doc)
            elif status == 'new':
                on_new_doc(doc)
            progress_cb(progress, count,
                        DocSearch.INDEX_STEP_CHECKING, doc)
            progress += 1

        while True:
            (status, doc) = self.docsearch.index.continue_examine_rootdir2()
            if status == 'end':
                break
            on_doc_deleted(doc)

        progress_cb(1, 1, DocSearch.INDEX_STEP_CHECKING)
        self.docsearch.index.end_examine_rootdir()