Patch from Bernhard Fischer to make a bunch of symbols static

which were otherwise cluttering the global namespace.
This commit is contained in:
Eric Andersen
2005-04-16 19:39:00 +00:00
parent a77b4f3970
commit 14f5c8d764
30 changed files with 96 additions and 91 deletions

View File

@@ -106,7 +106,7 @@ static int send_pack(int sock, struct in_addr *src_addr,
return err;
}
void finish(void)
static void finish(void)
{
if (!quiet) {
printf("Sent %d probes (%d broadcast(s))\n", sent, brd_sent);
@@ -129,7 +129,7 @@ void finish(void)
exit(!received);
}
void catcher(void)
static void catcher(void)
{
struct timeval tv;
static struct timeval start;
@@ -151,7 +151,7 @@ void catcher(void)
alarm(1);
}
int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
static int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
{
struct timeval tv;
struct arphdr *ah = (struct arphdr *) buf;

View File

@@ -462,7 +462,7 @@ static struct method_t methods6[] = {
{ "loopback", loopback_up6, loopback_down6, },
};
struct address_family_t addr_inet6 = {
static struct address_family_t addr_inet6 = {
"inet6",
sizeof(methods6) / sizeof(struct method_t),
methods6
@@ -611,7 +611,7 @@ static struct method_t methods[] =
{ "loopback", loopback_up, loopback_down, },
};
struct address_family_t addr_inet =
static struct address_family_t addr_inet =
{
"inet",
sizeof(methods) / sizeof(struct method_t),

View File

@@ -48,7 +48,7 @@ static struct
struct rtnl_handle *rth;
} filter;
void print_link_flags(FILE *fp, unsigned flags, unsigned mdown)
static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown)
{
fprintf(fp, "<");
flags &= ~IFF_RUNNING;

View File

@@ -361,7 +361,7 @@ static int do_add(int cmd, int argc, char **argv)
return -1;
}
int do_del(int argc, char **argv)
static int do_del(int argc, char **argv)
{
struct ip_tunnel_parm p;
@@ -381,7 +381,7 @@ int do_del(int argc, char **argv)
return -1;
}
void print_tunnel(struct ip_tunnel_parm *p)
static void print_tunnel(struct ip_tunnel_parm *p)
{
char s1[256];
char s2[256];

View File

@@ -90,7 +90,7 @@ __PF(ECONET,econet)
#undef __PF
char * ll_proto_n2a(unsigned short id, char *buf, int len)
const char * ll_proto_n2a(unsigned short id, char *buf, int len)
{
int i;

View File

@@ -13,7 +13,7 @@
#include <linux/if_arp.h>
char * ll_type_n2a(int type, char *buf, int len)
const char * ll_type_n2a(int type, char *buf, int len)
{
#define __PF(f,n) { ARPHRD_##f, #n },
static struct {

View File

@@ -76,7 +76,7 @@ static void rtnl_rtprot_initialize(void)
rtnl_rtprot_tab, 256);
}
char * rtnl_rtprot_n2a(int id, char *buf, int len)
const char * rtnl_rtprot_n2a(int id, char *buf, int len)
{
if (id<0 || id>=256) {
snprintf(buf, len, "%d", id);
@@ -143,7 +143,7 @@ static void rtnl_rtscope_initialize(void)
rtnl_rtscope_tab, 256);
}
char * rtnl_rtscope_n2a(int id, char *buf, int len)
const char * rtnl_rtscope_n2a(int id, char *buf, int len)
{
if (id<0 || id>=256) {
snprintf(buf, len, "%d", id);
@@ -206,7 +206,7 @@ static void rtnl_rtrealm_initialize(void)
rtnl_rtrealm_tab, 256);
}
char * rtnl_rtrealm_n2a(int id, char *buf, int len)
const char * rtnl_rtrealm_n2a(int id, char *buf, int len)
{
if (id<0 || id>=256) {
snprintf(buf, len, "%d", id);
@@ -272,7 +272,7 @@ static void rtnl_rttable_initialize(void)
rtnl_rttable_tab, 256);
}
char * rtnl_rttable_n2a(int id, char *buf, int len)
const char * rtnl_rttable_n2a(int id, char *buf, int len)
{
if (id<0 || id>=256) {
snprintf(buf, len, "%d", id);
@@ -334,7 +334,7 @@ static void rtnl_rtdsfield_initialize(void)
rtnl_rtdsfield_tab, 256);
}
char * rtnl_dsfield_n2a(int id, char *buf, int len)
const char * rtnl_dsfield_n2a(int id, char *buf, int len)
{
if (id<0 || id>=256) {
snprintf(buf, len, "%d", id);

View File

@@ -86,7 +86,7 @@ static void serror(const char *s, ...)
}
/* Check ascii str_macaddr, convert and copy to *mac */
struct ether_addr *cc_macaddr(char *str_macaddr)
static struct ether_addr *cc_macaddr(char *str_macaddr)
{
struct ether_addr *lmac, *mac;

View File

@@ -178,7 +178,10 @@ static int myid, options;
static unsigned long tmin = ULONG_MAX, tmax, tsum;
static char rcvd_tbl[MAX_DUP_CHK / 8];
struct hostent *hostent;
#ifndef CONFIG_FEATURE_FANCY_PING6
static
#endif
struct hostent *hostent;
static void sendping(int);
static void pingstats(int);

View File

@@ -485,6 +485,7 @@ void set_flags(char *flagstr, int flags)
}
}
/* also used in netstat */
void displayroutes(int noresolve, int netstatfmt)
{
char devname[64], flags[16], sdest[16], sgw[16];

View File

@@ -71,8 +71,8 @@ static const char *tftp_bb_error_msg[] = {
"No such user"
};
const int tftp_cmd_get = 1;
const int tftp_cmd_put = 2;
static const int tftp_cmd_get = 1;
static const int tftp_cmd_put = 2;
#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE

View File

@@ -1,6 +1,6 @@
#ifndef _SCRIPT_H
#define _SCRIPT_H
void run_script(struct dhcpMessage *packet, const char *name);
extern void run_script(struct dhcpMessage *packet, const char *name);
#endif

View File

@@ -117,9 +117,9 @@ static char *safe_fgets(char *s, int size, FILE *stream)
/*
* Base64-encode character string
* oops... isn't something similar in uuencode.c?
* It would be better to use already existing code
* XXX: It would be better to use already existing code
*/
char *base64enc(unsigned char *p, char *buf, int len) {
static char *base64enc(unsigned char *p, char *buf, int len) {
char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
"0123456789+/";