def update_definitions(self, idxes): global hash_file_lock, defs_lock for idx in idxes: if (idx % 1000 == 0): progress('defs: ' + str(idx), self.index + 1) with hash_file_lock: hash = db.hash.get(idx) filename = db.file.get(idx) family = lib.getFileFamily(filename) if family == None: continue lines = scriptLines('parse-defs', hash, filename, family) for l in lines: ident, type, line = l.split(b' ') type = type.decode() line = int(line.decode()) with defs_lock: if db.defs.exists(ident): obj = db.defs.get(ident) else: obj = data.DefList() obj.add_family(family) obj.append(idx, type, line, family) if verbose: print(f"def {type} {ident} in #{idx} @ {line}") with defs_lock: db.defs.put(ident, obj)
def update_definitions(self, idxes): global hash_file_lock, defs_lock, tags_defs for idx in idxes: if (idx % 1000 == 0): progress('defs: ' + str(idx), tags_defs[0]) with hash_file_lock: hash = db.hash.get(idx) filename = db.file.get(idx) family = lib.getFileFamily(filename) if family in [None, 'M']: continue lines = scriptLines('parse-defs', hash, filename, family) with defs_lock: for l in lines: ident, type, line = l.split(b' ') type = type.decode() line = int(line.decode()) defs_idxes[idx*idx_key_mod + line] = ident if db.defs.exists(ident): obj = db.defs.get(ident) elif lib.isIdent(ident): obj = data.DefList() else: continue obj.append(idx, type, line, family) if verbose: print(f"def {type} {ident} in #{idx} @ {line}") db.defs.put(ident, obj)
def updateDefinitions(blobs): for blob in blobs: if (blob % 1000 == 0): progress('defs: ' + str(blob)) hash = db.hash.get(blob) filename = db.file.get(blob) if not lib.hasSupportedExt(filename): continue lines = scriptLines('parse-defs', hash, filename) for l in lines: ident, type, line = l.split(b' ') type = type.decode() line = int(line.decode()) if db.defs.exists(ident): obj = db.defs.get(ident) else: obj = data.DefList() obj.append(blob, type, line) db.defs.put(ident, obj)
def updateDefinitions(blobs): for blob in blobs: if (blob % 100 == 0): print('D:', blob) hash = db.hash.get(blob) filename = db.file.get(blob) ext = filename[-2:] if not (ext == '.c' or ext == '.h'): continue lines = scriptLines('parse-defs', hash, filename) for l in lines: ident, type, line = l.split(b' ') type = type.decode() line = int(line.decode()) if db.defs.exists(ident): obj = db.defs.get(ident) else: obj = data.DefList() obj.append(blob, type, line) db.defs.put(ident, obj)
def updateDefinitions(idxes): for idx in idxes: if (idx % 1000 == 0): progress('defs: ' + str(idx)) hash = db.hash.get(idx) filename = db.file.get(idx) if not lib.hasSupportedExt(filename): continue lines = scriptLines('parse-defs', hash, filename) for l in lines: ident, type, line = l.split(b' ') type = type.decode() line = int(line.decode()) if db.defs.exists(ident): obj = db.defs.get(ident) else: obj = data.DefList() obj.append(idx, type, line) if verbose: print(f"def {type} {ident} in #{idx} @ {line}") db.defs.put(ident, obj)