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/fontset.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/fontset.c')
| -rw-r--r-- | src/fontset.c | 97 |
1 files changed, 26 insertions, 71 deletions
diff --git a/src/fontset.c b/src/fontset.c index 84035838552..01c62000ca0 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -306,9 +306,7 @@ fontset_id_valid_p (id) | |||
| 306 | : fontset_ref ((fontset), (c))) | 306 | : fontset_ref ((fontset), (c))) |
| 307 | 307 | ||
| 308 | static Lisp_Object | 308 | static Lisp_Object |
| 309 | fontset_ref (fontset, c) | 309 | fontset_ref (Lisp_Object fontset, int c) |
| 310 | Lisp_Object fontset; | ||
| 311 | int c; | ||
| 312 | { | 310 | { |
| 313 | Lisp_Object elt; | 311 | Lisp_Object elt; |
| 314 | 312 | ||
| @@ -343,8 +341,7 @@ fontset_ref (fontset, c) | |||
| 343 | : fontset_add ((fontset), (range), (elt), (add))) | 341 | : fontset_add ((fontset), (range), (elt), (add))) |
| 344 | 342 | ||
| 345 | static Lisp_Object | 343 | static Lisp_Object |
| 346 | fontset_add (fontset, range, elt, add) | 344 | fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Object add) |
| 347 | Lisp_Object fontset, range, elt, add; | ||
| 348 | { | 345 | { |
| 349 | Lisp_Object args[2]; | 346 | Lisp_Object args[2]; |
| 350 | int idx = (EQ (add, Qappend) ? 0 : 1); | 347 | int idx = (EQ (add, Qappend) ? 0 : 1); |
| @@ -376,8 +373,7 @@ fontset_add (fontset, range, elt, add) | |||
| 376 | } | 373 | } |
| 377 | 374 | ||
| 378 | static int | 375 | static int |
| 379 | fontset_compare_rfontdef (val1, val2) | 376 | fontset_compare_rfontdef (const void *val1, const void *val2) |
| 380 | const void *val1, *val2; | ||
| 381 | { | 377 | { |
| 382 | return (RFONT_DEF_SCORE (*(Lisp_Object *) val1) | 378 | return (RFONT_DEF_SCORE (*(Lisp_Object *) val1) |
| 383 | - RFONT_DEF_SCORE (*(Lisp_Object *) val2)); | 379 | - RFONT_DEF_SCORE (*(Lisp_Object *) val2)); |
| @@ -392,12 +388,10 @@ fontset_compare_rfontdef (val1, val2) | |||
| 392 | If PREFERRED_FAMILY is not nil, that family has the higher priority | 388 | If PREFERRED_FAMILY is not nil, that family has the higher priority |
| 393 | if the encoding charsets or languages in font-specs are the same. */ | 389 | if the encoding charsets or languages in font-specs are the same. */ |
| 394 | 390 | ||
| 395 | extern Lisp_Object Fassoc_string (); | 391 | extern Lisp_Object Fassoc_string (Lisp_Object, Lisp_Object, Lisp_Object); |
| 396 | 392 | ||
| 397 | static void | 393 | static void |
| 398 | reorder_font_vector (font_group, font) | 394 | reorder_font_vector (Lisp_Object font_group, struct font *font) |
| 399 | Lisp_Object font_group; | ||
| 400 | struct font *font; | ||
| 401 | { | 395 | { |
| 402 | Lisp_Object vec, font_object; | 396 | Lisp_Object vec, font_object; |
| 403 | int size; | 397 | int size; |
| @@ -525,11 +519,7 @@ fontset_get_font_group (Lisp_Object fontset, int c) | |||
| 525 | If FALLBACK is nonzero, search only fallback fonts. */ | 519 | If FALLBACK is nonzero, search only fallback fonts. */ |
| 526 | 520 | ||
| 527 | static Lisp_Object | 521 | static Lisp_Object |
| 528 | fontset_find_font (fontset, c, face, id, fallback) | 522 | fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fallback) |
| 529 | Lisp_Object fontset; | ||
| 530 | int c; | ||
| 531 | struct face *face; | ||
| 532 | int id, fallback; | ||
| 533 | { | 523 | { |
| 534 | Lisp_Object vec, font_group; | 524 | Lisp_Object vec, font_group; |
| 535 | int i, charset_matched = 0, found_index; | 525 | int i, charset_matched = 0, found_index; |
| @@ -728,11 +718,7 @@ fontset_find_font (fontset, c, face, id, fallback) | |||
| 728 | 718 | ||
| 729 | 719 | ||
| 730 | static Lisp_Object | 720 | static Lisp_Object |
| 731 | fontset_font (fontset, c, face, id) | 721 | fontset_font (Lisp_Object fontset, int c, struct face *face, int id) |
| 732 | Lisp_Object fontset; | ||
| 733 | int c; | ||
| 734 | struct face *face; | ||
| 735 | int id; | ||
| 736 | { | 722 | { |
| 737 | Lisp_Object rfont_def, default_rfont_def; | 723 | Lisp_Object rfont_def, default_rfont_def; |
| 738 | Lisp_Object base_fontset; | 724 | Lisp_Object base_fontset; |
| @@ -793,8 +779,7 @@ fontset_font (fontset, c, face, id) | |||
| 793 | BASE. */ | 779 | BASE. */ |
| 794 | 780 | ||
| 795 | static Lisp_Object | 781 | static Lisp_Object |
| 796 | make_fontset (frame, name, base) | 782 | make_fontset (Lisp_Object frame, Lisp_Object name, Lisp_Object base) |
| 797 | Lisp_Object frame, name, base; | ||
| 798 | { | 783 | { |
| 799 | Lisp_Object fontset; | 784 | Lisp_Object fontset; |
| 800 | int size = ASIZE (Vfontset_table); | 785 | int size = ASIZE (Vfontset_table); |
| @@ -835,8 +820,7 @@ make_fontset (frame, name, base) | |||
| 835 | /* Return the name of the fontset who has ID. */ | 820 | /* Return the name of the fontset who has ID. */ |
| 836 | 821 | ||
| 837 | Lisp_Object | 822 | Lisp_Object |
| 838 | fontset_name (id) | 823 | fontset_name (int id) |
| 839 | int id; | ||
| 840 | { | 824 | { |
| 841 | Lisp_Object fontset; | 825 | Lisp_Object fontset; |
| 842 | 826 | ||
| @@ -848,8 +832,7 @@ fontset_name (id) | |||
| 848 | /* Return the ASCII font name of the fontset who has ID. */ | 832 | /* Return the ASCII font name of the fontset who has ID. */ |
| 849 | 833 | ||
| 850 | Lisp_Object | 834 | Lisp_Object |
| 851 | fontset_ascii (id) | 835 | fontset_ascii (int id) |
| 852 | int id; | ||
| 853 | { | 836 | { |
| 854 | Lisp_Object fontset, elt; | 837 | Lisp_Object fontset, elt; |
| 855 | 838 | ||
| @@ -861,9 +844,7 @@ fontset_ascii (id) | |||
| 861 | } | 844 | } |
| 862 | 845 | ||
| 863 | void | 846 | void |
| 864 | free_realized_fontset (f, fontset) | 847 | free_realized_fontset (FRAME_PTR f, Lisp_Object fontset) |
| 865 | FRAME_PTR f; | ||
| 866 | Lisp_Object fontset; | ||
| 867 | { | 848 | { |
| 868 | Lisp_Object tail; | 849 | Lisp_Object tail; |
| 869 | 850 | ||
| @@ -879,9 +860,7 @@ free_realized_fontset (f, fontset) | |||
| 879 | free_realized_face. */ | 860 | free_realized_face. */ |
| 880 | 861 | ||
| 881 | void | 862 | void |
| 882 | free_face_fontset (f, face) | 863 | free_face_fontset (FRAME_PTR f, struct face *face) |
| 883 | FRAME_PTR f; | ||
| 884 | struct face *face; | ||
| 885 | { | 864 | { |
| 886 | Lisp_Object fontset; | 865 | Lisp_Object fontset; |
| 887 | 866 | ||
| @@ -915,9 +894,7 @@ free_face_fontset (f, face) | |||
| 915 | when C is not an ASCII character. */ | 894 | when C is not an ASCII character. */ |
| 916 | 895 | ||
| 917 | int | 896 | int |
| 918 | face_suitable_for_char_p (face, c) | 897 | face_suitable_for_char_p (struct face *face, int c) |
| 919 | struct face *face; | ||
| 920 | int c; | ||
| 921 | { | 898 | { |
| 922 | Lisp_Object fontset, rfont_def; | 899 | Lisp_Object fontset, rfont_def; |
| 923 | 900 | ||
| @@ -934,11 +911,7 @@ face_suitable_for_char_p (face, c) | |||
| 934 | the macro FACE_FOR_CHAR. */ | 911 | the macro FACE_FOR_CHAR. */ |
| 935 | 912 | ||
| 936 | int | 913 | int |
| 937 | face_for_char (f, face, c, pos, object) | 914 | face_for_char (FRAME_PTR f, struct face *face, int c, int pos, Lisp_Object object) |
| 938 | FRAME_PTR f; | ||
| 939 | struct face *face; | ||
| 940 | int c, pos; | ||
| 941 | Lisp_Object object; | ||
| 942 | { | 915 | { |
| 943 | Lisp_Object fontset, rfont_def, charset; | 916 | Lisp_Object fontset, rfont_def, charset; |
| 944 | int face_id; | 917 | int face_id; |
| @@ -1006,10 +979,7 @@ face_for_char (f, face, c, pos, object) | |||
| 1006 | 979 | ||
| 1007 | 980 | ||
| 1008 | Lisp_Object | 981 | Lisp_Object |
| 1009 | font_for_char (face, c, pos, object) | 982 | font_for_char (struct face *face, int c, int pos, Lisp_Object object) |
| 1010 | struct face *face; | ||
| 1011 | int c, pos; | ||
| 1012 | Lisp_Object object; | ||
| 1013 | { | 983 | { |
| 1014 | Lisp_Object fontset, rfont_def, charset; | 984 | Lisp_Object fontset, rfont_def, charset; |
| 1015 | int id; | 985 | int id; |
| @@ -1059,10 +1029,7 @@ font_for_char (face, c, pos, object) | |||
| 1059 | Called from realize_x_face. */ | 1029 | Called from realize_x_face. */ |
| 1060 | 1030 | ||
| 1061 | int | 1031 | int |
| 1062 | make_fontset_for_ascii_face (f, base_fontset_id, face) | 1032 | make_fontset_for_ascii_face (FRAME_PTR f, int base_fontset_id, struct face *face) |
| 1063 | FRAME_PTR f; | ||
| 1064 | int base_fontset_id; | ||
| 1065 | struct face *face; | ||
| 1066 | { | 1033 | { |
| 1067 | Lisp_Object base_fontset, fontset, frame; | 1034 | Lisp_Object base_fontset, fontset, frame; |
| 1068 | 1035 | ||
| @@ -1096,8 +1063,7 @@ static Lisp_Object Vcached_fontset_data; | |||
| 1096 | expression corresponding to PATTERN. */ | 1063 | expression corresponding to PATTERN. */ |
| 1097 | 1064 | ||
| 1098 | static Lisp_Object | 1065 | static Lisp_Object |
| 1099 | fontset_pattern_regexp (pattern) | 1066 | fontset_pattern_regexp (Lisp_Object pattern) |
| 1100 | Lisp_Object pattern; | ||
| 1101 | { | 1067 | { |
| 1102 | if (!index ((char *) SDATA (pattern), '*') | 1068 | if (!index ((char *) SDATA (pattern), '*') |
| 1103 | && !index ((char *) SDATA (pattern), '?')) | 1069 | && !index ((char *) SDATA (pattern), '?')) |
| @@ -1171,9 +1137,7 @@ fontset_pattern_regexp (pattern) | |||
| 1171 | */ | 1137 | */ |
| 1172 | 1138 | ||
| 1173 | int | 1139 | int |
| 1174 | fs_query_fontset (name, name_pattern) | 1140 | fs_query_fontset (Lisp_Object name, int name_pattern) |
| 1175 | Lisp_Object name; | ||
| 1176 | int name_pattern; | ||
| 1177 | { | 1141 | { |
| 1178 | Lisp_Object tem; | 1142 | Lisp_Object tem; |
| 1179 | int i; | 1143 | int i; |
| @@ -1246,10 +1210,7 @@ If REGEXPP is non-nil, PATTERN is a regular expression. */) | |||
| 1246 | /* Return a list of base fontset names matching PATTERN on frame F. */ | 1210 | /* Return a list of base fontset names matching PATTERN on frame F. */ |
| 1247 | 1211 | ||
| 1248 | Lisp_Object | 1212 | Lisp_Object |
| 1249 | list_fontsets (f, pattern, size) | 1213 | list_fontsets (FRAME_PTR f, Lisp_Object pattern, int size) |
| 1250 | FRAME_PTR f; | ||
| 1251 | Lisp_Object pattern; | ||
| 1252 | int size; | ||
| 1253 | { | 1214 | { |
| 1254 | Lisp_Object frame, regexp, val; | 1215 | Lisp_Object frame, regexp, val; |
| 1255 | int id; | 1216 | int id; |
| @@ -1285,8 +1246,7 @@ list_fontsets (f, pattern, size) | |||
| 1285 | /* Free all realized fontsets whose base fontset is BASE. */ | 1246 | /* Free all realized fontsets whose base fontset is BASE. */ |
| 1286 | 1247 | ||
| 1287 | static void | 1248 | static void |
| 1288 | free_realized_fontsets (base) | 1249 | free_realized_fontsets (Lisp_Object base) |
| 1289 | Lisp_Object base; | ||
| 1290 | { | 1250 | { |
| 1291 | int id; | 1251 | int id; |
| 1292 | 1252 | ||
| @@ -1343,8 +1303,7 @@ free_realized_fontsets (base) | |||
| 1343 | Set *FRAME to the actual frame. */ | 1303 | Set *FRAME to the actual frame. */ |
| 1344 | 1304 | ||
| 1345 | static Lisp_Object | 1305 | static Lisp_Object |
| 1346 | check_fontset_name (name, frame) | 1306 | check_fontset_name (Lisp_Object name, Lisp_Object *frame) |
| 1347 | Lisp_Object name, *frame; | ||
| 1348 | { | 1307 | { |
| 1349 | int id; | 1308 | int id; |
| 1350 | 1309 | ||
| @@ -1373,8 +1332,7 @@ check_fontset_name (name, frame) | |||
| 1373 | } | 1332 | } |
| 1374 | 1333 | ||
| 1375 | static void | 1334 | static void |
| 1376 | accumulate_script_ranges (arg, range, val) | 1335 | accumulate_script_ranges (Lisp_Object arg, Lisp_Object range, Lisp_Object val) |
| 1377 | Lisp_Object arg, range, val; | ||
| 1378 | { | 1336 | { |
| 1379 | if (EQ (XCAR (arg), val)) | 1337 | if (EQ (XCAR (arg), val)) |
| 1380 | { | 1338 | { |
| @@ -1399,8 +1357,7 @@ accumulate_script_ranges (arg, range, val) | |||
| 1399 | case. */ | 1357 | case. */ |
| 1400 | 1358 | ||
| 1401 | static void | 1359 | static void |
| 1402 | set_fontset_font (arg, range) | 1360 | set_fontset_font (Lisp_Object arg, Lisp_Object range) |
| 1403 | Lisp_Object arg, range; | ||
| 1404 | { | 1361 | { |
| 1405 | Lisp_Object fontset, font_def, add, ascii, script_range_list; | 1362 | Lisp_Object fontset, font_def, add, ascii, script_range_list; |
| 1406 | int from = XINT (XCAR (range)), to = XINT (XCDR (range)); | 1363 | int from = XINT (XCAR (range)), to = XINT (XCDR (range)); |
| @@ -1762,8 +1719,7 @@ static int num_auto_fontsets; | |||
| 1762 | user intends to use FONT-OBJECT for Latin characters. */ | 1719 | user intends to use FONT-OBJECT for Latin characters. */ |
| 1763 | 1720 | ||
| 1764 | int | 1721 | int |
| 1765 | fontset_from_font (font_object) | 1722 | fontset_from_font (Lisp_Object font_object) |
| 1766 | Lisp_Object font_object; | ||
| 1767 | { | 1723 | { |
| 1768 | Lisp_Object font_name = font_get_name (font_object); | 1724 | Lisp_Object font_name = font_get_name (font_object); |
| 1769 | Lisp_Object font_spec = Fcopy_font_spec (font_object); | 1725 | Lisp_Object font_spec = Fcopy_font_spec (font_object); |
| @@ -1819,8 +1775,7 @@ fontset_from_font (font_object) | |||
| 1819 | fontset_from_font. */ | 1775 | fontset_from_font. */ |
| 1820 | 1776 | ||
| 1821 | static void | 1777 | static void |
| 1822 | update_auto_fontset_alist (font_object, fontset) | 1778 | update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset) |
| 1823 | Lisp_Object font_object, fontset; | ||
| 1824 | { | 1779 | { |
| 1825 | Lisp_Object prev, tail; | 1780 | Lisp_Object prev, tail; |
| 1826 | 1781 | ||
| @@ -2224,7 +2179,7 @@ DEFUN ("fontset-list-all", Ffontset_list_all, Sfontset_list_all, 0, 0, 0, | |||
| 2224 | #endif /* FONTSET_DEBUG */ | 2179 | #endif /* FONTSET_DEBUG */ |
| 2225 | 2180 | ||
| 2226 | void | 2181 | void |
| 2227 | syms_of_fontset () | 2182 | syms_of_fontset (void) |
| 2228 | { | 2183 | { |
| 2229 | DEFSYM (Qfontset, "fontset"); | 2184 | DEFSYM (Qfontset, "fontset"); |
| 2230 | Fput (Qfontset, Qchar_table_extra_slots, make_number (9)); | 2185 | Fput (Qfontset, Qchar_table_extra_slots, make_number (9)); |