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 (global module)
$ einsteinify path/to/root/folder
Usage (local module)
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.1.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for einsteinify-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 540b3b4a6e2252ff77e675e6499386a773b7687374cb3d3906fcf0c67fc788d8 |
|
MD5 | 688e291e489b0a8943b33c5da203afa1 |
|
BLAKE2b-256 | ad970a6921184f5cabab27673df7e8472abf91d288b82c55554657957b1d0d75 |