]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - lhnet.h
demos: support curl/dlcache (down)loading at start of playback
[xonotic/darkplaces.git] / lhnet.h
diff --git a/lhnet.h b/lhnet.h
index 1644fb17f2da7a237f8e2bf522b6d8678d886e45..e7ac0e48294dc79878e01b17c5f2bb16b48552b7 100644 (file)
--- a/lhnet.h
+++ b/lhnet.h
@@ -5,6 +5,7 @@
 #define LHNET_H
 
 #include <stddef.h>
+#include "com_list.h"
 
 typedef enum lhnetaddresstype_e
 {
@@ -26,7 +27,13 @@ lhnetaddress_t;
 int LHNETADDRESS_FromPort(lhnetaddress_t *address, lhnetaddresstype_t addresstype, int port);
 int LHNETADDRESS_FromString(lhnetaddress_t *address, const char *string, int defaultport);
 int LHNETADDRESS_ToString(const lhnetaddress_t *address, char *string, int stringbuffersize, int includeport);
-int LHNETADDRESS_GetAddressType(const lhnetaddress_t *address);
+static inline lhnetaddresstype_t LHNETADDRESS_GetAddressType(const lhnetaddress_t *address)
+{
+       if (address)
+               return address->addresstype;
+       else
+               return LHNETADDRESSTYPE_NONE;
+}
 const char *LHNETADDRESS_GetInterfaceName(const lhnetaddress_t *address, char *ifname, size_t ifnamelength);
 int LHNETADDRESS_GetPort(const lhnetaddress_t *address);
 int LHNETADDRESS_SetPort(lhnetaddress_t *address, int port);
@@ -36,9 +43,10 @@ typedef struct lhnetsocket_s
 {
        lhnetaddress_t address;
        int inetsocket;
-       struct lhnetsocket_s *next, *prev;
+       llist_t list;
 }
 lhnetsocket_t;
+extern lhnetsocket_t lhnet_socketlist;
 
 void LHNET_Init(void);
 void LHNET_Shutdown(void);