Skip to content

Commit

Permalink
test_server.o: make most decarations static
Browse files Browse the repository at this point in the history
* only main and fd are used outside the module, so declare every other symbol as static
  • Loading branch information
neuschaefer committed Mar 22, 2010
1 parent e79b928 commit 4211c0f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
#endif


int port=DEFAULT_PORT;
struct sockaddr_in server;
char *name=NULL;
int ttime=1;
static int port=DEFAULT_PORT;
static struct sockaddr_in server;
static char *name=NULL;
static int ttime=1;
int fd;


/* find server address from name and put it into server structure */
void find_server(void)
static void find_server(void)
{
struct hostent *h;

Expand All @@ -47,15 +47,15 @@ void find_server(void)


/* find a socket and and initialize it */
void init_socket(void)
static void init_socket(void)
{
fd=socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP);
if(fd<0){fprintf(stderr,"Can't get socket.\n");exit(1);}
}


/* contact server, send information request and wait for response */
int contact_server(void)
static int contact_server(void)
{
static char packet[256];
int a;
Expand Down Expand Up @@ -88,15 +88,15 @@ int contact_server(void)


/* write help to stdout */
void print_help(void)
static void print_help(void)
{
printf( "0verkill server testing program.\n"
"(c)2000 Brainsoft\n"
"Usage: test_server [-h] [-p <port number>] [-t <timeout>] -a <address>\n");
}


void parse_command_line(int argc,char **argv)
static void parse_command_line(int argc,char **argv)
{
int a;
char *c;
Expand Down

0 comments on commit 4211c0f

Please sign in to comment.