[liblouis-liblouisxml] Automatic finding of Tables in liblouis

  • From: "John J. Boyer" <johnjboyer@xxxxxxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Sun, 15 Feb 2009 20:43:25 -0600

New versions of compileTranslationTable.c 
 and liblouis.h are now in commit. H have verified that liblouis can now 
find tables automatically in Linux, table lists work, and all error 
messages print correctly. Specifying a path through an exvironment 
variable also works. To facilitate use on Windows, I have moved the 
getProgramPath function from paths.c in liblouisxml to 
compileTranslationTables.c and made it exportable as lou_getProgramPath. 
paths.c now calls this function, and it is available to Windows 
programs.

Unfortunately, it was not possible to keep the new getFullPath function 
in compileTranslationTables.c . I did mine it for information, and I 
have kept a copy. The reason is that automatic pathfinding has to be 
more tightly integrated with the existing facilities of the compiler. 
What was lou_getTable is now just plain getTable. It continues to keep 
track of which tables have been compiled and to compile new ones. 
However, it cannot recognize when a path has been prepended to a table 
list, either the installed poath or from an environment variable. That 
function is carried out by the new lou_getTable. It first checks to see 
if the environment variable LOUIS_TABLEPATH has been set. If so it 
prepends the path in this variable to the table list it has received and 
sees if getTable recognizes or compiles it. If so a non-null value for 
the table is returned. If the returned pointer is NULL it then tries the 
string that has been passed to it with no decoration. getTable handles 
absolute paths and paths relative to the current directory on its own. 
If the returned pointer is NULL this means that maybe the table list is 
in the installed path, so that is tried next. If the pointer is still 
NULL an error message is printed. Finally, the table pointer, NULL or 
otherwise is returned.

For Windows, lou_getProgramPath is called, \usr\share\liglouis\tables\ 
is appended to the returned value and the whole thing prepended to the 
passed string. This is for finding the installed path. The environment 
variable and direct paths work as for Unix. 

I hope Michel will make a new Windows binary soon. I'm still struggling 
with my setup. One oddity is that the install utility always r
refuses to run, with the error message "Permission denied." This happens 
even if I just type "install". All the necessary packages seem to be 
self-extracting exe's. I'm trying to make up a list.

Have fun,
John

-- 
My websites:
http://www.godtouches.org
http://www.jjb-software.com
Location: Madison, WI, USA

For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts:

  • » [liblouis-liblouisxml] Automatic finding of Tables in liblouis - John J. Boyer