Mercurial > hg > xemacs-beta
comparison src/eval.c @ 609:13e3d7ae7155
[xemacs-hg @ 2001-06-06 12:34:42 by ben]
nitpicky fixes:
emodules.c, tooltalk.c, process-unix.c: Fix warnings pointed out by Martin.
lisp.h: Correct usage of CBufbyte.
esd.c: indentation changes.
bytecode.c, eval.c, fileio.c: Use CBufbyte instead of char for error/warning functions.
linuxplay.c, miscplay.c, sgiplay.c, sunplay.c: Define DONT_ENCAPSULATE. (All encapsulation is removed in my pending Mule workspace.)
sgiplay.c: Put back #include <audio.h> accidentally removed.
Make play_sound_data return an int, like all other
such functions in *play.c.
sound.c: Fix up documentation of `play-sound'.
sysfile.h: Don't include sys/fcntl.h, as per Martin's advice.
author | ben |
---|---|
date | Wed, 06 Jun 2001 12:34:47 +0000 |
parents | 190b164ddcac |
children | af57a77cbc92 |
comparison
equal
deleted
inserted
replaced
608:4d7fdf497470 | 609:13e3d7ae7155 |
---|---|
282 | 282 |
283 static void | 283 static void |
284 print_subr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 284 print_subr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
285 { | 285 { |
286 Lisp_Subr *subr = XSUBR (obj); | 286 Lisp_Subr *subr = XSUBR (obj); |
287 const char *header = | 287 const CBufbyte *header = |
288 (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr "; | 288 (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr "; |
289 const char *name = subr_name (subr); | 289 const CBufbyte *name = subr_name (subr); |
290 const char *trailer = subr->prompt ? " (interactive)>" : ">"; | 290 const CBufbyte *trailer = subr->prompt ? " (interactive)>" : ">"; |
291 | 291 |
292 if (print_readably) | 292 if (print_readably) |
293 printing_unreadable_object ("%s%s%s", header, name, trailer); | 293 printing_unreadable_object ("%s%s%s", header, name, trailer); |
294 | 294 |
295 write_c_string (header, printcharfun); | 295 write_c_string (header, printcharfun); |
2268 | 2268 |
2269 /* Out of REASON and FROB, return a list of elements suitable for passing | 2269 /* Out of REASON and FROB, return a list of elements suitable for passing |
2270 to signal_error_1(). */ | 2270 to signal_error_1(). */ |
2271 | 2271 |
2272 Lisp_Object | 2272 Lisp_Object |
2273 build_error_data (const char *reason, Lisp_Object frob) | 2273 build_error_data (const CBufbyte *reason, Lisp_Object frob) |
2274 { | 2274 { |
2275 if (EQ (frob, Qunbound)) | 2275 if (EQ (frob, Qunbound)) |
2276 frob = Qnil; | 2276 frob = Qnil; |
2277 else if (CONSP (frob) && EQ (XCAR (frob), Qunbound)) | 2277 else if (CONSP (frob) && EQ (XCAR (frob), Qunbound)) |
2278 frob = XCDR (frob); | 2278 frob = XCDR (frob); |
2283 else | 2283 else |
2284 return Fcons (build_translated_string (reason), frob); | 2284 return Fcons (build_translated_string (reason), frob); |
2285 } | 2285 } |
2286 | 2286 |
2287 DOESNT_RETURN | 2287 DOESNT_RETURN |
2288 signal_error (Lisp_Object type, const char *reason, Lisp_Object frob) | 2288 signal_error (Lisp_Object type, const CBufbyte *reason, Lisp_Object frob) |
2289 { | 2289 { |
2290 signal_error_1 (type, build_error_data (reason, frob)); | 2290 signal_error_1 (type, build_error_data (reason, frob)); |
2291 } | 2291 } |
2292 | 2292 |
2293 void | 2293 void |
2294 maybe_signal_error (Lisp_Object type, const char *reason, | 2294 maybe_signal_error (Lisp_Object type, const CBufbyte *reason, |
2295 Lisp_Object frob, Lisp_Object class, | 2295 Lisp_Object frob, Lisp_Object class, |
2296 Error_Behavior errb) | 2296 Error_Behavior errb) |
2297 { | 2297 { |
2298 /* Optimization: */ | 2298 /* Optimization: */ |
2299 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2299 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2300 return; | 2300 return; |
2301 maybe_signal_error_1 (type, build_error_data (reason, frob), class, errb); | 2301 maybe_signal_error_1 (type, build_error_data (reason, frob), class, errb); |
2302 } | 2302 } |
2303 | 2303 |
2304 Lisp_Object | 2304 Lisp_Object |
2305 signal_continuable_error (Lisp_Object type, const char *reason, | 2305 signal_continuable_error (Lisp_Object type, const CBufbyte *reason, |
2306 Lisp_Object frob) | 2306 Lisp_Object frob) |
2307 { | 2307 { |
2308 return Fsignal (type, build_error_data (reason, frob)); | 2308 return Fsignal (type, build_error_data (reason, frob)); |
2309 } | 2309 } |
2310 | 2310 |
2311 Lisp_Object | 2311 Lisp_Object |
2312 maybe_signal_continuable_error (Lisp_Object type, const char *reason, | 2312 maybe_signal_continuable_error (Lisp_Object type, const CBufbyte *reason, |
2313 Lisp_Object frob, Lisp_Object class, | 2313 Lisp_Object frob, Lisp_Object class, |
2314 Error_Behavior errb) | 2314 Error_Behavior errb) |
2315 { | 2315 { |
2316 /* Optimization: */ | 2316 /* Optimization: */ |
2317 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2317 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2329 is three objects, a string and two related Lisp objects. | 2329 is three objects, a string and two related Lisp objects. |
2330 (The equivalent could be accomplished using the class 2 functions, | 2330 (The equivalent could be accomplished using the class 2 functions, |
2331 but these are more convenient in this particular case.) */ | 2331 but these are more convenient in this particular case.) */ |
2332 | 2332 |
2333 DOESNT_RETURN | 2333 DOESNT_RETURN |
2334 signal_error_2 (Lisp_Object type, const char *reason, | 2334 signal_error_2 (Lisp_Object type, const CBufbyte *reason, |
2335 Lisp_Object frob0, Lisp_Object frob1) | 2335 Lisp_Object frob0, Lisp_Object frob1) |
2336 { | 2336 { |
2337 signal_error_1 (type, list3 (build_translated_string (reason), frob0, | 2337 signal_error_1 (type, list3 (build_translated_string (reason), frob0, |
2338 frob1)); | 2338 frob1)); |
2339 } | 2339 } |
2340 | 2340 |
2341 void | 2341 void |
2342 maybe_signal_error_2 (Lisp_Object type, const char *reason, | 2342 maybe_signal_error_2 (Lisp_Object type, const CBufbyte *reason, |
2343 Lisp_Object frob0, Lisp_Object frob1, | 2343 Lisp_Object frob0, Lisp_Object frob1, |
2344 Lisp_Object class, Error_Behavior errb) | 2344 Lisp_Object class, Error_Behavior errb) |
2345 { | 2345 { |
2346 /* Optimization: */ | 2346 /* Optimization: */ |
2347 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2347 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2349 maybe_signal_error_1 (type, list3 (build_translated_string (reason), frob0, | 2349 maybe_signal_error_1 (type, list3 (build_translated_string (reason), frob0, |
2350 frob1), class, errb); | 2350 frob1), class, errb); |
2351 } | 2351 } |
2352 | 2352 |
2353 Lisp_Object | 2353 Lisp_Object |
2354 signal_continuable_error_2 (Lisp_Object type, const char *reason, | 2354 signal_continuable_error_2 (Lisp_Object type, const CBufbyte *reason, |
2355 Lisp_Object frob0, Lisp_Object frob1) | 2355 Lisp_Object frob0, Lisp_Object frob1) |
2356 { | 2356 { |
2357 return Fsignal (type, list3 (build_translated_string (reason), frob0, | 2357 return Fsignal (type, list3 (build_translated_string (reason), frob0, |
2358 frob1)); | 2358 frob1)); |
2359 } | 2359 } |
2360 | 2360 |
2361 Lisp_Object | 2361 Lisp_Object |
2362 maybe_signal_continuable_error_2 (Lisp_Object type, const char *reason, | 2362 maybe_signal_continuable_error_2 (Lisp_Object type, const CBufbyte *reason, |
2363 Lisp_Object frob0, Lisp_Object frob1, | 2363 Lisp_Object frob0, Lisp_Object frob1, |
2364 Lisp_Object class, Error_Behavior errb) | 2364 Lisp_Object class, Error_Behavior errb) |
2365 { | 2365 { |
2366 /* Optimization: */ | 2366 /* Optimization: */ |
2367 if (ERRB_EQ (errb, ERROR_ME_NOT)) | 2367 if (ERRB_EQ (errb, ERROR_ME_NOT)) |
2377 /* Class 4: Printf-like functions that signal an error. | 2377 /* Class 4: Printf-like functions that signal an error. |
2378 These functions signal an error of a specified type, whose data | 2378 These functions signal an error of a specified type, whose data |
2379 is a single string, created using the arguments. */ | 2379 is a single string, created using the arguments. */ |
2380 | 2380 |
2381 DOESNT_RETURN | 2381 DOESNT_RETURN |
2382 signal_ferror (Lisp_Object type, const char *fmt, ...) | 2382 signal_ferror (Lisp_Object type, const CBufbyte *fmt, ...) |
2383 { | 2383 { |
2384 Lisp_Object obj; | 2384 Lisp_Object obj; |
2385 va_list args; | 2385 va_list args; |
2386 | 2386 |
2387 va_start (args, fmt); | 2387 va_start (args, fmt); |
2393 signal_error (type, 0, obj); | 2393 signal_error (type, 0, obj); |
2394 } | 2394 } |
2395 | 2395 |
2396 void | 2396 void |
2397 maybe_signal_ferror (Lisp_Object type, Lisp_Object class, Error_Behavior errb, | 2397 maybe_signal_ferror (Lisp_Object type, Lisp_Object class, Error_Behavior errb, |
2398 const char *fmt, ...) | 2398 const CBufbyte *fmt, ...) |
2399 { | 2399 { |
2400 Lisp_Object obj; | 2400 Lisp_Object obj; |
2401 va_list args; | 2401 va_list args; |
2402 | 2402 |
2403 /* Optimization: */ | 2403 /* Optimization: */ |
2412 /* Fsignal GC-protects its args */ | 2412 /* Fsignal GC-protects its args */ |
2413 maybe_signal_error (type, 0, obj, class, errb); | 2413 maybe_signal_error (type, 0, obj, class, errb); |
2414 } | 2414 } |
2415 | 2415 |
2416 Lisp_Object | 2416 Lisp_Object |
2417 signal_continuable_ferror (Lisp_Object type, const char *fmt, ...) | 2417 signal_continuable_ferror (Lisp_Object type, const CBufbyte *fmt, ...) |
2418 { | 2418 { |
2419 Lisp_Object obj; | 2419 Lisp_Object obj; |
2420 va_list args; | 2420 va_list args; |
2421 | 2421 |
2422 va_start (args, fmt); | 2422 va_start (args, fmt); |
2428 return Fsignal (type, list1 (obj)); | 2428 return Fsignal (type, list1 (obj)); |
2429 } | 2429 } |
2430 | 2430 |
2431 Lisp_Object | 2431 Lisp_Object |
2432 maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class, | 2432 maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class, |
2433 Error_Behavior errb, const char *fmt, ...) | 2433 Error_Behavior errb, const CBufbyte *fmt, ...) |
2434 { | 2434 { |
2435 Lisp_Object obj; | 2435 Lisp_Object obj; |
2436 va_list args; | 2436 va_list args; |
2437 | 2437 |
2438 /* Optimization: */ | 2438 /* Optimization: */ |
2462 elements, the first of which is Qunbound), and these functions are | 2462 elements, the first of which is Qunbound), and these functions are |
2463 not commonly used. | 2463 not commonly used. |
2464 */ | 2464 */ |
2465 | 2465 |
2466 DOESNT_RETURN | 2466 DOESNT_RETURN |
2467 signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const char *fmt, | 2467 signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const CBufbyte *fmt, |
2468 ...) | 2468 ...) |
2469 { | 2469 { |
2470 Lisp_Object obj; | 2470 Lisp_Object obj; |
2471 va_list args; | 2471 va_list args; |
2472 | 2472 |
2480 } | 2480 } |
2481 | 2481 |
2482 void | 2482 void |
2483 maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, | 2483 maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, |
2484 Lisp_Object class, Error_Behavior errb, | 2484 Lisp_Object class, Error_Behavior errb, |
2485 const char *fmt, ...) | 2485 const CBufbyte *fmt, ...) |
2486 { | 2486 { |
2487 Lisp_Object obj; | 2487 Lisp_Object obj; |
2488 va_list args; | 2488 va_list args; |
2489 | 2489 |
2490 /* Optimization: */ | 2490 /* Optimization: */ |
2501 errb); | 2501 errb); |
2502 } | 2502 } |
2503 | 2503 |
2504 Lisp_Object | 2504 Lisp_Object |
2505 signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, | 2505 signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, |
2506 const char *fmt, ...) | 2506 const CBufbyte *fmt, ...) |
2507 { | 2507 { |
2508 Lisp_Object obj; | 2508 Lisp_Object obj; |
2509 va_list args; | 2509 va_list args; |
2510 | 2510 |
2511 va_start (args, fmt); | 2511 va_start (args, fmt); |
2519 | 2519 |
2520 Lisp_Object | 2520 Lisp_Object |
2521 maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, | 2521 maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, |
2522 Lisp_Object class, | 2522 Lisp_Object class, |
2523 Error_Behavior errb, | 2523 Error_Behavior errb, |
2524 const char *fmt, ...) | 2524 const CBufbyte *fmt, ...) |
2525 { | 2525 { |
2526 Lisp_Object obj; | 2526 Lisp_Object obj; |
2527 va_list args; | 2527 va_list args; |
2528 | 2528 |
2529 /* Optimization: */ | 2529 /* Optimization: */ |
2601 { | 2601 { |
2602 signal_error (Qcircular_property_list, 0, list); | 2602 signal_error (Qcircular_property_list, 0, list); |
2603 } | 2603 } |
2604 | 2604 |
2605 DOESNT_RETURN | 2605 DOESNT_RETURN |
2606 syntax_error (const char *reason, Lisp_Object frob) | 2606 syntax_error (const CBufbyte *reason, Lisp_Object frob) |
2607 { | 2607 { |
2608 signal_error (Qsyntax_error, reason, frob); | 2608 signal_error (Qsyntax_error, reason, frob); |
2609 } | 2609 } |
2610 | 2610 |
2611 DOESNT_RETURN | 2611 DOESNT_RETURN |
2612 syntax_error_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) | 2612 syntax_error_2 (const CBufbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
2613 { | 2613 { |
2614 signal_error_2 (Qsyntax_error, reason, frob1, frob2); | 2614 signal_error_2 (Qsyntax_error, reason, frob1, frob2); |
2615 } | 2615 } |
2616 | 2616 |
2617 void | 2617 void |
2618 maybe_syntax_error (const char *reason, Lisp_Object frob, | 2618 maybe_syntax_error (const CBufbyte *reason, Lisp_Object frob, |
2619 Lisp_Object class, Error_Behavior errb) | 2619 Lisp_Object class, Error_Behavior errb) |
2620 { | 2620 { |
2621 maybe_signal_error (Qsyntax_error, reason, frob, class, errb); | 2621 maybe_signal_error (Qsyntax_error, reason, frob, class, errb); |
2622 } | 2622 } |
2623 | 2623 |
2624 DOESNT_RETURN | 2624 DOESNT_RETURN |
2625 sferror (const char *reason, Lisp_Object frob) | 2625 sferror (const CBufbyte *reason, Lisp_Object frob) |
2626 { | 2626 { |
2627 signal_error (Qstructure_formation_error, reason, frob); | 2627 signal_error (Qstructure_formation_error, reason, frob); |
2628 } | 2628 } |
2629 | 2629 |
2630 DOESNT_RETURN | 2630 DOESNT_RETURN |
2631 sferror_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) | 2631 sferror_2 (const CBufbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
2632 { | 2632 { |
2633 signal_error_2 (Qstructure_formation_error, reason, frob1, frob2); | 2633 signal_error_2 (Qstructure_formation_error, reason, frob1, frob2); |
2634 } | 2634 } |
2635 | 2635 |
2636 void | 2636 void |
2637 maybe_sferror (const char *reason, Lisp_Object frob, | 2637 maybe_sferror (const CBufbyte *reason, Lisp_Object frob, |
2638 Lisp_Object class, Error_Behavior errb) | 2638 Lisp_Object class, Error_Behavior errb) |
2639 { | 2639 { |
2640 maybe_signal_error (Qstructure_formation_error, reason, frob, class, errb); | 2640 maybe_signal_error (Qstructure_formation_error, reason, frob, class, errb); |
2641 } | 2641 } |
2642 | 2642 |
2643 DOESNT_RETURN | 2643 DOESNT_RETURN |
2644 invalid_argument (const char *reason, Lisp_Object frob) | 2644 invalid_argument (const CBufbyte *reason, Lisp_Object frob) |
2645 { | 2645 { |
2646 signal_error (Qinvalid_argument, reason, frob); | 2646 signal_error (Qinvalid_argument, reason, frob); |
2647 } | 2647 } |
2648 | 2648 |
2649 DOESNT_RETURN | 2649 DOESNT_RETURN |
2650 invalid_argument_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) | 2650 invalid_argument_2 (const CBufbyte *reason, Lisp_Object frob1, |
2651 Lisp_Object frob2) | |
2651 { | 2652 { |
2652 signal_error_2 (Qinvalid_argument, reason, frob1, frob2); | 2653 signal_error_2 (Qinvalid_argument, reason, frob1, frob2); |
2653 } | 2654 } |
2654 | 2655 |
2655 void | 2656 void |
2656 maybe_invalid_argument (const char *reason, Lisp_Object frob, | 2657 maybe_invalid_argument (const CBufbyte *reason, Lisp_Object frob, |
2657 Lisp_Object class, Error_Behavior errb) | 2658 Lisp_Object class, Error_Behavior errb) |
2658 { | 2659 { |
2659 maybe_signal_error (Qinvalid_argument, reason, frob, class, errb); | 2660 maybe_signal_error (Qinvalid_argument, reason, frob, class, errb); |
2660 } | 2661 } |
2661 | 2662 |
2662 DOESNT_RETURN | 2663 DOESNT_RETURN |
2663 invalid_constant (const char *reason, Lisp_Object frob) | 2664 invalid_constant (const CBufbyte *reason, Lisp_Object frob) |
2664 { | 2665 { |
2665 signal_error (Qinvalid_constant, reason, frob); | 2666 signal_error (Qinvalid_constant, reason, frob); |
2666 } | 2667 } |
2667 | 2668 |
2668 DOESNT_RETURN | 2669 DOESNT_RETURN |
2669 invalid_constant_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) | 2670 invalid_constant_2 (const CBufbyte *reason, Lisp_Object frob1, |
2671 Lisp_Object frob2) | |
2670 { | 2672 { |
2671 signal_error_2 (Qinvalid_constant, reason, frob1, frob2); | 2673 signal_error_2 (Qinvalid_constant, reason, frob1, frob2); |
2672 } | 2674 } |
2673 | 2675 |
2674 void | 2676 void |
2675 maybe_invalid_constant (const char *reason, Lisp_Object frob, | 2677 maybe_invalid_constant (const CBufbyte *reason, Lisp_Object frob, |
2676 Lisp_Object class, Error_Behavior errb) | 2678 Lisp_Object class, Error_Behavior errb) |
2677 { | 2679 { |
2678 maybe_signal_error (Qinvalid_constant, reason, frob, class, errb); | 2680 maybe_signal_error (Qinvalid_constant, reason, frob, class, errb); |
2679 } | 2681 } |
2680 | 2682 |
2681 DOESNT_RETURN | 2683 DOESNT_RETURN |
2682 invalid_operation (const char *reason, Lisp_Object frob) | 2684 invalid_operation (const CBufbyte *reason, Lisp_Object frob) |
2683 { | 2685 { |
2684 signal_error (Qinvalid_operation, reason, frob); | 2686 signal_error (Qinvalid_operation, reason, frob); |
2685 } | 2687 } |
2686 | 2688 |
2687 DOESNT_RETURN | 2689 DOESNT_RETURN |
2688 invalid_operation_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) | 2690 invalid_operation_2 (const CBufbyte *reason, Lisp_Object frob1, |
2691 Lisp_Object frob2) | |
2689 { | 2692 { |
2690 signal_error_2 (Qinvalid_operation, reason, frob1, frob2); | 2693 signal_error_2 (Qinvalid_operation, reason, frob1, frob2); |
2691 } | 2694 } |
2692 | 2695 |
2693 void | 2696 void |
2694 maybe_invalid_operation (const char *reason, Lisp_Object frob, | 2697 maybe_invalid_operation (const CBufbyte *reason, Lisp_Object frob, |
2695 Lisp_Object class, Error_Behavior errb) | 2698 Lisp_Object class, Error_Behavior errb) |
2696 { | 2699 { |
2697 maybe_signal_error (Qinvalid_operation, reason, frob, class, errb); | 2700 maybe_signal_error (Qinvalid_operation, reason, frob, class, errb); |
2698 } | 2701 } |
2699 | 2702 |
2700 DOESNT_RETURN | 2703 DOESNT_RETURN |
2701 invalid_change (const char *reason, Lisp_Object frob) | 2704 invalid_change (const CBufbyte *reason, Lisp_Object frob) |
2702 { | 2705 { |
2703 signal_error (Qinvalid_change, reason, frob); | 2706 signal_error (Qinvalid_change, reason, frob); |
2704 } | 2707 } |
2705 | 2708 |
2706 DOESNT_RETURN | 2709 DOESNT_RETURN |
2707 invalid_change_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) | 2710 invalid_change_2 (const CBufbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
2708 { | 2711 { |
2709 signal_error_2 (Qinvalid_change, reason, frob1, frob2); | 2712 signal_error_2 (Qinvalid_change, reason, frob1, frob2); |
2710 } | 2713 } |
2711 | 2714 |
2712 void | 2715 void |
2713 maybe_invalid_change (const char *reason, Lisp_Object frob, | 2716 maybe_invalid_change (const CBufbyte *reason, Lisp_Object frob, |
2714 Lisp_Object class, Error_Behavior errb) | 2717 Lisp_Object class, Error_Behavior errb) |
2715 { | 2718 { |
2716 maybe_signal_error (Qinvalid_change, reason, frob, class, errb); | 2719 maybe_signal_error (Qinvalid_change, reason, frob, class, errb); |
2717 } | 2720 } |
2718 | 2721 |
2719 DOESNT_RETURN | 2722 DOESNT_RETURN |
2720 invalid_state (const char *reason, Lisp_Object frob) | 2723 invalid_state (const CBufbyte *reason, Lisp_Object frob) |
2721 { | 2724 { |
2722 signal_error (Qinvalid_state, reason, frob); | 2725 signal_error (Qinvalid_state, reason, frob); |
2723 } | 2726 } |
2724 | 2727 |
2725 DOESNT_RETURN | 2728 DOESNT_RETURN |
2726 invalid_state_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) | 2729 invalid_state_2 (const CBufbyte *reason, Lisp_Object frob1, Lisp_Object frob2) |
2727 { | 2730 { |
2728 signal_error_2 (Qinvalid_state, reason, frob1, frob2); | 2731 signal_error_2 (Qinvalid_state, reason, frob1, frob2); |
2729 } | 2732 } |
2730 | 2733 |
2731 void | 2734 void |
2732 maybe_invalid_state (const char *reason, Lisp_Object frob, | 2735 maybe_invalid_state (const CBufbyte *reason, Lisp_Object frob, |
2733 Lisp_Object class, Error_Behavior errb) | 2736 Lisp_Object class, Error_Behavior errb) |
2734 { | 2737 { |
2735 maybe_signal_error (Qinvalid_state, reason, frob, class, errb); | 2738 maybe_signal_error (Qinvalid_state, reason, frob, class, errb); |
2736 } | 2739 } |
2737 | 2740 |
2738 DOESNT_RETURN | 2741 DOESNT_RETURN |
2739 wtaerror (const char *reason, Lisp_Object frob) | 2742 wtaerror (const CBufbyte *reason, Lisp_Object frob) |
2740 { | 2743 { |
2741 signal_error (Qwrong_type_argument, reason, frob); | 2744 signal_error (Qwrong_type_argument, reason, frob); |
2742 } | 2745 } |
2743 | 2746 |
2744 DOESNT_RETURN | 2747 DOESNT_RETURN |
2745 stack_overflow (const char *reason, Lisp_Object frob) | 2748 stack_overflow (const CBufbyte *reason, Lisp_Object frob) |
2746 { | 2749 { |
2747 signal_error (Qstack_overflow, reason, frob); | 2750 signal_error (Qstack_overflow, reason, frob); |
2748 } | 2751 } |
2749 | 2752 |
2750 DOESNT_RETURN | 2753 DOESNT_RETURN |
2751 out_of_memory (const char *reason, Lisp_Object frob) | 2754 out_of_memory (const CBufbyte *reason, Lisp_Object frob) |
2752 { | 2755 { |
2753 signal_error (Qout_of_memory, reason, frob); | 2756 signal_error (Qout_of_memory, reason, frob); |
2754 } | 2757 } |
2755 | 2758 |
2756 DOESNT_RETURN | 2759 DOESNT_RETURN |
2757 printing_unreadable_object (const char *fmt, ...) | 2760 printing_unreadable_object (const CBufbyte *fmt, ...) |
2758 { | 2761 { |
2759 Lisp_Object obj; | 2762 Lisp_Object obj; |
2760 va_list args; | 2763 va_list args; |
2761 | 2764 |
2762 va_start (args, fmt); | 2765 va_start (args, fmt); |
4383 { | 4386 { |
4384 Lisp_Object args[2]; | 4387 Lisp_Object args[2]; |
4385 | 4388 |
4386 if (!NILP (arg)) | 4389 if (!NILP (arg)) |
4387 { | 4390 { |
4388 char *str = (char *) get_opaque_ptr (arg); | 4391 CBufbyte *str = (CBufbyte *) get_opaque_ptr (arg); |
4389 args[0] = build_string (str); | 4392 args[0] = build_string (str); |
4390 } | 4393 } |
4391 else | 4394 else |
4392 args[0] = build_string ("error"); | 4395 args[0] = build_string ("error"); |
4393 /* #### This should call | 4396 /* #### This should call |
4437 { | 4440 { |
4438 return eval_in_buffer (XBUFFER (XCAR (cons)), XCDR (cons)); | 4441 return eval_in_buffer (XBUFFER (XCAR (cons)), XCDR (cons)); |
4439 } | 4442 } |
4440 | 4443 |
4441 Lisp_Object | 4444 Lisp_Object |
4442 eval_in_buffer_trapping_errors (const char *warning_string, | 4445 eval_in_buffer_trapping_errors (const CBufbyte *warning_string, |
4443 struct buffer *buf, Lisp_Object form) | 4446 struct buffer *buf, Lisp_Object form) |
4444 { | 4447 { |
4445 int speccount = specpdl_depth(); | 4448 int speccount = specpdl_depth(); |
4446 Lisp_Object tem; | 4449 Lisp_Object tem; |
4447 Lisp_Object buffer; | 4450 Lisp_Object buffer; |
4477 run_hook (hook_symbol); | 4480 run_hook (hook_symbol); |
4478 return Qnil; | 4481 return Qnil; |
4479 } | 4482 } |
4480 | 4483 |
4481 Lisp_Object | 4484 Lisp_Object |
4482 run_hook_trapping_errors (const char *warning_string, Lisp_Object hook_symbol) | 4485 run_hook_trapping_errors (const CBufbyte *warning_string, |
4486 Lisp_Object hook_symbol) | |
4483 { | 4487 { |
4484 int speccount; | 4488 int speccount; |
4485 Lisp_Object tem; | 4489 Lisp_Object tem; |
4486 Lisp_Object opaque; | 4490 Lisp_Object opaque; |
4487 struct gcpro gcpro1; | 4491 struct gcpro gcpro1; |
4510 | 4514 |
4511 /* Same as run_hook_trapping_errors() but also set the hook to nil | 4515 /* Same as run_hook_trapping_errors() but also set the hook to nil |
4512 if an error occurs. */ | 4516 if an error occurs. */ |
4513 | 4517 |
4514 Lisp_Object | 4518 Lisp_Object |
4515 safe_run_hook_trapping_errors (const char *warning_string, | 4519 safe_run_hook_trapping_errors (const CBufbyte *warning_string, |
4516 Lisp_Object hook_symbol, | 4520 Lisp_Object hook_symbol, |
4517 int allow_quit) | 4521 int allow_quit) |
4518 { | 4522 { |
4519 int speccount = specpdl_depth(); | 4523 int speccount = specpdl_depth(); |
4520 Lisp_Object tem; | 4524 Lisp_Object tem; |
4556 /* This function can GC */ | 4560 /* This function can GC */ |
4557 return call0 (function); | 4561 return call0 (function); |
4558 } | 4562 } |
4559 | 4563 |
4560 Lisp_Object | 4564 Lisp_Object |
4561 call0_trapping_errors (const char *warning_string, Lisp_Object function) | 4565 call0_trapping_errors (const CBufbyte *warning_string, Lisp_Object function) |
4562 { | 4566 { |
4563 int speccount; | 4567 int speccount; |
4564 Lisp_Object tem; | 4568 Lisp_Object tem; |
4565 Lisp_Object opaque = Qnil; | 4569 Lisp_Object opaque = Qnil; |
4566 struct gcpro gcpro1, gcpro2; | 4570 struct gcpro gcpro1, gcpro2; |
4603 /* This function can GC */ | 4607 /* This function can GC */ |
4604 return call2 (XCAR (cons), XCAR (XCDR (cons)), XCAR (XCDR (XCDR (cons)))); | 4608 return call2 (XCAR (cons), XCAR (XCDR (cons)), XCAR (XCDR (XCDR (cons)))); |
4605 } | 4609 } |
4606 | 4610 |
4607 Lisp_Object | 4611 Lisp_Object |
4608 call1_trapping_errors (const char *warning_string, Lisp_Object function, | 4612 call1_trapping_errors (const CBufbyte *warning_string, Lisp_Object function, |
4609 Lisp_Object object) | 4613 Lisp_Object object) |
4610 { | 4614 { |
4611 int speccount = specpdl_depth(); | 4615 int speccount = specpdl_depth(); |
4612 Lisp_Object tem; | 4616 Lisp_Object tem; |
4613 Lisp_Object cons = Qnil; | 4617 Lisp_Object cons = Qnil; |
4640 /* gc_currently_forbidden = 0; */ | 4644 /* gc_currently_forbidden = 0; */ |
4641 return unbind_to (speccount, tem); | 4645 return unbind_to (speccount, tem); |
4642 } | 4646 } |
4643 | 4647 |
4644 Lisp_Object | 4648 Lisp_Object |
4645 call2_trapping_errors (const char *warning_string, Lisp_Object function, | 4649 call2_trapping_errors (const CBufbyte *warning_string, Lisp_Object function, |
4646 Lisp_Object object1, Lisp_Object object2) | 4650 Lisp_Object object1, Lisp_Object object2) |
4647 { | 4651 { |
4648 int speccount = specpdl_depth(); | 4652 int speccount = specpdl_depth(); |
4649 Lisp_Object tem; | 4653 Lisp_Object tem; |
4650 Lisp_Object cons = Qnil; | 4654 Lisp_Object cons = Qnil; |
5197 An alternative approach is to just pass some non-string type of | 5201 An alternative approach is to just pass some non-string type of |
5198 Lisp_Object to warn_when_safe_lispobj(); `prin1-to-string' will | 5202 Lisp_Object to warn_when_safe_lispobj(); `prin1-to-string' will |
5199 automatically be called when it is safe to do so. */ | 5203 automatically be called when it is safe to do so. */ |
5200 | 5204 |
5201 void | 5205 void |
5202 warn_when_safe (Lisp_Object class, Lisp_Object level, const char *fmt, ...) | 5206 warn_when_safe (Lisp_Object class, Lisp_Object level, const CBufbyte *fmt, ...) |
5203 { | 5207 { |
5204 Lisp_Object obj; | 5208 Lisp_Object obj; |
5205 va_list args; | 5209 va_list args; |
5206 | 5210 |
5207 va_start (args, fmt); | 5211 va_start (args, fmt); |