home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / Foundation.framework / Versions / B / Headers / NSObjCRuntime.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-25  |  2.4 KB  |  103 lines

  1. /*    NSObjCRuntime.h
  2.     Language terminology and general utility
  3.     Copyright 1994-1996, NeXT Software, Inc.  All rights reserved.
  4. */
  5.  
  6. #if defined(WIN32)
  7.     #undef FOUNDATION_EXPORT
  8.     #if defined(NSBUILDINGFOUNDATION)
  9.     #define FOUNDATION_EXPORT __declspec(dllexport) extern
  10.     #else
  11.     #define FOUNDATION_EXPORT __declspec(dllimport) extern
  12.     #endif
  13.     #if !defined(FOUNDATION_IMPORT)
  14.     #define FOUNDATION_IMPORT __declspec(dllimport) extern
  15.     #endif
  16. #endif
  17.  
  18. #if !defined(FOUNDATION_EXPORT)
  19.     #define FOUNDATION_EXPORT extern
  20. #endif
  21.  
  22. #if !defined(FOUNDATION_IMPORT)
  23.     #define FOUNDATION_IMPORT extern
  24. #endif
  25.  
  26. /***************    Types        ***************/
  27.  
  28. #import <objc/objc.h>
  29. #import <objc/zone.h>
  30. #import <stdarg.h>
  31.  
  32. /***************    Functions        ***************/
  33.  
  34. @class NSString;
  35.  
  36. FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);
  37. FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
  38. FOUNDATION_EXPORT Class NSClassFromString(NSString *aClassName);
  39. FOUNDATION_EXPORT NSString *NSStringFromClass(Class aClass);
  40. FOUNDATION_EXPORT const char *NSGetSizeAndAlignment(const char *typePtr, unsigned int *sizep, unsigned int *alignp);
  41.  
  42. /***************    Logging        ***************/
  43.  
  44. FOUNDATION_EXPORT void NSLog(NSString *format, ...);
  45. FOUNDATION_EXPORT void NSLogv(NSString *format, va_list args);
  46.  
  47. /***************    Comparison and searching    ***************/
  48.  
  49. typedef enum _NSComparisonResult {NSOrderedAscending = -1, NSOrderedSame, NSOrderedDescending} NSComparisonResult;
  50.  
  51. enum {NSNotFound = 0x7fffffff};
  52.  
  53. /***************    Constants        ***************/
  54.  
  55. #if !defined(YES)
  56.     #define YES    (BOOL)1
  57. #endif
  58.  
  59. #if !defined(NO)
  60.     #define NO    (BOOL)0
  61. #endif
  62.  
  63. #if !defined(nil)
  64.     #define nil    (id)0
  65. #endif
  66.  
  67. #if !defined(Nil)
  68.     #define Nil    (Class)0
  69. #endif
  70.  
  71. /***************    MIN, MAX, ABS macros        ***********/
  72.  
  73. #if defined(__GNUC__)
  74.  
  75. #if !defined(MIN)
  76.     #define MIN(A,B)    ({ typeof(A) __a = (A); typeof(B) __b = (B); __a < __b ? __a : __b; })
  77. #endif
  78.  
  79. #if !defined(MAX)
  80.     #define MAX(A,B)    ({ typeof(A) __a = (A); typeof(B) __b = (B); __a < __b ? __b : __a; })
  81. #endif
  82.  
  83. #if !defined(ABS)
  84.     #define ABS(A)    ({ typeof(A) __a = (A); __a < 0 ? -__a : __a; })
  85. #endif
  86.  
  87. #else
  88.  
  89. #if !defined(MIN)
  90.     #define MIN(A,B)    ((A) < (B) ? (A) : (B))
  91. #endif
  92.  
  93. #if !defined(MAX)
  94.     #define MAX(A,B)    ((A) > (B) ? (A) : (B))
  95. #endif
  96.  
  97. #if !defined(ABS)
  98.     #define ABS(A)    ((A) < 0 ? (-(A)) : (A))
  99. #endif
  100.  
  101. #endif    /* __GNUC__ */
  102.  
  103.