/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : SiteFile.pkg */ /* Version : 04 Juillet 2000 */ /* Site struct and functions */ /* */ /***************************************************************************************/ /*************************************************************************************** Site Recent files functions ***************************************************************************************/ fun SITE_GetRecentFiles () = PARAMS_GetLS SCSparameters "RECENT_FILES_LIST" ;; fun SITE_SetRecentFiles (val) = PARAMS_SetLS SCSparameters "RECENT_FILES_LIST" val ;; fun SITE_FitRecentFiles (list) = let PARAMS_GetI SCSparameters "RECENT_FILES_NB" -> nb in fit_list list nb ;; fun SITE_AddToRecentFiles (filename) = let SITE_GetRecentFiles -> list in ( set list = removef_from_list list @strCompare filename; SITE_SetRecentFiles SITE_FitRecentFiles filename::list ) ;; fun SITE_SearchRecentFile (filename, param) = if (_checkpack filename) == nil then nil else filename ;; fun SITE_UpdateRecentFiles () = let SITE_GetRecentFiles -> list in SITE_SetRecentFiles apply_on_list_with_return list @SITE_SearchRecentFile nil ;; fun SITE_GetScolFileContent (site) = site.SITEoptions.SITEscolFileContent;; fun SITE_GetSatelliteScolFileContent (site) = site.SITEoptions.SITEsatelliteScolFileContent;; fun SITE_GetScolName (nameS) = strcat substr nameS 0 (strlen nameS) -4 ".scol" ;; fun SITE_SaveScol (site, filename) = _storepack (SITE_ScolFileContentParamToFilename site filename) SITE_GetScolName filename; 0 ;; fun SITE_LoadScolFileContent (site) = _getpack _checkpack (SITE_GetScolName site.SITEfilename);; fun SITE_SatGetScolName (nameS, num, port) = strcatn (substr nameS 0 (strlen nameS) -4)::"_sat"::num::"_"::port::".scol"::nil;; fun SITE_GenerateSatScriptRec (serv, site) = let serv -> [num _ port] in _storepack (SITE_SatelliteScolFileContentParamToAll site (itoh atoi port)) (SITE_SatGetScolName site.SITEfilename num port); 0 ;; fun SITE_GenerateSatelliteScript (site) = SCSGUI_OpenLoadingDialogBox (_locSCS "site-GENERATINGSATELLITESCRIPT" nil); apply_on_list site.SITEservers @SITE_GenerateSatScriptRec site; SCSGUI_CloseLoadingDialogBox; 0 ;; proto MODULE_ListGetNumberOfLinks = fun [[Module r1]] I;; proto MODULE_ListReport = fun [Site [Module r1]] [S r1];; fun SITE_ReportInFile (site, filename) = SCSGUI_OpenLoadingDialogBox (_locSCS "site-REPORTING" nil); let (TREE_TreeToList site.SITEmoduleTreeRoot TREE_PRE_ORDER) -> modList in _storepack lineBuildSeparator "SCS 2 Report Site File":: (strcatn "Generated on "::(ctime time)::nil):: (strcatn "Site Name : "::(site.SITEoptions.SITEname)::nil):: (strcatn "Site File Name : "::(site.SITEfilename)::nil):: (strcatn "Site Version : "::(itoa site.SITEoptions.SITEversion)::nil):: (strcatn "Site Last Save Date : "::(site.SITEoptions.SITEdate)::nil):: "Site Description :":: (webtostr site.SITEoptions.SITEdescription):: "":: (strcatn "Total Number of Modules : "::(itoa sizelist modList)::nil):: (strcatn "Total Number of Links : "::(itoa MODULE_ListGetNumberOfLinks modList)::nil):: "":: "Module List : ":: (strcat " " lineBuildSeparator (MODULE_PrintList modList) "\n "):: (MODULE_ListReport site modList) "\n" filename; SCSGUI_CloseLoadingDialogBox; 0 ;; fun SITE_RunLocalSatellite (satellite, site) = let satellite -> [num _ port] in let _checkpack SITE_SatGetScolName site.SITEfilename num port -> pack in if pack == nil then nil else _newmachineS pack (-1) 0 ;;