]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/misc: add MsgList_Present()
authorVMware, Inc <>
Thu, 2 Aug 2012 06:52:32 +0000 (23:52 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Thu, 2 Aug 2012 18:23:08 +0000 (11:23 -0700)
Add MsgList_Present (which matches Msg_Present) as a convenience for
ASSERTs.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/lib/include/msgList.h
open-vm-tools/lib/misc/msgList.c

index 5c736ea9b113b3a4d54584e83a72c65c765815fe..631da4b7db4aee75a73b52159079c12abf6bb86a 100644 (file)
@@ -69,4 +69,6 @@ void MsgList_Free(MsgList *messages);
 
 const char *MsgList_GetMsgID(const MsgList *messages);
 
+Bool MsgList_Present(const MsgList *messages);
+
 #endif // ifndef _MSGLIST_H_
index 4673024ae6f8b4bee126f193ab65b98519fbb255..6df8e40a6475359faeef887a78c8318adf71c137 100644 (file)
@@ -531,3 +531,26 @@ MsgList_Log(const MsgList *messages)  // IN:
       free(formatted);
    }
 }
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MsgList_Present --
+ *
+ *      Tests if the MsgList is empty.
+ *
+ * Results:
+ *      TRUE if there are appended messages; FALSE otherwise.
+ *
+ * Side effects:
+ *      None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Bool
+MsgList_Present(const MsgList *messages)  // IN:
+{
+   return messages != NULL;
+}