Added SILC CPUID API
[runtime.git] / lib / silcutil / silctypes.h
index fd2da8f8df8ba71734fbc9fb11d22ee857117bbf..802f81138e35975fd36ba86ceac638169d5b2002 100644 (file)
@@ -163,14 +163,14 @@ typedef signed short SilcInt16;
  *
  * SOURCE
  */
-#if SILC_SIZEOF_LONG == 4
-typedef unsigned long SilcUInt32;
-typedef signed long SilcInt32;
-#else
 #if SILC_SIZEOF_INT == 4
 typedef unsigned int SilcUInt32;
 typedef signed int SilcInt32;
 #else
+#if SILC_SIZEOF_LONG == 4
+typedef unsigned long SilcUInt32;
+typedef signed long SilcInt32;
+#else
 #if SILC_SIZEOF_LONG_LONG >= 4
 #ifndef WIN32
 typedef unsigned long long SilcUInt32;
@@ -341,6 +341,44 @@ typedef SilcUInt32 SilcParam;
 #define SILC_PARAM_ALLOC         0x00010000     /* Allocate, bitmask */
 #define SILC_PARAM_REPLACE       0x00020000    /* Replace, bitmask */
 
+/****d* silcutil/SilcCompareValue
+ *
+ * NAME
+ *
+ *    typedef enum { ... } SilcCompareValue
+ *
+ * DESCRIPTION
+ *
+ *    Values that can be returned by the SilcCompare function.  Note that
+ *    not all routines may respect all of the return values.
+ *
+ * SOURCE
+ */
+typedef enum {
+  SILC_COMPARE_LESS_THAN_EQUAL_TO    = -2,  /* Value 1 <= value 2 */
+  SILC_COMPARE_LESS_THAN             = -1,  /* Value 1 < value 2 */
+  SILC_COMPARE_EQUAL_TO              = 0,   /* Value 1 == value 2 */
+  SILC_COMPARE_GREATER_THAN          = 1,   /* Value 1 > value 2 */
+  SILC_COMPARE_GREATER_THAN_EQUAL_TO = 2,   /* Value 1 >= value 2 */
+  SILC_COMPARE_STOP                  = 3,   /* Stop comparison */
+} SilcCompareValue;
+/***/
+
+/****f* silcutil/SilcCompare
+ *
+ * SYNOPSIS
+ *
+ *    typedef SilcCompareValue (*SilcCompare)(void *value1, void *value2,
+ *                                            void *context);
+ *
+ * DESCRIPTION
+ *
+ *   A comparison function used by many routines in SILC Runtime Toolkit.
+ *
+ ***/
+typedef SilcCompareValue (*SilcCompare)(void *value1, void *value2,
+                                       void *context);
+
 /* Macros */
 
 #if (defined(SILC_I486) || defined(SILC_X86_64)) && defined(__GNUC__)
@@ -1287,4 +1325,11 @@ void silc_prefetch_block(void *addr,
 #undef SILC_PREFETCH_ASM
 }
 
+typedef char __check_size1[sizeof(SilcInt8)   ==       1 ? 1 : -1];
+typedef char __check_size2[sizeof(SilcUInt8)  ==       1 ? 1 : -1];
+typedef char __check_size3[sizeof(SilcInt16)  ==       2 ? 1 : -1];
+typedef char __check_size4[sizeof(SilcUInt16) ==       2 ? 1 : -1];
+typedef char __check_size5[sizeof(SilcInt32)  ==       4 ? 1 : -1];
+typedef char __check_size6[sizeof(SilcUInt32) ==       4 ? 1 : -1];
+
 #endif /* SILCTYPES_H */