diff options
| author | Joseph Arceneaux | 1992-10-01 01:00:41 +0000 |
|---|---|---|
| committer | Joseph Arceneaux | 1992-10-01 01:00:41 +0000 |
| commit | e221eae302bba578376130f0e851162cb7ffca0c (patch) | |
| tree | 180e16b7c1b7d62a4fdb3b5e11d2fbedd9cf2065 /src | |
| parent | 679194a6a0e5f6002ddc2b554e2a4b15c39fc298 (diff) | |
| download | emacs-e221eae302bba578376130f0e851162cb7ffca0c.tar.gz emacs-e221eae302bba578376130f0e851162cb7ffca0c.zip | |
* lisp.h: Conditionally define interval structure and macros.
Add DECLARE_INTERVALS to struct Lisp_String.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index 58ae4a9ec2f..32048e9a29d 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -425,6 +425,60 @@ extern int pure_size; | |||
| 425 | #define XSETPROCESS(a, b) XSETPNTR(a, (int) (b)) | 425 | #define XSETPROCESS(a, b) XSETPNTR(a, (int) (b)) |
| 426 | #define XSETFLOAT(a, b) XSETPNTR(a, (int) (b)) | 426 | #define XSETFLOAT(a, b) XSETPNTR(a, (int) (b)) |
| 427 | 427 | ||
| 428 | #ifdef USE_TEXT_PROPERTIES | ||
| 429 | /* Basic data type for use of intervals. See the macros in intervals.h */ | ||
| 430 | |||
| 431 | struct interval | ||
| 432 | { | ||
| 433 | /* The first group of entries deal with the tree structure. */ | ||
| 434 | |||
| 435 | unsigned int total_length; /* Length of myself and both children. */ | ||
| 436 | unsigned int position; /* Cache of interval's character position */ | ||
| 437 | struct interval *left; /* Intervals which precede me. */ | ||
| 438 | struct interval *right; /* Intervals which succeed me. */ | ||
| 439 | struct interval *parent; /* Parent in the tree, or the Lisp_Object | ||
| 440 | containing this interval tree. */ | ||
| 441 | |||
| 442 | /* The remaining components are `properties' of the interval. | ||
| 443 | The first four are duplicates for things which can be on the list, | ||
| 444 | for purposes of speed. */ | ||
| 445 | |||
| 446 | unsigned char write_protect; /* Non-zero means can't modify. */ | ||
| 447 | unsigned char visible; /* Zero means don't display. */ | ||
| 448 | unsigned char front_hungry; /* Non-zero means text inserted just | ||
| 449 | before this interval goes into it. */ | ||
| 450 | unsigned char rear_hungry; /* Likewise for just after it. */ | ||
| 451 | |||
| 452 | Lisp_Object plist; /* Properties of this interval. */ | ||
| 453 | }; | ||
| 454 | |||
| 455 | typedef struct interval *INTERVAL; | ||
| 456 | |||
| 457 | /* Complain if object is not string or buffer type */ | ||
| 458 | #define CHECK_STRING_OR_BUFFER(x, i) \ | ||
| 459 | { if (XTYPE ((x)) != Lisp_String && XTYPE ((x)) != Lisp_Buffer) \ | ||
| 460 | x = wrong_type_argument (Qbuffer_or_string_p, (x)); } | ||
| 461 | |||
| 462 | /* Macro used to conditionally compile intervals into certain data | ||
| 463 | structures. See, e.g., struct Lisp_String below. */ | ||
| 464 | #define DECLARE_INTERVALS INTERVAL intervals; | ||
| 465 | |||
| 466 | /* Macro used to condionally compile interval initialization into | ||
| 467 | certain code. See, e.g., alloc.c. */ | ||
| 468 | #define INITIALIZE_INTERVAL(ptr,val) ptr->intervals = val | ||
| 469 | |||
| 470 | #else /* No text properties */ | ||
| 471 | |||
| 472 | /* If no intervals are used, make the above definitions go away. */ | ||
| 473 | |||
| 474 | #define CHECK_STRING_OR_BUFFER(x, i) | ||
| 475 | |||
| 476 | #define INTERVAL | ||
| 477 | #define DECLARE_INTERVALS | ||
| 478 | #define INITIALIZE_INTERVAL(ptr,val) | ||
| 479 | |||
| 480 | #endif /* USE_TEXT_PROPERTIES */ | ||
| 481 | |||
| 428 | /* In a cons, the markbit of the car is the gc mark bit */ | 482 | /* In a cons, the markbit of the car is the gc mark bit */ |
| 429 | 483 | ||
| 430 | struct Lisp_Cons | 484 | struct Lisp_Cons |
| @@ -447,6 +501,7 @@ struct Lisp_Buffer_Cons | |||
| 447 | struct Lisp_String | 501 | struct Lisp_String |
| 448 | { | 502 | { |
| 449 | int size; | 503 | int size; |
| 504 | DECLARE_INTERVALS /* `data' field must be last. */ | ||
| 450 | unsigned char data[1]; | 505 | unsigned char data[1]; |
| 451 | }; | 506 | }; |
| 452 | 507 | ||