aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--config/var-def.mk1
-rw-r--r--src/ChangeLog11
-rw-r--r--src/driver/utils.c1
-rw-r--r--src/include/open-axiom.h4
-rw-r--r--src/lib/cfuns-c.c2
-rw-r--r--src/share/Makefile.in12
-rw-r--r--src/share/tex/open-axiom.sty76
8 files changed, 106 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 06bb9f4a..7389e197 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * config/var-def.mk (axiom_src_texdir): New.
+
2009-10-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
* configure.ac.pamphlet: Look for SBCL before GCL; look for ECL too.
diff --git a/config/var-def.mk b/config/var-def.mk
index 542b0bc2..a4dc07e8 100644
--- a/config/var-def.mk
+++ b/config/var-def.mk
@@ -149,6 +149,7 @@ axiom_src_srcdir = $(top_srcdir)/src
axiom_src_docdir = $(axiom_src_srcdir)/doc
axiom_src_datadir = $(axiom_src_srcdir)/share
axiom_src_algdir = $(axiom_src_srcdir)/algebra
+axiom_src_texdir = $(axiom_src_datadir)/tex
## Where tools for the build machine are built
# Tools that we occasionally build don't know
diff --git a/src/ChangeLog b/src/ChangeLog
index 636a99ba..fa5d4e20 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,16 @@
2009-10-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * share/tex/open-axiom.sty: New.
+ * share/Makefile.in (FILES): Update.
+ ($(axiom_target_texdir)/open-axiom.sty): New rule.
+ * lib/cfuns-c.c (oa_spawn)[__WIN32__]: Return exit status if in
+ overlay mode.
+ * include/open-axiom.h (OPENAXIOM_TEXINPUTS_PATH): Tidy.
+ (OPENAXIOM_BIBINPUTS_PATH): Likewise.
+ * driver/utils.c (print_usage): Document --execute option.
+
+2009-10-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* lib/cfuns-c.c (oa_concatenate_string): Define.
* include/open-axiom.h (openaxiom_ifs): New.
(OPENAXIOM_TEXINPUTS_PATH): Likewise.
diff --git a/src/driver/utils.c b/src/driver/utils.c
index b3ba56e9..d0d4ca86 100644
--- a/src/driver/utils.c
+++ b/src/driver/utils.c
@@ -200,6 +200,7 @@ static void print_usage(void) {
print_line(" --hyperdoc Start the HyperDoc component. This option is meaningful");
print_line(" only if OpenAxiom was built with graphics support.");
print_line(" --no-hyperdoc Do not start the HyperDoc component.");
+ print_line(" --execute cmd args execute `cmd' with arguments `args'");
print_line("");
print_line("Compiler options:");
diff --git a/src/include/open-axiom.h b/src/include/open-axiom.h
index 67f378d7..fd0e7326 100644
--- a/src/include/open-axiom.h
+++ b/src/include/open-axiom.h
@@ -110,8 +110,8 @@ typedef enum openaxiom_spawn_flags {
/* Paths to LaTeX input support file directories.
These paths are relative to system directory. */
-#define OPENAXIOM_TEXINPUTS_PATH "/share/tex"
-#define OPENAXIOM_BIBINPUTS_PATH "/share/tex"
+#define OPENAXIOM_TEXINPUTS_PATH "/share/texmf/tex"
+#define OPENAXIOM_BIBINPUTS_PATH "/share/texmf/tex"
/* The function sleep() is not available under Windows. Instead, they
have Sleep(); with capital S, please. Furthermore, it does not
diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c
index 42dce2ed..e8f2562b 100644
--- a/src/lib/cfuns-c.c
+++ b/src/lib/cfuns-c.c
@@ -792,7 +792,7 @@ oa_spawn(openaxiom_process* proc, openaxiom_spawn_flags flags)
GetExitCodeProcess(proc_info.hProcess, &status);
CloseHandle(proc_info.hThread);
CloseHandle(proc_info.hProcess);
- return 0;
+ return status;
#else
proc->id = 0;
diff --git a/src/share/Makefile.in b/src/share/Makefile.in
index 6939be5b..f4813bad 100644
--- a/src/share/Makefile.in
+++ b/src/share/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2008, Gabriel Dos Reis.
+# Copyright (C) 2007-2009, Gabriel Dos Reis.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,10 @@
subdir = src/share/
-FILES=$(axiom_target_libdir)/command.list
+FILES = \
+ $(axiom_target_libdir)/command.list \
+ $(axiom_target_texdir)/open-axiom.sty
+
.SUFFIXES:
.PHONY: all all-share
@@ -54,3 +57,8 @@ distclean-local: clean-local
$(axiom_target_libdir)/command.list: $(srcdir)/algebra/command.list
cp -p $< $@
+
+$(axiom_target_texdir)/open-axiom.sty: $(axiom_src_texdir)/open-axiom.sty
+ $(mkdir_p) "$(axiom_target_texdir)"
+ cp -p $< $@
+
diff --git a/src/share/tex/open-axiom.sty b/src/share/tex/open-axiom.sty
new file mode 100644
index 00000000..13ca2c0d
--- /dev/null
+++ b/src/share/tex/open-axiom.sty
@@ -0,0 +1,76 @@
+%% Copyright (C) 2009, Gabriel Dos Reis
+%% All rights reserved.
+%% Redistribution and use in source and binary forms, with or without
+%% modification, are permitted provided that the following conditions are
+%% met:
+%%
+%% - Redistributions of source code must retain the above copyright
+%% notice, this list of conditions and the following disclaimer.
+%%
+%% - Redistributions in binary form must reproduce the above copyright
+%% notice, this list of conditions and the following disclaimer in
+%% the documentation and/or other materials provided with the
+%% distribution.
+%%
+%% - Neither the name of The Numerical Algorithms Group Ltd. nor the
+%% names of its contributors may be used to endorse or promote products
+%% derived from this software without specific prior written permission.
+%%
+%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+%% IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+%% TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+%% PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+%% OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+%% EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+%% PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+%% PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+%% LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+%% NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+%% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{open-axiom}[2009/10/11 OpenAxiom LaTeX package]
+
+%% We build on top of the listings package
+\RequirePackage{listings}
+
+
+%% The base Spad language
+\lstdefinelanguage{Spad}{%
+ keywords={add,and,break,case,else,false,for,has,if,import,%
+ in,is,isnt,iterate,macro,mod,or,pretend,%
+ quot,rem,rule,repeat,return,then,true,with,where,while},%
+ otherkeywords={->,<,<=,>,>=,=,==,~=,=>,\#,::,\@,\$,|},%
+ alsoletter={\%},%
+ comment=[l]{++},%
+ morecomment=[l]{--},%
+ morestring=[b]",%
+ sensitive=true
+}
+
+%% OpenAxiom's Spad
+\lstdefinelanguage[OpenAxiom]{Spad}[]{Spad}{%
+ morecomment=[l][\itshape\bfseries]{++}
+}
+
+\lstdefinestyle{spad}{%
+ language=[OpenAxiom]spad,%
+ basicstyle=\renewcommand{\ttdefault}{txtt}\footnotesize\ttfamily,%
+ columns=flexible,%
+ showstringspaces=false
+}
+
+%% Inline Spad code
+%% FIXME: This definition prohibits '!' as valid identifier
+%% in inline Spad code. That is unfortunate.
+\newcommand{\OpenAxiomCode}[1]{\lstinline[style=Spad]!#1!}
+
+%% The main inout environment
+\lstnewenvironment{OpenAxiomInput}{\lstset{style=spad}}{}
+
+%% Include a whole Spad file
+\newcommand{\OpenAxiomFile}[1]{\lstinputlisting[style=Spad]{#1}}
+
+%% Some legacy commands
+\newcommand{\spad}[1]{\ensuremath{\mathtt{#1}}}