<commit_before># Dynlib

Dynlib is a generalized C++ wrapper around the dl functions
from `<dlfcn.h>` to handle the loading and symbol lookup in dynamic
libraries.

### Usage

#### Loading Dynamic Libraries

	// Construct a DL handle with a string.
    dl::handle lib("library-name.so");

	// Given an already constructed DL handle, replace it with a new DL.
	dl::handle lib;
	lib.load("library-name.so");


#### Symbol Lookup

	// Get an optional<function<Signature>> to the function.
	auto func_symbol = lib.lookup<int()>("function_name");
	if (func_symbol)
	{
	  std::function<int()> f = func_symbol.get();
	  f(5);
	}
	else
	{
	  std::cout << "Symbol lookup failed.\n";
	}


#### Class Instance Creation

	class base_type
	{
	  virtual void foo() = 0;
	};

	std::shared_ptr<base_type> p = lib.create<base_type>("factory_function");
	p->foo();


<commit_msg>Added syntax highlighting to README.<commit_after># Dynlib

Dynlib is a generalized C++ wrapper around the dl functions
from `<dlfcn.h>` to handle the loading and symbol lookup in dynamic
libraries.

### Usage

#### Loading Dynamic Libraries

```cpp
	// Construct a DL handle with a string.
    dl::handle lib("library-name.so");

	// Given an already constructed DL handle, replace it with a new DL.
	dl::handle lib;
	lib.load("library-name.so");
```

#### Symbol Lookup

```cpp
	// Get an optional<function<Signature>> to the function.
	auto func_symbol = lib.lookup<int()>("function_name");
	if (func_symbol)
	{
	  std::function<int()> f = func_symbol.get();
	  f(5);
	}
	else
	{
	  std::cout << "Symbol lookup failed.\n";
	}
```

#### Class Instance Creation

```cpp
	class base_type
	{
	  virtual void foo() = 0;
	};

	std::shared_ptr<base_type> p = lib.create<base_type>("factory_function");
	p->foo();
```


{'fraction_non_alphanumeric': 0.15267605633802817, 'fraction_numerical': 0.0022535211267605635, 'mean_word_length': 3.9747899159663866, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '1706584', 'n_tokens_mistral': 623, 'n_tokens_neox': 586, 'n_words': 181}