A package that transforms every C #include absolute path to a given directory to a relative path to the .c or .h file
Project description
einsteinify
A pip moudle that transforms every C #include absolute path to a given directory to a relative path to the .c or .h file
Install
You can install einsteinify with pip:
$ pip install einsteinify
Project purpose
It may happen that you have a folder with .c
and .h
files where some the #include "*.h"
are global paths to respect to the root folder. This module makes them relative paths to the root folder.
Usage
from einsteinify import einsteinify
PATH = 'path/to/root/folder'
einsteinify(PATH)
Result
Suppose that you have a directory like this:
root
├── main.h
├── other.h
├─> services
│ └── services.h
└─> utils
└── utils.h
Where initially:
main.h
#include "root/other.h"
#include "root/services/services.h"
other.h
#include "root/utils/utils.h"
utils.h
#include "root/other.h"
#include "root/services/services.h"
After running einsteinify the includes would be:
main.h
#include "./other.h"
#include "./services/services.h"
other.h
#include "./utils/utils.h"
utils.h
#include "../other.h"
#include "../services.h"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
einsteinify-1.1.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for einsteinify-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6940334bdbb4e3bec1c9fdfec885eac4b2c3759fe5e81cb2b0f119a9786d570 |
|
MD5 | 6f74b47d4ae18ff5ce7d496c6a79075b |
|
BLAKE2b-256 | 769b3a56e90bda64bd2fd4f2cb84993c9ec0ad34da1dcce4a6206fe0fe331a03 |