Skip to content

Commit

Permalink
Added IsLIBGAP constant
Browse files Browse the repository at this point in the history
This constant can be set to true in the initialize_libgap function (future work)
to stop GAP from starting an interactive session
  • Loading branch information
sebasguts authored and fingolfin committed Jun 12, 2018
1 parent 2288016 commit d05bbd2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/init.g
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,17 @@ BindGlobal ("ShowSystemInformation", function ()
ShowPackageInformation();
end );


#############################################################################
##
## Initialize the IsLIBGAP variable (if not done before). If this variable
## is false, an interactive session will be started.
## Otherwise no interactive session is started.
##
if not IsBound( IsLIBGAP ) then
BIND_CONSTANT( "IsLIBGAP", false );
fi;

#############################################################################
##
## Finally, deal with the lists of global variables.
Expand Down Expand Up @@ -1016,7 +1027,9 @@ InstallAndCallPostRestore( function()
od;
end );

if IsHPCGAP and THREAD_UI() then
if IsLIBGAP then
# GAP is used as a library, do not start an interactive session
elif IsHPCGAP and THREAD_UI() then
ReadLib("hpc/consoleui.g");
MULTI_SESSION();
else
Expand Down
12 changes: 12 additions & 0 deletions tst/testinstall/IsLIBGAP.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#############################################################################
##
#W IsLIBGAP.tst GAP library Sebastian Gutsche
##
##
#Y Copyright (C) 2018, GAP Group
##
gap> START_TEST("IsLIBGAP.tst");
gap> IsBound( IsLIBGAP );
true
gap> STOP_TEST( "IsLIBGAP.tst", 1);

0 comments on commit d05bbd2

Please sign in to comment.