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.0.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for einsteinify-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1650f8febfb6797f130725a5aa6b9e869f8894ef2fc29e8dceee4ce8e65e813 |
|
MD5 | 32357dfadc743bbb955170823371c91d |
|
BLAKE2b-256 | d405c1feb8ddb36d58a8a26e32734cacdaeff882225a9b726e4af721316eaaea |