Change methods in Queryable.cs - call Provider.CreateQuery instead of Provider.Execute
[mono.git] / support / mph.h
index 56f83e52b16e6c832bab0b8ec843fd640c2b3abb..224f01093333f715a3408958c87047673c7b07cf 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <config.h>
 
+#include <stddef.h>             /* offsetof */
 #include <limits.h>             /* LONG_MAX, ULONG_MAX */
 #include <errno.h>              /* for ERANGE */
 #include <glib.h>               /* for g* types, etc. */
@@ -170,6 +171,13 @@ typedef gint64 suseconds_t;
 
 #define mph_return_if_time_t_overflow(var) mph_return_if_long_overflow(var)
 
+#define mph_return_if_val_in_list5(var,a,b,c,d,e) \
+       do {                                                            \
+               int v = (var);                                                \
+               if (v == a || v == b || v == c || v == d || v == e)           \
+                       return -1;                                                  \
+       } while (0)
+
 /*
  * Helper function for functions which use ERANGE (such as getpwnam_r and
  * getgrnam_r).  These functions accept buffers which are dynamically
@@ -191,10 +199,20 @@ recheck_range (int ret)
        return 0;
 }
 
+typedef unsigned int mph_string_offset_t;
+
+enum {
+       MPH_STRING_OFFSET_PTR   = 0x0,
+       MPH_STRING_OFFSET_ARRAY = 0x1,
+       MPH_STRING_OFFSET_MASK  = 0x1
+};
+
+#define MPH_STRING_OFFSET(type,member,kind) ((offsetof(type,member) << 1) | kind)
+
 MPH_INTERNAL char* 
 _mph_copy_structure_strings (
-       void *to,         const size_t *to_offsets, 
-       const void *from, const size_t *from_offsets, 
+       void *to,         const mph_string_offset_t *to_offsets, 
+       const void *from, const mph_string_offset_t *from_offsets, 
        size_t num_strings);
 
 #endif /* ndef INC_mph_H */