The current range_table_entry lrecord declaration sucks because you
can't #include it.
Beware Steve, this creates a new file.
OG.
1998-05-02 Olivier Galibert <galibert(a)pobox.com>
* buffer.h: Put the range_table lrecrod declaration where it
belongs...
* rangetab.h: New file - ...which is here.
* rangetab.c: Move declarations to rangetab.h
Index: src/buffer.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/buffer.h,v
retrieving revision 1.11
diff -u -r1.11 buffer.h
--- buffer.h 1998/03/31 20:11:25 1.11
+++ buffer.h 1998/05/02 09:10:49
@@ -1789,9 +1789,4 @@
#define DOWNCASE(buf, ch) DOWNCASE_TABLE_OF (buf, ch)
-
-/* put it here, somewhat arbitrarily ... it needs to be in *some*
- header file. */
-DECLARE_LRECORD (range_table, struct Lisp_Range_Table);
-
#endif /* _XEMACS_BUFFER_H_ */
Index: src/rangetab.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/rangetab.c,v
retrieving revision 1.4
diff -u -r1.4 rangetab.c
--- rangetab.c 1998/03/31 20:12:07 1.4
+++ rangetab.c 1998/05/02 09:10:49
@@ -23,35 +23,7 @@
/* Written by Ben Wing, August 1995. */
-#include <config.h>
-#include "lisp.h"
-
-typedef struct range_table_entry range_table_entry;
-struct range_table_entry
-{
- EMACS_INT first;
- EMACS_INT last;
- Lisp_Object val;
-};
-
-typedef struct
-{
- Dynarr_declare (range_table_entry);
-} range_table_entry_dynarr;
-
-struct Lisp_Range_Table
-{
- struct lcrecord_header header;
- range_table_entry_dynarr *entries;
-};
-
-DECLARE_LRECORD (range_table, struct Lisp_Range_Table);
-#define XRANGE_TABLE(x) \
- XRECORD (x, range_table, struct Lisp_Range_Table)
-#define XSETRANGE_TABLE(x, p) XSETRECORD (x, p, range_table)
-#define RANGE_TABLEP(x) RECORDP (x, range_table)
-#define GC_RANGE_TABLEP(x) GC_RECORDP (x, range_table)
-#define CHECK_RANGE_TABLE(x) CHECK_RECORD (x, range_table)
+#include "rangetab.h"
Lisp_Object Qrange_tablep;
Lisp_Object Qrange_table;
@@ -159,7 +131,7 @@
}
DEFINE_LRECORD_IMPLEMENTATION ("range-table", range_table,
- mark_range_table, print_range_table, 0,
+ default_dumper, mark_range_table, print_range_table, 0,
range_table_equal, range_table_hash,
struct Lisp_Range_Table);
Index: src/rangetab.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/rangetab.h,v
retrieving revision 1.0
diff -u -r1.0 rangetab.h
--- /dev/null Sat May 2 03:05:04 1998
+++ rangetab.h Sat May 2 03:03:02 1998
@@ -0,0 +1,59 @@
+/* XEmacs routines to deal with range tables.
+ Copyright (C) 1995 Sun Microsystems, Inc.
+ Copyright (C) 1995 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Synched up with: Not in FSF. */
+
+/* Extracted from rangetab.c by O. Galibert, 1998. */
+
+#ifndef _XEMACS_RANGETAB_H_
+#define _XEMACS_RANGETAB_H_
+
+#include <config.h>
+#include "lisp.h"
+
+typedef struct range_table_entry range_table_entry;
+struct range_table_entry
+{
+ EMACS_INT first;
+ EMACS_INT last;
+ Lisp_Object val;
+};
+
+typedef struct
+{
+ Dynarr_declare (range_table_entry);
+} range_table_entry_dynarr;
+
+struct Lisp_Range_Table
+{
+ struct lcrecord_header header;
+ range_table_entry_dynarr *entries;
+};
+
+DECLARE_LRECORD (range_table, struct Lisp_Range_Table);
+#define XRANGE_TABLE(x) \
+ XRECORD (x, range_table, struct Lisp_Range_Table)
+#define XSETRANGE_TABLE(x, p) XSETRECORD (x, p, range_table)
+#define RANGE_TABLEP(x) RECORDP (x, range_table)
+#define GC_RANGE_TABLEP(x) GC_RECORDP (x, range_table)
+#define CHECK_RANGE_TABLE(x) CHECK_RECORD (x, range_table)
+
+#endif