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/print.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/print.c')
| -rw-r--r-- | src/print.c | 94 |
1 files changed, 27 insertions, 67 deletions
diff --git a/src/print.c b/src/print.c index dedd58b99e3..76ce467eed0 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -168,7 +168,7 @@ extern int noninteractive_need_newline; | |||
| 168 | 168 | ||
| 169 | extern int minibuffer_auto_raise; | 169 | extern int minibuffer_auto_raise; |
| 170 | 170 | ||
| 171 | void print_interval (); | 171 | void print_interval (INTERVAL interval, Lisp_Object printcharfun); |
| 172 | 172 | ||
| 173 | /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ | 173 | /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ |
| 174 | int print_output_debug_flag = 1; | 174 | int print_output_debug_flag = 1; |
| @@ -287,8 +287,7 @@ int print_output_debug_flag = 1; | |||
| 287 | when there is a recursive call to print. */ | 287 | when there is a recursive call to print. */ |
| 288 | 288 | ||
| 289 | static Lisp_Object | 289 | static Lisp_Object |
| 290 | print_unwind (saved_text) | 290 | print_unwind (Lisp_Object saved_text) |
| 291 | Lisp_Object saved_text; | ||
| 292 | { | 291 | { |
| 293 | bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text)); | 292 | bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text)); |
| 294 | return Qnil; | 293 | return Qnil; |
| @@ -301,9 +300,7 @@ print_unwind (saved_text) | |||
| 301 | argument. */ | 300 | argument. */ |
| 302 | 301 | ||
| 303 | static void | 302 | static void |
| 304 | printchar (ch, fun) | 303 | printchar (unsigned int ch, Lisp_Object fun) |
| 305 | unsigned int ch; | ||
| 306 | Lisp_Object fun; | ||
| 307 | { | 304 | { |
| 308 | if (!NILP (fun) && !EQ (fun, Qt)) | 305 | if (!NILP (fun) && !EQ (fun, Qt)) |
| 309 | call1 (fun, make_number (ch)); | 306 | call1 (fun, make_number (ch)); |
| @@ -353,11 +350,7 @@ printchar (ch, fun) | |||
| 353 | to data in a Lisp string. Otherwise that is not safe. */ | 350 | to data in a Lisp string. Otherwise that is not safe. */ |
| 354 | 351 | ||
| 355 | static void | 352 | static void |
| 356 | strout (ptr, size, size_byte, printcharfun, multibyte) | 353 | strout (char *ptr, int size, int size_byte, Lisp_Object printcharfun, int multibyte) |
| 357 | char *ptr; | ||
| 358 | int size, size_byte; | ||
| 359 | Lisp_Object printcharfun; | ||
| 360 | int multibyte; | ||
| 361 | { | 354 | { |
| 362 | if (size < 0) | 355 | if (size < 0) |
| 363 | size_byte = size = strlen (ptr); | 356 | size_byte = size = strlen (ptr); |
| @@ -440,9 +433,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte) | |||
| 440 | because printing one char can relocate. */ | 433 | because printing one char can relocate. */ |
| 441 | 434 | ||
| 442 | static void | 435 | static void |
| 443 | print_string (string, printcharfun) | 436 | print_string (Lisp_Object string, Lisp_Object printcharfun) |
| 444 | Lisp_Object string; | ||
| 445 | Lisp_Object printcharfun; | ||
| 446 | { | 437 | { |
| 447 | if (EQ (printcharfun, Qt) || NILP (printcharfun)) | 438 | if (EQ (printcharfun, Qt) || NILP (printcharfun)) |
| 448 | { | 439 | { |
| @@ -549,9 +540,7 @@ PRINTCHARFUN defaults to the value of `standard-output' (which see). */) | |||
| 549 | Do not use this on the contents of a Lisp string. */ | 540 | Do not use this on the contents of a Lisp string. */ |
| 550 | 541 | ||
| 551 | void | 542 | void |
| 552 | write_string (data, size) | 543 | write_string (char *data, int size) |
| 553 | char *data; | ||
| 554 | int size; | ||
| 555 | { | 544 | { |
| 556 | PRINTDECLARE; | 545 | PRINTDECLARE; |
| 557 | Lisp_Object printcharfun; | 546 | Lisp_Object printcharfun; |
| @@ -568,10 +557,7 @@ write_string (data, size) | |||
| 568 | Do not use this on the contents of a Lisp string. */ | 557 | Do not use this on the contents of a Lisp string. */ |
| 569 | 558 | ||
| 570 | void | 559 | void |
| 571 | write_string_1 (data, size, printcharfun) | 560 | write_string_1 (char *data, int size, Lisp_Object printcharfun) |
| 572 | char *data; | ||
| 573 | int size; | ||
| 574 | Lisp_Object printcharfun; | ||
| 575 | { | 561 | { |
| 576 | PRINTDECLARE; | 562 | PRINTDECLARE; |
| 577 | 563 | ||
| @@ -582,8 +568,7 @@ write_string_1 (data, size, printcharfun) | |||
| 582 | 568 | ||
| 583 | 569 | ||
| 584 | void | 570 | void |
| 585 | temp_output_buffer_setup (bufname) | 571 | temp_output_buffer_setup (const char *bufname) |
| 586 | const char *bufname; | ||
| 587 | { | 572 | { |
| 588 | int count = SPECPDL_INDEX (); | 573 | int count = SPECPDL_INDEX (); |
| 589 | register struct buffer *old = current_buffer; | 574 | register struct buffer *old = current_buffer; |
| @@ -616,10 +601,7 @@ temp_output_buffer_setup (bufname) | |||
| 616 | } | 601 | } |
| 617 | 602 | ||
| 618 | Lisp_Object | 603 | Lisp_Object |
| 619 | internal_with_output_to_temp_buffer (bufname, function, args) | 604 | internal_with_output_to_temp_buffer (const char *bufname, Lisp_Object (*function) (Lisp_Object), Lisp_Object args) |
| 620 | const char *bufname; | ||
| 621 | Lisp_Object (*function) (Lisp_Object); | ||
| 622 | Lisp_Object args; | ||
| 623 | { | 605 | { |
| 624 | int count = SPECPDL_INDEX (); | 606 | int count = SPECPDL_INDEX (); |
| 625 | Lisp_Object buf, val; | 607 | Lisp_Object buf, val; |
| @@ -695,10 +677,10 @@ usage: (with-output-to-temp-buffer BUFNAME BODY...) */) | |||
| 695 | } | 677 | } |
| 696 | 678 | ||
| 697 | 679 | ||
| 698 | static void print (); | 680 | static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); |
| 699 | static void print_preprocess (); | 681 | static void print_preprocess (Lisp_Object obj); |
| 700 | static void print_preprocess_string (); | 682 | static void print_preprocess_string (INTERVAL interval, Lisp_Object arg); |
| 701 | static void print_object (); | 683 | static void print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); |
| 702 | 684 | ||
| 703 | DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, | 685 | DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, |
| 704 | doc: /* Output a newline to stream PRINTCHARFUN. | 686 | doc: /* Output a newline to stream PRINTCHARFUN. |
| @@ -919,8 +901,7 @@ to make it write to the debugging output. */) | |||
| 919 | print_output_debug_flag from being optimized away. */ | 901 | print_output_debug_flag from being optimized away. */ |
| 920 | 902 | ||
| 921 | void | 903 | void |
| 922 | debug_output_compilation_hack (x) | 904 | debug_output_compilation_hack (int x) |
| 923 | int x; | ||
| 924 | { | 905 | { |
| 925 | print_output_debug_flag = x; | 906 | print_output_debug_flag = x; |
| 926 | } | 907 | } |
| @@ -974,16 +955,14 @@ append to existing target file. */) | |||
| 974 | /* This is the interface for debugging printing. */ | 955 | /* This is the interface for debugging printing. */ |
| 975 | 956 | ||
| 976 | void | 957 | void |
| 977 | debug_print (arg) | 958 | debug_print (Lisp_Object arg) |
| 978 | Lisp_Object arg; | ||
| 979 | { | 959 | { |
| 980 | Fprin1 (arg, Qexternal_debugging_output); | 960 | Fprin1 (arg, Qexternal_debugging_output); |
| 981 | fprintf (stderr, "\r\n"); | 961 | fprintf (stderr, "\r\n"); |
| 982 | } | 962 | } |
| 983 | 963 | ||
| 984 | void | 964 | void |
| 985 | safe_debug_print (arg) | 965 | safe_debug_print (Lisp_Object arg) |
| 986 | Lisp_Object arg; | ||
| 987 | { | 966 | { |
| 988 | int valid = valid_lisp_object_p (arg); | 967 | int valid = valid_lisp_object_p (arg); |
| 989 | 968 | ||
| @@ -1037,10 +1016,7 @@ error message is constructed. */) | |||
| 1037 | CALLER is the Lisp function inside which the error was signaled. */ | 1016 | CALLER is the Lisp function inside which the error was signaled. */ |
| 1038 | 1017 | ||
| 1039 | void | 1018 | void |
| 1040 | print_error_message (data, stream, context, caller) | 1019 | print_error_message (Lisp_Object data, Lisp_Object stream, char *context, Lisp_Object caller) |
| 1041 | Lisp_Object data, stream; | ||
| 1042 | char *context; | ||
| 1043 | Lisp_Object caller; | ||
| 1044 | { | 1020 | { |
| 1045 | Lisp_Object errname, errmsg, file_error, tail; | 1021 | Lisp_Object errname, errmsg, file_error, tail; |
| 1046 | struct gcpro gcpro1; | 1022 | struct gcpro gcpro1; |
| @@ -1125,9 +1101,7 @@ print_error_message (data, stream, context, caller) | |||
| 1125 | */ | 1101 | */ |
| 1126 | 1102 | ||
| 1127 | void | 1103 | void |
| 1128 | float_to_string (buf, data) | 1104 | float_to_string (unsigned char *buf, double data) |
| 1129 | unsigned char *buf; | ||
| 1130 | double data; | ||
| 1131 | { | 1105 | { |
| 1132 | unsigned char *cp; | 1106 | unsigned char *cp; |
| 1133 | int width; | 1107 | int width; |
| @@ -1250,10 +1224,7 @@ float_to_string (buf, data) | |||
| 1250 | 1224 | ||
| 1251 | 1225 | ||
| 1252 | static void | 1226 | static void |
| 1253 | print (obj, printcharfun, escapeflag) | 1227 | print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag) |
| 1254 | Lisp_Object obj; | ||
| 1255 | register Lisp_Object printcharfun; | ||
| 1256 | int escapeflag; | ||
| 1257 | { | 1228 | { |
| 1258 | new_backquote_output = 0; | 1229 | new_backquote_output = 0; |
| 1259 | 1230 | ||
| @@ -1312,8 +1283,7 @@ print (obj, printcharfun, escapeflag) | |||
| 1312 | The status fields of Vprint_number_table mean whether each object appears | 1283 | The status fields of Vprint_number_table mean whether each object appears |
| 1313 | more than once in OBJ: Qnil at the first time, and Qt after that . */ | 1284 | more than once in OBJ: Qnil at the first time, and Qt after that . */ |
| 1314 | static void | 1285 | static void |
| 1315 | print_preprocess (obj) | 1286 | print_preprocess (Lisp_Object obj) |
| 1316 | Lisp_Object obj; | ||
| 1317 | { | 1287 | { |
| 1318 | int i; | 1288 | int i; |
| 1319 | EMACS_INT size; | 1289 | EMACS_INT size; |
| @@ -1433,9 +1403,7 @@ print_preprocess (obj) | |||
| 1433 | } | 1403 | } |
| 1434 | 1404 | ||
| 1435 | static void | 1405 | static void |
| 1436 | print_preprocess_string (interval, arg) | 1406 | print_preprocess_string (INTERVAL interval, Lisp_Object arg) |
| 1437 | INTERVAL interval; | ||
| 1438 | Lisp_Object arg; | ||
| 1439 | { | 1407 | { |
| 1440 | print_preprocess (interval->plist); | 1408 | print_preprocess (interval->plist); |
| 1441 | } | 1409 | } |
| @@ -1445,7 +1413,7 @@ print_preprocess_string (interval, arg) | |||
| 1445 | Lisp_Object Vprint_charset_text_property; | 1413 | Lisp_Object Vprint_charset_text_property; |
| 1446 | extern Lisp_Object Qdefault; | 1414 | extern Lisp_Object Qdefault; |
| 1447 | 1415 | ||
| 1448 | static void print_check_string_charset_prop (); | 1416 | static void print_check_string_charset_prop (INTERVAL interval, Lisp_Object string); |
| 1449 | 1417 | ||
| 1450 | #define PRINT_STRING_NON_CHARSET_FOUND 1 | 1418 | #define PRINT_STRING_NON_CHARSET_FOUND 1 |
| 1451 | #define PRINT_STRING_UNSAFE_CHARSET_FOUND 2 | 1419 | #define PRINT_STRING_UNSAFE_CHARSET_FOUND 2 |
| @@ -1454,9 +1422,7 @@ static void print_check_string_charset_prop (); | |||
| 1454 | static int print_check_string_result; | 1422 | static int print_check_string_result; |
| 1455 | 1423 | ||
| 1456 | static void | 1424 | static void |
| 1457 | print_check_string_charset_prop (interval, string) | 1425 | print_check_string_charset_prop (INTERVAL interval, Lisp_Object string) |
| 1458 | INTERVAL interval; | ||
| 1459 | Lisp_Object string; | ||
| 1460 | { | 1426 | { |
| 1461 | Lisp_Object val; | 1427 | Lisp_Object val; |
| 1462 | 1428 | ||
| @@ -1503,8 +1469,7 @@ print_check_string_charset_prop (interval, string) | |||
| 1503 | static Lisp_Object print_prune_charset_plist; | 1469 | static Lisp_Object print_prune_charset_plist; |
| 1504 | 1470 | ||
| 1505 | static Lisp_Object | 1471 | static Lisp_Object |
| 1506 | print_prune_string_charset (string) | 1472 | print_prune_string_charset (Lisp_Object string) |
| 1507 | Lisp_Object string; | ||
| 1508 | { | 1473 | { |
| 1509 | print_check_string_result = 0; | 1474 | print_check_string_result = 0; |
| 1510 | traverse_intervals (STRING_INTERVALS (string), 0, | 1475 | traverse_intervals (STRING_INTERVALS (string), 0, |
| @@ -1528,10 +1493,7 @@ print_prune_string_charset (string) | |||
| 1528 | } | 1493 | } |
| 1529 | 1494 | ||
| 1530 | static void | 1495 | static void |
| 1531 | print_object (obj, printcharfun, escapeflag) | 1496 | print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag) |
| 1532 | Lisp_Object obj; | ||
| 1533 | register Lisp_Object printcharfun; | ||
| 1534 | int escapeflag; | ||
| 1535 | { | 1497 | { |
| 1536 | char buf[40]; | 1498 | char buf[40]; |
| 1537 | 1499 | ||
| @@ -2307,9 +2269,7 @@ print_object (obj, printcharfun, escapeflag) | |||
| 2307 | This is part of printing a string that has text properties. */ | 2269 | This is part of printing a string that has text properties. */ |
| 2308 | 2270 | ||
| 2309 | void | 2271 | void |
| 2310 | print_interval (interval, printcharfun) | 2272 | print_interval (INTERVAL interval, Lisp_Object printcharfun) |
| 2311 | INTERVAL interval; | ||
| 2312 | Lisp_Object printcharfun; | ||
| 2313 | { | 2273 | { |
| 2314 | if (NILP (interval->plist)) | 2274 | if (NILP (interval->plist)) |
| 2315 | return; | 2275 | return; |
| @@ -2324,7 +2284,7 @@ print_interval (interval, printcharfun) | |||
| 2324 | 2284 | ||
| 2325 | 2285 | ||
| 2326 | void | 2286 | void |
| 2327 | syms_of_print () | 2287 | syms_of_print (void) |
| 2328 | { | 2288 | { |
| 2329 | Qtemp_buffer_setup_hook = intern_c_string ("temp-buffer-setup-hook"); | 2289 | Qtemp_buffer_setup_hook = intern_c_string ("temp-buffer-setup-hook"); |
| 2330 | staticpro (&Qtemp_buffer_setup_hook); | 2290 | staticpro (&Qtemp_buffer_setup_hook); |