diff options
| author | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
| commit | 971de7fb158335fbda39525feb2d7776a26bc030 (patch) | |
| tree | 605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/chartab.c | |
| parent | b8463cbfbe2c5183cf40772df2746e58b787ddeb (diff) | |
| download | emacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip | |
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
Diffstat (limited to 'src/chartab.c')
| -rw-r--r-- | src/chartab.c | 67 |
1 files changed, 16 insertions, 51 deletions
diff --git a/src/chartab.c b/src/chartab.c index 90ec660d671..a95e3ac6dca 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -92,9 +92,7 @@ the char-table has no extra slot. */) | |||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | static Lisp_Object | 94 | static Lisp_Object |
| 95 | make_sub_char_table (depth, min_char, defalt) | 95 | make_sub_char_table (int depth, int min_char, Lisp_Object defalt) |
| 96 | int depth, min_char; | ||
| 97 | Lisp_Object defalt; | ||
| 98 | { | 96 | { |
| 99 | Lisp_Object table; | 97 | Lisp_Object table; |
| 100 | int size = VECSIZE (struct Lisp_Sub_Char_Table) - 1 + chartab_size[depth]; | 98 | int size = VECSIZE (struct Lisp_Sub_Char_Table) - 1 + chartab_size[depth]; |
| @@ -108,8 +106,7 @@ make_sub_char_table (depth, min_char, defalt) | |||
| 108 | } | 106 | } |
| 109 | 107 | ||
| 110 | static Lisp_Object | 108 | static Lisp_Object |
| 111 | char_table_ascii (table) | 109 | char_table_ascii (Lisp_Object table) |
| 112 | Lisp_Object table; | ||
| 113 | { | 110 | { |
| 114 | Lisp_Object sub; | 111 | Lisp_Object sub; |
| 115 | 112 | ||
| @@ -123,8 +120,7 @@ char_table_ascii (table) | |||
| 123 | } | 120 | } |
| 124 | 121 | ||
| 125 | Lisp_Object | 122 | Lisp_Object |
| 126 | copy_sub_char_table (table) | 123 | copy_sub_char_table (Lisp_Object table) |
| 127 | Lisp_Object table; | ||
| 128 | { | 124 | { |
| 129 | Lisp_Object copy; | 125 | Lisp_Object copy; |
| 130 | int depth = XINT (XSUB_CHAR_TABLE (table)->depth); | 126 | int depth = XINT (XSUB_CHAR_TABLE (table)->depth); |
| @@ -148,8 +144,7 @@ copy_sub_char_table (table) | |||
| 148 | 144 | ||
| 149 | 145 | ||
| 150 | Lisp_Object | 146 | Lisp_Object |
| 151 | copy_char_table (table) | 147 | copy_char_table (Lisp_Object table) |
| 152 | Lisp_Object table; | ||
| 153 | { | 148 | { |
| 154 | Lisp_Object copy; | 149 | Lisp_Object copy; |
| 155 | int size = XCHAR_TABLE (table)->size & PSEUDOVECTOR_SIZE_MASK; | 150 | int size = XCHAR_TABLE (table)->size & PSEUDOVECTOR_SIZE_MASK; |
| @@ -175,9 +170,7 @@ copy_char_table (table) | |||
| 175 | } | 170 | } |
| 176 | 171 | ||
| 177 | Lisp_Object | 172 | Lisp_Object |
| 178 | sub_char_table_ref (table, c) | 173 | sub_char_table_ref (Lisp_Object table, int c) |
| 179 | Lisp_Object table; | ||
| 180 | int c; | ||
| 181 | { | 174 | { |
| 182 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 175 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 183 | int depth = XINT (tbl->depth); | 176 | int depth = XINT (tbl->depth); |
| @@ -191,9 +184,7 @@ sub_char_table_ref (table, c) | |||
| 191 | } | 184 | } |
| 192 | 185 | ||
| 193 | Lisp_Object | 186 | Lisp_Object |
| 194 | char_table_ref (table, c) | 187 | char_table_ref (Lisp_Object table, int c) |
| 195 | Lisp_Object table; | ||
| 196 | int c; | ||
| 197 | { | 188 | { |
| 198 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); | 189 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); |
| 199 | Lisp_Object val; | 190 | Lisp_Object val; |
| @@ -220,11 +211,7 @@ char_table_ref (table, c) | |||
| 220 | } | 211 | } |
| 221 | 212 | ||
| 222 | static Lisp_Object | 213 | static Lisp_Object |
| 223 | sub_char_table_ref_and_range (table, c, from, to, defalt) | 214 | sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp_Object defalt) |
| 224 | Lisp_Object table; | ||
| 225 | int c; | ||
| 226 | int *from, *to; | ||
| 227 | Lisp_Object defalt; | ||
| 228 | { | 215 | { |
| 229 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 216 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 230 | int depth = XINT (tbl->depth); | 217 | int depth = XINT (tbl->depth); |
| @@ -286,10 +273,7 @@ sub_char_table_ref_and_range (table, c, from, to, defalt) | |||
| 286 | 1) are different from that of C. */ | 273 | 1) are different from that of C. */ |
| 287 | 274 | ||
| 288 | Lisp_Object | 275 | Lisp_Object |
| 289 | char_table_ref_and_range (table, c, from, to) | 276 | char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) |
| 290 | Lisp_Object table; | ||
| 291 | int c; | ||
| 292 | int *from, *to; | ||
| 293 | { | 277 | { |
| 294 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); | 278 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); |
| 295 | int index = CHARTAB_IDX (c, 0, 0), idx; | 279 | int index = CHARTAB_IDX (c, 0, 0), idx; |
| @@ -363,10 +347,7 @@ char_table_ref_and_range (table, c, from, to) | |||
| 363 | 347 | ||
| 364 | 348 | ||
| 365 | static void | 349 | static void |
| 366 | sub_char_table_set (table, c, val) | 350 | sub_char_table_set (Lisp_Object table, int c, Lisp_Object val) |
| 367 | Lisp_Object table; | ||
| 368 | int c; | ||
| 369 | Lisp_Object val; | ||
| 370 | { | 351 | { |
| 371 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 352 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 372 | int depth = XINT ((tbl)->depth); | 353 | int depth = XINT ((tbl)->depth); |
| @@ -390,10 +371,7 @@ sub_char_table_set (table, c, val) | |||
| 390 | } | 371 | } |
| 391 | 372 | ||
| 392 | Lisp_Object | 373 | Lisp_Object |
| 393 | char_table_set (table, c, val) | 374 | char_table_set (Lisp_Object table, int c, Lisp_Object val) |
| 394 | Lisp_Object table; | ||
| 395 | int c; | ||
| 396 | Lisp_Object val; | ||
| 397 | { | 375 | { |
| 398 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); | 376 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); |
| 399 | 377 | ||
| @@ -421,12 +399,7 @@ char_table_set (table, c, val) | |||
| 421 | } | 399 | } |
| 422 | 400 | ||
| 423 | static void | 401 | static void |
| 424 | sub_char_table_set_range (table, depth, min_char, from, to, val) | 402 | sub_char_table_set_range (Lisp_Object *table, int depth, int min_char, int from, int to, Lisp_Object val) |
| 425 | Lisp_Object *table; | ||
| 426 | int depth; | ||
| 427 | int min_char; | ||
| 428 | int from, to; | ||
| 429 | Lisp_Object val; | ||
| 430 | { | 403 | { |
| 431 | int max_char = min_char + chartab_chars[depth] - 1; | 404 | int max_char = min_char + chartab_chars[depth] - 1; |
| 432 | 405 | ||
| @@ -454,10 +427,7 @@ sub_char_table_set_range (table, depth, min_char, from, to, val) | |||
| 454 | 427 | ||
| 455 | 428 | ||
| 456 | Lisp_Object | 429 | Lisp_Object |
| 457 | char_table_set_range (table, from, to, val) | 430 | char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) |
| 458 | Lisp_Object table; | ||
| 459 | int from, to; | ||
| 460 | Lisp_Object val; | ||
| 461 | { | 431 | { |
| 462 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); | 432 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); |
| 463 | Lisp_Object *contents = tbl->contents; | 433 | Lisp_Object *contents = tbl->contents; |
| @@ -640,9 +610,7 @@ This function is obsolete and has no effect. */) | |||
| 640 | integer. If the element is not a character, return CH itself. */ | 610 | integer. If the element is not a character, return CH itself. */ |
| 641 | 611 | ||
| 642 | int | 612 | int |
| 643 | char_table_translate (table, ch) | 613 | char_table_translate (Lisp_Object table, int ch) |
| 644 | Lisp_Object table; | ||
| 645 | int ch; | ||
| 646 | { | 614 | { |
| 647 | Lisp_Object value; | 615 | Lisp_Object value; |
| 648 | value = Faref (table, make_number (ch)); | 616 | value = Faref (table, make_number (ch)); |
| @@ -652,8 +620,7 @@ char_table_translate (table, ch) | |||
| 652 | } | 620 | } |
| 653 | 621 | ||
| 654 | static Lisp_Object | 622 | static Lisp_Object |
| 655 | optimize_sub_char_table (table, test) | 623 | optimize_sub_char_table (Lisp_Object table, Lisp_Object test) |
| 656 | Lisp_Object table, test; | ||
| 657 | { | 624 | { |
| 658 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 625 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 659 | int depth = XINT (tbl->depth); | 626 | int depth = XINT (tbl->depth); |
| @@ -840,9 +807,7 @@ map_sub_char_table (c_function, function, table, arg, val, range, | |||
| 840 | ARG is passed to C_FUNCTION when that is called. */ | 807 | ARG is passed to C_FUNCTION when that is called. */ |
| 841 | 808 | ||
| 842 | void | 809 | void |
| 843 | map_char_table (c_function, function, table, arg) | 810 | map_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), Lisp_Object function, Lisp_Object table, Lisp_Object arg) |
| 844 | void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object); | ||
| 845 | Lisp_Object function, table, arg; | ||
| 846 | { | 811 | { |
| 847 | Lisp_Object range, val; | 812 | Lisp_Object range, val; |
| 848 | struct gcpro gcpro1, gcpro2, gcpro3; | 813 | struct gcpro gcpro1, gcpro2, gcpro3; |
| @@ -1049,7 +1014,7 @@ map_char_table_for_charset (c_function, function, table, arg, | |||
| 1049 | 1014 | ||
| 1050 | 1015 | ||
| 1051 | void | 1016 | void |
| 1052 | syms_of_chartab () | 1017 | syms_of_chartab (void) |
| 1053 | { | 1018 | { |
| 1054 | defsubr (&Smake_char_table); | 1019 | defsubr (&Smake_char_table); |
| 1055 | defsubr (&Schar_table_parent); | 1020 | defsubr (&Schar_table_parent); |