Helloyunho / gen5w-utils

Useful utilities for Hyundai/KIA/Genesis Gen5W navigation firmwares. Join the Discord server here: https://discord.gg/KpwrAeHmQJ
Apache License 2.0
26 stars 9 forks source link

Add script to convert char[] to explicit char assignments, add file enumeration in /etc #2

Closed allyorbase closed 1 year ago

allyorbase commented 1 year ago

This PR adds a new Python script, textify.py, that effortlessly breathes a bit of life into your C source files. By charmingly transforming char[] definitions into explicit character assignments, it brings a touch of elegance and specificity to your code.

Usage is as simple as adding a //@textify decorator above your char[] definitions:

//@textify
char filename[] = "some filename";

Once the decorator is in place, all you need to do is run python3 texitfy.py. The script will take hook.c as its dance partner, and when the music stops, out-hook.c will be left standing with the transformed code, ready to compile.

Let's have some fun with this and see where the rhythm takes us. Do give it a whirl, and if the mood strikes.