Get rid of the non-standard ICOM_VFIELD macro.
[wine] / dlls / dmstyle / dmutils.h
1 /* Debug and Helper Functions
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
4  * Copyright (C) 2003-2004 Raphael Junqueira
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __WINE_DMUTILS_H
22 #define __WINE_DMUTILS_H
23  
24 /* for simpler reading */
25 typedef struct _DMUS_PRIVATE_CHUNK {
26         FOURCC fccID; /* FOURCC ID of the chunk */
27         DWORD dwSize; /* size of the chunk */
28 } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
29
30 /**
31  * Parsing utilities
32  */
33 extern HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc);
34 extern HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc);
35 extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject);
36
37 /**
38  * Debug utilities
39  */
40 /* used for generic dumping (copied from ddraw) */
41 typedef struct {
42     DWORD val;
43     const char* name;
44 } flag_info;
45
46 typedef struct {
47     const GUID *guid;
48     const char* name;
49 } guid_info;
50
51 /* used for initialising structs */
52 #define DM_STRUCT_INIT(x)                       \
53         do {                                    \
54                 memset((x), 0, sizeof(*(x)));   \
55                 (x)->dwSize = sizeof(*x);       \
56         } while (0)
57
58 #define FE(x) { x, #x } 
59 #define GE(x) { &x, #x }
60
61 /* check whether the given DWORD is even (return 0) or odd (return 1) */
62 extern int even_or_odd (DWORD number);
63 /* check whether chunkID is valid dmobject form chunk */
64 extern BOOL IS_VALID_DMFORM (FOURCC chunkID);
65 /* translate STREAM_SEEK flag to string */
66 extern const char *resolve_STREAM_SEEK (DWORD flag);
67 /* FOURCC to string conversion for debug messages */
68 extern const char *debugstr_fourcc (DWORD fourcc);
69 /* DMUS_VERSION struct to string conversion for debug messages */
70 extern const char *debugstr_dmversion (LPDMUS_VERSION version);
71 /* FILETIME struct to string conversion for debug messages */
72 extern const char *debugstr_filetime (LPFILETIME time);
73 /* returns name of given GUID */
74 extern const char *debugstr_dmguid (const GUID *id);
75 /* returns name of given error code */
76 extern const char *debugstr_dmreturn (DWORD code);
77 /* generic flags-dumping function */
78 extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names);
79
80 extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask);
81 extern const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask);
82 extern const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask);
83 /* dump whole DMUS_OBJECTDESC struct */
84 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc);
85 extern void        debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc);
86 extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader);
87 extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader);
88
89 #endif /* __WINE_DMUTILS_H */