actube/src/ac/dataman.h
7u83@mail.ru 11ee224d78 actube compiles again
FossilOrigin-Name: b4d49cce87d73a9c8e5bff97bda7cde9586849cfce0b6261dfee1fb7b7097d0f
2018-03-25 17:13:58 +00:00

34 lines
757 B
C

#ifndef __DATAMAN_H
#define __DATAMAN_H
#include <pthread.h>
/*#include "cw/netconn.h"*/
#include "wtpman.h"
struct dataman {
struct netconn *nc;
pthread_t thread;
struct wtpman * wtpman;
};
extern int dataman_list_init();
struct dataman *dataman_list_add(struct dataman *dm);
extern struct dataman *dataman_list_get(int sock, struct sockaddr *addr);
extern struct dataman *dataman_create(int sock, struct sockaddr *addr);
extern void dataman_start(struct dataman * dm);
extern pthread_mutex_t dataman_list_mutex;
#define dataman_list_lock() pthread_mutex_lock(&dataman_list_mutex)
#define dataman_list_unlock() pthread_mutex_unlock(&dataman_list_mutex)
#define dataman_add_packet(dm,data,len) (netconn_q_add_packet(dm->nc,data,len))
#endif