]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/libcitadel.h
Moved parse_url() into libcitadel; I will need it for
[citadel.git] / libcitadel / lib / libcitadel.h
index b4008aebebc70f7f25eed23e7dea8ea630701d2c..4bfea6f6fecc48c4f39e29c90dbe815f5d1cfb6b 100644 (file)
@@ -9,7 +9,7 @@
  */
 #include <time.h>
 #include <stdlib.h>
-#define LIBCITADEL_VERSION_NUMBER      109
+#define LIBCITADEL_VERSION_NUMBER      113
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
@@ -269,31 +269,58 @@ typedef struct HashPos HashPos;
 typedef void (*DeleteHashDataFunc)(void * Data);
 typedef const char *(*PrintHashContent)(void * Data);
 typedef int (*CompareFunc)(const void* Item1, const void*Item2);
+typedef int (*HashFunc)(const char *Str, long Len);
+typedef void (*TransitionFunc) (void *Item1, void *Item2, int Odd);
+typedef void (*PrintHashDataFunc) (const char *Key, void *Item, int Odd);
 
-HashList *NewHash(void);
-
+HashList *NewHash(int Uniq, HashFunc F);
 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);
-
+void Put(HashList *Hash, const 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);
-
+int dbg_PrintHash(HashList *Hash, PrintHashContent first, PrintHashContent Second);
+int PrintHash(HashList *Hash, TransitionFunc Trans, PrintHashDataFunc PrintEntry);
 HashPos *GetNewHashPos(void);
-
 void DeleteHashPos(HashPos **DelMe);
-
 int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, char **HashKey, void **Data);
-
-void SortByHashKey(HashList *Hash);
+void SortByHashKey(HashList *Hash, int Order);
 void SortByHashKeyStr(HashList *Hash);
-
+int GetCount(HashList *Hash);
 const void *GetSearchPayload(const void *HashVoid);
 void SortByPayload(HashList *Hash, CompareFunc SortBy);
-
 void convert_spaces_to_underscores(char *str);
+int parse_url(char *url, char *hostname, int *port, char *identifier);
+
+/*
+ * Convert 4 bytes char into an Integer.
+ * usefull for easy inexpensive hashing 
+ * of for char strings.
+ */
+#define CHAR4TO_INT(a) ((int) (a[0] | (a[1]<<8) | (a[2]<<16) | (a[3]<<24)))
+
+/* vNote implementation */
+
+#define CTDL_VNOTE_MAGIC       0xa1fa
+
+struct vnote {
+       int magic;
+       char *uid;
+       char *summary;
+       char *body;
+       int pos_left;
+       int pos_top;
+       int pos_width;
+       int pos_height;
+       int color_red;
+       int color_green;
+       int color_blue;
+};
+
+
+
+struct vnote *vnote_new(void);
+struct vnote *vnote_new_from_str(char *s);
+void vnote_free(struct vnote *v);
+char *vnote_serialize(struct vnote *v);
+void vnote_serialize_output_field(char *append_to, char *field, char *label);