diff options
author | dos-reis <gdr@axiomatics.org> | 2008-08-09 16:06:56 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-08-09 16:06:56 +0000 |
commit | f176a2f516055a0a211e6dd1d05c836dd913692e (patch) | |
tree | 5ee92c2a205aee7d66f59b5ca3e3a323dfeeca7b | |
parent | 818b1dfea785e615317b6bf2e1a8e44352d9088c (diff) | |
download | open-axiom-f176a2f516055a0a211e6dd1d05c836dd913692e.tar.gz |
* include/open-axiom.h (OPENAXIOM_HAVE_GRAPHICS): Define.
* sman/sman.c (process_arguments): Use it.
(process_arguments): Likewise.
-rw-r--r-- | src/ChangeLog | 10 | ||||
-rw-r--r-- | src/include/open-axiom.h | 7 | ||||
-rw-r--r-- | src/interp/pf2sex.boot | 46 | ||||
-rw-r--r-- | src/sman/sman.c | 6 |
4 files changed, 64 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dd89775b..54c3a9a8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ -2008-08-09 Alfredo Portes <doyenatccny@gmail.com> - Gabriel Dos Reis <gdr@cs.tamu.edu> +2008-08-09 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * include/open-axiom.h (OPENAXIOM_HAVE_GRAPHICS): Define. + * sman/sman.c (process_arguments): Use it. + (process_arguments): Likewise. + +2008-08-09 Alfredo Portes <doyenatccny@gmail.com> + Gabriel Dos Reis <gdr@cs.tamu.edu> * sman/sman.c: Do not start hyperdoc/graphics if OpenAxiom was build without X support. diff --git a/src/include/open-axiom.h b/src/include/open-axiom.h index b34733bd..378e1802 100644 --- a/src/include/open-axiom.h +++ b/src/include/open-axiom.h @@ -63,4 +63,11 @@ typedef HANDLE openaxiom_handle; typedef void* openaxiom_handle; #endif +/* Do we have graphics support? */ +#ifdef X_DISPLAY_MISSING +# define OPENAXIOM_HAVE_GRAPHICS 0 +#else +# define OPENAXIOM_HAVE_GRAPHICS 1 +#endif + #endif /* OPENAXIOM_included */ diff --git a/src/interp/pf2sex.boot b/src/interp/pf2sex.boot index 936f93ed..77c04c83 100644 --- a/src/interp/pf2sex.boot +++ b/src/interp/pf2sex.boot @@ -157,6 +157,15 @@ pf2Sex1 pf == #args = 1 => ["where", pf2Sex1 pfWhereExpr pf, :args] ["where", pf2Sex1 pfWhereExpr pf, ["SEQ", :args]] + pfWith? pf => pfWith2Sex pf + pfAdd? pf => pfAdd2Sex pf + pfWDeclare? pf => pfWDeclare2Sex pf + pfAttribute? pf => pfAttribute2Sex pf + pfWIf? pf => pfWIf2Sex pf + pfExport? pf => pfExport2Sex pf + pfImport? pf => pfImport2Sex pf + pfInline? pf => pfInline2Sex pf + pfQualType? pf => pfQualType2Sex pf -- under strange circumstances/piling, system commands can wind -- up in expressions. This just passes it through as a string for @@ -483,3 +492,40 @@ pfMacro2Sex pf == pfMLambda2Sex pf == ["%MLambda", [pf2Sex1 a for a in pf0MLambdaArgs pf], pf2Sex1 pfMLambdaBody pf] + + +pfType2SexOrNil pf == + pfNohting? pf => nil + pf2Sex1 pf + +pfWith2Sex pf == + ["%With", pf2Sex1 pfWithBase, pf2Sex1 pfWithWithin pf, + pf2Sex1 pf2Sex1 pfWithWithon pf] + +pfAdd2Sex pf == + ["%Add", pf2Sex1 pfAddBase pf, pf2Sex1 pfAddAddin pf, + pfType2SexOrNil pfAddAddon pf] + +pfWDeclare2Sex pf == + ["%Declare", pf2Sex1 pfWDeclareSignature pf, pf2Sex1 pfWDeclareDoc pf] + +pfAttribute2Sex pf == + ["%Attribute", pf2Sex1 pfAttributeExpr pf] + +pfWIf2Sex pf == + ["%ConditionalExport", pf2Sex1 pfWIfCond pf, + pf2Sex1 pfWIfThen pf, pf2Sex1 pfWIfElse pf] + +pfExport2Sex pf == + ["%Export", :[pf2Sex1 item for item in pf0ExportItems pf]] + +pfImport2Sex pf == + ["%Import", :[pf2Sex1 item for item in pf0ImportItems pf]] + +pfInline2Sex pf == + ["%Inline", :[pf2Sex1 item for item in pfInlineItems pf]] + +pfQualType2Sex pf == + ["%QualType", pf2Sex1 pfQyalTypeType pf, + pfType2SexOrNil pfQualTypeQual pf] + diff --git a/src/sman/sman.c b/src/sman/sman.c index ed44bd36..a92980b8 100644 --- a/src/sman/sman.c +++ b/src/sman/sman.c @@ -159,7 +159,7 @@ process_arguments(openaxiom_command* command, int argc,char ** argv) else if (strcmp(argv[arg], "-clef") == 0) start_clef = 1; else if (strcmp(argv[arg], "-gr") == 0) { - if (X_DISPLAY_MISSING) + if (!OPENAXIOM_HAVE_GRAPHICS) fprintf(stderr, "OpenAxiom was not build with Graphics support.\n"); else start_graphics = 1; @@ -167,7 +167,7 @@ process_arguments(openaxiom_command* command, int argc,char ** argv) else if (strcmp(argv[arg], "-nogr") == 0) start_graphics = 0; else if (strcmp(argv[arg], "-ht") == 0) { - if (X_DISPLAY_MISSING) + if (!OPENAXIOM_HAVE_GRAPHICS) fprintf(stderr, "OpenAxiom was not build with HyperDoc support.\n"); else start_ht = 1; @@ -220,7 +220,7 @@ process_arguments(openaxiom_command* command, int argc,char ** argv) * graphical components of * OpenAxiom (Hyperdoc, Graphics). */ - if (X_DISPLAY_MISSING) { + if (!OPENAXIOM_HAVE_GRAPHICS) { use_X = 0; start_local_spadclient = 1; start_ht = 0; |