<commit_before>---
title: C
short-description: Discover symbols in C files with Clang
...

# C extension

The C extension can be used to parse C source files to extract comments and
symbols.

## Dependencies

The extension uses [Clang] to build and walk an AST from the source code, as
such it is necessary for the build environment to allow its compilation, and
arguments are exposed to allow specifying the C flags and / or the names of the
dependencies that C flags should be obtained from using [pkg-config].

## Commment parser

Currently, comments are expected to be formatted according to the [gtk-doc syntax].

## Arguments

This extension exposes the following arguments / configuration options:

* `--c-index`, `c_index`: Name of the root markdown file, which can be None. See
  [](the-smart-index.markdown) for more information.

* `--c-include-directories`, `c_include_directories`: List of include directories, equivalent
  to clang's `-I`
<commit_msg>Document packages needed in Debian for the C extension (#153)<commit_after>---
title: C
short-description: Discover symbols in C files with Clang
...

# C extension

The C extension can be used to parse C source files to extract comments and
symbols.

## Dependencies

The extension uses [Clang] to build and walk an AST from the source code, as
such it is necessary for the build environment to allow its compilation, and
arguments are exposed to allow specifying the C flags and / or the names of the
dependencies that C flags should be obtained from using [pkg-config].

On a Debian-based OS you will need to install `llvm` and `libclang-dev` packages.

## Commment parser

Currently, comments are expected to be formatted according to the [gtk-doc syntax].

## Arguments

This extension exposes the following arguments / configuration options:

* `--c-index`, `c_index`: Name of the root markdown file, which can be None. See
  [](the-smart-index.markdown) for more information.

* `--c-include-directories`, `c_include_directories`: List of include directories, equivalent
  to clang's `-I`

{'fraction_non_alphanumeric': 0.07472100921882581, 'fraction_numerical': 0.001455604075691412, 'mean_word_length': 4.246819338422392, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '669187', 'n_tokens_mistral': 571, 'n_tokens_neox': 536, 'n_words': 288}