aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-04 00:50:25 -0700
committerDan Nicolaescu2010-07-04 00:50:25 -0700
commit971de7fb158335fbda39525feb2d7776a26bc030 (patch)
tree605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/coding.c
parentb8463cbfbe2c5183cf40772df2746e58b787ddeb (diff)
downloademacs-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/coding.c')
-rw-r--r--src/coding.c255
1 files changed, 70 insertions, 185 deletions
diff --git a/src/coding.c b/src/coding.c
index 1730468ade9..8c6fc0aeadf 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1106,8 +1106,7 @@ record_conversion_result (struct coding_system *coding,
1106 1106
1107 1107
1108static void 1108static void
1109coding_set_source (coding) 1109coding_set_source (struct coding_system *coding)
1110 struct coding_system *coding;
1111{ 1110{
1112 if (BUFFERP (coding->src_object)) 1111 if (BUFFERP (coding->src_object))
1113 { 1112 {
@@ -1129,8 +1128,7 @@ coding_set_source (coding)
1129} 1128}
1130 1129
1131static void 1130static void
1132coding_set_destination (coding) 1131coding_set_destination (struct coding_system *coding)
1133 struct coding_system *coding;
1134{ 1132{
1135 if (BUFFERP (coding->dst_object)) 1133 if (BUFFERP (coding->dst_object))
1136 { 1134 {
@@ -1159,9 +1157,7 @@ coding_set_destination (coding)
1159 1157
1160 1158
1161static void 1159static void
1162coding_alloc_by_realloc (coding, bytes) 1160coding_alloc_by_realloc (struct coding_system *coding, EMACS_INT bytes)
1163 struct coding_system *coding;
1164 EMACS_INT bytes;
1165{ 1161{
1166 coding->destination = (unsigned char *) xrealloc (coding->destination, 1162 coding->destination = (unsigned char *) xrealloc (coding->destination,
1167 coding->dst_bytes + bytes); 1163 coding->dst_bytes + bytes);
@@ -1169,9 +1165,7 @@ coding_alloc_by_realloc (coding, bytes)
1169} 1165}
1170 1166
1171static void 1167static void
1172coding_alloc_by_making_gap (coding, gap_head_used, bytes) 1168coding_alloc_by_making_gap (struct coding_system *coding, EMACS_INT gap_head_used, EMACS_INT bytes)
1173 struct coding_system *coding;
1174 EMACS_INT gap_head_used, bytes;
1175{ 1169{
1176 if (EQ (coding->src_object, coding->dst_object)) 1170 if (EQ (coding->src_object, coding->dst_object))
1177 { 1171 {
@@ -1200,10 +1194,7 @@ coding_alloc_by_making_gap (coding, gap_head_used, bytes)
1200 1194
1201 1195
1202static unsigned char * 1196static unsigned char *
1203alloc_destination (coding, nbytes, dst) 1197alloc_destination (struct coding_system *coding, EMACS_INT nbytes, unsigned char *dst)
1204 struct coding_system *coding;
1205 EMACS_INT nbytes;
1206 unsigned char *dst;
1207{ 1198{
1208 EMACS_INT offset = dst - coding->destination; 1199 EMACS_INT offset = dst - coding->destination;
1209 1200
@@ -1301,9 +1292,7 @@ alloc_destination (coding, nbytes, dst)
1301#define UTF_8_BOM_3 0xBF 1292#define UTF_8_BOM_3 0xBF
1302 1293
1303static int 1294static int
1304detect_coding_utf_8 (coding, detect_info) 1295detect_coding_utf_8 (struct coding_system *coding, struct coding_detection_info *detect_info)
1305 struct coding_system *coding;
1306 struct coding_detection_info *detect_info;
1307{ 1296{
1308 const unsigned char *src = coding->source, *src_base; 1297 const unsigned char *src = coding->source, *src_base;
1309 const unsigned char *src_end = coding->source + coding->src_bytes; 1298 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1386,8 +1375,7 @@ detect_coding_utf_8 (coding, detect_info)
1386 1375
1387 1376
1388static void 1377static void
1389decode_coding_utf_8 (coding) 1378decode_coding_utf_8 (struct coding_system *coding)
1390 struct coding_system *coding;
1391{ 1379{
1392 const unsigned char *src = coding->source + coding->consumed; 1380 const unsigned char *src = coding->source + coding->consumed;
1393 const unsigned char *src_end = coding->source + coding->src_bytes; 1381 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1543,8 +1531,7 @@ decode_coding_utf_8 (coding)
1543 1531
1544 1532
1545static int 1533static int
1546encode_coding_utf_8 (coding) 1534encode_coding_utf_8 (struct coding_system *coding)
1547 struct coding_system *coding;
1548{ 1535{
1549 int multibytep = coding->dst_multibyte; 1536 int multibytep = coding->dst_multibyte;
1550 int *charbuf = coding->charbuf; 1537 int *charbuf = coding->charbuf;
@@ -1623,9 +1610,7 @@ encode_coding_utf_8 (coding)
1623 1610
1624 1611
1625static int 1612static int
1626detect_coding_utf_16 (coding, detect_info) 1613detect_coding_utf_16 (struct coding_system *coding, struct coding_detection_info *detect_info)
1627 struct coding_system *coding;
1628 struct coding_detection_info *detect_info;
1629{ 1614{
1630 const unsigned char *src = coding->source, *src_base = src; 1615 const unsigned char *src = coding->source, *src_base = src;
1631 const unsigned char *src_end = coding->source + coding->src_bytes; 1616 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1708,8 +1693,7 @@ detect_coding_utf_16 (coding, detect_info)
1708} 1693}
1709 1694
1710static void 1695static void
1711decode_coding_utf_16 (coding) 1696decode_coding_utf_16 (struct coding_system *coding)
1712 struct coding_system *coding;
1713{ 1697{
1714 const unsigned char *src = coding->source + coding->consumed; 1698 const unsigned char *src = coding->source + coding->consumed;
1715 const unsigned char *src_end = coding->source + coding->src_bytes; 1699 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1837,8 +1821,7 @@ decode_coding_utf_16 (coding)
1837} 1821}
1838 1822
1839static int 1823static int
1840encode_coding_utf_16 (coding) 1824encode_coding_utf_16 (struct coding_system *coding)
1841 struct coding_system *coding;
1842{ 1825{
1843 int multibytep = coding->dst_multibyte; 1826 int multibytep = coding->dst_multibyte;
1844 int *charbuf = coding->charbuf; 1827 int *charbuf = coding->charbuf;
@@ -1979,9 +1962,7 @@ char emacs_mule_bytes[256];
1979 else return 0. */ 1962 else return 0. */
1980 1963
1981static int 1964static int
1982detect_coding_emacs_mule (coding, detect_info) 1965detect_coding_emacs_mule (struct coding_system *coding, struct coding_detection_info *detect_info)
1983 struct coding_system *coding;
1984 struct coding_detection_info *detect_info;
1985{ 1966{
1986 const unsigned char *src = coding->source, *src_base; 1967 const unsigned char *src = coding->source, *src_base;
1987 const unsigned char *src_end = coding->source + coding->src_bytes; 1968 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -2069,11 +2050,7 @@ detect_coding_emacs_mule (coding, detect_info)
2069 -1. If SRC is too short, return -2. */ 2050 -1. If SRC is too short, return -2. */
2070 2051
2071int 2052int
2072emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) 2053emacs_mule_char (struct coding_system *coding, const unsigned char *src, int *nbytes, int *nchars, int *id, struct composition_status *cmp_status)
2073 struct coding_system *coding;
2074 const unsigned char *src;
2075 int *nbytes, *nchars, *id;
2076 struct composition_status *cmp_status;
2077{ 2054{
2078 const unsigned char *src_end = coding->source + coding->src_bytes; 2055 const unsigned char *src_end = coding->source + coding->src_bytes;
2079 const unsigned char *src_base = src; 2056 const unsigned char *src_base = src;
@@ -2391,9 +2368,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
2391 2368
2392 2369
2393static int 2370static int
2394emacs_mule_finish_composition (charbuf, cmp_status) 2371emacs_mule_finish_composition (int *charbuf, struct composition_status *cmp_status)
2395 int *charbuf;
2396 struct composition_status *cmp_status;
2397{ 2372{
2398 int idx = - cmp_status->length; 2373 int idx = - cmp_status->length;
2399 int new_chars; 2374 int new_chars;
@@ -2448,8 +2423,7 @@ emacs_mule_finish_composition (charbuf, cmp_status)
2448 2423
2449 2424
2450static void 2425static void
2451decode_coding_emacs_mule (coding) 2426decode_coding_emacs_mule (struct coding_system *coding)
2452 struct coding_system *coding;
2453{ 2427{
2454 const unsigned char *src = coding->source + coding->consumed; 2428 const unsigned char *src = coding->source + coding->consumed;
2455 const unsigned char *src_end = coding->source + coding->src_bytes; 2429 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -2713,8 +2687,7 @@ decode_coding_emacs_mule (coding)
2713 2687
2714 2688
2715static int 2689static int
2716encode_coding_emacs_mule (coding) 2690encode_coding_emacs_mule (struct coding_system *coding)
2717 struct coding_system *coding;
2718{ 2691{
2719 int multibytep = coding->dst_multibyte; 2692 int multibytep = coding->dst_multibyte;
2720 int *charbuf = coding->charbuf; 2693 int *charbuf = coding->charbuf;
@@ -3007,8 +2980,7 @@ enum iso_code_class_type iso_code_class[256];
3007 (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0) 2980 (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0)
3008 2981
3009static void 2982static void
3010setup_iso_safe_charsets (attrs) 2983setup_iso_safe_charsets (Lisp_Object attrs)
3011 Lisp_Object attrs;
3012{ 2984{
3013 Lisp_Object charset_list, safe_charsets; 2985 Lisp_Object charset_list, safe_charsets;
3014 Lisp_Object request; 2986 Lisp_Object request;
@@ -3076,9 +3048,7 @@ setup_iso_safe_charsets (attrs)
3076 If it is, return 1, else return 0. */ 3048 If it is, return 1, else return 0. */
3077 3049
3078static int 3050static int
3079detect_coding_iso_2022 (coding, detect_info) 3051detect_coding_iso_2022 (struct coding_system *coding, struct coding_detection_info *detect_info)
3080 struct coding_system *coding;
3081 struct coding_detection_info *detect_info;
3082{ 3052{
3083 const unsigned char *src = coding->source, *src_base = src; 3053 const unsigned char *src = coding->source, *src_base = src;
3084 const unsigned char *src_end = coding->source + coding->src_bytes; 3054 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -3445,9 +3415,7 @@ detect_coding_iso_2022 (coding, detect_info)
3445static int finish_composition (int *, struct composition_status *); 3415static int finish_composition (int *, struct composition_status *);
3446 3416
3447static int 3417static int
3448finish_composition (charbuf, cmp_status) 3418finish_composition (int *charbuf, struct composition_status *cmp_status)
3449 int *charbuf;
3450 struct composition_status *cmp_status;
3451{ 3419{
3452 int idx = - cmp_status->length; 3420 int idx = - cmp_status->length;
3453 int new_chars; 3421 int new_chars;
@@ -3584,8 +3552,7 @@ finish_composition (charbuf, cmp_status)
3584/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ 3552/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
3585 3553
3586static void 3554static void
3587decode_coding_iso_2022 (coding) 3555decode_coding_iso_2022 (struct coding_system *coding)
3588 struct coding_system *coding;
3589{ 3556{
3590 const unsigned char *src = coding->source + coding->consumed; 3557 const unsigned char *src = coding->source + coding->consumed;
3591 const unsigned char *src_end = coding->source + coding->src_bytes; 3558 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4331,11 +4298,7 @@ decode_coding_iso_2022 (coding)
4331 Return new DST. */ 4298 Return new DST. */
4332 4299
4333unsigned char * 4300unsigned char *
4334encode_invocation_designation (charset, coding, dst, p_nchars) 4301encode_invocation_designation (struct charset *charset, struct coding_system *coding, unsigned char *dst, int *p_nchars)
4335 struct charset *charset;
4336 struct coding_system *coding;
4337 unsigned char *dst;
4338 int *p_nchars;
4339{ 4302{
4340 int multibytep = coding->dst_multibyte; 4303 int multibytep = coding->dst_multibyte;
4341 int produced_chars = *p_nchars; 4304 int produced_chars = *p_nchars;
@@ -4447,10 +4410,7 @@ encode_invocation_designation (charset, coding, dst, p_nchars)
4447 find all the necessary designations. */ 4410 find all the necessary designations. */
4448 4411
4449static unsigned char * 4412static unsigned char *
4450encode_designation_at_bol (coding, charbuf, charbuf_end, dst) 4413encode_designation_at_bol (struct coding_system *coding, int *charbuf, int *charbuf_end, unsigned char *dst)
4451 struct coding_system *coding;
4452 int *charbuf, *charbuf_end;
4453 unsigned char *dst;
4454{ 4414{
4455 struct charset *charset; 4415 struct charset *charset;
4456 /* Table of charsets to be designated to each graphic register. */ 4416 /* Table of charsets to be designated to each graphic register. */
@@ -4500,8 +4460,7 @@ encode_designation_at_bol (coding, charbuf, charbuf_end, dst)
4500/* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */ 4460/* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */
4501 4461
4502static int 4462static int
4503encode_coding_iso_2022 (coding) 4463encode_coding_iso_2022 (struct coding_system *coding)
4504 struct coding_system *coding;
4505{ 4464{
4506 int multibytep = coding->dst_multibyte; 4465 int multibytep = coding->dst_multibyte;
4507 int *charbuf = coding->charbuf; 4466 int *charbuf = coding->charbuf;
@@ -4691,9 +4650,7 @@ encode_coding_iso_2022 (coding)
4691 CATEGORY_MASK_SJIS, else return 0. */ 4650 CATEGORY_MASK_SJIS, else return 0. */
4692 4651
4693static int 4652static int
4694detect_coding_sjis (coding, detect_info) 4653detect_coding_sjis (struct coding_system *coding, struct coding_detection_info *detect_info)
4695 struct coding_system *coding;
4696 struct coding_detection_info *detect_info;
4697{ 4654{
4698 const unsigned char *src = coding->source, *src_base; 4655 const unsigned char *src = coding->source, *src_base;
4699 const unsigned char *src_end = coding->source + coding->src_bytes; 4656 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4749,9 +4706,7 @@ detect_coding_sjis (coding, detect_info)
4749 CATEGORY_MASK_BIG5, else return 0. */ 4706 CATEGORY_MASK_BIG5, else return 0. */
4750 4707
4751static int 4708static int
4752detect_coding_big5 (coding, detect_info) 4709detect_coding_big5 (struct coding_system *coding, struct coding_detection_info *detect_info)
4753 struct coding_system *coding;
4754 struct coding_detection_info *detect_info;
4755{ 4710{
4756 const unsigned char *src = coding->source, *src_base; 4711 const unsigned char *src = coding->source, *src_base;
4757 const unsigned char *src_end = coding->source + coding->src_bytes; 4712 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4797,8 +4752,7 @@ detect_coding_big5 (coding, detect_info)
4797 If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */ 4752 If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */
4798 4753
4799static void 4754static void
4800decode_coding_sjis (coding) 4755decode_coding_sjis (struct coding_system *coding)
4801 struct coding_system *coding;
4802{ 4756{
4803 const unsigned char *src = coding->source + coding->consumed; 4757 const unsigned char *src = coding->source + coding->consumed;
4804 const unsigned char *src_end = coding->source + coding->src_bytes; 4758 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4916,8 +4870,7 @@ decode_coding_sjis (coding)
4916} 4870}
4917 4871
4918static void 4872static void
4919decode_coding_big5 (coding) 4873decode_coding_big5 (struct coding_system *coding)
4920 struct coding_system *coding;
4921{ 4874{
4922 const unsigned char *src = coding->source + coding->consumed; 4875 const unsigned char *src = coding->source + coding->consumed;
4923 const unsigned char *src_end = coding->source + coding->src_bytes; 4876 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5021,8 +4974,7 @@ decode_coding_big5 (coding)
5021 SJIS text, else encode BIG5 text. */ 4974 SJIS text, else encode BIG5 text. */
5022 4975
5023static int 4976static int
5024encode_coding_sjis (coding) 4977encode_coding_sjis (struct coding_system *coding)
5025 struct coding_system *coding;
5026{ 4978{
5027 int multibytep = coding->dst_multibyte; 4979 int multibytep = coding->dst_multibyte;
5028 int *charbuf = coding->charbuf; 4980 int *charbuf = coding->charbuf;
@@ -5114,8 +5066,7 @@ encode_coding_sjis (coding)
5114} 5066}
5115 5067
5116static int 5068static int
5117encode_coding_big5 (coding) 5069encode_coding_big5 (struct coding_system *coding)
5118 struct coding_system *coding;
5119{ 5070{
5120 int multibytep = coding->dst_multibyte; 5071 int multibytep = coding->dst_multibyte;
5121 int *charbuf = coding->charbuf; 5072 int *charbuf = coding->charbuf;
@@ -5193,9 +5144,7 @@ encode_coding_big5 (coding)
5193 CATEGORY_MASK_CCL, else return 0. */ 5144 CATEGORY_MASK_CCL, else return 0. */
5194 5145
5195static int 5146static int
5196detect_coding_ccl (coding, detect_info) 5147detect_coding_ccl (struct coding_system *coding, struct coding_detection_info *detect_info)
5197 struct coding_system *coding;
5198 struct coding_detection_info *detect_info;
5199{ 5148{
5200 const unsigned char *src = coding->source, *src_base; 5149 const unsigned char *src = coding->source, *src_base;
5201 const unsigned char *src_end = coding->source + coding->src_bytes; 5150 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5234,8 +5183,7 @@ detect_coding_ccl (coding, detect_info)
5234} 5183}
5235 5184
5236static void 5185static void
5237decode_coding_ccl (coding) 5186decode_coding_ccl (struct coding_system *coding)
5238 struct coding_system *coding;
5239{ 5187{
5240 const unsigned char *src = coding->source + coding->consumed; 5188 const unsigned char *src = coding->source + coding->consumed;
5241 const unsigned char *src_end = coding->source + coding->src_bytes; 5189 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5304,8 +5252,7 @@ decode_coding_ccl (coding)
5304} 5252}
5305 5253
5306static int 5254static int
5307encode_coding_ccl (coding) 5255encode_coding_ccl (struct coding_system *coding)
5308 struct coding_system *coding;
5309{ 5256{
5310 struct ccl_program *ccl = &coding->spec.ccl->ccl; 5257 struct ccl_program *ccl = &coding->spec.ccl->ccl;
5311 int multibytep = coding->dst_multibyte; 5258 int multibytep = coding->dst_multibyte;
@@ -5374,8 +5321,7 @@ encode_coding_ccl (coding)
5374/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ 5321/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
5375 5322
5376static void 5323static void
5377decode_coding_raw_text (coding) 5324decode_coding_raw_text (struct coding_system *coding)
5378 struct coding_system *coding;
5379{ 5325{
5380 int eol_crlf = 5326 int eol_crlf =
5381 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 5327 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
@@ -5394,8 +5340,7 @@ decode_coding_raw_text (coding)
5394} 5340}
5395 5341
5396static int 5342static int
5397encode_coding_raw_text (coding) 5343encode_coding_raw_text (struct coding_system *coding)
5398 struct coding_system *coding;
5399{ 5344{
5400 int multibytep = coding->dst_multibyte; 5345 int multibytep = coding->dst_multibyte;
5401 int *charbuf = coding->charbuf; 5346 int *charbuf = coding->charbuf;
@@ -5478,9 +5423,7 @@ encode_coding_raw_text (coding)
5478 is, return 1, else return 0. */ 5423 is, return 1, else return 0. */
5479 5424
5480static int 5425static int
5481detect_coding_charset (coding, detect_info) 5426detect_coding_charset (struct coding_system *coding, struct coding_detection_info *detect_info)
5482 struct coding_system *coding;
5483 struct coding_detection_info *detect_info;
5484{ 5427{
5485 const unsigned char *src = coding->source, *src_base; 5428 const unsigned char *src = coding->source, *src_base;
5486 const unsigned char *src_end = coding->source + coding->src_bytes; 5429 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5582,8 +5525,7 @@ detect_coding_charset (coding, detect_info)
5582} 5525}
5583 5526
5584static void 5527static void
5585decode_coding_charset (coding) 5528decode_coding_charset (struct coding_system *coding)
5586 struct coding_system *coding;
5587{ 5529{
5588 const unsigned char *src = coding->source + coding->consumed; 5530 const unsigned char *src = coding->source + coding->consumed;
5589 const unsigned char *src_end = coding->source + coding->src_bytes; 5531 const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5711,8 +5653,7 @@ decode_coding_charset (coding)
5711} 5653}
5712 5654
5713static int 5655static int
5714encode_coding_charset (coding) 5656encode_coding_charset (struct coding_system *coding)
5715 struct coding_system *coding;
5716{ 5657{
5717 int multibytep = coding->dst_multibyte; 5658 int multibytep = coding->dst_multibyte;
5718 int *charbuf = coding->charbuf; 5659 int *charbuf = coding->charbuf;
@@ -5782,9 +5723,7 @@ encode_coding_charset (coding)
5782 CODING_SYSTEM is invalid, signal an error. */ 5723 CODING_SYSTEM is invalid, signal an error. */
5783 5724
5784void 5725void
5785setup_coding_system (coding_system, coding) 5726setup_coding_system (Lisp_Object coding_system, struct coding_system *coding)
5786 Lisp_Object coding_system;
5787 struct coding_system *coding;
5788{ 5727{
5789 Lisp_Object attrs; 5728 Lisp_Object attrs;
5790 Lisp_Object eol_type; 5729 Lisp_Object eol_type;
@@ -5987,8 +5926,7 @@ setup_coding_system (coding_system, coding)
5987/* Return a list of charsets supported by CODING. */ 5926/* Return a list of charsets supported by CODING. */
5988 5927
5989Lisp_Object 5928Lisp_Object
5990coding_charset_list (coding) 5929coding_charset_list (struct coding_system *coding)
5991 struct coding_system *coding;
5992{ 5930{
5993 Lisp_Object attrs, charset_list; 5931 Lisp_Object attrs, charset_list;
5994 5932
@@ -6011,8 +5949,7 @@ coding_charset_list (coding)
6011/* Return a list of charsets supported by CODING-SYSTEM. */ 5949/* Return a list of charsets supported by CODING-SYSTEM. */
6012 5950
6013Lisp_Object 5951Lisp_Object
6014coding_system_charset_list (coding_system) 5952coding_system_charset_list (Lisp_Object coding_system)
6015 Lisp_Object coding_system;
6016{ 5953{
6017 int id; 5954 int id;
6018 Lisp_Object attrs, charset_list; 5955 Lisp_Object attrs, charset_list;
@@ -6045,8 +5982,7 @@ coding_system_charset_list (coding_system)
6045 eol_type as CODING-SYSTEM. */ 5982 eol_type as CODING-SYSTEM. */
6046 5983
6047Lisp_Object 5984Lisp_Object
6048raw_text_coding_system (coding_system) 5985raw_text_coding_system (Lisp_Object coding_system)
6049 Lisp_Object coding_system;
6050{ 5986{
6051 Lisp_Object spec, attrs; 5987 Lisp_Object spec, attrs;
6052 Lisp_Object eol_type, raw_text_eol_type; 5988 Lisp_Object eol_type, raw_text_eol_type;
@@ -6077,8 +6013,7 @@ raw_text_coding_system (coding_system)
6077 (system_eol_type). */ 6013 (system_eol_type). */
6078 6014
6079Lisp_Object 6015Lisp_Object
6080coding_inherit_eol_type (coding_system, parent) 6016coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent)
6081 Lisp_Object coding_system, parent;
6082{ 6017{
6083 Lisp_Object spec, eol_type; 6018 Lisp_Object spec, eol_type;
6084 6019
@@ -6233,10 +6168,7 @@ coding_inherit_eol_type (coding_system, parent)
6233#define MAX_EOL_CHECK_COUNT 3 6168#define MAX_EOL_CHECK_COUNT 3
6234 6169
6235static int 6170static int
6236detect_eol (source, src_bytes, category) 6171detect_eol (const unsigned char *source, EMACS_INT src_bytes, enum coding_category category)
6237 const unsigned char *source;
6238 EMACS_INT src_bytes;
6239 enum coding_category category;
6240{ 6172{
6241 const unsigned char *src = source, *src_end = src + src_bytes; 6173 const unsigned char *src = source, *src_end = src + src_bytes;
6242 unsigned char c; 6174 unsigned char c;
@@ -6334,9 +6266,7 @@ detect_eol (source, src_bytes, category)
6334 6266
6335 6267
6336static Lisp_Object 6268static Lisp_Object
6337adjust_coding_eol_type (coding, eol_seen) 6269adjust_coding_eol_type (struct coding_system *coding, int eol_seen)
6338 struct coding_system *coding;
6339 int eol_seen;
6340{ 6270{
6341 Lisp_Object eol_type; 6271 Lisp_Object eol_type;
6342 6272
@@ -6364,8 +6294,7 @@ adjust_coding_eol_type (coding, eol_seen)
6364 system. */ 6294 system. */
6365 6295
6366void 6296void
6367detect_coding (coding) 6297detect_coding (struct coding_system *coding)
6368 struct coding_system *coding;
6369{ 6298{
6370 const unsigned char *src, *src_end; 6299 const unsigned char *src, *src_end;
6371 int saved_mode = coding->mode; 6300 int saved_mode = coding->mode;
@@ -6544,8 +6473,7 @@ detect_coding (coding)
6544 6473
6545 6474
6546static void 6475static void
6547decode_eol (coding) 6476decode_eol (struct coding_system *coding)
6548 struct coding_system *coding;
6549{ 6477{
6550 Lisp_Object eol_type; 6478 Lisp_Object eol_type;
6551 unsigned char *p, *pbeg, *pend; 6479 unsigned char *p, *pbeg, *pend;
@@ -6647,9 +6575,7 @@ decode_eol (coding)
6647 decoding (ENCODEP is zero). */ 6575 decoding (ENCODEP is zero). */
6648 6576
6649static Lisp_Object 6577static Lisp_Object
6650get_translation_table (attrs, encodep, max_lookup) 6578get_translation_table (Lisp_Object attrs, int encodep, int *max_lookup)
6651 Lisp_Object attrs;
6652 int encodep, *max_lookup;
6653{ 6579{
6654 Lisp_Object standard, translation_table; 6580 Lisp_Object standard, translation_table;
6655 Lisp_Object val; 6581 Lisp_Object val;
@@ -6751,9 +6677,7 @@ get_translation_table (attrs, encodep, max_lookup)
6751 If BUF is too short to lookup characters in FROM, return Qt. */ 6677 If BUF is too short to lookup characters in FROM, return Qt. */
6752 6678
6753static Lisp_Object 6679static Lisp_Object
6754get_translation (trans, buf, buf_end) 6680get_translation (Lisp_Object trans, int *buf, int *buf_end)
6755 Lisp_Object trans;
6756 int *buf, *buf_end;
6757{ 6681{
6758 6682
6759 if (INTEGERP (trans)) 6683 if (INTEGERP (trans))
@@ -6780,10 +6704,7 @@ get_translation (trans, buf, buf_end)
6780 6704
6781 6705
6782static int 6706static int
6783produce_chars (coding, translation_table, last_block) 6707produce_chars (struct coding_system *coding, Lisp_Object translation_table, int last_block)
6784 struct coding_system *coding;
6785 Lisp_Object translation_table;
6786 int last_block;
6787{ 6708{
6788 unsigned char *dst = coding->destination + coding->produced; 6709 unsigned char *dst = coding->destination + coding->produced;
6789 unsigned char *dst_end = coding->destination + coding->dst_bytes; 6710 unsigned char *dst_end = coding->destination + coding->dst_bytes;
@@ -6981,10 +6902,7 @@ produce_chars (coding, translation_table, last_block)
6981 */ 6902 */
6982 6903
6983static INLINE void 6904static INLINE void
6984produce_composition (coding, charbuf, pos) 6905produce_composition (struct coding_system *coding, int *charbuf, EMACS_INT pos)
6985 struct coding_system *coding;
6986 int *charbuf;
6987 EMACS_INT pos;
6988{ 6906{
6989 int len; 6907 int len;
6990 EMACS_INT to; 6908 EMACS_INT to;
@@ -7028,10 +6946,7 @@ produce_composition (coding, charbuf, pos)
7028 */ 6946 */
7029 6947
7030static INLINE void 6948static INLINE void
7031produce_charset (coding, charbuf, pos) 6949produce_charset (struct coding_system *coding, int *charbuf, EMACS_INT pos)
7032 struct coding_system *coding;
7033 int *charbuf;
7034 EMACS_INT pos;
7035{ 6950{
7036 EMACS_INT from = pos - charbuf[2]; 6951 EMACS_INT from = pos - charbuf[2];
7037 struct charset *charset = CHARSET_FROM_ID (charbuf[3]); 6952 struct charset *charset = CHARSET_FROM_ID (charbuf[3]);
@@ -7066,9 +6981,7 @@ produce_charset (coding, charbuf, pos)
7066 6981
7067 6982
7068static void 6983static void
7069produce_annotation (coding, pos) 6984produce_annotation (struct coding_system *coding, EMACS_INT pos)
7070 struct coding_system *coding;
7071 EMACS_INT pos;
7072{ 6985{
7073 int *charbuf = coding->charbuf; 6986 int *charbuf = coding->charbuf;
7074 int *charbuf_end = charbuf + coding->charbuf_used; 6987 int *charbuf_end = charbuf + coding->charbuf_used;
@@ -7123,8 +7036,7 @@ produce_annotation (coding, pos)
7123*/ 7036*/
7124 7037
7125static int 7038static int
7126decode_coding (coding) 7039decode_coding (struct coding_system *coding)
7127 struct coding_system *coding;
7128{ 7040{
7129 Lisp_Object attrs; 7041 Lisp_Object attrs;
7130 Lisp_Object undo_list; 7042 Lisp_Object undo_list;
@@ -7262,11 +7174,7 @@ decode_coding (coding)
7262 return BUF. */ 7174 return BUF. */
7263 7175
7264static INLINE int * 7176static INLINE int *
7265handle_composition_annotation (pos, limit, coding, buf, stop) 7177handle_composition_annotation (EMACS_INT pos, EMACS_INT limit, struct coding_system *coding, int *buf, EMACS_INT *stop)
7266 EMACS_INT pos, limit;
7267 struct coding_system *coding;
7268 int *buf;
7269 EMACS_INT *stop;
7270{ 7178{
7271 EMACS_INT start, end; 7179 EMACS_INT start, end;
7272 Lisp_Object prop; 7180 Lisp_Object prop;
@@ -7347,11 +7255,7 @@ handle_composition_annotation (pos, limit, coding, buf, stop)
7347 property value is non-nil (limiting by LIMIT), and return BUF. */ 7255 property value is non-nil (limiting by LIMIT), and return BUF. */
7348 7256
7349static INLINE int * 7257static INLINE int *
7350handle_charset_annotation (pos, limit, coding, buf, stop) 7258handle_charset_annotation (EMACS_INT pos, EMACS_INT limit, struct coding_system *coding, int *buf, EMACS_INT *stop)
7351 EMACS_INT pos, limit;
7352 struct coding_system *coding;
7353 int *buf;
7354 EMACS_INT *stop;
7355{ 7259{
7356 Lisp_Object val, next; 7260 Lisp_Object val, next;
7357 int id; 7261 int id;
@@ -7371,10 +7275,7 @@ handle_charset_annotation (pos, limit, coding, buf, stop)
7371 7275
7372 7276
7373static void 7277static void
7374consume_chars (coding, translation_table, max_lookup) 7278consume_chars (struct coding_system *coding, Lisp_Object translation_table, int max_lookup)
7375 struct coding_system *coding;
7376 Lisp_Object translation_table;
7377 int max_lookup;
7378{ 7279{
7379 int *buf = coding->charbuf; 7280 int *buf = coding->charbuf;
7380 int *buf_end = coding->charbuf + coding->charbuf_size; 7281 int *buf_end = coding->charbuf + coding->charbuf_size;
@@ -7530,8 +7431,7 @@ consume_chars (coding, translation_table, max_lookup)
7530 memory area specified by CODING->destination. */ 7431 memory area specified by CODING->destination. */
7531 7432
7532static int 7433static int
7533encode_coding (coding) 7434encode_coding (struct coding_system *coding)
7534 struct coding_system *coding;
7535{ 7435{
7536 Lisp_Object attrs; 7436 Lisp_Object attrs;
7537 Lisp_Object translation_table; 7437 Lisp_Object translation_table;
@@ -7595,8 +7495,7 @@ static int reused_workbuf_in_use;
7595 multibyteness of returning buffer. */ 7495 multibyteness of returning buffer. */
7596 7496
7597static Lisp_Object 7497static Lisp_Object
7598make_conversion_work_buffer (multibyte) 7498make_conversion_work_buffer (int multibyte)
7599 int multibyte;
7600{ 7499{
7601 Lisp_Object name, workbuf; 7500 Lisp_Object name, workbuf;
7602 struct buffer *current; 7501 struct buffer *current;
@@ -7628,8 +7527,7 @@ make_conversion_work_buffer (multibyte)
7628 7527
7629 7528
7630static Lisp_Object 7529static Lisp_Object
7631code_conversion_restore (arg) 7530code_conversion_restore (Lisp_Object arg)
7632 Lisp_Object arg;
7633{ 7531{
7634 Lisp_Object current, workbuf; 7532 Lisp_Object current, workbuf;
7635 struct gcpro gcpro1; 7533 struct gcpro gcpro1;
@@ -7650,8 +7548,7 @@ code_conversion_restore (arg)
7650} 7548}
7651 7549
7652Lisp_Object 7550Lisp_Object
7653code_conversion_save (with_work_buf, multibyte) 7551code_conversion_save (int with_work_buf, int multibyte)
7654 int with_work_buf, multibyte;
7655{ 7552{
7656 Lisp_Object workbuf = Qnil; 7553 Lisp_Object workbuf = Qnil;
7657 7554
@@ -7663,9 +7560,7 @@ code_conversion_save (with_work_buf, multibyte)
7663} 7560}
7664 7561
7665int 7562int
7666decode_coding_gap (coding, chars, bytes) 7563decode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes)
7667 struct coding_system *coding;
7668 EMACS_INT chars, bytes;
7669{ 7564{
7670 int count = specpdl_ptr - specpdl; 7565 int count = specpdl_ptr - specpdl;
7671 Lisp_Object attrs; 7566 Lisp_Object attrs;
@@ -7710,9 +7605,7 @@ decode_coding_gap (coding, chars, bytes)
7710} 7605}
7711 7606
7712int 7607int
7713encode_coding_gap (coding, chars, bytes) 7608encode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes)
7714 struct coding_system *coding;
7715 EMACS_INT chars, bytes;
7716{ 7609{
7717 int count = specpdl_ptr - specpdl; 7610 int count = specpdl_ptr - specpdl;
7718 7611
@@ -8165,7 +8058,7 @@ encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
8165 8058
8166 8059
8167Lisp_Object 8060Lisp_Object
8168preferred_coding_system () 8061preferred_coding_system (void)
8169{ 8062{
8170 int id = coding_categories[coding_priorities[0]].id; 8063 int id = coding_categories[coding_priorities[0]].id;
8171 8064
@@ -8643,9 +8536,7 @@ highest priority. */)
8643 8536
8644 8537
8645static INLINE int 8538static INLINE int
8646char_encodable_p (c, attrs) 8539char_encodable_p (int c, Lisp_Object attrs)
8647 int c;
8648 Lisp_Object attrs;
8649{ 8540{
8650 Lisp_Object tail; 8541 Lisp_Object tail;
8651 struct charset *charset; 8542 struct charset *charset;
@@ -9031,9 +8922,7 @@ is nil. */)
9031 8922
9032 8923
9033Lisp_Object 8924Lisp_Object
9034code_convert_region (start, end, coding_system, dst_object, encodep, norecord) 8925code_convert_region (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object dst_object, int encodep, int norecord)
9035 Lisp_Object start, end, coding_system, dst_object;
9036 int encodep, norecord;
9037{ 8926{
9038 struct coding_system coding; 8927 struct coding_system coding;
9039 EMACS_INT from, from_byte, to, to_byte; 8928 EMACS_INT from, from_byte, to, to_byte;
@@ -9172,9 +9061,7 @@ code_convert_string (string, coding_system, dst_object,
9172 ENCODE_FILE, thus we ignore character composition. */ 9061 ENCODE_FILE, thus we ignore character composition. */
9173 9062
9174Lisp_Object 9063Lisp_Object
9175code_convert_string_norecord (string, coding_system, encodep) 9064code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, int encodep)
9176 Lisp_Object string, coding_system;
9177 int encodep;
9178{ 9065{
9179 return code_convert_string (string, coding_system, Qt, encodep, 0, 1); 9066 return code_convert_string (string, coding_system, Qt, encodep, 0, 1);
9180} 9067}
@@ -9656,8 +9543,7 @@ HIGHESTP non-nil means just return the highest priority one. */)
9656static const char *const suffixes[] = { "-unix", "-dos", "-mac" }; 9543static const char *const suffixes[] = { "-unix", "-dos", "-mac" };
9657 9544
9658static Lisp_Object 9545static Lisp_Object
9659make_subsidiaries (base) 9546make_subsidiaries (Lisp_Object base)
9660 Lisp_Object base;
9661{ 9547{
9662 Lisp_Object subsidiaries; 9548 Lisp_Object subsidiaries;
9663 int base_name_len = SBYTES (SYMBOL_NAME (base)); 9549 int base_name_len = SBYTES (SYMBOL_NAME (base));
@@ -10385,7 +10271,7 @@ coding system whose eol-type is N. */)
10385/*** 9. Post-amble ***/ 10271/*** 9. Post-amble ***/
10386 10272
10387void 10273void
10388init_coding_once () 10274init_coding_once (void)
10389{ 10275{
10390 int i; 10276 int i;
10391 10277
@@ -10427,7 +10313,7 @@ init_coding_once ()
10427#ifdef emacs 10313#ifdef emacs
10428 10314
10429void 10315void
10430syms_of_coding () 10316syms_of_coding (void)
10431{ 10317{
10432 staticpro (&Vcoding_system_hash_table); 10318 staticpro (&Vcoding_system_hash_table);
10433 { 10319 {
@@ -10977,8 +10863,7 @@ character.");
10977} 10863}
10978 10864
10979char * 10865char *
10980emacs_strerror (error_number) 10866emacs_strerror (int error_number)
10981 int error_number;
10982{ 10867{
10983 char *str; 10868 char *str;
10984 10869