necessity being the mother of invention... I came up with a hack once that
just might help you if it seem appropriate.
I did something like this by setting up a series of configuration overloads.
Something similar to the following psudocode:
load_config ("/etc/config/system_defs.ini"); // system wide defaults
load_config ("/etc/config/machine.ini"); // machine specific overload
load_config ("~/.machine.ini"); // user specific settings
with:
int load_config (char *fname) {
if (file_exists(fname)) {
...
Another idea to look at is to set up a variable in the .ini file like:
MACHINE_CONFIGS=/etc/config/system_defs.ini;/etc/config/machine.ini;...
and the initialization then grabs the MACHINE_CONFIGS var and then parses the
chain. The only problem I see with this idea is that var's might not
overload/chain properly. I just do not know that part of the code base to
make more specific suggestions.
Anyway, that is just an idea of something that worked for me in the past...
EBo --
Sebastian Kuzminsky <[email protected]> said:
> Stephen Wille Padnos wrote:
> > Sebastian Kuzminsky wrote:
> >> But i'd be happy to change it if this is not the proper way to do sample
> >> configs.
> >>
> > I think it might be better to have the comments be instructive, rather
> > than anecdotal. Something like "This axis shows how to sset up 'home to
> > index'", rather than "my machine is like this".
>
> You are right of course. Here's the updated patch:
>
>
<http://git.linuxcnc.org/gitweb?p=emc2.git;a=commitdiff;h=82040654265cdeab3afec91d329469b4132d7b41;hp=ef35c86acf71b1e5897e456d214a38e538cbd108>
>
>
> I wish there was a way to #include one .ini from another, all the hm2
> .ini files differ in only a few lines...
>
>
> --
> Sebastian Kuzminsky
> the sky calls to us -- carl sagan
> <http://www.youtube.com/watch?v=zSgiXGELjbc>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
--
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers