summaryrefslogtreecommitdiffstats
path: root/printf.c
AgeCommit message (Collapse)Author
2022-04-16Source / Include Folder (#88)トトも
Moved Source Files Into `src` Folder
2022-03-27parse: Highlight command line errorsTavian Barnes
2022-03-25printf: Switch from a linked list to an arrayTavian Barnes
2022-03-12Don't shadow standard headersTavian Barnes
@italic on the AUR stated that bfs from the AUR fails to build on Manjaro. From the build log, it seems like <time.h> doesn't get included properly. I assume it's picking up ./time.h instead. I couldn't reproduce the build issue in the default configuration, but it does fail with EXTRA_CFLAGS="-I." which isn't good. So rename everything with an x prefix to stop clashing. Link: https://aur.archlinux.org/packages/bfs#comment-856102 Link: https://paste.rs/eqR
2021-10-09printf: Colorize file names/paths in simple casesTavian Barnes
2021-10-09printf: Take a CFILE, not a FILETavian Barnes
2021-06-09util: Rename fallthrough to BFS_FALLTHROUGHTavian Barnes
This avoids shadowing the actually standard name fallthrough.
2021-06-02Enable -Wimplicit-fallthroughTavian Barnes
2021-02-05Update copyright datesTavian Barnes
2021-01-28dir: New DIR* facadeTavian Barnes
2020-11-12Include what I useTavian Barnes
Thanks to https://github.com/include-what-you-use/include-what-you-use
2020-11-04Enable -Wsign-compare to catch bugs like 726d7801Tavian Barnes
2020-10-06printf: Adjust some calling conventionsTavian Barnes
2020-10-05diag: New bfs_perror() functionTavian Barnes
2020-09-30util: Don't rely on bftwTavian Barnes
And rename format_mode() to xstrmode() while I'm at it.
2020-09-27Rename struct cmdline to bfs_ctxTavian Barnes
The API remains similar, with some added accessor functions for lazy initialization of the pwcache and mtab.
2020-09-20printf: Format the empty string for %l of non-linksTavian Barnes
It makes a difference if the format specifier has a width.
2020-09-18Don't call stat() just to determine symbolic lengthsTavian Barnes
The new bftw_cached_stat() helper gets us stat info if we already have it, but doesn't call stat() if we don't. In that case we just take a guess for the initial length to readlinkat(). This lets us avoid stat() entirely in many cases for -lname and -printf %l.
2020-07-29bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmaskTavian Barnes
2020-04-22pwcache: Rename from passwd.[ch]Tavian Barnes
2020-02-29passwd: Cache the user/group tablesTavian Barnes
This is a significant optimization for conditions that need these tables: Benchmark #1: ./bfs ~/code/linux -nouser >/dev/null Time (mean ± σ): 232.0 ms ± 2.5 ms [User: 44.3 ms, System: 185.0 ms] Range (min … max): 228.7 ms … 238.7 ms 12 runs Benchmark #2: ./bfs-1.6 ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.050 s ± 0.012 s [User: 544.2 ms, System: 500.0 ms] Range (min … max): 1.025 s … 1.063 s 10 runs Benchmark #3: find ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.040 s ± 0.012 s [User: 533.6 ms, System: 500.6 ms] Range (min … max): 1.017 s … 1.054 s 10 runs Summary './bfs ~/code/linux -nouser >/dev/null' ran 4.48 ± 0.07 times faster than 'find ~/code/linux -nouser >/dev/null' 4.52 ± 0.07 times faster than './bfs-1.6 ~/code/linux -nouser >/dev/null'
2020-02-13time: Split out time-related functions from utilTavian Barnes
2019-05-05bftw: Pass a const struct BFTW * to the callbackTavian Barnes
2019-05-04bftw: Add a caching stat() API to struct BFTWTavian Barnes
2019-05-04stat: Unify the flags argumentsTavian Barnes
2019-04-15Release 1.41.4Tavian Barnes
2019-03-06bftw: Work around d_type being wrong for bind mounts on LinuxTavian Barnes
C.f. https://savannah.gnu.org/bugs/?54913 C.f. https://lkml.org/lkml/2019/2/11/2027 Fixes https://github.com/tavianator/bfs/issues/37
2019-02-06Turn on -Wstrict-prototypesTavian Barnes
2019-01-02diag: Unify diagnostic formattingTavian Barnes
This adds a bfs: prefix to error/warning messages for consistency with other command line tools, and leaves only the "error:"/"warning:" part colored like GCC. It also uniformly adds full stops after messages.
2018-12-20stat: Unify bfs_stat_time() implementationsTavian Barnes
2018-12-17bftw: Move bftw_typeflag conversion out of utilTavian Barnes
Turns out incomplete enum types are a GNU C extension.
2018-09-24Update copyright datesTavian Barnes
2018-08-16Add some missing fallthrough commentsTavian Barnes
2018-07-24printf: Support all standard strftime() directivesTavian Barnes
2018-07-24printf: Support %B, GNU find's undocumented birth time specifierTavian Barnes
2018-07-24stat: Don't assume blocks are 512 bytesTavian Barnes
POSIX says > The unit for the st_blocks member of the stat structure is not defined > within POSIX.1‐2008. and recommends using DEV_BSIZE from <sys/param.h> if available. Also, for -printf '%S', print 1 instead of NaN for empty files with no blocks.
2018-07-20printf: Output ? for errors in %YTavian Barnes
2018-01-20printf: Add %w and %Wk for file birth timesTavian Barnes
%w and %W were chosen to match the format specifiers for file birth times from stat(1)
2018-01-08stat: New wrapper around the stat() familyTavian Barnes
This lets bfs transparently support the new statx() system call on Linux, giving it access to file birth times.
2017-11-13color: Implement %m for cfprintf()Tavian Barnes
2017-11-05Add support for file birth/creation times on platforms that have itTavian Barnes
Fixes #19
2017-09-16opt: Separate optimization from parsingTavian Barnes
2017-08-27printf: Save some lines in time specifier parsingTavian Barnes
2017-07-27Re-license under the BSD Zero Clause LicenseTavian Barnes
2017-07-09Handle ENOTDIR the same as ENOENTTavian Barnes
For a/b/c, ENOTDIR is returned instead of ENOENT if a or b are not directories. Handle this uniformly when detecting broken symlinks, readdir races, etc.
2017-06-10printf: Fix embedded nul bytesTavian Barnes
Fixes #26.
2017-04-29Don't parse the mount table until it's neededTavian Barnes
2017-04-23Implement -fstypeTavian Barnes
Fixes #6!
2017-04-08Move bftw_typeflag converters to util.cTavian Barnes
2017-03-11Implement -ls and -flsTavian Barnes