This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
devel/mktodo.pl: Add ability to dump generated file
[perl5.git] / dist / Devel-PPPort / module3.c
1 /*******************************************************************************
2 *
3 *  Perl/Pollution/Portability
4 *
5 ********************************************************************************
6 *
7 *  Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
8 *  Version 2.x, Copyright (C) 2001, Paul Marquess.
9 *  Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
10 *
11 *  This program is free software; you can redistribute it and/or
12 *  modify it under the same terms as Perl itself.
13 *
14 *******************************************************************************/
15
16 #include "EXTERN.h"
17 #include "perl.h"
18
19 #define NEED_PL_parser
20 #define NO_XSLOCKS
21 #include "XSUB.h"
22
23 #include "ppport.h"
24
25 static void throws_exception(int throw_e)
26 {
27   if (throw_e)
28     croak("boo\n");
29 }
30
31 int exception(int throw_e)
32 {
33   dTHR;
34   dXCPT;
35   SV *caught = get_sv("Devel::PPPort::exception_caught", 0);
36
37   XCPT_TRY_START {
38     throws_exception(throw_e);
39   } XCPT_TRY_END
40
41   XCPT_CATCH
42   {
43     sv_setiv(caught, 1);
44     XCPT_RETHROW;
45   }
46
47   sv_setiv(caught, 0);
48
49   return 42;
50 }
51
52 void call_newCONSTSUB_3(void)
53 {
54   newCONSTSUB(gv_stashpv("Devel::PPPort", FALSE), "test_value_3", newSViv(3));
55 }
56
57 U32 get_PL_signals_3(void)
58 {
59   return PL_signals;
60 }
61
62 int dummy_parser_warning(void)
63 {
64   char * volatile my_bufptr;
65   char * volatile *my_p_bufptr;
66   my_bufptr = PL_bufptr;
67   my_p_bufptr = &PL_bufptr;
68   PL_bufptr = my_bufptr;
69   PL_bufptr = *my_p_bufptr;
70   return &PL_bufptr != NULL;
71 }