Added sfdisk. Ststic-ified a bunch of stuff.

This commit is contained in:
Eric Andersen
1999-10-19 20:03:34 +00:00
parent a3f09076ef
commit e77ae3a2c0
61 changed files with 4029 additions and 504 deletions

View File

@@ -32,7 +32,7 @@ static void print_file( FILE *file)
fflush(stdout);
}
extern int cat_more_main(int argc, char **argv)
extern int cat_main(int argc, char **argv)
{
FILE *file;

View File

@@ -25,7 +25,7 @@
#include <utime.h>
#include <dirent.h>
const char cp_usage[] = "cp [OPTION]... SOURCE DEST\n"
static const char cp_usage[] = "cp [OPTION]... SOURCE DEST\n"
" or: cp [OPTION]... SOURCE... DIRECTORY\n"
"Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"
"\n"

View File

@@ -34,7 +34,7 @@
an RFC 822 complient date output for shell scripting
mail commands */
const char date_usage[] = "date [OPTION]... [+FORMAT]\n"
static const char date_usage[] = "date [OPTION]... [+FORMAT]\n"
" or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n"
"Display the current time in the given FORMAT, or set the system date.\n"
"\nOptions:\n\t-R\t\toutput RFC-822 compliant date string\n"

View File

@@ -14,7 +14,7 @@
#include <fcntl.h>
#include <errno.h>
const char dd_usage[] =
static const char dd_usage[] =
"Copy a file, converting and formatting according to options\n\
\n\
usage: [if=name] [of=name] [bs=n] [count=n]\n\

View File

@@ -5,7 +5,7 @@
#include <sys/vfs.h>
#include <fstab.h>
const char df_usage[] = "df [filesystem ...]\n"
static const char df_usage[] = "df [filesystem ...]\n"
"\n"
"\tPrint the filesystem space used and space available.\n";

View File

@@ -132,7 +132,6 @@ int ls_main(int argc, char **argv)
#else
#include "internal.h"
/*
* tiny-ls.c version 0.1.0: A minimalist 'ls'
* Copyright (C) 1996 Brian Candler <B.Candler@pobox.com>
@@ -175,7 +174,7 @@ int ls_main(int argc, char **argv)
* 1. requires lstat (BSD) - how do you do it without?
*/
#define FEATURE_USERNAME /* show username/groupnames (libc6 uses NSS) */
//#define FEATURE_USERNAME /* show username/groupnames (libc6 uses NSS) */
#define FEATURE_TIMESTAMPS /* show file timestamps */
#define FEATURE_AUTOWIDTH /* calculate terminal & column widths */
#define FEATURE_FILETYPECHAR /* enable -p and -F */
@@ -187,8 +186,8 @@ int ls_main(int argc, char **argv)
/************************************************************************/
#if 1 /* FIXME libc 6 */
#include "internal.h"
#if !defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
# include <linux/types.h>
#else
# include <sys/types.h>
@@ -225,7 +224,7 @@ int ls_main(int argc, char **argv)
/* The 9 mode bits to test */
static const umode_t MBIT[] = {
static const mode_t MBIT[] = {
S_IRUSR, S_IWUSR, S_IXUSR,
S_IRGRP, S_IWGRP, S_IXGRP,
S_IROTH, S_IWOTH, S_IXOTH
@@ -233,7 +232,7 @@ static const umode_t MBIT[] = {
/* The special bits. If set, display SMODE0/1 instead of MODE0/1 */
static const umode_t SBIT[] = {
static const mode_t SBIT[] = {
0, 0, S_ISUID,
0, 0, S_ISGID,
0, 0, S_ISVTX
@@ -278,7 +277,7 @@ static unsigned char time_fmt = TIME_MOD;
static void writenum(long val, short minwidth)
{
char scratch[20];
char scratch[128];
char *p = scratch + sizeof(scratch);
short len = 0;
@@ -324,7 +323,7 @@ static void tab(short col)
}
#ifdef FEATURE_FILETYPECHAR
static char append_char(umode_t mode)
static char append_char(mode_t mode)
{
if (!(opts & DISP_FTYPE))
return '\0';
@@ -343,14 +342,14 @@ static char append_char(umode_t mode)
static void list_single(const char *name, struct stat *info)
{
char scratch[20];
char scratch[PATH_MAX];
short len = strlen(name);
#ifdef FEATURE_FILETYPECHAR
char append = append_char(info->st_mode);
#endif
if (display_fmt == FMT_LONG) {
umode_t mode = info->st_mode;
mode_t mode = info->st_mode;
int i;
scratch[0] = TYPECHAR(mode);

View File

@@ -24,7 +24,7 @@
#include <errno.h>
#include <sys/param.h>
const char mkdir_usage[] = "Usage: mkdir [OPTION] DIRECTORY...\n"
static const char mkdir_usage[] = "Usage: mkdir [OPTION] DIRECTORY...\n"
"Create the DIRECTORY(ies), if they do not already exist\n\n"
"-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n"
"-p\tno error if existing, make parent directories as needed\n";

View File

@@ -6,7 +6,7 @@
#include <fcntl.h>
#include <unistd.h>
const char mknod_usage[] = "mknod file b|c|u|p major minor\n"
static const char mknod_usage[] = "mknod file b|c|u|p major minor\n"
"\tMake special files.\n"
"\n"
"\tb:\tMake a block (buffered) device.\n"

View File

@@ -136,7 +136,7 @@ static void verify __P ((char *s, char *end));
/* The value to return to the calling program. */
static int exit_status;
const char printf_usage[] = "printf format [argument...]\n";
static const char printf_usage[] = "printf format [argument...]\n";
int
printf_main(int argc, char** argv)

View File

@@ -28,7 +28,7 @@
#include <errno.h>
const char touch_usage[] = "touch [-c] file [file ...]\n\n"
static const char touch_usage[] = "touch [-c] file [file ...]\n\n"
"\tUpdate the last-modified date on the given file[s].\n";