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
Built Distribution
File details
Details for the file einsteinify-1.1.1.tar.gz
.
File metadata
- Download URL: einsteinify-1.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.8.0-45-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38a5a80af7890e6fb37c9873a272a24514a6734fc326c4df14755a71f65c857d |
|
MD5 | d3f8749e54fbe0e5394a83954c51bbb6 |
|
BLAKE2b-256 | a2bdf101dd73d42e14acfb842f8d15677b4f9c0f256af85530c74535effebc8f |
File details
Details for the file einsteinify-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: einsteinify-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.8.0-45-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 540b3b4a6e2252ff77e675e6499386a773b7687374cb3d3906fcf0c67fc788d8 |
|
MD5 | 688e291e489b0a8943b33c5da203afa1 |
|
BLAKE2b-256 | ad970a6921184f5cabab27673df7e8472abf91d288b82c55554657957b1d0d75 |