comparison src/alloc.c @ 88353:8e996bb689ca

Include "character.h" instead of "charset.h". (Fmake_char_table): Moved to chartab.c. (make_sub_char_table): Likewise. (syms_of_alloc): Remove defsubr for Smake_char_table.
author Kenichi Handa <handa@m17n.org>
date Fri, 01 Mar 2002 01:06:56 +0000
parents 383c4e6bb59c
children ac49af641799
comparison
equal deleted inserted replaced
88352:509c3faec8b6 88353:8e996bb689ca
45 #include "buffer.h" 45 #include "buffer.h"
46 #include "window.h" 46 #include "window.h"
47 #include "keyboard.h" 47 #include "keyboard.h"
48 #include "frame.h" 48 #include "frame.h"
49 #include "blockinput.h" 49 #include "blockinput.h"
50 #include "charset.h" 50 #include "character.h"
51 #include "syssignal.h" 51 #include "syssignal.h"
52 #include <setjmp.h> 52 #include <setjmp.h>
53 53
54 #ifdef HAVE_UNISTD_H 54 #ifdef HAVE_UNISTD_H
55 #include <unistd.h> 55 #include <unistd.h>
2353 p = allocate_vector (sizei); 2353 p = allocate_vector (sizei);
2354 for (index = 0; index < sizei; index++) 2354 for (index = 0; index < sizei; index++)
2355 p->contents[index] = init; 2355 p->contents[index] = init;
2356 2356
2357 XSETVECTOR (vector, p); 2357 XSETVECTOR (vector, p);
2358 return vector;
2359 }
2360
2361
2362 DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0,
2363 doc: /* Return a newly created char-table, with purpose PURPOSE.
2364 Each element is initialized to INIT, which defaults to nil.
2365 PURPOSE should be a symbol which has a `char-table-extra-slots' property.
2366 The property's value should be an integer between 0 and 10. */)
2367 (purpose, init)
2368 register Lisp_Object purpose, init;
2369 {
2370 Lisp_Object vector;
2371 Lisp_Object n;
2372 CHECK_SYMBOL (purpose);
2373 n = Fget (purpose, Qchar_table_extra_slots);
2374 CHECK_NUMBER (n);
2375 if (XINT (n) < 0 || XINT (n) > 10)
2376 args_out_of_range (n, Qnil);
2377 /* Add 2 to the size for the defalt and parent slots. */
2378 vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)),
2379 init);
2380 XCHAR_TABLE (vector)->top = Qt;
2381 XCHAR_TABLE (vector)->parent = Qnil;
2382 XCHAR_TABLE (vector)->purpose = purpose;
2383 XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
2384 return vector;
2385 }
2386
2387
2388 /* Return a newly created sub char table with default value DEFALT.
2389 Since a sub char table does not appear as a top level Emacs Lisp
2390 object, we don't need a Lisp interface to make it. */
2391
2392 Lisp_Object
2393 make_sub_char_table (defalt)
2394 Lisp_Object defalt;
2395 {
2396 Lisp_Object vector
2397 = Fmake_vector (make_number (SUB_CHAR_TABLE_STANDARD_SLOTS), Qnil);
2398 XCHAR_TABLE (vector)->top = Qnil;
2399 XCHAR_TABLE (vector)->defalt = defalt;
2400 XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
2401 return vector; 2358 return vector;
2402 } 2359 }
2403 2360
2404 2361
2405 DEFUN ("vector", Fvector, Svector, 0, MANY, 0, 2362 DEFUN ("vector", Fvector, Svector, 0, MANY, 0,
5556 defsubr (&Slist); 5513 defsubr (&Slist);
5557 defsubr (&Svector); 5514 defsubr (&Svector);
5558 defsubr (&Smake_byte_code); 5515 defsubr (&Smake_byte_code);
5559 defsubr (&Smake_list); 5516 defsubr (&Smake_list);
5560 defsubr (&Smake_vector); 5517 defsubr (&Smake_vector);
5561 defsubr (&Smake_char_table);
5562 defsubr (&Smake_string); 5518 defsubr (&Smake_string);
5563 defsubr (&Smake_bool_vector); 5519 defsubr (&Smake_bool_vector);
5564 defsubr (&Smake_symbol); 5520 defsubr (&Smake_symbol);
5565 defsubr (&Smake_marker); 5521 defsubr (&Smake_marker);
5566 defsubr (&Spurecopy); 5522 defsubr (&Spurecopy);