projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Include character.h in every MULE.
[chise/xemacs-chise.git-]
/
src
/
buffer.h
diff --git
a/src/buffer.h
b/src/buffer.h
index
f9bf6c1
..
142901e
100644
(file)
--- a/
src/buffer.h
+++ b/
src/buffer.h
@@
-33,7
+33,7
@@
Boston, MA 02111-1307, USA. */
#define _XEMACS_BUFFER_H_
#ifdef MULE
#define _XEMACS_BUFFER_H_
#ifdef MULE
-#include "mule-charset.h"
+#include "character.h"
#endif
/************************************************************************/
#endif
/************************************************************************/
@@
-94,7
+94,11
@@
struct buffer_text
This information is text-only so it goes here. */
Bufpos mule_bufmin, mule_bufmax;
Bytind mule_bytmin, mule_bytmax;
This information is text-only so it goes here. */
Bufpos mule_bufmin, mule_bufmax;
Bytind mule_bytmin, mule_bytmax;
+#ifdef UTF2000
+ int mule_size;
+#else
int mule_shifter, mule_three_p;
int mule_shifter, mule_three_p;
+#endif
/* And we also cache 16 positions for fairly fast access near those
positions. */
/* And we also cache 16 positions for fairly fast access near those
positions. */
@@
-528,6
+532,9
@@
charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2)
#ifdef MULE
#ifdef MULE
+#ifdef UTF2000
+#define valid_char_p(ch) 1
+#else
int non_ascii_valid_char_p (Emchar ch);
INLINE int valid_char_p (Emchar ch);
int non_ascii_valid_char_p (Emchar ch);
INLINE int valid_char_p (Emchar ch);
@@
-536,6
+543,7
@@
valid_char_p (Emchar ch)
{
return ((unsigned int) (ch) <= 0xff) || non_ascii_valid_char_p (ch);
}
{
return ((unsigned int) (ch) <= 0xff) || non_ascii_valid_char_p (ch);
}
+#endif
#else /* not MULE */
#else /* not MULE */
@@
-572,11
+580,15
@@
XCHAR_OR_CHAR_INT (Lisp_Object obj)
x = wrong_type_argument (Qcharacterp, x); \
} while (0)
x = wrong_type_argument (Qcharacterp, x); \
} while (0)
+#ifdef UTF2000
+# define MAX_EMCHAR_LEN 6
+#else
#ifdef MULE
# define MAX_EMCHAR_LEN 4
#else
# define MAX_EMCHAR_LEN 1
#endif
#ifdef MULE
# define MAX_EMCHAR_LEN 4
#else
# define MAX_EMCHAR_LEN 1
#endif
+#endif
\f
/*----------------------------------------------------------------------*/
\f
/*----------------------------------------------------------------------*/
@@
-963,7
+975,9
@@
Bufpos bytind_to_bufpos_func (struct buffer *buf, Bytind x);
64K for width-three characters.
*/
64K for width-three characters.
*/
+#ifndef UTF2000
extern short three_to_one_table[];
extern short three_to_one_table[];
+#endif
INLINE int real_bufpos_to_bytind (struct buffer *buf, Bufpos x);
INLINE int
INLINE int real_bufpos_to_bytind (struct buffer *buf, Bufpos x);
INLINE int
@@
-971,8
+985,13
@@
real_bufpos_to_bytind (struct buffer *buf, Bufpos x)
{
if (x >= buf->text->mule_bufmin && x <= buf->text->mule_bufmax)
return (buf->text->mule_bytmin +
{
if (x >= buf->text->mule_bufmin && x <= buf->text->mule_bufmax)
return (buf->text->mule_bytmin +
+#ifdef UTF2000
+ (x - buf->text->mule_bufmin) * buf->text->mule_size
+#else
((x - buf->text->mule_bufmin) << buf->text->mule_shifter) +
((x - buf->text->mule_bufmin) << buf->text->mule_shifter) +
- (buf->text->mule_three_p ? (x - buf->text->mule_bufmin) : 0));
+ (buf->text->mule_three_p ? (x - buf->text->mule_bufmin) : 0)
+#endif
+ );
else
return bufpos_to_bytind_func (buf, x);
}
else
return bufpos_to_bytind_func (buf, x);
}
@@
-983,9
+1002,15
@@
real_bytind_to_bufpos (struct buffer *buf, Bytind x)
{
if (x >= buf->text->mule_bytmin && x <= buf->text->mule_bytmax)
return (buf->text->mule_bufmin +
{
if (x >= buf->text->mule_bytmin && x <= buf->text->mule_bytmax)
return (buf->text->mule_bufmin +
+#ifdef UTF2000
+ (buf->text->mule_size == 0 ? 0 :
+ (x - buf->text->mule_bytmin) / buf->text->mule_size)
+#else
((buf->text->mule_three_p
? three_to_one_table[x - buf->text->mule_bytmin]
((buf->text->mule_three_p
? three_to_one_table[x - buf->text->mule_bytmin]
- : (x - buf->text->mule_bytmin) >> buf->text->mule_shifter)));
+ : (x - buf->text->mule_bytmin) >> buf->text->mule_shifter))
+#endif
+ );
else
return bytind_to_bufpos_func (buf, x);
}
else
return bytind_to_bufpos_func (buf, x);
}
@@
-1513,6
+1538,7
@@
extern struct buffer *current_buffer;
/* This is the initial (startup) directory, as used for the *scratch* buffer.
We're making this a global to make others aware of the startup directory.
/* This is the initial (startup) directory, as used for the *scratch* buffer.
We're making this a global to make others aware of the startup directory.
+ `initial_directory' is stored in external format.
*/
extern char initial_directory[];
extern void init_initial_directory (void); /* initialize initial_directory */
*/
extern char initial_directory[];
extern void init_initial_directory (void); /* initialize initial_directory */