# `orchestrator.pkg.c_extractor`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/pkg/c_extractor.py`](../../src/orchestrator/pkg/c_extractor.py)

1 types · 18 functions · python

## Changing this safely

**Tested by** (1): `tests.pkg.test_c_extractor`

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491) — reaches **33** symbols · **no test path visible**
- [`_declarator_name`](../../src/orchestrator/pkg/c_extractor.py#L418) — reaches **14** symbols · **no test path visible**
- [`_function_declarator`](../../src/orchestrator/pkg/c_extractor.py#L406) — reaches **11** symbols · **no test path visible**
- [`_field_text`](../../src/orchestrator/pkg/c_extractor.py#L486) — reaches **10** symbols · **no test path visible**
- [`_declared_names`](../../src/orchestrator/pkg/c_extractor.py#L432) — reaches **9** symbols · **no test path visible**
- [`_member_type_name`](../../src/orchestrator/pkg/c_extractor.py#L445) — reaches **9** symbols · **no test path visible**
- [`_has_body`](../../src/orchestrator/pkg/c_extractor.py#L465) — reaches **7** symbols · **no test path visible**
- [`_header_index`](../../src/orchestrator/pkg/c_extractor.py#L325) — reaches **7** symbols · **no test path visible**

_17 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Types

### `CExtractor`

[`src/orchestrator/pkg/c_extractor.py:63`](../../src/orchestrator/pkg/c_extractor.py#L63)

- **Called by** (1 production · 2 test): [`default_extractors`](../../src/orchestrator/pkg/extractor.py#L530), [`_extract`](../../tests/pkg/test_c_extractor.py#L19), [`test_module_name_is_the_relative_path`](../../tests/pkg/test_c_extractor.py#L68)
- **Fields**: `language`, `suffixes`
- **Documented in**: `docs/specs/language-support-roadmap.md#track-2-c-c-h-do-second-new-model-but-simplest-language`

## Functions

### `_bound_names`

[`src/orchestrator/pkg/c_extractor.py:361`](../../src/orchestrator/pkg/c_extractor.py#L361)

- **Called by** (1): [`_calls`](../../src/orchestrator/pkg/c_extractor.py#L255)
- **Calls** (1): [`_identifiers_in`](../../src/orchestrator/pkg/c_extractor.py#L345)
- **Documented in**: `CHANGELOG.md`

### `_c_parser`

[`src/orchestrator/pkg/c_extractor.py:497`](../../src/orchestrator/pkg/c_extractor.py#L497)

- **Called by** (2): [`_parser_for`](../../src/orchestrator/pkg/scope.py#L466), [`extract`](../../src/orchestrator/pkg/c_extractor.py#L73)
- **Calls** (3): `language`, `tree_sitter.Language`, `tree_sitter.Parser`

### `_calls_in`

[`src/orchestrator/pkg/c_extractor.py:392`](../../src/orchestrator/pkg/c_extractor.py#L392)

- **Called by** (1): [`_calls`](../../src/orchestrator/pkg/c_extractor.py#L255)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_declarator_name`

[`src/orchestrator/pkg/c_extractor.py:418`](../../src/orchestrator/pkg/c_extractor.py#L418)

- **Called by** (7): [`_calls`](../../src/orchestrator/pkg/c_extractor.py#L255), [`_declaration`](../../src/orchestrator/pkg/c_extractor.py#L222), [`_declaration`](../../src/orchestrator/pkg/cpp_extractor.py#L247), [`_declared_names`](../../src/orchestrator/pkg/c_extractor.py#L432), [`_function`](../../src/orchestrator/pkg/c_extractor.py#L193), [`_function_def`](../../src/orchestrator/pkg/cpp_extractor.py#L214), [`_member_function`](../../src/orchestrator/pkg/cpp_extractor.py#L193)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_declared_names`

[`src/orchestrator/pkg/c_extractor.py:432`](../../src/orchestrator/pkg/c_extractor.py#L432)

- **Called by** (2): [`_emit_type`](../../src/orchestrator/pkg/c_extractor.py#L156), [`_emit_type`](../../src/orchestrator/pkg/cpp_extractor.py#L148)
- **Calls** (2): [`_declarator_name`](../../src/orchestrator/pkg/c_extractor.py#L418), [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_field_text`

[`src/orchestrator/pkg/c_extractor.py:486`](../../src/orchestrator/pkg/c_extractor.py#L486)

- **Called by** (8): [`_declaration`](../../src/orchestrator/pkg/c_extractor.py#L222), [`_declaration`](../../src/orchestrator/pkg/cpp_extractor.py#L247), [`_emit_type`](../../src/orchestrator/pkg/c_extractor.py#L156), [`_emit_type`](../../src/orchestrator/pkg/cpp_extractor.py#L148), [`_member_type_name`](../../src/orchestrator/pkg/c_extractor.py#L445), [`_top_level`](../../src/orchestrator/pkg/c_extractor.py#L95), [`_typedef`](../../src/orchestrator/pkg/c_extractor.py#L148), [`_walk`](../../src/orchestrator/pkg/cpp_extractor.py#L88)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_function_declarator`

[`src/orchestrator/pkg/c_extractor.py:406`](../../src/orchestrator/pkg/c_extractor.py#L406)

- **Called by** (7): [`_calls`](../../src/orchestrator/pkg/c_extractor.py#L255), [`_declaration`](../../src/orchestrator/pkg/c_extractor.py#L222), [`_declaration`](../../src/orchestrator/pkg/cpp_extractor.py#L247), [`_emit_type`](../../src/orchestrator/pkg/cpp_extractor.py#L148), [`_function`](../../src/orchestrator/pkg/c_extractor.py#L193), [`_function_def`](../../src/orchestrator/pkg/cpp_extractor.py#L214), [`_member_function`](../../src/orchestrator/pkg/cpp_extractor.py#L193)

### `_has_body`

[`src/orchestrator/pkg/c_extractor.py:465`](../../src/orchestrator/pkg/c_extractor.py#L465)

- **Called by** (5): [`_declaration`](../../src/orchestrator/pkg/c_extractor.py#L222), [`_declaration`](../../src/orchestrator/pkg/cpp_extractor.py#L247), [`_emit_type`](../../src/orchestrator/pkg/cpp_extractor.py#L148), [`_top_level`](../../src/orchestrator/pkg/c_extractor.py#L95), [`_walk`](../../src/orchestrator/pkg/cpp_extractor.py#L88)

### `_has_storage`

[`src/orchestrator/pkg/c_extractor.py:473`](../../src/orchestrator/pkg/c_extractor.py#L473)

- **Called by** (2): [`_declaration`](../../src/orchestrator/pkg/c_extractor.py#L222), [`_is_static`](../../src/orchestrator/pkg/c_extractor.py#L469)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_header_index`

[`src/orchestrator/pkg/c_extractor.py:325`](../../src/orchestrator/pkg/c_extractor.py#L325)

- **Called by** (1): [`_resolve_include`](../../src/orchestrator/pkg/c_extractor.py#L300)

### `_identifiers_in`

[`src/orchestrator/pkg/c_extractor.py:345`](../../src/orchestrator/pkg/c_extractor.py#L345)

- **Called by** (1): [`_bound_names`](../../src/orchestrator/pkg/c_extractor.py#L361)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_is_static`

[`src/orchestrator/pkg/c_extractor.py:469`](../../src/orchestrator/pkg/c_extractor.py#L469)

- **Called by** (2): [`_declaration`](../../src/orchestrator/pkg/c_extractor.py#L222), [`_function`](../../src/orchestrator/pkg/c_extractor.py#L193)
- **Calls** (1): [`_has_storage`](../../src/orchestrator/pkg/c_extractor.py#L473)

### `_iter_top_level`

[`src/orchestrator/pkg/c_extractor.py:288`](../../src/orchestrator/pkg/c_extractor.py#L288)

- **Called by** (2): [`_iter_top_level`](../../src/orchestrator/pkg/c_extractor.py#L288), [`extract`](../../src/orchestrator/pkg/c_extractor.py#L73)
- **Calls** (1): [`_iter_top_level`](../../src/orchestrator/pkg/c_extractor.py#L288)

### `_last_type_identifier`

[`src/orchestrator/pkg/c_extractor.py:459`](../../src/orchestrator/pkg/c_extractor.py#L459)

- **Called by** (1): [`_typedef`](../../src/orchestrator/pkg/c_extractor.py#L148)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_member_type_name`

[`src/orchestrator/pkg/c_extractor.py:445`](../../src/orchestrator/pkg/c_extractor.py#L445)

- **Called by** (2): [`_emit_type`](../../src/orchestrator/pkg/c_extractor.py#L156), [`_emit_type`](../../src/orchestrator/pkg/cpp_extractor.py#L148)
- **Calls** (2): [`_field_text`](../../src/orchestrator/pkg/c_extractor.py#L486), [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_resolve_include`

[`src/orchestrator/pkg/c_extractor.py:300`](../../src/orchestrator/pkg/c_extractor.py#L300)

- **Called by** (2): [`_include`](../../src/orchestrator/pkg/c_extractor.py#L120), [`_include`](../../src/orchestrator/pkg/cpp_extractor.py#L122)
- **Calls** (2): [`_header_index`](../../src/orchestrator/pkg/c_extractor.py#L325), `pathlib.Path`

### `_string_content`

[`src/orchestrator/pkg/c_extractor.py:479`](../../src/orchestrator/pkg/c_extractor.py#L479)

- **Called by** (2): [`_include`](../../src/orchestrator/pkg/c_extractor.py#L120), [`_include`](../../src/orchestrator/pkg/cpp_extractor.py#L122)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/c_extractor.py#L491)

### `_text`

[`src/orchestrator/pkg/c_extractor.py:491`](../../src/orchestrator/pkg/c_extractor.py#L491)

- **Called by** (16): [`_calls`](../../src/orchestrator/pkg/cpp_extractor.py#L287), [`_calls_in`](../../src/orchestrator/pkg/c_extractor.py#L392), [`_declarator_name`](../../src/orchestrator/pkg/c_extractor.py#L418), [`_declared_name`](../../src/orchestrator/pkg/cpp_extractor.py#L364), [`_declared_names`](../../src/orchestrator/pkg/c_extractor.py#L432), [`_field_text`](../../src/orchestrator/pkg/c_extractor.py#L486), [`_has_storage`](../../src/orchestrator/pkg/c_extractor.py#L473), [`_identifiers_in`](../../src/orchestrator/pkg/c_extractor.py#L345), [`_include`](../../src/orchestrator/pkg/c_extractor.py#L120), [`_include`](../../src/orchestrator/pkg/cpp_extractor.py#L122), [`_last_type_identifier`](../../src/orchestrator/pkg/c_extractor.py#L459), [`_member_type_name`](../../src/orchestrator/pkg/c_extractor.py#L445), [`_qualified_text`](../../src/orchestrator/pkg/cpp_extractor.py#L469), [`_resolve_callee`](../../src/orchestrator/pkg/cpp_extractor.py#L445), [`_string_content`](../../src/orchestrator/pkg/c_extractor.py#L479), [`_template_params`](../../src/orchestrator/pkg/cpp_extractor.py#L477)

## Imports

`__future__.annotations`, [`orchestrator.pkg.extractor`](../../src/orchestrator/pkg/extractor.py#L1), [`orchestrator.pkg.facts`](../../src/orchestrator/pkg/facts.py#L1), `pathlib.Path`, `tree_sitter.Language`, `tree_sitter.Node`, `tree_sitter.Parser`, `tree_sitter_c`, `typing.Any`, `typing.TYPE_CHECKING`

## Imported by

[`orchestrator.pkg.cpp_extractor`](orchestrator.pkg.cpp_extractor.md), [`orchestrator.pkg.extractor`](../../src/orchestrator/pkg/extractor.py#L1), [`orchestrator.pkg.scope`](orchestrator.pkg.scope.md), [`tests.pkg.test_c_extractor`](../../tests/pkg/test_c_extractor.py#L1)
