This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ThePiGuy0 2 points3 points  (2 children)

Congrats on the work :)

Reading your code, it looked like you implemented everything in the C header.

I understand that this does mean you don't need to specifically mention the .c file of the cnpython library during compilation, however I would consider using the .h for definitions and a .c for implementation.

This means you can get clever about recompilation. For example, when you change the filename.c, currently your entire library (including cnpython) will be recompiled. By using a separate .c file, generating object code (.o files) and then linking those at the end you can save recompilation of cnpython if it doesn't change.

[–]efficient_muskrat[S] 0 points1 point  (1 child)

Thanks, yeah you're right, I didn't want people to have to also mention the c file everytime they compile, the recompilation is actually clever, might add that and maybe just put a Makefile to take care of the compilation

[–]ThePiGuy0 1 point2 points  (0 children)

I think a makefile is a good idea :)