The C code in the tikzDevice has grown rather organically over the last few releases and lots of things have simply been dumped into it. The code should be reviewed to ensure comments are still valid, reorganized to make sure functions are laid out in a logical order and possibly improved by combining/eliminating unused or duplicated functions and replacing some common operations with Preprocessor macros.
A good target for replacement by a macro would be the operation that grabs the tikzDevice namespace:
The C code in the tikzDevice has grown rather organically over the last few releases and lots of things have simply been dumped into it. The code should be reviewed to ensure comments are still valid, reorganized to make sure functions are laid out in a logical order and possibly improved by combining/eliminating unused or duplicated functions and replacing some common operations with Preprocessor macros.
A good target for replacement by a macro would be the operation that grabs the tikzDevice namespace: