File: cairo-perl-private.h

package info (click to toggle)
libcairo-perl 1.070-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 560 kB
  • ctags: 699
  • sloc: perl: 2,278; ansic: 71; makefile: 4
file content (42 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download
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
42
/*
 * Copyright (c) 2004-2005 by the cairo perl team (see the file README)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 *
 */

#ifndef _CAIRO_PERL_PRIVATE_H_
#define _CAIRO_PERL_PRIVATE_H_

#include "ppport.h"

void * cairo_perl_alloc_temp (int nbytes);

void cairo_perl_set_isa (const char * child_package, const char * parent_package);

cairo_matrix_t * cairo_perl_copy_matrix (cairo_matrix_t *matrix);

#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)

void cairo_perl_package_table_insert (void *pointer, const char *package);

const char * cairo_perl_package_table_lookup (void *pointer);

#endif

#define CAIRO_PERL_CHECK_STATUS(status)				\
	if (CAIRO_STATUS_SUCCESS != status) {			\
		SV *errsv = get_sv ("@", TRUE);			\
		sv_setsv (errsv, newSVCairoStatus (status));	\
		croak (Nullch);					\
	}

#define cairo_perl_sv_is_array_ref(sv) \
	(SvOK (sv) && SvROK (sv) && SvTYPE (SvRV(sv)) == SVt_PVAV)

#define cairo_perl_sv_is_hash_ref(sv) \
	(SvOK (sv) && SvROK (sv) && SvTYPE (SvRV(sv)) == SVt_PVHV)

#endif /* _CAIRO_PERL_PRIVATE_H_ */