From: Wilfried Göesgens Date: Mon, 19 Apr 2010 10:07:49 +0000 (+0000) Subject: * CompareRoomListByFloorRoomPrivFirst() add a wrapper that can be called with types... X-Git-Tag: v7.86~266 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=5432025cf7847036cbaa2e8ba38f2b4afecc59ee * CompareRoomListByFloorRoomPrivFirst() add a wrapper that can be called with types for webcit internal use... --- diff --git a/webcit/roomlist.c b/webcit/roomlist.c index 10e0f1b66..5710b54d0 100644 --- a/webcit/roomlist.c +++ b/webcit/roomlist.c @@ -509,7 +509,12 @@ int GroupchangeRoomListByFloorRoomPrivFirst(const void *room1, const void *room2 } - +int CompareRooms(const folder *room1, const folder *room2) +{ + if ((room1 == NULL) || (room2 == NULL)) + return -1; + return CompareRoomListByFloorRoomPrivFirst(room1, room2); +} diff --git a/webcit/roomops.h b/webcit/roomops.h index 31bd65dca..5753b23fc 100644 --- a/webcit/roomops.h +++ b/webcit/roomops.h @@ -102,6 +102,12 @@ void vDeleteFolder(void *vFolder); void FlushFolder(folder *room); void ParseGoto(folder *proom, StrBuf *Line); +/* + * wrapper around usual sort-comparator; private rooms will allways be prefered, -1 if one of them NULL + */ +int CompareRooms(const folder *room1, const folder *room2); + + #define REST_TOPLEVEL 0 #define REST_IN_NAMESPACE (1<<0) #define REST_IN_FLOOR (1<<1)