IdeState.dcl 2.97 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1 2 3 4
definition module IdeState

import StdPathname
import UtilStrictLists
Diederik van Arkel's avatar
Diederik van Arkel committed
5 6
from PmAbcMagic import :: ABCCache
from PmProject import :: Project
Diederik van Arkel's avatar
Diederik van Arkel committed
7 8 9
import PmCompilerOptions
import typewin
import PmEnvironment
Diederik van Arkel's avatar
Diederik van Arkel committed
10
from PmFileInfo import :: FileInfoCache
11
from PmCleanSystem import ::CompilerProcessIds,NoCompilerProcessIds
Diederik van Arkel's avatar
Diederik van Arkel committed
12 13 14

:: *General

15 16 17 18 19 20 21 22
:: *GeneralSt = {
		ls :: !General,
		gst_world :: !*World,
		gst_continue_or_stop :: !Bool
	}

app_world_instead_of_ps f gst :== {gst & gst_world=f gst.gst_world}

Camil Staps's avatar
Camil Staps committed
23 24
acc_world_instead_of_ps f gst :== (x,{gst & gst_world=w}) where (x,w) = f gst.gst_world

25 26
instance FileSystem GeneralSt
instance FileEnv GeneralSt
Diederik van Arkel's avatar
Diederik van Arkel committed
27

28
initGeneral :: !Bool !CompilerOptions !String !String !Project ![Target] !*File -> *General
Diederik van Arkel's avatar
Diederik van Arkel committed
29 30 31 32 33 34 35 36 37 38 39 40

:: Prefs =
	{ be_verbose			:: !Bool
	, compopts				:: !CompilerOptions
	, edwintabs				:: !(Int,Bool,Bool,Bool,Bool)
	, number_of_processes	:: !Int
	}

:: ErrPrefs
:: SrcPrefs
:: NewlinePrefs

41 42 43 44 45 46 47 48 49 50 51 52
getPrefs :: !*GeneralSt -> (Prefs,*GeneralSt)
setPrefs :: Prefs !*GeneralSt -> *GeneralSt

getProject :: !*GeneralSt -> (Project,*GeneralSt)
setProject :: !Project !*GeneralSt -> *GeneralSt

getABCCache :: !*GeneralSt -> *(!*ABCCache,!*GeneralSt)
setABCCache :: !*ABCCache !*GeneralSt -> *GeneralSt

getFICache :: !*GeneralSt -> (FileInfoCache,*GeneralSt)
setFICache :: !FileInfoCache !*GeneralSt -> *GeneralSt

53 54
getProjectFilePath :: !*GeneralSt -> (!Pathname,!*GeneralSt)
setProjectFilePath :: !Pathname !*GeneralSt -> *GeneralSt
55 56 57 58

getStup :: !*GeneralSt -> (!Pathname,!*GeneralSt)

getTargets :: !*GeneralSt -> (![Target],!*GeneralSt)
John van Groningen's avatar
John van Groningen committed
59
setTargets :: ![Target] !*GeneralSt -> *GeneralSt
60
getCurrentTarget :: !*GeneralSt -> (!Int,!*GeneralSt)
John van Groningen's avatar
John van Groningen committed
61
setCurrentTarget :: !Int !*GeneralSt -> *GeneralSt
62 63 64 65 66 67
getCurrentPaths :: !*GeneralSt -> (!(List Pathname),!*GeneralSt)
getCurrentDlibs :: !*GeneralSt -> (!(List String),!*GeneralSt)
getCurrentSlibs :: !*GeneralSt -> (!(List String),!*GeneralSt)
getCurrentObjts :: !*GeneralSt -> (!(List String),!*GeneralSt)
getCurrentComp :: !*GeneralSt -> (!String,!*GeneralSt)
getCurrentCgen :: !*GeneralSt -> (!String,!*GeneralSt)
68 69 70
getCurrentAbcOpt :: !*GeneralSt -> (!String,!*GeneralSt)
getCurrentBCgen :: !*GeneralSt -> (!String,!*GeneralSt)
getCurrentBClink :: !*GeneralSt -> (!String,!*GeneralSt)
71
getCurrentBCstrip :: !*GeneralSt -> (!String,!*GeneralSt)
72 73 74 75 76 77 78 79 80
getCurrentLink :: !*GeneralSt -> (!String,!*GeneralSt)
getCurrentDynl :: !*GeneralSt -> (!String,!*GeneralSt)
getCurrentVers :: !*GeneralSt -> (!Int,!*GeneralSt)
getCurrent64BitProcessor :: !*GeneralSt -> (!Bool,!*GeneralSt)
getCurrentProc :: !*GeneralSt -> (!Processor,!*GeneralSt)
getCurrentMeth :: !*GeneralSt -> (!CompileMethod,!*GeneralSt)

getCompilerProcessIds :: !*GeneralSt -> (!CompilerProcessIds,!*GeneralSt)
setCompilerProcessIds :: !CompilerProcessIds !*GeneralSt -> *GeneralSt
81

82 83
//-- boolean that indicates if user interaction is allowed

84
getInteract  :: !*GeneralSt -> (!Bool,!*GeneralSt)
85 86 87

//-- log functions for batch build

88 89
writeLog :: !String !*GeneralSt -> *GeneralSt
abortLog :: !Bool !String !*GeneralSt -> *GeneralSt