*/
-#define LIBCITADEL_VERSION_NUMBER 102
+
+/*
+ * since we reference time_t...
+ */
+#include <time.h>
+#include <stdlib.h>
+#define LIBCITADEL_VERSION_NUMBER 109
/*
* Here's a bunch of stupid magic to make the MIME parser portable.
/*
- * 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 */
#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
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 */
-char *safestrncpy(char *dest, const char *src, size_t n);
+int safestrncpy(char *dest, const char *src, size_t n);
int num_tokens (const char *source, char tok);
long extract_token(char *dest, const char *source, int parmnum, char separator, int maxlen);
long grab_token(char **dest, const char *source, int parmnum, char separator);
int is_msg_in_mset(char *mset, long msgnum);
int pattern2(char *search, char *patn);
void stripltlen(char *, int *);
+char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaformat);
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);
+typedef int (*CompareFunc)(const void* Item1, const void*Item2);
HashList *NewHash(void);
-void DeleteHash(HashList **Hash);
+void DeleteHash(HashList **Hash);
-int GetHash(HashList *Hash, char *HKey, long HKLen, void **Data);
+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, const char ***List);
+int GetHashKeys(HashList *Hash, char ***List);
-int PrintHash(HashList *Hash);
+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);
+
+void SortByHashKey(HashList *Hash);
+void SortByHashKeyStr(HashList *Hash);
+
+const void *GetSearchPayload(const void *HashVoid);
+void SortByPayload(HashList *Hash, CompareFunc SortBy);
+
+void convert_spaces_to_underscores(char *str);