---
name: "ExtUtils::XSBuilder::ParseSource"
section: "3pm"
platform: "linux"
package: "perl-extutils-xsbuilder"
version: "0.28-11"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ExtUtils::XSBuilder::ParseSource"
---

# ExtUtils::XSBuilder::ParseSource(3pm)

parse C source files

## NAME

ExtUtils::XSBuilder::ParseSource - parse C source files

### DESCRIPTION

For more information, see ExtUtils::XSBuilder

### extent\_parser (o)

Allows the user to call the Extent or Replace method of the parser to add  new syntax rules. This is mainly useful to include expansions for  preprocessor macros.

### preprocess (o)

Allows the user to preprocess the source before it is given to the parser. You may modify the source, which is given as first argument in place.

### include\_dirs (o)

Returns a reference to the list of directories that should be searched for include files which contain the functions, structures, etc. to be extracted.

Default: `'.'`

### include\_paths (o)

Returns a reference to a list of directories that are given as include directories to the C compiler. This is mainly used to strip these directories from filenames to convert absolute paths to relative paths.

Default: empty list (`"[]"`)

### unwanted\_includes (o)

Returns a reference to a list of include files that should not be processed.

Default: empty list (`"[]"`)

### sort\_includes (o, include\_list)

Passed an array ref of include files, it allows the user to define the sort order, so includes are processed correctly.

Default: return the passed array reference.

### find\_includes (o)

Returns a list of include files to be processed.

Default: search directories given by `"include_dirs"` for all files and build a list of include files. All files starting with a word matched by  `"unwanted_includes"` are not included in the list.

### handle\_define (o)

Passed a hash ref with the definition of a define, may modify it. Return false to discard it, return true to keep it.

Default: `1`

### handle\_enum (o)

Passed a hash ref with the definition of a enum value, may modify it. Return false to discard it, return true to keep it.

Default: `1`

### handle\_struct (o)

Passed a hash ref with the definition of a struct, may modify it. Return false to discard it, return true to keep it.

Default: `1`

### handle\_function (o)

Passed a hash ref with the definition of a function, may modify it. Return false to discard it, return true to keep it.

Default: `1`

### handle\_callback (o)

Passed a hash ref with the definition of a callback, may modify it. Return false to discard it, return true to keep it.

Default: `1`

### package (o)

Return package name for tables

Default: `'MY'`

### targetdir (o)

Return name of target directory where to write tables

Default: `'./xsbuilder/tables'`

### run

Call this class method to parse your source. Before you can do so you must provide a class that overrides the defaults in ExtUtils::XSBuilder::ParseSource. After that you scan the source files with

```
    MyClass -> run ;
```
