当前位置 - 股票行情交易網 - 企業服務 - C語言中csapp.h 是什麽意思?

C語言中csapp.h 是什麽意思?

csapp.h其實就是壹堆頭文件的打包 我們也可以用啊!!

csapp.h

csapp.c

//csapp.h

/* $begin csapp.h */

#include <stdio.h>

#include <stdlib.h>

#include <unistd.h>

#include <string.h>

#include <ctype.h>

#include <setjmp.h>

#include <signal.h>

#include <sys/time.h>

#include <sys/types.h>

#include <sys/wait.h>

#include <sys/stat.h>

#include <fcntl.h>

#include <sys/mman.h>

#include <errno.h>

#include <math.h>

#include <pthread.h>

#include <semaphore.h>

#include <sys/socket.h>

#include <netdb.h>

#include <netinet/in.h>

#include <arpa/inet.h>

/* Simplifies calls to bind(), connect(), and accept() */

/* $begin sockaddrdef */

typedef struct sockaddr SA;

/* $end sockaddrdef */

//csapp.c

/* $begin csapp.c */

#include "csapp.h"

/**************************

* Error-handling functions

**************************/

/* $begin errorfuns */

/* $begin unixerror */

void unix_error(char *msg) /* unix-style error */

{

fprintf(stderr, "%s: %s\n", msg, strerror(errno));

exit(0);

}