Subj : [C] Code File Structure To : All From : Bruce Partridge Date : Sat Jul 24 2004 09:35 am From: Bruce Partridge I'm a long time programmer, but I have only been using C for the last couple of years. I'm interested in finding a document or book that explains how to split modules into files. I have done several different things, and none of them seem perfect. Global and local variables seem to be obvious, but where is the "normal" place to put hardware defines. For example, I use hardware defines that only apply if I have a certain type of temperature sensor. A different sensor uses different defines. Should these be in a global hw.h file or in the module code file. And where do you define enums that are used in several modules. For example, I have a state machine. Other modules sometimes need to know the current state. Right now I have a enum.h file to define the enums, then a main.h with the actual variables. Some modules need both, and some don't. I also have questions about reusable code, and how to optimally split up the files. Anyway, I think it would be time well spent for me to learn more about "best practises." Bruce Partridge http://www.rebreather.ca -+- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.720 / Virus Database: 476 - Release Date: 7/14/2004 --- BBBS/LiI v4.01 Flag-5 * Origin: Prism's_Point (1:261/38.1) .