]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/libcitadel.h
* fixed several crash / invalid data cases in the hash implementation
[citadel.git] / libcitadel / lib / libcitadel.h
index d74e80afb2870668c857db2c2032d18885e83606..7dac9e97146dfbe2c577bde3c0c86ccb29334e06 100644 (file)
@@ -4,7 +4,13 @@
  */
 
 
-#define LIBCITADEL_VERSION_NUMBER      101
+
+/*
+ * since we reference time_t...
+ */
+#include <time.h>
+#include <stdlib.h>
+#define LIBCITADEL_VERSION_NUMBER      106
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
@@ -15,7 +21,8 @@
 
 
 /*
- * Views
+ * View definitions.
+ * Note that not all views are implemented in all clients.
  */
 #define        VIEW_BBS                0       /* Bulletin board view */
 #define VIEW_MAILBOX           1       /* Mailbox summary */
@@ -25,7 +32,7 @@
 #define VIEW_NOTES             5       /* Notes view */
 #define        VIEW_WIKI               6       /* Wiki view */
 #define VIEW_CALBRIEF          7       /* Brief Calendar view */
-#define VIEW_JOURNAL           8       /* Journal view (not yet implemented in native clients) */
+#define VIEW_JOURNAL           8       /* Journal view */
 
 
 #ifndef IsEmptyStr
@@ -167,6 +174,14 @@ void the_mime_parser(char *partnum,
                      int dont_decode
 );
 
+const char *GuessMimeType(char *data, size_t dlen);
+const char* GuessMimeByFilename(const char *what, size_t len);
+
+/** Run once at Programstart */
+int LoadIconDir(const char *DirName);
+/** guess an icon to the mimetype */
+const char *GetIconFilename(char *MimeType, size_t len);
+void ShutDownLibCitadel(void);
 
 
 /* tools */
@@ -234,3 +249,36 @@ char *vcard_get_prop(struct vCard *v, char *propname, int is_partial,
 char *vcard_serialize(struct vCard *);
 void vcard_fn_to_n(char *vname, char *n, size_t vname_size);
 void remove_charset_attribute(char *strbuf);
+
+/**
+ * Citadels Hashlist Implementation
+ */
+
+typedef struct HashList HashList;
+
+typedef struct HashKey HashKey;
+
+typedef struct HashPos HashPos;
+
+typedef void (*DeleteHashDataFunc)(void * Data);
+typedef const char *(*PrintHashContent)(void * Data);
+
+HashList *NewHash(void);
+
+void DeleteHash(HashList **Hash);
+
+int GetHash(HashList *Hash, const char *HKey, long HKLen, void **Data);
+
+void Put(HashList *Hash, char *HKey, long HKLen, void *Data, DeleteHashDataFunc DeleteIt);
+
+int GetKey(HashList *Hash, char *HKey, long HKLen, void **Data);
+
+int GetHashKeys(HashList *Hash, char ***List);
+
+int PrintHash(HashList *Hash, PrintHashContent first, PrintHashContent Second);
+
+HashPos *GetNewHashPos(void);
+
+void DeleteHashPos(HashPos **DelMe);
+
+int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, char **HashKey, void **Data);