File: gperl-i11n-croak.c

package info (click to toggle)
libglib-object-introspection-perl 0.048-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 544 kB
  • sloc: ansic: 3,468; perl: 2,785; makefile: 9; sh: 3
file content (41 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* -*- mode: c; indent-tabs-mode: t; c-basic-offset: 8; -*- */

/* Call Carp's croak() so that errors are reported at their location in the
 * user's program, not in Introspection.pm.  Adapted from
 * <http://www.perlmonks.org/?node_id=865159>. */
static void
call_carp_croak (const char *msg)
{
	dSP;

	ENTER;
	SAVETMPS;

	PUSHMARK (SP);
	XPUSHs (sv_2mortal (newSVpv(msg, 0)));
	PUTBACK;

	call_pv("Carp::croak", G_VOID | G_DISCARD);

	FREETMPS;
	LEAVE;
}

/* Similarly for Carp's carp(). */
static void
call_carp_carp (const char *msg)
{
	dSP;

	ENTER;
	SAVETMPS;

	PUSHMARK (SP);
	XPUSHs (sv_2mortal (newSVpv(msg, 0)));
	PUTBACK;

	call_pv("Carp::carp", G_VOID | G_DISCARD);

	FREETMPS;
	LEAVE;
}