connlist uses own header file

FossilOrigin-Name: 5734410105aebdef354b117bc91406ad0ac961273a7c80fd56c11bf386906139
This commit is contained in:
7u83@mail.ru 2016-04-09 16:13:32 +00:00
parent adc6489d9b
commit 650ebbac8d
2 changed files with 28 additions and 0 deletions

View File

@ -29,6 +29,8 @@
#include <stdio.h>
#include "conn.h"
#include "connlist.h"
#include "sock.h"

26
src/cw/connlist.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef __CONLIST_H
#define __CONLIST_H
#include "conn.h"
#include "mavl.h"
struct connlist {
/* struct conn ** connlist; */
struct mavl *t;
int len;
pthread_mutex_t connlist_mutex;
};
struct connlist *connlist_create(int len);
void connlist_lock(struct connlist *cl);
void connlist_unlock(struct connlist *cl);
void conlist_destroy(struct connlist *cl);
struct conn *connlist_get(struct connlist *cl, const struct sockaddr *addr);
struct conn *connlist_add(struct connlist *cl, struct conn *conn);
void connlist_remove(struct connlist *cl, struct conn *conn);
void connlist_destroy(struct connlist *cl);
#endif