summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-11-19 20:49:42 -0500
committermidipix <writeonce@midipix.org>2017-11-19 20:49:42 -0500
commit05785e920a1736bd06554c7f4548e533f1a54e13 (patch)
tree30e73f663f74c15f1b8a133cf37170651eadc867
parentaee3a687ec517c4a668c2442740a2544beac1a9b (diff)
downloadw32lib-05785e920a1736bd06554c7f4548e533f1a54e13.tar.bz2
w32lib-05785e920a1736bd06554c7f4548e533f1a54e13.tar.xz
(mis)guid'ed data: iid: initial commit.
-rw-r--r--config.project2
-rw-r--r--project/common.mk1
-rw-r--r--project/tree.mk2
-rw-r--r--src/guid/w32lib_guid_iid.c40
-rw-r--r--src/internal/w32lib_impl.h25
5 files changed, 69 insertions, 1 deletions
diff --git a/config.project b/config.project
index 10d7af5..15c4487 100644
--- a/config.project
+++ b/config.project
@@ -57,5 +57,5 @@ mb_default_elf_config_defs=
mb_all_static=
mb_all_shared=
mb_disable_frontend=yes
-mb_disable_static=yes
+mb_disable_static=
mb_disable_shared=yes
diff --git a/project/common.mk b/project/common.mk
index f3d101a..be95268 100644
--- a/project/common.mk
+++ b/project/common.mk
@@ -1,4 +1,5 @@
API_SRCS = \
+ src/guid/w32lib_guid_iid.c \
INTERNAL_SRCS = \
diff --git a/project/tree.mk b/project/tree.mk
index 2045989..30a553c 100644
--- a/project/tree.mk
+++ b/project/tree.mk
@@ -1,3 +1,5 @@
tree.tag:
mkdir -p lib
+ mkdir -p src
+ mkdir -p src/guid
touch tree.tag
diff --git a/src/guid/w32lib_guid_iid.c b/src/guid/w32lib_guid_iid.c
new file mode 100644
index 0000000..d0c120d
--- /dev/null
+++ b/src/guid/w32lib_guid_iid.c
@@ -0,0 +1,40 @@
+#include <w32lib/w32lib.h>
+#include "w32lib_impl.h"
+
+/***************************************************************/
+#define W32LIB_IID_GUID(mname,lname, \
+ u32,u16a,u16b, \
+ u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h) \
+ W32LIB_GUID (W32LIB_HIDDEN_NAME(iid,mname), \
+ W32LIB_NAMESPACE_NAME(iid,mname), \
+ W32LIB_LEGACY_NAME(IID,lname), \
+ u32,u16a,u16b, \
+ u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h) \
+/***************************************************************/
+
+W32LIB_IID_GUID(iunknown, IUnknown, 0x0,0x0,0x0, 0,0,0,0,0,0,0,0)
+W32LIB_IID_GUID(iclass_factory,IClassFactory, 0x1,0x0,0x0, 0,0,0,0,0,0,0,0)
+
+W32LIB_IID_GUID(idrop_target,IDropTarget, \
+ 0x00000122,0x0000,0x0000, \
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46)
+
+W32LIB_IID_GUID(ipersist_file,IPersistFile, \
+ 0x0000010b,0x0000,0x0000, \
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46)
+
+W32LIB_IID_GUID(ishell_link_ansi,IShellLinkA, \
+ 0x000214ee,0x0000,0x0000, \
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46)
+
+W32LIB_IID_GUID(ishell_link_utf16,IShellLinkW, \
+ 0x000214f9,0x0000,0x0000, \
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46)
+
+W32LIB_IID_GUID(idrop_target_helper,IDropTargetHelper, \
+ 0x4657278b,0x411b,0x11d2, \
+ 0x83,0x9a,0x00,0xc0,0x4f,0xd9,0x18,0xd0)
+
+W32LIB_IID_GUID(iproperty_store,IPropertyStore, \
+ 0x886d8eeb,0x8cf2,0x4446, \
+ 0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99)
diff --git a/src/internal/w32lib_impl.h b/src/internal/w32lib_impl.h
new file mode 100644
index 0000000..9e5bcec
--- /dev/null
+++ b/src/internal/w32lib_impl.h
@@ -0,0 +1,25 @@
+#include <stdint.h>
+
+struct w32lib_guid {
+ uint32_t data1;
+ uint16_t data2;
+ uint16_t data3;
+ unsigned char data4[8];
+};
+
+#define W32LIB_QUOTE(name) #name
+
+#define W32LIB_HIDDEN_JOIN(prefix,name) __ ## prefix ## _ ## name
+#define W32LIB_NAMESPACE_JOIN(prefix,name) w32lib ## _ ## prefix ## _ ## name
+#define W32LIB_LEGACY_JOIN(prefix,name) prefix ## _ ## name
+
+#define W32LIB_HIDDEN_NAME(prefix,name) W32LIB_HIDDEN_JOIN(prefix,name)
+#define W32LIB_NAMESPACE_NAME(prefix,name) W32LIB_NAMESPACE_JOIN(prefix,name)
+#define W32LIB_LEGACY_NAME(prefix,name) W32LIB_LEGACY_JOIN(prefix,name)
+
+/************************************************************************************************/
+#define W32LIB_GUID(hname,mname,lname,u32,u16a,u16b,u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h) \
+static const struct w32lib_guid hname = {u32,u16a,u16b,{u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h}}; \
+extern const struct w32lib_guid mname __attribute((weak,alias(W32LIB_QUOTE(hname)))); \
+extern const struct w32lib_guid lname __attribute((weak,alias(W32LIB_QUOTE(hname)))); \
+/************************************************************************************************/