File: Clang.xs

package info (click to toggle)
libclang-perl 0.09-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 297; cpp: 55; makefile: 10; ansic: 8
file content (37 lines) | stat: -rw-r--r-- 807 bytes parent folder | download | duplicates (2)
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
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include <clang-c/Index.h>

typedef CXIndex			Index;
typedef CXTranslationUnit	TUnit;
typedef CXCursor *		Cursor;
typedef enum CXCursorKind	CursorKind;
typedef CXType *		Type;
typedef enum CXTypeKind		TypeKind;
typedef CXDiagnostic		Diagnostic;

enum CXChildVisitResult visitor(CXCursor cursor, CXCursor parent, CXClientData data) {
	SV *child;
	AV *children = data;

	CXCursor *ref = malloc(sizeof(CXCursor));
	*ref = cursor;

	child = sv_setref_pv(newSV(0), "Clang::Cursor", (void *) ref);

	av_push(children, child);

	return CXChildVisit_Continue;
}

MODULE = Clang				PACKAGE = Clang

INCLUDE: xs/Index.xs
INCLUDE: xs/TUnit.xs
INCLUDE: xs/Cursor.xs
INCLUDE: xs/CursorKind.xs
INCLUDE: xs/Type.xs
INCLUDE: xs/TypeKind.xs
INCLUDE: xs/Diagnostic.xs