]> granicus.if.org Git - strace/commit
fsmagic: sort array by value and use bsearch for faster lookup
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 21 Sep 2014 22:42:45 +0000 (22:42 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 22 Sep 2014 00:31:06 +0000 (00:31 +0000)
commit4176d533e0c0a205aa07e9670c6935cf9bd394a6
tree8586ddd59fdef1130588c40b270014988fc9f2c0
parent7faa5b488444b798324989df5ebcc614b68477ff
fsmagic: sort array by value and use bsearch for faster lookup

* defs.h (xlat_search): New prototype.
* util.c (xlat_bsearch_compare, xlat_search): New functions.
* file.c (sprintfstype): Use xlat_search for fsmagic lookup.
* xlat/fsmagic.in: Sort by value and mark as not NULL-terminated.
* tests/statfs.c: New file.
* tests/statfs.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add statfs.
(statfs_CFLAGS): Define.
(TESTS): Add statfs.test.
* tests/.gitignore: Add statfs.
defs.h
file.c
tests/.gitignore
tests/Makefile.am
tests/statfs.c [new file with mode: 0644]
tests/statfs.test [new file with mode: 0755]
util.c
xlat/fsmagic.in