改错本 请帮我简单明了的指出错误

client文件内容如下:

#include "net.h"

void usage(char *s){
printf("\n%s serv_ip serv_port",s);
printf("\n\t serv_ip: server ip address");
printf("\n\t serv_port:server port(>5000)\n\n");
}

int main(int argc, const char argv[])
{
int fd = -1;
int port = -1;
struct sockaddr_in sin;
if((fd = socket(AF_INET,SOCK_STREAM,0))<0){
perror("socket");
exit(1);
}
port = atoi(argv[2]);
if(port < 5000){
usage(argv[0]);
exit(1);
}
bzero(&sin,sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
#if 0
sin.sin_addr.s_addr = inet_addr(SERV_IP_ADDR);
#else
if(inet_pton(AF_INET,argv[1],(void
)&sin.sin_addr) != 1){
perror("inet_pton");
exit(1);
}
#endif
if(connect(fd,(struct sockaddr *)&sin,sizeof(sin)) < 0){
perror("connect");
exit(1);
}
printf("Client staring...ok!");

int ret = -1;
fd_set rset;
int maxfd = -1;
struct timeval tout;
char buf(BUFSIZ);
while(1){
    FD_ZERO(&rset);
    FD_SET(0,&rset);
    FD_SET(fd,&rset);
    maxfd = fd;
    tout.tv_sec = 5;
    tout.tv_usec = 0;
    select(maxfd+1,&rset,NULL,NULL,&tout);
    if(FD_ISSET(0,&rset)){
        bzero(buf,BUDSIZ);
        do{
            ret = read(0,buf,BUFSIZ-1);
        }while(ret < 0 && EINTR == errno);
        if(ret < 0){
            perror("read");
            continue;
        }
        if(!ret)continue;
        if(write(fd,buf,strlen(buf))<0){
            perror("write() to socket");
            continue;
        }
        if(!strncasecmp(buf,QUIT_STR,strlen(QUIT_STR))){
            printf("Client is exiting!\n");
            break;
        }

    }
    if(FD_ISSET(fd,&rset)){
        bzero(buf,BUDSIZ);
        do{
            ret = read(fd,buf,BUFSIZ-1);
        }while(ret < 0 && EINTR == errno);
        if(ret < 0){
            perror("read from socket");
            continue;
        }
        if(!ret) break;
        printf("server said:%s\n",buf);
        if(!strncasecmp(buf,QUIT_STR,strlen(QUIT_STR))){
            printf("Sender Client is exiting!\n");
            break;
        }
        
    }
}
close(fd);
return 0;

}

net.h文件如下图:
img

编译过程如下:
linux@linux:~/io/111$ gcc -g -O2 -o client client.c -I /home/linux/io/111/net.h
cc1: warning: /home/linux/io/111/net.h: not a directory [enabled by default]
client.c: In function ‘main’:
client.c:16:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
exit(1);
^
client.c:20:3: warning: passing argument 1 of ‘usage’ discards ‘const’ qualifier from pointer target type [enabled by default]
usage(argv[0]);
^
client.c:3:6: note: expected ‘char *’ but argument is of type ‘const char *’
void usage(char *s){
^
client.c:21:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
exit(1);
^
client.c:31:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
exit(1);
^
client.c:36:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
exit(1);
^
In file included from /usr/include/libio.h:31:0,
from /usr/include/stdio.h:74,
from net.h:4,
from client.c:1:
client.c:45:11: error: expected declaration specifiers or ‘...’ before numeric constant
char buf(BUFSIZ);
^
client.c:55:10: error: ‘buf’ undeclared (first use in this function)
bzero(buf,BUDSIZ);
^
client.c:55:10: note: each undeclared identifier is reported only once for each function it appears in
client.c:55:14: error: ‘BUDSIZ’ undeclared (first use in this function)
bzero(buf,BUDSIZ);
^
client.c:58:22: error: ‘EINTR’ undeclared (first use in this function)
}while(ret < 0 && EINTR == errno);
^
client.c:58:31: error: ‘errno’ undeclared (first use in this function)
}while(ret < 0 && EINTR == errno);
^