[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xtl, LyX and a small patch




Hi,

I'm the fellow who's trying to use xtl with LyX and I'm the main author of
LDN as well (thanks for the back link and the mention in the manual).  
That's me introduced, now on with the patch.

I ran into a very annoying documentation bug when I first started using
xtl.  A vitally important line was missing in the code samples that had me
very frustrated.  The patch fixes the code samples.

It also adds a \usepackage{pslatex} so that the pdf file uses the standard
postscript fonts and is therefore readable in xpdf.  It also looks a lot
neater in acroread and gv also.  LaTeX also gets called an extra time so
that the citations are all correctly updated.

A couple of other small fixes to makefiles (mainly adding "./" to a few
test programs).

++++

Has anyone started or in anyone planning an automem_buffer<> that would do
it's own memory management?  Resizing as needed rather than having a
separate "char buf[some_size_that_might_not_be_big_enough];".

Such a buffer would simplify the use of xtl in LyX where we'll be using
mem_buffers all the time for the gui independence work.

Additionally, I want to pass a memory buffer as a char *.  That way we can
use the same function to handle inputs from scripts and other external
applications.  It seems I should be able to externalize the
mem_buffer<raw_format> variable to get a buffer I can recreate at the
other end when it's internalized.  This however complicates the work that
script writers would have to do since they don't have the benefit of xtl.
I was thinking of just directly modifying the buf[] before passing it as a
parameter to our function-dispatcher but this is ugly and format
dependent.

Instead, I was considering making an automem_buffer<>::c_str() function
that would prepend the buffer size to the buffer and return it as a char*.
This is potentially leaky but then so is using an ordinary mem_buffer<> in
this way (passing a char* as an arguement).

Thoughts?

Allan. (ARRae)
diff -u --recursive xtl-1.3/doc/Makefile xtl-1.3a/doc/Makefile
--- xtl-1.3/doc/Makefile	Fri Mar  3 01:24:18 2000
+++ xtl-1.3a/doc/Makefile	Thu Mar  9 21:06:37 2000
@@ -36,6 +36,7 @@
 
 xtlguide.dvi: xtlguide.bbl xtlguide.tex
 	latex xtlguide.tex
+	latex xtlguide.tex
 
 arch.ps: arch.fig
 	fig2dev -L ps arch.fig arch.ps
diff -u --recursive xtl-1.3/doc/xtlguide.tex xtl-1.3a/doc/xtlguide.tex
--- xtl-1.3/doc/xtlguide.tex	Fri Mar  3 01:24:18 2000
+++ xtl-1.3a/doc/xtlguide.tex	Thu Mar  9 21:17:48 2000
@@ -23,10 +23,11 @@
 %
 % $Id: xtlguide.tex 1.5 Thu, 02 Mar 2000 15:24:18 +0000 jop $
 
-\documentclass[11t,titlepage,twocolumn,letter]{article}
+\documentclass[titlepage,twocolumn]{article}
 \usepackage{isolatin1}
 \usepackage{epsfig}
 \usepackage{fullpage}
+\usepackage{pslatex}
 
 \title{XTL -- The Externalization Template Library}
 \author{Josť Orlando Pereira\\
@@ -346,15 +347,17 @@
 {\small\begin{verbatim}
     char buf[SIZE];
     mem_buffer mb(buf, SIZE);
+    GIOP_format<mem_buffer> gfmb(mb);
     obj_output<GIOP_format<mem_buffer> >
-        stream(mb);
+        stream(gfmb);
 \end{verbatim}}
 An XDR input stream from a file is declared as:
 {\small\begin{verbatim}
     FILE* fp=fopen("stuff", "r");
     cfile_buffer fb(fp);
+    XDR_format<cfile_buffer> xffb(fb);
     obj_input<XDR_format<cfile_buffer> >
-        stream(fb);
+        stream(xffb);
 \end{verbatim}}
     A stream can then be used to externalize, or internalize, any
     data-structure, by invoking the appropriate methods.
diff -u --recursive xtl-1.3/examples/bench/xtl/Makefile xtl-1.3a/examples/bench/xtl/Makefile
--- xtl-1.3/examples/bench/xtl/Makefile	Wed Dec 29 04:37:31 1999
+++ xtl-1.3a/examples/bench/xtl/Makefile	Thu Mar  9 21:51:28 2000
@@ -12,7 +12,7 @@
 	g++ -g -o $@ -I ../../../include $<
 
 o%: %.cpp
-	g++ -m486 -O16 -o $@ -I ../../../include $<
+	g++ -O16 -o $@ -I ../../../include $<
 
 times: all
 	echo "raw" >> ../xtl.times 2>&1
@@ -20,25 +20,25 @@
 	time ./raw >> ../xtl.times 2>&1
 	time ./raw >> ../xtl.times 2>&1
 	echo "raw opt" >> ../xtl.times 2>&1
-	time oraw >> ../xtl.times 2>&1
-	time oraw >> ../xtl.times 2>&1
-	time oraw >> ../xtl.times 2>&1
+	time ./oraw >> ../xtl.times 2>&1
+	time ./oraw >> ../xtl.times 2>&1
+	time ./oraw >> ../xtl.times 2>&1
 	echo "xdr" >> ../xtl.times 2>&1
-	time xdr >> ../xtl.times 2>&1
-	time xdr >> ../xtl.times 2>&1
-	time xdr >> ../xtl.times 2>&1
+	time ./xdr >> ../xtl.times 2>&1
+	time ./xdr >> ../xtl.times 2>&1
+	time ./xdr >> ../xtl.times 2>&1
 	echo "xdr opt" >> ../xtl.times 2>&1
-	time oxdr >> ../xtl.times 2>&1
-	time oxdr >> ../xtl.times 2>&1
-	time oxdr >> ../xtl.times 2>&1
+	time ./oxdr >> ../xtl.times 2>&1
+	time ./oxdr >> ../xtl.times 2>&1
+	time ./oxdr >> ../xtl.times 2>&1
 	echo "giop" >> ../xtl.times 2>&1
-	time giop >> ../xtl.times 2>&1
-	time giop >> ../xtl.times 2>&1
-	time giop >> ../xtl.times 2>&1
+	time ./giop >> ../xtl.times 2>&1
+	time ./giop >> ../xtl.times 2>&1
+	time ./giop >> ../xtl.times 2>&1
 	echo "giop opt" >> ../xtl.times 2>&1
-	time ogiop >> ../xtl.times 2>&1
-	time ogiop >> ../xtl.times 2>&1
-	time ogiop >> ../xtl.times 2>&1
+	time ./ogiop >> ../xtl.times 2>&1
+	time ./ogiop >> ../xtl.times 2>&1
+	time ./ogiop >> ../xtl.times 2>&1
 
 dep:
 	makedepend -I ../../../include *.cpp
diff -u --recursive xtl-1.3/examples/tests/Makefile xtl-1.3a/examples/tests/Makefile
--- xtl-1.3/examples/tests/Makefile	Fri Mar  3 01:24:18 2000
+++ xtl-1.3a/examples/tests/Makefile	Thu Mar  9 21:03:07 2000
@@ -24,7 +24,7 @@
 	cat xtl.tests
 
 xtl.tests: all
-	(./raw ; oraw ; giop ; ogiop ; xdr ; oxdr) > xtl.tests 2>&1
+	(./raw ; ./oraw ; ./giop ; ./ogiop ; ./xdr ; ./oxdr) > xtl.tests 2>&1
 
 dep:
 	makedepend -I ../../include *.cpp