Sort includes and more cleanup and fixes in util/
This commit is contained in:
parent
0810c61154
commit
7d2683ddf2
6
chgrp.c
6
chgrp.c
|
@ -1,12 +1,12 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
3
chmod.c
3
chmod.c
|
@ -2,8 +2,9 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
static void chmodr(const char *);
|
||||
|
|
2
cksum.c
2
cksum.c
|
@ -1,6 +1,6 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
2
cols.c
2
cols.c
|
@ -4,8 +4,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
|
|
2
comm.c
2
comm.c
|
@ -1,9 +1,9 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
14
du.c
14
du.c
|
@ -1,13 +1,13 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
4
env.c
4
env.c
|
@ -1,9 +1,9 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
kill.c
2
kill.c
|
@ -1,5 +1,4 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <sys/wait.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
|
@ -8,6 +7,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
|
2
ls.c
2
ls.c
|
@ -7,9 +7,9 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
md5sum.c
2
md5sum.c
|
@ -4,9 +4,9 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "crypt.h"
|
||||
#include "md5.h"
|
||||
#include "util.h"
|
||||
|
||||
struct md5 s;
|
||||
struct crypt_ops md5_ops = {
|
||||
|
|
3
mkdir.c
3
mkdir.c
|
@ -1,12 +1,11 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
mkfifo.c
2
mkfifo.c
|
@ -1,8 +1,8 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
mv.c
2
mv.c
|
@ -2,8 +2,8 @@
|
|||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "fs.h"
|
||||
#include "util.h"
|
||||
|
|
2
rmdir.c
2
rmdir.c
|
@ -1,9 +1,9 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
setsid.c
2
setsid.c
|
@ -1,9 +1,9 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "crypt.h"
|
||||
#include "sha1.h"
|
||||
#include "util.h"
|
||||
|
||||
struct sha1 s;
|
||||
struct crypt_ops sha1_ops = {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "crypt.h"
|
||||
#include "sha256.h"
|
||||
#include "util.h"
|
||||
|
||||
struct sha256 s;
|
||||
struct crypt_ops sha256_ops = {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "crypt.h"
|
||||
#include "sha512.h"
|
||||
#include "util.h"
|
||||
|
||||
struct sha512 s;
|
||||
struct crypt_ops sha512_ops = {
|
||||
|
|
8
split.c
8
split.c
|
@ -1,10 +1,10 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
14
tar.c
14
tar.c
|
@ -1,15 +1,15 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <grp.h>
|
||||
#include <limits.h>
|
||||
#include <pwd.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <limits.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
test.c
2
test.c
|
@ -1,10 +1,10 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
|
2
touch.c
2
touch.c
|
@ -3,10 +3,10 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
tr.c
2
tr.c
|
@ -1,9 +1,9 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <locale.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "text.h"
|
||||
|
|
2
tty.c
2
tty.c
|
@ -1,7 +1,7 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
2
uname.c
2
uname.c
|
@ -2,8 +2,8 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
3
unlink.c
3
unlink.c
|
@ -1,6 +1,7 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
static void
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "../util.h"
|
||||
#include "../text.h"
|
||||
|
||||
#include "../crypt.h"
|
||||
#include "../text.h"
|
||||
#include "../util.h"
|
||||
|
||||
static int
|
||||
hexdec(int c)
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../util.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* public domain md5 implementation based on rfc1321 and libtomcrypt */
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../md5.h"
|
||||
|
||||
static uint32_t rol(uint32_t n, int k) { return (n << k) | (n >> (32-k)); }
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../util.h"
|
||||
|
||||
mode_t
|
||||
|
|
|
@ -15,4 +15,3 @@ putword(const char *s)
|
|||
fputs(s, stdout);
|
||||
first = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,4 +15,3 @@ rm(const char *path)
|
|||
if (remove(path) == -1 && !rm_fflag)
|
||||
eprintf("remove %s:", path);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* public domain sha1 implementation based on rfc3174 and libtomcrypt */
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../sha1.h"
|
||||
|
||||
static uint32_t rol(uint32_t n, int k) { return (n << k) | (n >> (32-k)); }
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/* public domain sha256 implementation based on fips180-3 */
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../sha256.h"
|
||||
|
||||
static uint32_t ror(uint32_t n, int k) { return (n >> k) | (n << (32-k)); }
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
/* public domain sha256 implementation based on fips180-3 */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../sha512.h"
|
||||
|
||||
static uint64_t ror(uint64_t n, int k) { return (n >> k) | (n << (64-k)); }
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "../util.h"
|
||||
|
||||
/*
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "../util.h"
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
|
||||
static void uudecode(FILE *, FILE *);
|
||||
static void parseheader(FILE *, const char *, const char *, mode_t *, char **);
|
||||
|
|
Loading…
Reference in New Issue
Block a user