csdr/ddcd.h

36 lines
554 B
C
Raw Normal View History

#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
2016-06-04 23:42:29 +08:00
#include <signal.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <vector>
#define SOFTWARE_NAME "ddcd"
#define MSG_START SOFTWARE_NAME ": "
2015-12-02 21:51:20 +08:00
typedef enum ddc_method_e
{
M_TD,
M_FASTDDC
} ddc_method_t;
typedef struct client_s
{
struct sockaddr_in addr;
2016-06-04 23:42:29 +08:00
int id;
int socket;
int error;
pthread_t thread;
} client_t;
2015-12-02 21:51:20 +08:00
2016-06-04 23:42:29 +08:00
void print_exit(const char* why);
void error_exit(const char* why);
void maxfd(int* maxfd, int fd);