To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 9632
9631  |  9633
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:
  Re: LDrawIni API (was: LDRAWPREDIRS LDRAWPOSTDIRS - additional search paths)
 
(...) By modifying ldraw.ini or setting an env var. Why would you want to enable a <SKIP> dir from within a program? (...) I did notice, but forgot it, sorry. %USERPROFILE% or $HOME for <HOMEDIR>, OK fine with me. (...) Yes, I actually thought of (...) (21 years ago, 16-Mar-04, to lugnet.cad.dev)

Message is in Reply To:
  LDrawIni API (was: LDRAWPREDIRS LDRAWPOSTDIRS - additional search paths)
 
Here are my ideas of an API for accessing the LDrawIni settings. The basic idea is that it should be very simple to use, there are only four functions and a data structure declaration. First you call LDrawIniGet to read and initialize all relevant (...) (21 years ago, 15-Mar-04, to lugnet.cad.dev)

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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR