]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/types/TinyError.h
Update tos-bsl for win32 python
[tinyos-2.x.git] / tos / types / TinyError.h
index d733a4260477c1ba50048188b08356921b31cfc7..b9767ae6580d1366c185991b1d6ecb8c82d683a0 100644 (file)
@@ -1,5 +1,5 @@
 // $Id$
-/*                                                                     tab:4
+/*
  * "Copyright (c) 2000-2005 The Regents of the University  of California.  
  * All rights reserved.
  *
 #ifndef TINY_ERROR_H_INCLUDED
 #define TINY_ERROR_H_INCLUDED
 
+#ifdef NESC
+#define NESC_COMBINE(x) @combine(x)
+#else
+#define NESC_COMBINE(x)
+#endif
+
 enum {
-  SUCCESS        = 0,          
-  FAIL           = 1,           // Generic condition: backwards compatible
-  ESIZE          = 2,           // Parameter passed in was too big.
-  ECANCEL        = 3,           // Operation cancelled by a call.
-  EOFF           = 4,           // Subsystem is not active
-  EBUSY          = 5,           // The underlying system is busy; retry later
-  EINVAL         = 6,           // An invalid parameter was passed
-  ERETRY         = 7,           // A rare and transient failure: can retry
-  ERESERVE       = 8,           // Reservation required before usage
-  EALREADY       = 9,           // The device state you are requesting is already set
+  SUCCESS        =  0,          
+  FAIL           =  1,           // Generic condition: backwards compatible
+  ESIZE          =  2,           // Parameter passed in was too big.
+  ECANCEL        =  3,           // Operation cancelled by a call.
+  EOFF           =  4,           // Subsystem is not active
+  EBUSY          =  5,           // The underlying system is busy; retry later
+  EINVAL         =  6,           // An invalid parameter was passed
+  ERETRY         =  7,           // A rare and transient failure: can retry
+  ERESERVE       =  8,           // Reservation required before usage
+  EALREADY       =  9,           // The device state you are requesting is already set
+  ENOMEM         = 10,           // Memory required not available
+  ENOACK         = 11,           // A packet was not acknowledged
+  ELAST          = 11            // Last enum value
 };
 
-typedef uint8_t error_t __attribute__((combine(ecombine)));
+typedef uint8_t error_t NESC_COMBINE("ecombine");
 
-error_t ecombine(error_t r1, error_t r2)
+error_t ecombine(error_t r1, error_t r2) @safe()
 /* Returns: r1 if r1 == r2, FAIL otherwise. This is the standard error
      combination function: two successes, or two identical errors are
      preserved, while conflicting errors are represented by FAIL.