<commit_before>lj-cdefdb - An auto-generated cdef database for LuaJIT
======================================================

Introduction
------------

This is intended to be used in a self-contained LuaJIT codebase to
both make it easy to define and use low-level C APIs from LuaJIT, and
to avoid the issue of incompatible redefinitions of cdefs from
multiple locations.

Prerequisites
-------------

lj-cdefdb uses [Clang](http://clang.llvm.org/) as its C parser.  This
will need to be installed.  For Debian derivatives, something like
```
# apt-get install clang-3.5 libclang-3.5-dev
```
should work fine.  Also obviously LuaJIT must be installed.

Database Generation
-------------------

The `gen-cdefdb` command is used to generate the database.  It takes
as input a C file that should include every header file whose
definitons are required in the database.  The usage of this is:
```
./gen-cdefdb file.c <cc args...><commit_msg>Fix typo<commit_after>lj-cdefdb - An auto-generated cdef database for LuaJIT
======================================================

Introduction
------------

This is intended to be used in a self-contained LuaJIT codebase to
both make it easy to define and use low-level C APIs from LuaJIT, and
to avoid the issue of incompatible redefinitions of cdefs from
multiple locations.

Prerequisites
-------------

lj-cdefdb uses [Clang](http://clang.llvm.org/) as its C parser.  This
will need to be installed.  For Debian derivatives, something like
```
# apt-get install clang-3.5 libclang-3.5-dev
```
should work fine.  Also obviously LuaJIT must be installed.

Database Generation
-------------------

The `gen-cdefdb` command is used to generate the database.  It takes
as input a C file that should include every header file whose
definitions are required in the database.  The usage of this is:
```
./gen-cdefdb file.c <cc args...>
{'fraction_non_alphanumeric': 0.1655982905982906, 'fraction_numerical': 0.004273504273504274, 'mean_word_length': 3.3761682242990654, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2291934', 'n_tokens_mistral': 541, 'n_tokens_neox': 516, 'n_words': 236}