Skip to main content

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)

Uploaded Source

Built Distribution

einsteinify-1.1.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page