aboutsummaryrefslogtreecommitdiffstats
path: root/src/print.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/print.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/print.c')
-rw-r--r--src/print.c94
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
169extern int minibuffer_auto_raise; 169extern int minibuffer_auto_raise;
170 170
171void print_interval (); 171void 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. */
174int print_output_debug_flag = 1; 174int 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
289static Lisp_Object 289static Lisp_Object
290print_unwind (saved_text) 290print_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
303static void 302static void
304printchar (ch, fun) 303printchar (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
355static void 352static void
356strout (ptr, size, size_byte, printcharfun, multibyte) 353strout (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
442static void 435static void
443print_string (string, printcharfun) 436print_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
551void 542void
552write_string (data, size) 543write_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
570void 559void
571write_string_1 (data, size, printcharfun) 560write_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
584void 570void
585temp_output_buffer_setup (bufname) 571temp_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
618Lisp_Object 603Lisp_Object
619internal_with_output_to_temp_buffer (bufname, function, args) 604internal_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
698static void print (); 680static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag);
699static void print_preprocess (); 681static void print_preprocess (Lisp_Object obj);
700static void print_preprocess_string (); 682static void print_preprocess_string (INTERVAL interval, Lisp_Object arg);
701static void print_object (); 683static void print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag);
702 684
703DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, 685DEFUN ("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
921void 903void
922debug_output_compilation_hack (x) 904debug_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
976void 957void
977debug_print (arg) 958debug_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
984void 964void
985safe_debug_print (arg) 965safe_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
1039void 1018void
1040print_error_message (data, stream, context, caller) 1019print_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
1127void 1103void
1128float_to_string (buf, data) 1104float_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
1252static void 1226static void
1253print (obj, printcharfun, escapeflag) 1227print (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 . */
1314static void 1285static void
1315print_preprocess (obj) 1286print_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
1435static void 1405static void
1436print_preprocess_string (interval, arg) 1406print_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)
1445Lisp_Object Vprint_charset_text_property; 1413Lisp_Object Vprint_charset_text_property;
1446extern Lisp_Object Qdefault; 1414extern Lisp_Object Qdefault;
1447 1415
1448static void print_check_string_charset_prop (); 1416static 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 ();
1454static int print_check_string_result; 1422static int print_check_string_result;
1455 1423
1456static void 1424static void
1457print_check_string_charset_prop (interval, string) 1425print_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)
1503static Lisp_Object print_prune_charset_plist; 1469static Lisp_Object print_prune_charset_plist;
1504 1470
1505static Lisp_Object 1471static Lisp_Object
1506print_prune_string_charset (string) 1472print_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
1530static void 1495static void
1531print_object (obj, printcharfun, escapeflag) 1496print_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
2309void 2271void
2310print_interval (interval, printcharfun) 2272print_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
2326void 2286void
2327syms_of_print () 2287syms_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);