From: VMware, Inc <> Date: Thu, 2 Aug 2012 06:52:32 +0000 (-0700) Subject: lib/misc: add MsgList_Present() X-Git-Tag: 2012.10.14-874563~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0cfb6673ec7db9c0f89e6a4c2148d3be8a3237e;p=thirdparty%2Fopen-vm-tools.git lib/misc: add MsgList_Present() Add MsgList_Present (which matches Msg_Present) as a convenience for ASSERTs. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/include/msgList.h b/open-vm-tools/lib/include/msgList.h index 5c736ea9b..631da4b7d 100644 --- a/open-vm-tools/lib/include/msgList.h +++ b/open-vm-tools/lib/include/msgList.h @@ -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_ diff --git a/open-vm-tools/lib/misc/msgList.c b/open-vm-tools/lib/misc/msgList.c index 4673024ae..6df8e40a6 100644 --- a/open-vm-tools/lib/misc/msgList.c +++ b/open-vm-tools/lib/misc/msgList.c @@ -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; +}