]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/libcitadel.h
Switch handling to have a pointer to the target address
[citadel.git] / libcitadel / lib / libcitadel.h
index f0c8ab735d7ec2074d3b50f966e40b7f934f1825..1201a9be74abf773308201056da88bae16623880 100644 (file)
@@ -14,6 +14,9 @@
 #include <time.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <arpa/inet.h>
+#include <libcitadel.h>
+
 #define LIBCITADEL_VERSION_NUMBER      789
 
 /*
@@ -352,6 +355,26 @@ int LoadIconDir(const char *DirName);
 const char *GetIconFilename(char *MimeType, size_t len);
 
 
+/* URL parsing & connection data */
+typedef struct ParsedURL ParsedURL;
+struct ParsedURL {
+       StrBuf *URL;
+       unsigned Port;
+       const char *Host;
+       const char *User;
+       const char *Pass;
+       const char *LocalPart;
+       int IsIP;
+       int IPv6;
+       int af;
+       struct hostent *HEnt;
+       struct sockaddr_in6 Addr;
+       ParsedURL *Next;
+};
+
+void FreeURL(ParsedURL** Url);
+int ParseURL(ParsedURL **Url, StrBuf *UrlStr, unsigned short DefaultPort);
+
 /* tools */
 
 
@@ -454,6 +477,7 @@ long lFlathash(const char *str, long len);
 
 HashList *NewHash(int Uniq, HashFunc F);
 void DeleteHash(HashList **Hash);
+void DeleteHashContent(HashList **Hash);
 void HDeleteHash(void *vHash);
 int GetHash(HashList *Hash, const char *HKey, long HKLen, void **Data);
 void Put(HashList *Hash, const char *HKey, long HKLen, void *Data, DeleteHashDataFunc DeleteIt);