home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / objc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-11  |  1.3 KB  |  52 lines

  1. /*
  2.  *    objc.h
  3.  *    Copyright 1988-1996, NeXT Software, Inc.
  4.  */
  5.  
  6. #ifndef _OBJC_OBJC_H_
  7. #define _OBJC_OBJC_H_
  8.  
  9. #import <objc/objc-api.h>        // for OBJC_EXPORT
  10. typedef struct objc_class *Class;
  11.  
  12. typedef struct objc_object {
  13.     Class isa;
  14. } *id;
  15.  
  16. typedef struct objc_selector     *SEL;    
  17. typedef char *            STR;
  18. typedef id             (*IMP)(id, SEL, ...); 
  19. typedef char            BOOL;
  20.  
  21. // pointer arithmetic
  22. //
  23. #if defined(__osf__) && defined(__alpha__)
  24.     typedef long arith_t;
  25.     typedef unsigned long uarith_t;
  26.     #define ARITH_SHIFT 32
  27. #else
  28.     typedef int arith_t;
  29.     typedef unsigned uarith_t;
  30.     #define ARITH_SHIFT 16
  31. #endif
  32.  
  33. OBJC_EXPORT BOOL sel_isMapped(SEL sel);
  34. OBJC_EXPORT const char *sel_getName(SEL sel);
  35. OBJC_EXPORT SEL sel_getUid(const char *str);
  36. OBJC_EXPORT SEL sel_registerName(const char *str);
  37. OBJC_EXPORT const char *object_getClassName(id obj);
  38. OBJC_EXPORT void *object_getIndexedIvars(id obj);
  39.  
  40. #define YES             (BOOL)1
  41. #define NO              (BOOL)0
  42. #define ISSELECTOR(sel) sel_isMapped(sel)
  43. #define SELNAME(sel)    sel_getName(sel)
  44. #define SELUID(str)    sel_getUid(str)
  45. #define NAMEOF(obj)     object_getClassName(obj)
  46. #define IV(obj)         object_getIndexedIvars(obj)
  47.  
  48. #define Nil (Class)0           /* id of Nil class */
  49. #define nil (id)0              /* id of Nil instance */
  50.  
  51. #endif /* _OBJC_OBJC_H_ */
  52.