Subject:
|
Re: LDrawIni API (was: LDRAWPREDIRS LDRAWPOSTDIRS - additional search paths)
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Tue, 16 Mar 2004 16:43:15 GMT
|
Viewed:
|
4055 times
|
| |
| |
In lugnet.cad.dev, Lars C. Hassing wrote:
> Here are my ideas of an API for accessing the LDrawIni settings.
<Snip ideas>
Here are a few random thoughts on those ideas...
I haven't thought about it enough to decide if I have a preference
on the format of the UnknownFlags. Either way seems ok to me.
If directories marked with <SKIP> are excluded from the search dirs,
how would I temporarily enable a <SKIP> directory? It looks like I might
be able to go into the PrivateData struct to find it. Then perhaps build
up a | delimited string from the SymbolicSearchDirs, except with the <SKIP>
tag removed from the newly enabled directory. Finally pass this string to
LDrawIniResetSearchDirs() and rerun LDrawIniComputeRealDirs() on the
modified LdrawIniS struct. So maybe the PrivateData really shouldn't
be all that private.
I mentioned this before but apparently nobody noticed. :^) How about
having LDrawIniComputeRealDirs() also substitute the value of
%USERPROFILE% or $HOME for a <HOMEDIR> tag? That way I can have a
platform independent way of pointing to part directories in my home
directory from a centralized ldraw.ini file on the network. Or a
single ldraw.ini file on a dual boot PC.
Perhaps the PrivateData should tell where the info came from: what ini
file, environment vars, or LdrawIniResetSearchDirs(). (I'm not actually
sure I need to know unless I'm planning on saving ini modifications.)
Are you planning on making a similar API for creating or modifying and
saving the ini file? I'll probably try to use the LdrawSetup program
as an LDDP style plugin, but others may want to incorporate it directly
into their programs.
I see you've included the LGEODIR. Have you given any thought to
making this extensible beyond that? We might someday like to be able
to locate some other ldraw part conversion library via the ldraw.ini
file. For example the LDRAWPOV library. Could LDrawIniGet() be
extended to handle this, or would a more generic function be better.
char *LDrawIniGetVar(const char *LdrawDir, char *VarName, int *ErrorCode);
LgeoDir = LdrawIniGetVar(NULL, "LgeoDirectory", &err);
ldrawpovDir = LdrawIniGetVar(NULL, "LdrawpovDir", &err);
Enjoy,
Don
|
|
Message has 1 Reply:
Message is in Reply To:
132 Messages in This Thread: (Inline display suppressed due to large size. Click Dots below to view.)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|