------------------------------------------------------------------ -- | -- Module : IdlGLobal -- Copyright : (c) Dmitry Golubovsky, 2009 -- License : BSD-style -- -- Maintainer : golubovsky@gmail.com -- Stability : experimental -- Portability : portable -- -- -- -- Global definitions for IDL conversion programs. ------------------------------------------------------------------ module IdlGlobal where import qualified Data.Map as M import System.FilePath -- Global environment for idlconv (result of command line parsing). data ICGlobal = ICGlobal { cppopt :: [String] -- remaining cpphs options ,runcpp :: Bool -- True if cpphs is to be run ,ppronly :: Bool -- only pretty-print, do not produce Haskell ,infiles :: [FilePath] -- input file(s), multiple files concatenated ,incldirs :: [FilePath] -- include directories (only when using cpphs) ,outfile :: FilePath -- output (unsplit) file ,runmode :: ICMode -- mode of operation ,timestamp :: Integer -- unique timestamp for derived class module names ,tagspec :: M.Map String String -- correspondence between HTML tags and IDL interfaces -- Options after this line are passed to the slave process. ,compconst :: Bool -- compute constants if True (default is runcpp value) ,domns :: String -- DOM default namespace (see section 3.2 of WebIDL spec) ,modules :: [String] -- produce Haskell code only for these modules ,verbose :: Bool -- verbose operation } deriving (Show) -- Master/slave mode data ICMode = ICMaster -- master mode (run by user shell) | ICSlavePP -- slave mode pretty-print only | ICSlaveCV -- slave mode full conversion deriving (Eq, Show) -- Initial set of idlconv options. icopt = ICGlobal { cppopt = [] ,runcpp = True ,ppronly = False ,infiles = [] ,incldirs = [] ,outfile = "-" ,compconst = True ,domns = "Foreign.WebIDL" ,modules = [] ,verbose = False ,runmode = ICMaster ,timestamp = 0 ,tagspec = M.empty }