def set_include_list(inclist): global CTAGS_CACHE CTAGS_CACHE = CtagsCache(inclist) for b in vim.buffers: if not b.name: continue if not b.name.endswith('.c') and not b.name.endswith('.h'): continue if not int(vim.eval("buflisted('" + b.name + "')")): continue CTAGS_CACHE.update_file(b.name)
def set_include_list(inclist): global CTAGS_CACHE CTAGS_CACHE = CtagsCache('c', inclist) files = [] for b in vim.buffers: if not b.name: continue if not b.name.endswith('.c') and not b.name.endswith('.h'): continue if not int(vim.eval("buflisted('" + b.name + "')")): continue files.append(b.name) CTAGS_CACHE.add_files(files)
#!/usr/bin/env python import os import pdb import time from ctags_cache import CtagsCache print("test 1:") cache = CtagsCache() cache._update_file("test/test.c") cache.printall() cache._remove_file('test/test.c') cache.printall() print("test 2:") cache = CtagsCache(['/home/lfw/works/linux-2.6/include', 'linux-2.6']) cache._update_file('/home/lfw/works/linux-2.6/fs/romfs/super.c') cache._update_file('/home/lfw/works/linux-2.6/fs/romfs/storage.c') cache._update_file('/home/lfw/works/linux-2.6/fs/romfs/storage.c') cache._update_file('/home/lfw/works/linux-2.6/fs/romfs/super.c') cache.printall() cache._remove_file('/home/lfw/works/linux-2.6/fs/romfs/super.c') cache._remove_file('/home/lfw/works/linux-2.6/fs/romfs/super.c') cache._remove_file('/home/lfw/works/linux-2.6/fs/romfs/storage.c') cache._remove_file('/home/lfw/works/linux-2.6/fs/romfs/storage.c') cache.printall() print("test 3:") import timeit cb_header = r"""