More -Wmissing-variable-declarations fixes.

In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
This commit is contained in:
ed 2012-10-19 14:49:42 +00:00
parent b146225385
commit af31e8843c
61 changed files with 437 additions and 458 deletions

View File

@ -30,4 +30,6 @@
* $FreeBSD$
*/
extern int retval;
int netsettime(time_t);

View File

@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$");
#define WAITACK 2 /* seconds */
#define WAITDATEACK 5 /* seconds */
extern int retval;
/*
* Set the date in the machines controlled by timedaemons by communicating the
* new date to the local timedaemon. If the timedaemon is in the master state,

View File

@ -185,9 +185,6 @@ get_addressed_line_node(long n)
return lp;
}
extern int newline_added;
static char sfn[15] = ""; /* scratch file name */
/* open_sbuf: open scratch file */

View File

@ -277,3 +277,9 @@ extern int lineno;
extern long second_addr;
extern long u_addr_last;
extern long u_current_addr;
extern long rows;
extern int cols;
extern int newline_added;
extern int des;
extern int scripted;
extern int patlock;

View File

@ -30,9 +30,6 @@ __FBSDID("$FreeBSD$");
#include "ed.h"
extern int scripted;
/* read_file: read a named file/pipe into the buffer; return line count */
long
read_file(char *fn, long n)
@ -58,9 +55,6 @@ read_file(char *fn, long n)
return current_addr - n;
}
extern int des;
static char *sbuf; /* file i/o buffer */
static int sbufsz; /* file i/o buffer size */
int newline_added; /* if set, newline appended to input file */
@ -298,9 +292,6 @@ get_tty_line(void)
#define ESCAPES "\a\b\f\n\r\t\v\\"
#define ESCCHARS "abfnrtv\\"
extern int rows;
extern int cols;
/* put_tty_line: print text to stdout */
int
put_tty_line(const char *s, int l, long n, int gflag)

View File

@ -31,9 +31,6 @@ __FBSDID("$FreeBSD$");
#include "ed.h"
extern int patlock;
const char *errmsg = "";
/* get_compiled_pattern: return pointer to compiled pattern from command

View File

@ -62,7 +62,7 @@
char **search_dirs;
int n_search_dirs;
const char *standard_search_dirs[] = {
static const char *standard_search_dirs[] = {
STANDARD_SEARCH_DIRS
};

View File

@ -5783,9 +5783,10 @@ atapm(struct cam_device *device, int argc, char **argv,
#endif /* MINIMALISTIC */
void
usage(int verbose)
usage(int printlong)
{
fprintf(verbose ? stdout : stderr,
fprintf(printlong ? stdout : stderr,
"usage: camcontrol <command> [device id][generic args][command args]\n"
" camcontrol devlist [-v]\n"
#ifndef MINIMALISTIC
@ -5834,7 +5835,7 @@ usage(int verbose)
" camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n"
#endif /* MINIMALISTIC */
" camcontrol help\n");
if (!verbose)
if (!printlong)
return;
#ifndef MINIMALISTIC
fprintf(stdout,

View File

@ -40,8 +40,10 @@ struct get_hook
int got;
};
extern int verbose;
int fwdownload(struct cam_device *device, int argc, char **argv,
char *combinedopt, int verbose, int retry_count, int timeout,
char *combinedopt, int printerrors, int retry_count, int timeout,
const char */*type*/);
void mode_sense(struct cam_device *device, int mode_page, int page_control,
int dbd, int retry_count, int timeout, u_int8_t *data,
@ -58,5 +60,5 @@ char *cget(void *hook, char *name);
int iget(void *hook, char *name);
void arg_put(void *hook, int letter, void *arg, int count, char *name);
int get_confirmation(void);
void usage(int verbose);
void usage(int printlong);
#endif /* _CAMCONTROL_H */

View File

@ -131,7 +131,7 @@ static char *fw_read_img(const char *fw_img_path,
const struct fw_vendor *vp, int *num_bytes);
static int fw_download_img(struct cam_device *cam_dev,
const struct fw_vendor *vp, char *buf, int img_size,
int sim_mode, int verbose, int retry_count, int timeout,
int sim_mode, int printerrors, int retry_count, int timeout,
const char */*name*/, const char */*type*/);
/*
@ -238,7 +238,7 @@ fw_read_img(const char *fw_img_path, const struct fw_vendor *vp, int *num_bytes)
*/
static int
fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
char *buf, int img_size, int sim_mode, int verbose, int retry_count,
char *buf, int img_size, int sim_mode, int printerrors, int retry_count,
int timeout, const char *imgname, const char *type)
{
struct scsi_write_buffer cdb;
@ -290,7 +290,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
ccb->ccb_h.flags |= CAM_DEV_QFRZDIS;
if (cam_send_ccb(cam_dev, ccb) < 0) {
warnx("Error sending identify/test unit ready");
if (verbose)
if (printerrors)
cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
CAM_EPF_ALL, stderr);
cam_freeccb(ccb);
@ -298,7 +298,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
}
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
warnx("Device is not ready");
if (verbose)
if (printerrors)
cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
CAM_EPF_ALL, stderr);
cam_freeccb(ccb);
@ -372,7 +372,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
/* Execute the command. */
if (cam_send_ccb(cam_dev, ccb) < 0) {
warnx("Error writing image to device");
if (verbose)
if (printerrors)
cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
CAM_EPF_ALL, stderr);
goto bailout;
@ -398,7 +398,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
int
fwdownload(struct cam_device *device, int argc, char **argv,
char *combinedopt, int verbose, int retry_count, int timeout,
char *combinedopt, int printerrors, int retry_count, int timeout,
const char *type)
{
const struct fw_vendor *vp;
@ -450,7 +450,7 @@ fwdownload(struct cam_device *device, int argc, char **argv,
if (sim_mode)
fprintf(stdout, "Running in simulation mode\n");
if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose,
if (fw_download_img(device, vp, buf, img_size, sim_mode, printerrors,
retry_count, timeout, fw_img_path, type) != 0) {
fprintf(stderr, "Firmware download failed\n");
goto fail;

View File

@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$");
#include <camlib.h>
#include "camcontrol.h"
int verbose = 0;
#define DEFAULT_SCSI_MODE_DB "/usr/share/misc/scsi_modes"
#define DEFAULT_EDITOR "vi"
#define MAX_FORMAT_SPEC 4096 /* Max CDB format specifier. */

View File

@ -74,7 +74,7 @@ static void std_status(struct gctl_req *req, unsigned flags);
static void std_load(struct gctl_req *req, unsigned flags);
static void std_unload(struct gctl_req *req, unsigned flags);
struct g_command std_commands[] = {
static struct g_command std_commands[] = {
{ "help", 0, std_help, G_NULL_OPTS, NULL },
{ "list", 0, std_list,
{

View File

@ -59,15 +59,13 @@
* to the real userid before calling any of them.
*/
#ifndef MAIN
extern
#endif
uid_t real_uid, effective_uid;
extern uid_t real_uid, effective_uid;
extern gid_t real_gid, effective_gid;
#ifndef MAIN
extern
#endif
#ifdef MAIN
uid_t real_uid, effective_uid;
gid_t real_gid, effective_gid;
#endif
#define RELINQUISH_PRIVS { \
real_uid = getuid(); \

View File

@ -60,8 +60,8 @@ __FBSDID("$FreeBSD$");
struct passwd *pw;
int doall = 0;
int debug = 0;
char *DEBUG = NULL;
time_t f_time = 0;
static char *DEBUG = NULL;
static time_t f_time = 0;
double UTCOffset = UTCOFFSET_NOTSET;
int EastLongitude = LONGITUDE_NOTSET;

View File

@ -43,7 +43,7 @@ struct cal_year {
int firstdayofweek; /* 0 .. 6 */
struct cal_month *months;
struct cal_year *nextyear;
} cal_year;
};
struct cal_month {
int month; /* 01 .. 12 */
@ -52,7 +52,7 @@ struct cal_month {
struct cal_year *year; /* points back */
struct cal_day *days;
struct cal_month *nextmonth;
} cal_month;
};
struct cal_day {
int dayofmonth; /* 01 .. 31 */
@ -62,19 +62,18 @@ struct cal_day {
struct cal_month *month; /* points back */
struct cal_year *year; /* points back */
struct event *events;
} cal_day;
};
int debug_remember = 0;
struct cal_year *hyear = NULL;
static struct cal_year *hyear = NULL;
/* 1-based month, 0-based days, cumulative */
int *cumdays;
int cumdaytab[][14] = {
{0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364},
{0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
};
/* 1-based month, individual */
int *mondays;
static int *mondays;
int mondaytab[][14] = {
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30},
{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30},

View File

@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include "calendar.h"
time_t time1, time2;
static time_t time1, time2;
const struct tm tm0;
char dayname[100];
int year1, year2;

View File

@ -60,10 +60,10 @@ __FBSDID("$FreeBSD$");
#include "calendar.h"
const char *calendarFile = "calendar"; /* default calendar file */
const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */
const char *calendarNoMail = "nomail"; /* don't sent mail if this file exist */
static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */
static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */
char path[MAXPATHLEN];
static char path[MAXPATHLEN];
struct fixs neaster, npaskha, ncny, nfullmoon, nnewmoon;
struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice;

View File

@ -109,40 +109,39 @@ __FBSDID("$FreeBSD$");
#define MAX_REPORTS 50
#define DEFAULT_CHAT_TIMEOUT 45
int echo = 0;
int verbose = 0;
int to_log = 1;
int to_stderr = 0;
int Verbose = 0;
int quiet = 0;
int exit_code = 0;
FILE* report_fp = (FILE *) 0;
char *report_file = (char *) 0;
char *chat_file = (char *) 0;
char *phone_num = (char *) 0;
char *phone_num2 = (char *) 0;
int timeout = DEFAULT_CHAT_TIMEOUT;
static int echo;
static int verbose;
static int to_log;
static int to_stderr;
static int Verbose;
static int quiet;
static int exit_code;
static FILE* report_fp;
static char *report_file;
static char *chat_file;
static char *phone_num;
static char *phone_num2;
static int timeout = DEFAULT_CHAT_TIMEOUT;
static char blank[] = "";
int have_tty_parameters = 0;
static int have_tty_parameters;
#define term_parms struct termios
#define get_term_param(param) tcgetattr(0, param)
#define set_term_param(param) tcsetattr(0, TCSANOW, param)
struct termios saved_tty_parameters;
static struct termios saved_tty_parameters;
char *abort_string[MAX_ABORTS], *fail_reason = (char *)0,
fail_buffer[50];
int n_aborts = 0, abort_next = 0, timeout_next = 0, echo_next = 0;
int clear_abort_next = 0;
static char *abort_string[MAX_ABORTS], *fail_reason, fail_buffer[50];
static int n_aborts, abort_next, timeout_next, echo_next;
static int clear_abort_next;
char *report_string[MAX_REPORTS] ;
char report_buffer[50] ;
int n_reports = 0, report_next = 0, report_gathering = 0 ;
int clear_report_next = 0;
static char *report_string[MAX_REPORTS];
static char report_buffer[50];
static int n_reports, report_next, report_gathering;
static int clear_report_next;
int say_next = 0, hup_next = 0;
static int say_next, hup_next;
void *dup_mem(void *b, size_t c);
void *copy_of(char *s);
@ -396,14 +395,13 @@ usage(void)
exit(1);
}
char line[1024];
/*
* Send a message to syslog and/or stderr.
*/
void
chat_logf(const char *fmt, ...)
{
char line[1024];
va_list args;
va_start(args, fmt);
@ -422,6 +420,7 @@ chat_logf(const char *fmt, ...)
void
fatal(int code, const char *fmt, ...)
{
char line[1024];
va_list args;
va_start(args, fmt);
@ -434,7 +433,7 @@ fatal(int code, const char *fmt, ...)
terminate(code);
}
int alarmed = 0;
static int alarmed;
SIGTYPE sigalrm(int signo __unused)
{

View File

@ -329,7 +329,7 @@ compute_stats(struct ctl_lun_io_stats *cur_stats,
#define PRINT_BINTIME(prefix, bt) \
printf("%s %jd s %ju frac\n", prefix, (intmax_t)(bt).sec, \
(uintmax_t)(bt).frac)
const char *iotypes[] = {"NO IO", "READ", "WRITE"};
static const char *iotypes[] = {"NO IO", "READ", "WRITE"};
static void
ctlstat_dump(struct ctlstat_context *ctx) {

View File

@ -83,7 +83,7 @@ enum elf_member {
typedef enum elf_member elf_member_t;
int elf32_offsets[] = {
static int elf32_offsets[] = {
0,
offsetof(Elf32_Dyn, d_tag), offsetof(Elf32_Dyn, d_un.d_ptr),
@ -124,7 +124,7 @@ int elf32_offsets[] = {
offsetof(Elf32_Rela, r_addend)
};
int elf64_offsets[] = {
static int elf64_offsets[] = {
0,
offsetof(Elf64_Dyn, d_tag), offsetof(Elf64_Dyn, d_un.d_ptr),
@ -266,23 +266,23 @@ e_machines(u_int mach)
return (machdesc);
}
const char *e_types[] = {
static const char *e_types[] = {
"ET_NONE", "ET_REL", "ET_EXEC", "ET_DYN", "ET_CORE"
};
const char *ei_versions[] = {
static const char *ei_versions[] = {
"EV_NONE", "EV_CURRENT"
};
const char *ei_classes[] = {
static const char *ei_classes[] = {
"ELFCLASSNONE", "ELFCLASS32", "ELFCLASS64"
};
const char *ei_data[] = {
static const char *ei_data[] = {
"ELFDATANONE", "ELFDATA2LSB", "ELFDATA2MSB"
};
const char *ei_abis[256] = {
static const char *ei_abis[256] = {
"ELFOSABI_SYSV", "ELFOSABI_HPUX", "ELFOSABI_NETBSD", "ELFOSABI_LINUX",
"ELFOSABI_HURD", "ELFOSABI_86OPEN", "ELFOSABI_SOLARIS", "ELFOSABI_AIX",
"ELFOSABI_IRIX", "ELFOSABI_FREEBSD", "ELFOSABI_TRU64",
@ -290,12 +290,12 @@ const char *ei_abis[256] = {
[255] = "ELFOSABI_STANDALONE"
};
const char *p_types[] = {
static const char *p_types[] = {
"PT_NULL", "PT_LOAD", "PT_DYNAMIC", "PT_INTERP", "PT_NOTE",
"PT_SHLIB", "PT_PHDR", "PT_TLS"
};
const char *p_flags[] = {
static const char *p_flags[] = {
"", "PF_X", "PF_W", "PF_X|PF_W", "PF_R", "PF_X|PF_R", "PF_W|PF_R",
"PF_X|PF_W|PF_R"
};
@ -339,44 +339,47 @@ sh_types(u_int64_t sht) {
}
}
const char *sh_flags[] = {
static const char *sh_flags[] = {
"", "SHF_WRITE", "SHF_ALLOC", "SHF_WRITE|SHF_ALLOC", "SHF_EXECINSTR",
"SHF_WRITE|SHF_EXECINSTR", "SHF_ALLOC|SHF_EXECINSTR",
"SHF_WRITE|SHF_ALLOC|SHF_EXECINSTR"
};
const char *st_types[] = {
static const char *st_types[] = {
"STT_NOTYPE", "STT_OBJECT", "STT_FUNC", "STT_SECTION", "STT_FILE"
};
const char *st_bindings[] = {
static const char *st_bindings[] = {
"STB_LOCAL", "STB_GLOBAL", "STB_WEAK"
};
char *dynstr;
char *shstrtab;
char *strtab;
FILE *out;
static char *dynstr;
static char *shstrtab;
static char *strtab;
static FILE *out;
u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member);
u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member);
u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member);
u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member);
u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member);
static u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member);
static u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base,
elf_member_t member);
#if 0
static u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member);
#endif
static u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member);
static u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member);
void elf_print_ehdr(Elf32_Ehdr *e);
void elf_print_phdr(Elf32_Ehdr *e, void *p);
void elf_print_shdr(Elf32_Ehdr *e, void *sh);
void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str);
void elf_print_dynamic(Elf32_Ehdr *e, void *sh);
void elf_print_rel(Elf32_Ehdr *e, void *r);
void elf_print_rela(Elf32_Ehdr *e, void *ra);
void elf_print_interp(Elf32_Ehdr *e, void *p);
void elf_print_got(Elf32_Ehdr *e, void *sh);
void elf_print_hash(Elf32_Ehdr *e, void *sh);
void elf_print_note(Elf32_Ehdr *e, void *sh);
static void elf_print_ehdr(Elf32_Ehdr *e);
static void elf_print_phdr(Elf32_Ehdr *e, void *p);
static void elf_print_shdr(Elf32_Ehdr *e, void *sh);
static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str);
static void elf_print_dynamic(Elf32_Ehdr *e, void *sh);
static void elf_print_rel(Elf32_Ehdr *e, void *r);
static void elf_print_rela(Elf32_Ehdr *e, void *ra);
static void elf_print_interp(Elf32_Ehdr *e, void *p);
static void elf_print_got(Elf32_Ehdr *e, void *sh);
static void elf_print_hash(Elf32_Ehdr *e, void *sh);
static void elf_print_note(Elf32_Ehdr *e, void *sh);
void usage(void);
static void usage(void);
int
main(int ac, char **av)
@ -551,7 +554,7 @@ main(int ac, char **av)
return 0;
}
void
static void
elf_print_ehdr(Elf32_Ehdr *e)
{
u_int64_t class;
@ -606,7 +609,7 @@ elf_print_ehdr(Elf32_Ehdr *e)
fprintf(out, "\te_shstrndx: %jd\n", (intmax_t)shstrndx);
}
void
static void
elf_print_phdr(Elf32_Ehdr *e, void *p)
{
u_int64_t phentsize;
@ -648,7 +651,7 @@ elf_print_phdr(Elf32_Ehdr *e, void *p)
}
}
void
static void
elf_print_shdr(Elf32_Ehdr *e, void *sh)
{
u_int64_t shentsize;
@ -696,7 +699,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh)
}
}
void
static void
elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str)
{
u_int64_t offset;
@ -735,7 +738,7 @@ elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str)
}
}
void
static void
elf_print_dynamic(Elf32_Ehdr *e, void *sh)
{
u_int64_t offset;
@ -795,7 +798,7 @@ elf_print_dynamic(Elf32_Ehdr *e, void *sh)
}
}
void
static void
elf_print_rela(Elf32_Ehdr *e, void *sh)
{
u_int64_t offset;
@ -827,7 +830,7 @@ elf_print_rela(Elf32_Ehdr *e, void *sh)
}
}
void
static void
elf_print_rel(Elf32_Ehdr *e, void *sh)
{
u_int64_t offset;
@ -856,7 +859,7 @@ elf_print_rel(Elf32_Ehdr *e, void *sh)
}
}
void
static void
elf_print_interp(Elf32_Ehdr *e, void *p)
{
u_int64_t offset;
@ -868,7 +871,7 @@ elf_print_interp(Elf32_Ehdr *e, void *p)
fprintf(out, "\t%s\n", s);
}
void
static void
elf_print_got(Elf32_Ehdr *e, void *sh)
{
u_int64_t offset;
@ -891,12 +894,12 @@ elf_print_got(Elf32_Ehdr *e, void *sh)
}
}
void
static void
elf_print_hash(Elf32_Ehdr *e __unused, void *sh __unused)
{
}
void
static void
elf_print_note(Elf32_Ehdr *e, void *sh)
{
u_int64_t offset;
@ -922,7 +925,7 @@ elf_print_note(Elf32_Ehdr *e, void *sh)
}
}
u_int64_t
static u_int64_t
elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member)
{
u_int64_t val;
@ -942,7 +945,7 @@ elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member)
return val;
}
u_int64_t
static u_int64_t
elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member)
{
u_int64_t val;
@ -982,7 +985,8 @@ elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member)
return val;
}
u_int64_t
#if 0
static u_int64_t
elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member)
{
u_int64_t val;
@ -1021,8 +1025,9 @@ elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member)
return val;
}
#endif
u_int64_t
static u_int64_t
elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member)
{
u_int64_t val;
@ -1062,7 +1067,7 @@ elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member)
return val;
}
u_int64_t
static u_int64_t
elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member)
{
u_int64_t val;
@ -1102,7 +1107,7 @@ elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member)
return val;
}
void
static void
usage(void)
{
fprintf(stderr, "usage: elfdump -a | -cdeGhinprs [-w file] file\n");

View File

@ -51,47 +51,47 @@ __FBSDID("$FreeBSD$");
#define TIMEOUT 120
/* Option flags */
int A_flag; /* -A: do not follow 302 redirects */
int a_flag; /* -a: auto retry */
off_t B_size; /* -B: buffer size */
int b_flag; /*! -b: workaround TCP bug */
char *c_dirname; /* -c: remote directory */
int d_flag; /* -d: direct connection */
int F_flag; /* -F: restart without checking mtime */
char *f_filename; /* -f: file to fetch */
char *h_hostname; /* -h: host to fetch from */
int i_flag; /* -i: specify input file for mtime comparison */
char *i_filename; /* name of input file */
int l_flag; /* -l: link rather than copy file: URLs */
int m_flag; /* -[Mm]: mirror mode */
char *N_filename; /* -N: netrc file name */
int n_flag; /* -n: do not preserve modification time */
int o_flag; /* -o: specify output file */
int o_directory; /* output file is a directory */
char *o_filename; /* name of output file */
int o_stdout; /* output file is stdout */
int once_flag; /* -1: stop at first successful file */
int p_flag; /* -[Pp]: use passive FTP */
int R_flag; /* -R: don't delete partially transferred files */
int r_flag; /* -r: restart previously interrupted transfer */
off_t S_size; /* -S: require size to match */
int s_flag; /* -s: show size, don't fetch */
long T_secs; /* -T: transfer timeout in seconds */
int t_flag; /*! -t: workaround TCP bug */
int U_flag; /* -U: do not use high ports */
int v_level = 1; /* -v: verbosity level */
int v_tty; /* stdout is a tty */
pid_t pgrp; /* our process group */
long w_secs; /* -w: retry delay */
int family = PF_UNSPEC; /* -[46]: address family to use */
static int A_flag; /* -A: do not follow 302 redirects */
static int a_flag; /* -a: auto retry */
static off_t B_size; /* -B: buffer size */
static int b_flag; /*! -b: workaround TCP bug */
static char *c_dirname; /* -c: remote directory */
static int d_flag; /* -d: direct connection */
static int F_flag; /* -F: restart without checking mtime */
static char *f_filename; /* -f: file to fetch */
static char *h_hostname; /* -h: host to fetch from */
static int i_flag; /* -i: specify file for mtime comparison */
static char *i_filename; /* name of input file */
static int l_flag; /* -l: link rather than copy file: URLs */
static int m_flag; /* -[Mm]: mirror mode */
static char *N_filename; /* -N: netrc file name */
static int n_flag; /* -n: do not preserve modification time */
static int o_flag; /* -o: specify output file */
static int o_directory; /* output file is a directory */
static char *o_filename; /* name of output file */
static int o_stdout; /* output file is stdout */
static int once_flag; /* -1: stop at first successful file */
static int p_flag; /* -[Pp]: use passive FTP */
static int R_flag; /* -R: don't delete partial files */
static int r_flag; /* -r: restart previous transfer */
static off_t S_size; /* -S: require size to match */
static int s_flag; /* -s: show size, don't fetch */
static long T_secs; /* -T: transfer timeout in seconds */
static int t_flag; /*! -t: workaround TCP bug */
static int U_flag; /* -U: do not use high ports */
static int v_level = 1; /* -v: verbosity level */
static int v_tty; /* stdout is a tty */
static pid_t pgrp; /* our process group */
static long w_secs; /* -w: retry delay */
static int family = PF_UNSPEC; /* -[46]: address family to use */
int sigalrm; /* SIGALRM received */
int siginfo; /* SIGINFO received */
int sigint; /* SIGINT received */
static int sigalrm; /* SIGALRM received */
static int siginfo; /* SIGINFO received */
static int sigint; /* SIGINT received */
long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */
long http_timeout = TIMEOUT; /* default timeout for HTTP transfers */
char *buf; /* transfer buffer */
static long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */
static long http_timeout = TIMEOUT;/* default timeout for HTTP transfers */
static char *buf; /* transfer buffer */
/*

View File

@ -87,7 +87,8 @@ __FBSDID("$FreeBSD$");
DB *db;
time_t now;
int entries, gflag, kflag, lflag, mflag, pplan, sflag, oflag;
static int kflag, mflag, sflag;
int entries, gflag, lflag, pplan, oflag;
sa_family_t family = PF_UNSPEC;
int d_first = -1;
char tbuf[1024];

View File

@ -96,7 +96,7 @@ struct _setT {
LIST_ENTRY(_setT) entries;
};
LIST_HEAD(sethead, _setT) sethead;
static LIST_HEAD(sethead, _setT) sethead;
static struct _setT *curSet;
static char *curline = NULL;

View File

@ -82,14 +82,15 @@ int eflags = REG_STARTEND;
bool matchall;
/* Searching patterns */
unsigned int patterns, pattern_sz;
unsigned int patterns;
static unsigned int pattern_sz;
struct pat *pattern;
regex_t *r_pattern;
fastmatch_t *fg_pattern;
/* Filename exclusion/inclusion patterns */
unsigned int fpatterns, fpattern_sz;
unsigned int dpatterns, dpattern_sz;
unsigned int fpatterns, dpatterns;
static unsigned int fpattern_sz, dpattern_sz;
struct epat *dpattern, *fpattern;
/* For regex errors */

View File

@ -39,9 +39,9 @@ typedef struct {
} hashTable;
static int xmalloc_peak;
int xmalloc_current;
static int xmalloc_current;
static int xmalloc_peak_blocks;
int xmalloc_current_blocks;
static int xmalloc_current_blocks;
static int xmalloc_fail_after;
#define TABLE_BITS 8

View File

@ -77,10 +77,9 @@ static char_type magic_header[] =
static char_type rmask[9] =
{0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
/* XXX zuncompress global */
off_t total_compressed_bytes;
size_t compressed_prelen;
char *compressed_pre;
static off_t total_compressed_bytes;
static size_t compressed_prelen;
static char *compressed_pre;
struct s_zstate {
FILE *zs_fp; /* File stream for I/O */

View File

@ -105,47 +105,47 @@ __FBSDID("$FreeBSD$");
typedef char bool;
FILE *msgsrc;
FILE *newmsg;
const char *sep = "-";
char inbuf[BUFSIZ];
char fname[MAXPATHLEN];
char cmdbuf[MAXPATHLEN + MAXPATHLEN];
char subj[128];
char from[128];
char date[128];
char *ptr;
char *in;
bool local;
bool ruptible;
bool totty;
bool seenfrom;
bool seensubj;
bool blankline;
bool printing = NO;
bool mailing = NO;
bool quitit = NO;
bool sending = NO;
bool intrpflg = NO;
uid_t uid;
int msg;
int prevmsg;
int lct;
int nlines;
int Lpp = 0;
time_t t;
time_t keep;
static FILE *msgsrc;
static FILE *newmsg;
static const char *sep = "-";
static char inbuf[BUFSIZ];
static char fname[MAXPATHLEN];
static char cmdbuf[MAXPATHLEN + MAXPATHLEN];
static char subj[128];
static char from[128];
static char date[128];
static char *ptr;
static char *in;
static bool local;
static bool ruptible;
static bool totty;
static bool seenfrom;
static bool seensubj;
static bool blankline;
static bool printing = NO;
static bool mailing = NO;
static bool quitit = NO;
static bool sending = NO;
static bool intrpflg = NO;
static uid_t uid;
static int msg;
static int prevmsg;
static int lct;
static int nlines;
static int Lpp = 0;
static time_t t;
static time_t keep;
/* option initialization */
bool hdrs = NO;
bool qopt = NO;
bool hush = NO;
bool send_msg = NO;
bool locomode = NO;
bool use_pager = NO;
bool clean = NO;
bool lastcmd = NO;
jmp_buf tstpbuf;
static bool hdrs = NO;
static bool qopt = NO;
static bool hush = NO;
static bool send_msg = NO;
static bool locomode = NO;
static bool use_pager = NO;
static bool clean = NO;
static bool lastcmd = NO;
static jmp_buf tstpbuf;
static void ask(const char *);
static void gfrsub(FILE *);
@ -155,7 +155,7 @@ static char *nxtfld(char *);
static void onsusp(int);
static void onintr(int);
static void prmesg(int);
static void usage(void);
static void usage(void);
int
main(int argc, char *argv[])

View File

@ -24,10 +24,8 @@
* SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <calendar.h>
#include <ctype.h>
@ -111,77 +109,81 @@ static struct djswitch {
{"YU", "Yugoslavia", {1919, 3, 4}}
};
struct djswitch *dftswitch =
static struct djswitch *dftswitch =
switches + sizeof(switches) / sizeof(struct djswitch) - 2;
/* default switch (should be "US") */
/* Table used to print day of month and week numbers */
char daystr[] = " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
" 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"
" 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47"
" 48 49 50 51 52 53";
static char daystr[] = " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
" 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"
" 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47"
" 48 49 50 51 52 53";
/* Table used to print day of year and week numbers */
char jdaystr[] = " 1 2 3 4 5 6 7 8 9"
" 10 11 12 13 14 15 16 17 18 19"
" 20 21 22 23 24 25 26 27 28 29"
" 30 31 32 33 34 35 36 37 38 39"
" 40 41 42 43 44 45 46 47 48 49"
" 50 51 52 53 54 55 56 57 58 59"
" 60 61 62 63 64 65 66 67 68 69"
" 70 71 72 73 74 75 76 77 78 79"
" 80 81 82 83 84 85 86 87 88 89"
" 90 91 92 93 94 95 96 97 98 99"
" 100 101 102 103 104 105 106 107 108 109"
" 110 111 112 113 114 115 116 117 118 119"
" 120 121 122 123 124 125 126 127 128 129"
" 130 131 132 133 134 135 136 137 138 139"
" 140 141 142 143 144 145 146 147 148 149"
" 150 151 152 153 154 155 156 157 158 159"
" 160 161 162 163 164 165 166 167 168 169"
" 170 171 172 173 174 175 176 177 178 179"
" 180 181 182 183 184 185 186 187 188 189"
" 190 191 192 193 194 195 196 197 198 199"
" 200 201 202 203 204 205 206 207 208 209"
" 210 211 212 213 214 215 216 217 218 219"
" 220 221 222 223 224 225 226 227 228 229"
" 230 231 232 233 234 235 236 237 238 239"
" 240 241 242 243 244 245 246 247 248 249"
" 250 251 252 253 254 255 256 257 258 259"
" 260 261 262 263 264 265 266 267 268 269"
" 270 271 272 273 274 275 276 277 278 279"
" 280 281 282 283 284 285 286 287 288 289"
" 290 291 292 293 294 295 296 297 298 299"
" 300 301 302 303 304 305 306 307 308 309"
" 310 311 312 313 314 315 316 317 318 319"
" 320 321 322 323 324 325 326 327 328 329"
" 330 331 332 333 334 335 336 337 338 339"
" 340 341 342 343 344 345 346 347 348 349"
" 350 351 352 353 354 355 356 357 358 359"
" 360 361 362 363 364 365 366";
static char jdaystr[] = " 1 2 3 4 5 6 7 8 9"
" 10 11 12 13 14 15 16 17 18 19"
" 20 21 22 23 24 25 26 27 28 29"
" 30 31 32 33 34 35 36 37 38 39"
" 40 41 42 43 44 45 46 47 48 49"
" 50 51 52 53 54 55 56 57 58 59"
" 60 61 62 63 64 65 66 67 68 69"
" 70 71 72 73 74 75 76 77 78 79"
" 80 81 82 83 84 85 86 87 88 89"
" 90 91 92 93 94 95 96 97 98 99"
" 100 101 102 103 104 105 106 107 108 109"
" 110 111 112 113 114 115 116 117 118 119"
" 120 121 122 123 124 125 126 127 128 129"
" 130 131 132 133 134 135 136 137 138 139"
" 140 141 142 143 144 145 146 147 148 149"
" 150 151 152 153 154 155 156 157 158 159"
" 160 161 162 163 164 165 166 167 168 169"
" 170 171 172 173 174 175 176 177 178 179"
" 180 181 182 183 184 185 186 187 188 189"
" 190 191 192 193 194 195 196 197 198 199"
" 200 201 202 203 204 205 206 207 208 209"
" 210 211 212 213 214 215 216 217 218 219"
" 220 221 222 223 224 225 226 227 228 229"
" 230 231 232 233 234 235 236 237 238 239"
" 240 241 242 243 244 245 246 247 248 249"
" 250 251 252 253 254 255 256 257 258 259"
" 260 261 262 263 264 265 266 267 268 269"
" 270 271 272 273 274 275 276 277 278 279"
" 280 281 282 283 284 285 286 287 288 289"
" 290 291 292 293 294 295 296 297 298 299"
" 300 301 302 303 304 305 306 307 308 309"
" 310 311 312 313 314 315 316 317 318 319"
" 320 321 322 323 324 325 326 327 328 329"
" 330 331 332 333 334 335 336 337 338 339"
" 340 341 342 343 344 345 346 347 348 349"
" 350 351 352 353 354 355 356 357 358 359"
" 360 361 362 363 364 365 366";
int flag_nohighlight; /* user doesn't want a highlighted today */
int flag_weeks; /* user wants number of week */
int nswitch; /* user defined switch date */
int nswitchb; /* switch date for backward compatibility */
int highlightdate;
static int flag_nohighlight; /* user doesn't want a highlighted today */
static int flag_weeks; /* user wants number of week */
static int nswitch; /* user defined switch date */
static int nswitchb; /* switch date for backward compatibility */
static int highlightdate;
char *center(char *s, char *t, int w);
wchar_t *wcenter(wchar_t *s, wchar_t *t, int w);
int firstday(int y, int m);
void highlight(char *dst, char *src, int len, int *extraletters);
void mkmonthr(int year, int month, int jd_flag, struct monthlines * monthl);
void mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl);
void mkweekdays(struct weekdays * wds);
void monthranger(int year, int m, int jd_flag, int before, int after);
void monthrangeb(int year, int m, int jd_flag, int before, int after);
int parsemonth(const char *s, int *m, int *y);
void printcc(void);
void printeaster(int year, int julian, int orthodox);
date *sdater(int ndays, struct date * d);
date *sdateb(int ndays, struct date * d);
int sndaysr(struct date * d);
int sndaysb(struct date * d);
static char *center(char *s, char *t, int w);
static wchar_t *wcenter(wchar_t *s, wchar_t *t, int w);
static int firstday(int y, int m);
static void highlight(char *dst, char *src, int len, int *extraletters);
static void mkmonthr(int year, int month, int jd_flag,
struct monthlines * monthl);
static void mkmonthb(int year, int month, int jd_flag,
struct monthlines * monthl);
static void mkweekdays(struct weekdays * wds);
static void monthranger(int year, int m, int jd_flag,
int before, int after);
static void monthrangeb(int year, int m, int jd_flag,
int before, int after);
static int parsemonth(const char *s, int *m, int *y);
static void printcc(void);
static void printeaster(int year, int julian, int orthodox);
static date *sdater(int ndays, struct date * d);
static date *sdateb(int ndays, struct date * d);
static int sndaysr(struct date * d);
static int sndaysb(struct date * d);
static void usage(void);
int
@ -513,7 +515,7 @@ usage(void)
}
/* Print the assumed switches for all countries. */
void
static void
printcc(void)
{
struct djswitch *p;
@ -534,7 +536,7 @@ printcc(void)
}
/* Print the date of easter sunday. */
void
static void
printeaster(int y, int julian, int orthodox)
{
date dt;
@ -579,7 +581,7 @@ printeaster(int y, int julian, int orthodox)
#define M2M(m) (1 + (m) % 12)
/* Print all months for the period in the range [ before .. y-m .. after ]. */
void
static void
monthrangeb(int y, int m, int jd_flag, int before, int after)
{
struct monthlines year[12];
@ -669,7 +671,7 @@ monthrangeb(int y, int m, int jd_flag, int before, int after)
}
}
void
static void
monthranger(int y, int m, int jd_flag, int before, int after)
{
struct monthlines year[12];
@ -757,7 +759,7 @@ monthranger(int y, int m, int jd_flag, int before, int after)
return;
}
void
static void
mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines)
{
@ -848,7 +850,7 @@ mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines)
}
}
void
static void
mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines)
{
@ -945,7 +947,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines)
}
/* Put the local names of weekdays into the wds. */
void
static void
mkweekdays(struct weekdays *wds)
{
int i, len, width = 0;
@ -973,7 +975,7 @@ mkweekdays(struct weekdays *wds)
* Compute the day number of the first existing date after the first day in
* month. (the first day in month and even the month might not exist!)
*/
int
static int
firstday(int y, int m)
{
date dt;
@ -997,7 +999,7 @@ firstday(int y, int m)
* Compute the number of days from date, obey the local switch from
* Julian to Gregorian if specified by the user.
*/
int
static int
sndaysr(struct date *d)
{
@ -1014,7 +1016,7 @@ sndaysr(struct date *d)
* Compute the number of days from date, obey the switch from
* Julian to Gregorian as used by UK and her colonies.
*/
int
static int
sndaysb(struct date *d)
{
@ -1025,7 +1027,7 @@ sndaysb(struct date *d)
}
/* Inverse of sndays. */
struct date *
static struct date *
sdater(int nd, struct date *d)
{
@ -1036,7 +1038,7 @@ sdater(int nd, struct date *d)
}
/* Inverse of sndaysb. */
struct date *
static struct date *
sdateb(int nd, struct date *d)
{
@ -1047,7 +1049,7 @@ sdateb(int nd, struct date *d)
}
/* Center string t in string s of length w by putting enough leading blanks. */
char *
static char *
center(char *s, char *t, int w)
{
char blanks[MAX_WIDTH];
@ -1058,7 +1060,7 @@ center(char *s, char *t, int w)
}
/* Center string t in string s of length w by putting enough leading blanks. */
wchar_t *
static wchar_t *
wcenter(wchar_t *s, wchar_t *t, int w)
{
char blanks[MAX_WIDTH];
@ -1068,7 +1070,7 @@ wcenter(wchar_t *s, wchar_t *t, int w)
return (s);
}
int
static int
parsemonth(const char *s, int *m, int *y)
{
int nm, ny;
@ -1101,7 +1103,7 @@ parsemonth(const char *s, int *m, int *y)
return (1);
}
void
static void
highlight(char *dst, char *src, int len, int *extralen)
{
static int first = 1;

View File

@ -92,35 +92,35 @@ __FBSDID("$FreeBSD$");
#define SIGUSR1 30
#endif
int eight, rem;
struct termios deftty;
static int eight, rem;
static struct termios deftty;
int family = PF_UNSPEC;
static int family = PF_UNSPEC;
int noescape;
u_char escapechar = '~';
static int noescape;
static u_char escapechar = '~';
#define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp)
struct winsize winsize;
static struct winsize winsize;
void catch_child(int);
void copytochild(int);
void doit(long) __dead2;
void done(int) __dead2;
void echo(char);
u_int getescape(const char *);
void lostpeer(int);
void mode(int);
void msg(const char *);
void oob(int);
int reader(int);
void sendwindow(void);
void setsignal(int);
void sigwinch(int);
void stop(char);
void usage(void) __dead2;
void writer(void);
void writeroob(int);
static void catch_child(int);
static void copytochild(int);
static _Noreturn void doit(long);
static _Noreturn void done(int);
static void echo(char);
static u_int getescape(const char *);
static void lostpeer(int);
static void mode(int);
static void msg(const char *);
static void oob(int);
static int reader(int);
static void sendwindow(void);
static void setsignal(int);
static void sigwinch(int);
static void stop(char);
static _Noreturn void usage(void);
static void writer(void);
static void writeroob(int);
int
main(int argc, char *argv[])
@ -269,9 +269,9 @@ main(int argc, char *argv[])
/*NOTREACHED*/
}
int child;
static int child;
void
static void
doit(long omask)
{
@ -309,7 +309,7 @@ doit(long omask)
}
/* trap a signal, unless it is being ignored. */
void
static void
setsignal(int sig)
{
int omask = sigblock(sigmask(sig));
@ -319,7 +319,7 @@ setsignal(int sig)
(void)sigsetmask(omask);
}
void
static void
done(int status)
{
int w, wstatus;
@ -334,14 +334,14 @@ done(int status)
exit(status);
}
int dosigwinch;
static int dosigwinch;
/*
* This is called when the reader process gets the out-of-band (urgent)
* request to turn on the window-changing protocol.
*/
/* ARGSUSED */
void
static void
writeroob(int signo __unused)
{
if (dosigwinch == 0) {
@ -352,7 +352,7 @@ writeroob(int signo __unused)
}
/* ARGSUSED */
void
static void
catch_child(int signo __unused)
{
pid_t pid;
@ -375,7 +375,7 @@ catch_child(int signo __unused)
* ~^Z suspend rlogin process.
* ~<delayed-suspend char> suspend rlogin process, but leave reader alone.
*/
void
static void
writer(void)
{
int bol, local, n;
@ -432,7 +432,7 @@ writer(void)
}
}
void
static void
echo(char c)
{
char *p;
@ -454,7 +454,7 @@ echo(char c)
(void)write(STDOUT_FILENO, buf, p - buf);
}
void
static void
stop(char cmdc)
{
mode(0);
@ -466,7 +466,7 @@ stop(char cmdc)
}
/* ARGSUSED */
void
static void
sigwinch(int signo __unused)
{
struct winsize ws;
@ -481,7 +481,7 @@ sigwinch(int signo __unused)
/*
* Send the window size to the server via the magic escape
*/
void
static void
sendwindow(void)
{
struct winsize ws;
@ -506,13 +506,13 @@ sendwindow(void)
#define READING 1
#define WRITING 2
jmp_buf rcvtop;
int rcvcnt, rcvstate;
pid_t ppid;
char rcvbuf[8 * 1024];
static jmp_buf rcvtop;
static int rcvcnt, rcvstate;
static pid_t ppid;
static char rcvbuf[8 * 1024];
/* ARGSUSED */
void
static void
oob(int signo __unused)
{
struct termios tty;
@ -593,7 +593,7 @@ oob(int signo __unused)
}
/* reader: read from remote: line -> 1 */
int
static int
reader(int omask)
{
int n, remaining;
@ -636,7 +636,7 @@ reader(int omask)
}
}
void
static void
mode(int f)
{
struct termios tty;
@ -667,7 +667,7 @@ mode(int f)
}
/* ARGSUSED */
void
static void
lostpeer(int signo __unused)
{
(void)signal(SIGPIPE, SIG_IGN);
@ -677,19 +677,19 @@ lostpeer(int signo __unused)
/* copy SIGURGs to the child process via SIGUSR1. */
/* ARGSUSED */
void
static void
copytochild(int signo __unused)
{
(void)kill(child, SIGUSR1);
}
void
static void
msg(const char *str)
{
(void)fprintf(stderr, "rlogin: %s\r\n", str);
}
void
static void
usage(void)
{
(void)fprintf(stderr,
@ -698,7 +698,7 @@ usage(void)
exit(1);
}
u_int
static u_int
getescape(const char *p)
{
long val;

View File

@ -435,7 +435,7 @@ c_initialize(void)
}
const char rpcgen_table_dcl[] = "struct rpcgen_table {\n\
static const char rpcgen_table_dcl[] = "struct rpcgen_table {\n\
char *(*proc)(); \n\
xdrproc_t xdr_arg; \n\
unsigned len_arg; \n\

View File

@ -54,7 +54,7 @@ static char RESULT[] = "result";
static char ROUTINE[] = "local";
static char RETVAL[] = "retval";
char _errbuf[256]; /* For all messages */
static char _errbuf[256]; /* For all messages */
void internal_proctype( proc_list * );
static void write_real_program( definition * );

View File

@ -59,8 +59,8 @@ int linenum = 0; /* current line number */
const char *infilename; /* input filename */
#define NFILES 7
const char *outfiles[NFILES]; /* output file names */
int nfiles;
static const char *outfiles[NFILES]; /* output file names */
static int nfiles;
FILE *fout; /* file pointer of current output */
FILE *fin; /* file pointer of current input */

View File

@ -146,7 +146,7 @@ enum
#define NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS 6
static const char mutually_exclusive_flags[NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS] = { 'M', 'n', 'g', 'R', 'h', 'V' };
struct option long_options[] = {
static struct option long_options[] = {
{ "batch-size", required_argument, NULL, BS_OPT },
{ "buffer-size", required_argument, NULL, 'S' },
{ "check", optional_argument, NULL, 'c' },

View File

@ -189,8 +189,8 @@ int format1(const struct stat *, /* stat info */
char *xfflagstostr(unsigned long);
#endif
const char *timefmt;
int linkfail;
static const char *timefmt;
static int linkfail;
#define addchar(s, c, nl) \
do { \

View File

@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$");
typedef struct sockaddr_storage peeraddr;
static int connected;
static char mode[32];
jmp_buf toplevel;
static jmp_buf toplevel;
volatile int txrx_error;
static int peer;
@ -89,7 +89,7 @@ static int margc;
static char *margv[MAX_MARGV];
int verbose;
char *port = NULL;
static char *port = NULL;
static void get(int, char **);
static void help(int, char **);

View File

@ -30,9 +30,12 @@
* $FreeBSD$
*/
#include <termios.h>
extern struct termios mode, oldmode;
extern int Columns, isreset, Lines;
extern int erasech, intrchar, killch;
extern speed_t Ospeed;
void add_mapping(const char *, char *);
void cat(char *);

View File

@ -44,8 +44,7 @@ static const char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/9/93";
#include "extern.h"
extern speed_t Ospeed;
speed_t tset_baudrate(char *);
static speed_t tset_baudrate(char *);
/* Baud rate conditionals for mapping. */
#define GT 0x01
@ -63,7 +62,7 @@ typedef struct map {
speed_t speed; /* Baud rate to compare against. */
} MAP;
MAP *cur, *maplist;
static MAP *cur, *maplist;
/*
* Syntax for -m:
@ -224,7 +223,7 @@ typedef struct speeds {
speed_t speed;
} SPEEDS;
SPEEDS speeds[] = {
static SPEEDS speeds[] = {
{ "0", B0 },
{ "134.5", B134 },
{ "exta", B19200 },
@ -232,7 +231,7 @@ SPEEDS speeds[] = {
{ NULL, 0 }
};
speed_t
static speed_t
tset_baudrate(char *rate)
{
SPEEDS *sp;

View File

@ -46,7 +46,7 @@ static const char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93";
#include <ttyent.h>
#include "extern.h"
char tbuf[1024]; /* Termcap entry. */
static char tbuf[1024]; /* Termcap entry. */
const char *askuser(const char *);
char *ttys(char *);

View File

@ -340,12 +340,13 @@ acpi_print_local_nmi(u_int lint, uint16_t mps_flags)
acpi_print_mps_flags(mps_flags);
}
const char *apic_types[] = { "Local APIC", "IO APIC", "INT Override", "NMI",
"Local APIC NMI", "Local APIC Override",
"IO SAPIC", "Local SAPIC", "Platform Interrupt",
"Local X2APIC", "Local X2APIC NMI" };
const char *platform_int_types[] = { "0 (unknown)", "PMI", "INIT",
"Corrected Platform Error" };
static const char *apic_types[] = { "Local APIC", "IO APIC", "INT Override",
"NMI", "Local APIC NMI",
"Local APIC Override", "IO SAPIC",
"Local SAPIC", "Platform Interrupt",
"Local X2APIC", "Local X2APIC NMI" };
static const char *platform_int_types[] = { "0 (unknown)", "PMI", "INIT",
"Corrected Platform Error" };
static void
acpi_print_madt(ACPI_SUBTABLE_HEADER *mp)
@ -747,7 +748,7 @@ acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp)
printf("\tProximity Domain=%d\n", mp->ProximityDomain);
}
const char *srat_types[] = { "CPU", "Memory", "X2APIC" };
static const char *srat_types[] = { "CPU", "Memory", "X2APIC" };
static void
acpi_print_srat(ACPI_SUBTABLE_HEADER *srat)

View File

@ -53,7 +53,7 @@ struct acpi_user_mapping {
size_t size;
};
LIST_HEAD(acpi_user_mapping_list, acpi_user_mapping) maplist;
static LIST_HEAD(acpi_user_mapping_list, acpi_user_mapping) maplist;
static void
acpi_user_init(void)

View File

@ -86,7 +86,7 @@ struct datadir {
};
static SLIST_HEAD(, datadir) datadirs = SLIST_HEAD_INITIALIZER(datadirs);
struct ucode_handler {
static struct ucode_handler {
ucode_probe_t *probe;
ucode_update_t *update;
} handlers[] = {

View File

@ -164,7 +164,7 @@ typedef enum {
static const char rw_opts[] = "Nb:c:d:f:l:";
static const char startstop_opts[] = "io";
struct ctladm_opts option_table[] = {
static struct ctladm_opts option_table[] = {
{"adddev", CTLADM_CMD_ADDDEV, CTLADM_ARG_NONE, NULL},
{"bbrread", CTLADM_CMD_BBRREAD, CTLADM_ARG_NEED_TL, "d:l:"},
{"create", CTLADM_CMD_CREATE, CTLADM_ARG_NONE, "b:B:d:l:o:s:S:t:"},
@ -572,7 +572,7 @@ typedef enum {
CCTL_PORT_MODE_OFF
} cctl_port_mode;
struct ctladm_opts cctl_fe_table[] = {
static struct ctladm_opts cctl_fe_table[] = {
{"fc", CTL_PORT_FC, CTLADM_ARG_NONE, NULL},
{"scsi", CTL_PORT_SCSI, CTLADM_ARG_NONE, NULL},
{"internal", CTL_PORT_INTERNAL, CTLADM_ARG_NONE, NULL},
@ -999,7 +999,7 @@ cctl_getsetsync(int fd, int target, int lun, ctladm_cmdfunction command,
return (retval);
}
struct ctladm_opts cctl_err_types[] = {
static struct ctladm_opts cctl_err_types[] = {
{"aborted", CTL_LUN_INJ_ABORTED, CTLADM_ARG_NONE, NULL},
{"mediumerr", CTL_LUN_INJ_MEDIUM_ERR, CTLADM_ARG_NONE, NULL},
{"ua", CTL_LUN_INJ_UA, CTLADM_ARG_NONE, NULL},
@ -1008,7 +1008,7 @@ struct ctladm_opts cctl_err_types[] = {
};
struct ctladm_opts cctl_err_patterns[] = {
static struct ctladm_opts cctl_err_patterns[] = {
{"read", CTL_LUN_PAT_READ, CTLADM_ARG_NONE, NULL},
{"write", CTL_LUN_PAT_WRITE, CTLADM_ARG_NONE, NULL},
{"rw", CTL_LUN_PAT_READWRITE, CTLADM_ARG_NONE, NULL},

View File

@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#include <camlib.h>
#include "ctladm.h"
int verbose;
static int verbose;
/* iget: Integer argument callback
*/

View File

@ -43,7 +43,7 @@ struct flag_desc {
uint32_t flag;
};
struct flag_desc gpio_flags[] = {
static struct flag_desc gpio_flags[] = {
{ "IN", GPIO_PIN_INPUT },
{ "OUT", GPIO_PIN_OUTPUT },
{ "OD", GPIO_PIN_OPENDRAIN },

View File

@ -59,7 +59,7 @@ struct policyqueue {
struct in6_addrpolicy pc_policy;
};
TAILQ_HEAD(policyhead, policyqueue);
struct policyhead policyhead;
static struct policyhead policyhead;
static void usage(void);
static void get_policy(void);

View File

@ -42,8 +42,6 @@
#define FLASH_BUF_SIZE (64 * 1024)
int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
static void
scan_firmware(struct mfi_info_component *comp)
{

View File

@ -570,8 +570,6 @@ show_drives(int ac, char **av __unused)
}
MFI_COMMAND(show, drives, show_drives);
int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
static void
scan_firmware(struct mfi_info_component *comp)
{

View File

@ -44,8 +44,8 @@ MFI_TABLE(top, stop);
MFI_TABLE(top, abort);
int mfi_unit;
u_int mfi_opts;
int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
static void
usage(void)

View File

@ -122,6 +122,7 @@ struct mfiutil_command {
extern int mfi_unit;
extern u_int mfi_opts;
extern int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref);
void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref);

View File

@ -66,12 +66,12 @@ __FBSDID("$FreeBSD$");
/* Global defs */
#ifdef DEBUG
#define syslog(e, s) fprintf(stderr,(s))
int debug = 1;
static int debug = 1;
#else
int debug = 0;
static int debug = 0;
#endif
pid_t children;
static pid_t children;
static void nonfs(int);
static void reapchild(int);

View File

@ -75,22 +75,22 @@ static const char rcsid[] =
/* Global defs */
#ifdef DEBUG
#define syslog(e, s...) fprintf(stderr,s)
int debug = 1;
static int debug = 1;
#else
int debug = 0;
static int debug = 0;
#endif
#define NFSD_STABLERESTART "/var/db/nfs-stablerestart"
#define NFSD_STABLEBACKUP "/var/db/nfs-stablerestart.bak"
#define MAXNFSDCNT 256
#define DEFNFSDCNT 4
pid_t children[MAXNFSDCNT]; /* PIDs of children */
int nfsdcnt; /* number of children */
int new_syscall;
int run_v4server = 1; /* Force running of nfsv4 server */
int nfssvc_nfsd; /* Set to correct NFSSVC_xxx flag */
int stablefd = -1; /* Fd for the stable restart file */
int backupfd; /* Fd for the backup stable restart file */
static pid_t children[MAXNFSDCNT]; /* PIDs of children */
static int nfsdcnt; /* number of children */
static int new_syscall;
static int run_v4server = 1; /* Force running of nfsv4 server */
static int nfssvc_nfsd; /* Set to correct NFSSVC_xxx flag */
static int stablefd = -1; /* Fd for the stable restart file */
static int backupfd; /* Fd for the backup stable restart file */
void cleanup(int);
void child_cleanup(int);

View File

@ -34,7 +34,7 @@ struct _elf_corres {
const char *string;
};
struct _elf_corres mach_corres[] = {
static struct _elf_corres mach_corres[] = {
{ EM_386, "x86" },
{ EM_AMD64, "x86" },
{ EM_ARM, "arm" },
@ -46,23 +46,18 @@ struct _elf_corres mach_corres[] = {
{ -1, NULL },
};
struct _elf_corres wordsize_corres[] = {
static struct _elf_corres wordsize_corres[] = {
{ ELFCLASS32, "32" },
{ ELFCLASS64, "64" },
{ -1, NULL},
};
struct _elf_corres endian_corres[] = {
static struct _elf_corres endian_corres[] = {
{ ELFDATA2MSB, "eb" },
{ ELFDATA2LSB, "el" },
{ -1, NULL}
};
struct _elf_corres os_corres[] = {
{ ELFOSABI_FREEBSD, "freebsd" },
{ -1, NULL }
};
#define EF_MIPS_ABI 0x0000F000
#define E_MIPS_ABI_O32 0x00001000
#define E_MIPS_ABI_N32 0x00000020

View File

@ -27,9 +27,9 @@ __FBSDID("$FreeBSD$");
#include <fetch.h>
#include <signal.h>
FILE *IndexFile;
char IndexPath[PATH_MAX] = "";
struct index_head Index = SLIST_HEAD_INITIALIZER(Index);
static FILE *IndexFile;
static char IndexPath[PATH_MAX] = "";
static struct index_head Index = SLIST_HEAD_INITIALIZER(Index);
static int pkg_do(char *);
static void show_version(Package, const char *, const char *);

View File

@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
#define PMCC_PROGRAM_NAME "pmccontrol"
STAILQ_HEAD(pmcc_op_list, pmcc_op) head = STAILQ_HEAD_INITIALIZER(head);
static STAILQ_HEAD(pmcc_op_list, pmcc_op) head = STAILQ_HEAD_INITIALIZER(head);
struct pmcc_op {
char op_cpu;
@ -94,7 +94,7 @@ static char usage_message[] =
" " PMCC_PROGRAM_NAME " [-e pmc | -d pmc | -c cpu] ...";
#if DEBUG
FILE *debug_stream = NULL;
static FILE *debug_stream = NULL;
#endif
#if DEBUG
@ -104,15 +104,6 @@ FILE *debug_stream = NULL;
#define DEBUG_MSG(m) /* */
#endif /* !DEBUG */
int pmc_syscall = -1;
#define PMC_CALL(cmd, params) \
if ((error = syscall(pmc_syscall, PMC_OP_##cmd, (params))) != 0) \
{ \
DEBUG_MSG("ERROR: syscall [" #cmd "]"); \
exit(EX_OSERR); \
}
#if DEBUG
/* log debug messages to a separate file */
static void

View File

@ -125,7 +125,7 @@ struct pmcpl_ct_node_hash {
STAILQ_ENTRY(pmcpl_ct_node_hash) pch_next;
};
struct pmcpl_ct_sample pmcpl_ct_callid;
static struct pmcpl_ct_sample pmcpl_ct_callid;
#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX
#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */
@ -135,8 +135,8 @@ struct pmcpl_ct_line {
unsigned ln_index;
};
struct pmcpl_ct_line pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1];
struct pmcpl_ct_node
static struct pmcpl_ct_line pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1];
static struct pmcpl_ct_node
*pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1];
/*

View File

@ -105,13 +105,12 @@ __FBSDID("$FreeBSD$");
/* Globals */
int pmcstat_interrupt = 0;
int pmcstat_displayheight = DEFAULT_DISPLAY_HEIGHT;
int pmcstat_displaywidth = DEFAULT_DISPLAY_WIDTH;
int pmcstat_sockpair[NSOCKPAIRFD];
int pmcstat_kq;
kvm_t *pmcstat_kvm;
struct kinfo_proc *pmcstat_plist;
int pmcstat_displayheight = DEFAULT_DISPLAY_HEIGHT;
int pmcstat_displaywidth = DEFAULT_DISPLAY_WIDTH;
static int pmcstat_sockpair[NSOCKPAIRFD];
static int pmcstat_kq;
static kvm_t *pmcstat_kvm;
static struct kinfo_proc *pmcstat_plist;
struct pmcstat_args args;
static void

View File

@ -142,7 +142,7 @@ struct pmcstat_image_hash_list pmcstat_image_hash[PMCSTAT_NHASH];
struct pmcstat_process_hash_list pmcstat_process_hash[PMCSTAT_NHASH];
struct pmcstat_stats pmcstat_stats; /* statistics */
int ps_samples_period; /* samples count between top refresh. */
static int ps_samples_period; /* samples count between top refresh. */
struct pmcstat_process *pmcstat_kernproc; /* kernel 'process' */
@ -151,7 +151,7 @@ struct pmcstat_process *pmcstat_kernproc; /* kernel 'process' */
#include "pmcpl_annotate.h"
#include "pmcpl_calltree.h"
struct pmc_plugins {
static struct pmc_plugins {
const char *pl_name; /* name */
/* configure */
@ -218,7 +218,7 @@ struct pmc_plugins {
}
};
int pmcstat_mergepmc;
static int pmcstat_mergepmc;
int pmcstat_pmcinfilter = 0; /* PMC filter for top mode. */
float pmcstat_threshold = 0.5; /* Cost filter for top mode. */
@ -275,7 +275,7 @@ int pmcstat_npmcs;
/*
* PMC Top mode pause state.
*/
int pmcstat_pause;
static int pmcstat_pause;
static void
pmcstat_stats_reset(int reset_global)

View File

@ -176,8 +176,8 @@ extern int pmcstat_npmcs; /* PMC count. */
/*
* Top mode global options.
*/
float pmcstat_threshold; /* Threshold to filter node. */
int pmcstat_pmcinfilter; /* PMC index displayed. */
extern float pmcstat_threshold; /* Threshold to filter node. */
extern int pmcstat_pmcinfilter; /* PMC index displayed. */
/* Function prototypes */
const char *pmcstat_pmcid_to_name(pmc_id_t _pmcid);

View File

@ -59,16 +59,15 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
const char *qfname = QUOTAFILENAME;
const char *qfextension[] = INITQFNAMES;
static const char *qfextension[] = INITQFNAMES;
int aflag; /* all filesystems */
int gflag; /* operate on group quotas */
int uflag; /* operate on user quotas */
int vflag; /* verbose */
static int aflag; /* all filesystems */
static int gflag; /* operate on group quotas */
static int uflag; /* operate on user quotas */
static int vflag; /* verbose */
int oneof(char *, char *[], int);
int quotaonoff(struct fstab *fs, int, int);
static int oneof(char *, char *[], int);
static int quotaonoff(struct fstab *fs, int, int);
static void usage(void);
int
@ -150,7 +149,7 @@ usage(void)
exit(1);
}
int
static int
quotaonoff(struct fstab *fs, int offmode, int type)
{
struct quotafile *qf;
@ -181,7 +180,7 @@ quotaonoff(struct fstab *fs, int offmode, int type)
/*
* Check to see if target appears in list of size cnt.
*/
int
static int
oneof(char *target, char *list[], int cnt)
{
int i;

View File

@ -79,8 +79,7 @@ __FBSDID("$FreeBSD$");
#define max(a,b) ((a) >= (b) ? (a) : (b))
const char *qfname = QUOTAFILENAME;
const char *qfextension[] = INITQFNAMES;
static const char *qfextension[] = INITQFNAMES;
struct fileusage {
struct fileusage *fu_next;
@ -89,15 +88,15 @@ struct fileusage {
/* actually bigger */
};
#define FUHASH 1024 /* must be power of two */
struct fileusage *fuhead[MAXQUOTAS][FUHASH];
struct fileusage *lookup(u_long, int);
struct fileusage *addid(u_long, int, char *);
u_long highid[MAXQUOTAS]; /* highest addid()'ed identifier per type */
static struct fileusage *fuhead[MAXQUOTAS][FUHASH];
static struct fileusage *lookup(u_long, int);
static struct fileusage *addid(u_long, int, char *);
static u_long highid[MAXQUOTAS]; /* highest addid()'ed identifier per type */
int vflag; /* verbose */
int aflag; /* all filesystems */
int nflag; /* display user/group by id */
int hflag; /* display in human readable format */
static int vflag; /* verbose */
static int aflag; /* all filesystems */
static int nflag; /* display user/group by id */
static int hflag; /* display in human readable format */
int oneof(char *, char *[], int);
int repquota(struct fstab *, int);

View File

@ -70,7 +70,7 @@ static const char *legal_colors[16] = {
"lightred", "lightmagenta", "yellow", "lightwhite"
};
struct {
static struct {
int active_vty;
vid_info_t console_info;
unsigned char screen_map[256];