move URL parsing / struct over into libcitadel
[citadel.git] / libcitadel / lib / libcitadel.h
index d74b9f12d8449cebb8f3991e1d2e9b936de6975f..b16e3296c34f56f5b4a897b6690ffada67d2db88 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 in6_addr Addr;
+       ParsedURL *Next;
+};
+
+void FreeURL(ParsedURL** Url);
+int ParseURL(ParsedURL **Url, StrBuf *UrlStr, unsigned short DefaultPort);
+
 /* tools */