data.h

来自「linux下多线程的下载软件源码」· C头文件 代码 · 共 35 行

H
35
字号
#ifndef DATA_H#define DATA_H#include <pthread.h>#include <netinet/in.h>#include "Defs.h"typedef struct request {	char host[MAXHOSTSIZ];		/* Remote host	*/	char url[MAXURLSIZ];		/* URL		*/	char file[MAXBUFSIZ];		/* file name	*/	char lfile[MAXBUFSIZ];		/* if local file name is specified	*/	char ip[MAXIPSIZ];		/* Remote IP	*/	char username[MAXBUFSIZ];		char password[MAXBUFSIZ];	int port;	int clength;			/* Content-length	*/	unsigned char proto;		/* Protocol		*/} request;typedef struct thread_data {	struct sockaddr_in sin;	char getstr[GETREQSIZ];	long soffset;		/* Start offset		*/	long foffset;		/* Finish offset	*/	long offset;		/* Current Offset	*/	long clength;		/* Content Length	*/	int fd;	pthread_t tid;		/* Thread ID		*/	unsigned char status;	/* thread exit status	*/} thread_data;#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?