read.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* read.h Copyright (C) Codemist Ltd, 1989-95 */
  2. /*
  3. * Header defining the structure of the package system for use by
  4. * intern and its friends.
  5. */
  6. /* Signature: 1a6e3642 07-Mar-2000 */
  7. #ifndef header_read_h
  8. #define header_read_h 1
  9. typedef struct Package
  10. {
  11. Header header;
  12. Lisp_Object packageid; /* 'package as type of this struct */
  13. Lisp_Object internals; /* either vector or list of vectors */
  14. Lisp_Object vinternals; /* number of 16K vectors in this package */
  15. Lisp_Object ninternals; /* number of symbols in this package */
  16. Lisp_Object pkgflags; /* place to put randomish flags etc */
  17. #ifdef COMMON
  18. /*
  19. * Standard Lisp can have a much simpler setup than Common Lisp here
  20. */
  21. Lisp_Object externals; /* vector or list of vectors */
  22. Lisp_Object vexternals; /* number of vectors in above */
  23. Lisp_Object nexternals; /* number of symbols involved */
  24. Lisp_Object name; /* name of this package */
  25. Lisp_Object nicknames; /* list of nicknames */
  26. Lisp_Object use_list; /* list of things that this package uses */
  27. Lisp_Object used_by_list; /* list of packages that use this one */
  28. Lisp_Object shadowing_symbols; /* magic to cope with name clashes */
  29. #endif
  30. } Package;
  31. /*
  32. * The following macros are coded the way they are so as to encourage the
  33. * C compiler into using the address modes I want...
  34. * Rationalize at your peril!
  35. */
  36. #define packhdr_(p) (*(Header *) ((char *)(p) + (0L - TAG_VECTOR)))
  37. #define packid_(p) (*(Lisp_Object *)((char *)(p) + (4L - TAG_VECTOR)))
  38. #define packint_(p) (*(Lisp_Object *)((char *)(p) + (8L - TAG_VECTOR)))
  39. #define packvint_(p) (*(Lisp_Object *)((char *)(p) + (12L - TAG_VECTOR)))
  40. #define packnint_(p) (*(Lisp_Object *)((char *)(p) + (16L - TAG_VECTOR)))
  41. #define packflags_(p) (*(Lisp_Object *)((char *)(p) + (20L - TAG_VECTOR)))
  42. #ifdef COMMON
  43. #define packext_(p) (*(Lisp_Object *)((char *)(p) + (24L - TAG_VECTOR)))
  44. #define packvext_(p) (*(Lisp_Object *)((char *)(p) + (28L - TAG_VECTOR)))
  45. #define packnext_(p) (*(Lisp_Object *)((char *)(p) + (32L - TAG_VECTOR)))
  46. #define packname_(p) (*(Lisp_Object *)((char *)(p) + (36L - TAG_VECTOR)))
  47. #define packnick_(p) (*(Lisp_Object *)((char *)(p) + (40L - TAG_VECTOR)))
  48. #define packuses_(p) (*(Lisp_Object *)((char *)(p) + (44L - TAG_VECTOR)))
  49. #define packused_(p) (*(Lisp_Object *)((char *)(p) + (48L - TAG_VECTOR)))
  50. #define packshade_(p) (*(Lisp_Object *)((char *)(p) + (52L - TAG_VECTOR)))
  51. #endif
  52. #define CP qvalue(current_package)
  53. #ifdef COMMON
  54. # define ESCAPE_CHAR '\\'
  55. #else
  56. # define ESCAPE_CHAR '!'
  57. #endif
  58. #define NO_PREFIX 'x'
  59. extern CSLbool is_constituent(int c);
  60. extern Lisp_Object intern(int len, CSLbool escaped);
  61. extern Lisp_Object iintern(Lisp_Object str, int32 h, Lisp_Object p,
  62. int str_is_ok /* NOT a bool */);
  63. extern Lisp_Object find_package(char *name, int len);
  64. extern Lisp_Object read_from_vector(char *v);
  65. extern char prompt_string[32];
  66. #endif /* header_read_h */
  67. /* end of read.h */