add a license
[ia32rtools.git] / tools / protoparse.h
index 26b0e00..0ae46f6 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * ia32rtools
+ * (C) notaz, 2013,2014
+ *
+ * This work is licensed under the terms of 3-clause BSD license.
+ * See COPYING file in the top-level directory.
+ */
 
 struct parsed_proto;
 
@@ -156,9 +163,11 @@ static const char *known_type_mod[] = {
 static const char *known_ptr_types[] = {
        "FARPROC",
        "WNDPROC",
+       "LINECALLBACK",
        "HACCEL",
        "HANDLE",
        "HBITMAP",
+       "HCALL",
        "HCURSOR",
        "HDC",
        "HFONT",
@@ -167,6 +176,9 @@ static const char *known_ptr_types[] = {
        "HICON",
        "HINSTANCE",
        "HIMC", // DWORD in mingw, ptr in wine..
+       "HLINE",
+       "HLINEAPP",
+       "HLOCAL",
        "HMODULE",
        "HPALETTE",
        "HRGN",
@@ -179,6 +191,7 @@ static const char *known_ptr_types[] = {
        "PCRITICAL_SECTION",
        "PDWORD",
        "PFILETIME",
+       "PLARGE_INTEGER",
        "PHKEY",
        "PLONG",
        "PMEMORY_BASIC_INFORMATION",
@@ -742,6 +755,30 @@ struct parsed_proto *proto_clone(const struct parsed_proto *pp_c)
        return pp;
 }
 
+
+static inline int pp_cmp_func(const struct parsed_proto *pp1,
+  const struct parsed_proto *pp2)
+{
+  int i;
+
+  if (pp1->argc != pp2->argc || pp1->argc_reg != pp2->argc_reg)
+    return 1;
+  else {
+    for (i = 0; i < pp1->argc; i++) {
+      if ((pp1->arg[i].reg != NULL) != (pp2->arg[i].reg != NULL))
+        return 1;
+
+      if ((pp1->arg[i].reg != NULL)
+        && !IS(pp1->arg[i].reg, pp2->arg[i].reg))
+      {
+        return 1;
+      }
+    }
+  }
+
+  return 0;
+}
+
 static inline void pp_print(char *buf, size_t buf_size,
   const struct parsed_proto *pp)
 {