Mercurial > hg > xemacs-beta
comparison src/syntax.c @ 5178:97eb4942aec8
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 29 Mar 2010 21:28:13 -0500 |
parents | 6c6d78781d59 |
children | 308d34e9f07d |
comparison
equal
deleted
inserted
replaced
5177:b785049378e3 | 5178:97eb4942aec8 |
---|---|
1 /* XEmacs routines to deal with syntax tables; also word and list parsing. | 1 /* XEmacs routines to deal with syntax tables; also word and list parsing. |
2 Copyright (C) 1985-1994 Free Software Foundation, Inc. | 2 Copyright (C) 1985-1994 Free Software Foundation, Inc. |
3 Copyright (C) 1995 Sun Microsystems, Inc. | 3 Copyright (C) 1995 Sun Microsystems, Inc. |
4 Copyright (C) 2001, 2002, 2003 Ben Wing. | 4 Copyright (C) 2001, 2002, 2003, 2010 Ben Wing. |
5 | 5 |
6 This file is part of XEmacs. | 6 This file is part of XEmacs. |
7 | 7 |
8 XEmacs is free software; you can redistribute it and/or modify it | 8 XEmacs is free software; you can redistribute it and/or modify it |
9 under the terms of the GNU General Public License as published by the | 9 under the terms of the GNU General Public License as published by the |
257 { XD_LISP_OBJECT, offsetof (struct syntax_cache, end) }, | 257 { XD_LISP_OBJECT, offsetof (struct syntax_cache, end) }, |
258 { XD_END } | 258 { XD_END } |
259 }; | 259 }; |
260 | 260 |
261 #ifdef NEW_GC | 261 #ifdef NEW_GC |
262 DEFINE_LRECORD_IMPLEMENTATION ("syntax-cache", syntax_cache, | 262 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("syntax-cache", syntax_cache, |
263 1, /*dumpable-flag*/ | 263 0, syntax_cache_description_1, |
264 0, 0, 0, 0, 0, | 264 Lisp_Syntax_Cache); |
265 syntax_cache_description_1, | |
266 Lisp_Syntax_Cache); | |
267 #else /* not NEW_GC */ | 265 #else /* not NEW_GC */ |
268 | 266 |
269 const struct sized_memory_description syntax_cache_description = { | 267 const struct sized_memory_description syntax_cache_description = { |
270 sizeof (struct syntax_cache), | 268 sizeof (struct syntax_cache), |
271 syntax_cache_description_1 | 269 syntax_cache_description_1 |
521 void | 519 void |
522 init_buffer_syntax_cache (struct buffer *buf) | 520 init_buffer_syntax_cache (struct buffer *buf) |
523 { | 521 { |
524 struct syntax_cache *cache; | 522 struct syntax_cache *cache; |
525 #ifdef NEW_GC | 523 #ifdef NEW_GC |
526 buf->syntax_cache = alloc_lrecord_type (struct syntax_cache, | 524 buf->syntax_cache = XSYNTAX_CACHE (ALLOC_NORMAL_LISP_OBJECT (syntax_cache)); |
527 &lrecord_syntax_cache); | |
528 #else /* not NEW_GC */ | 525 #else /* not NEW_GC */ |
529 buf->syntax_cache = xnew_and_zero (struct syntax_cache); | 526 buf->syntax_cache = xnew_and_zero (struct syntax_cache); |
530 #endif /* not NEW_GC */ | 527 #endif /* not NEW_GC */ |
531 cache = buf->syntax_cache; | 528 cache = buf->syntax_cache; |
532 cache->object = wrap_buffer (buf); | 529 cache->object = wrap_buffer (buf); |
543 | 540 |
544 void | 541 void |
545 uninit_buffer_syntax_cache (struct buffer *UNUSED_IF_NEW_GC (buf)) | 542 uninit_buffer_syntax_cache (struct buffer *UNUSED_IF_NEW_GC (buf)) |
546 { | 543 { |
547 #ifndef NEW_GC | 544 #ifndef NEW_GC |
548 xfree (buf->syntax_cache); | 545 if (buf->syntax_cache) |
549 buf->syntax_cache = 0; | 546 { |
547 xfree (buf->syntax_cache); | |
548 buf->syntax_cache = 0; | |
549 } | |
550 #endif /* not NEW_GC */ | 550 #endif /* not NEW_GC */ |
551 } | 551 } |
552 | 552 |
553 /* extent-specific APIs used in extents.c and insdel.c */ | 553 /* extent-specific APIs used in extents.c and insdel.c */ |
554 | 554 |
2391 | 2391 |
2392 void | 2392 void |
2393 syms_of_syntax (void) | 2393 syms_of_syntax (void) |
2394 { | 2394 { |
2395 #ifdef NEW_GC | 2395 #ifdef NEW_GC |
2396 INIT_LRECORD_IMPLEMENTATION (syntax_cache); | 2396 INIT_LISP_OBJECT (syntax_cache); |
2397 #endif /* NEW_GC */ | 2397 #endif /* NEW_GC */ |
2398 DEFSYMBOL (Qsyntax_table_p); | 2398 DEFSYMBOL (Qsyntax_table_p); |
2399 DEFSYMBOL (Qsyntax_table); | 2399 DEFSYMBOL (Qsyntax_table); |
2400 | 2400 |
2401 DEFSUBR (Fsyntax_table_p); | 2401 DEFSUBR (Fsyntax_table_p); |