;;; .cdsinit file for Cppsim 

printf("...Reading Cppsim .cdsinit file '%s/.cdsinit' ...\n" getWorkingDir())

CPPSIMSHAREDHOME = getShellEnvVar("CPPSIMSHAREDHOME")
if( CPPSIMSHAREDHOME == nil then
   printf("Error:  UNIX environment variable CPPSIMSHAREDHOME is not defined\n")
)

let( (bindKeyFileList file path saveSkillPath)
     bindKeyFileList = '(
			 "leBindKeys.il" 
			 "schBindKeys.il"
			 )
     path = strcat(
		   ".   ~   "
		   prependInstallPath("local ")
		   prependInstallPath("samples/local")
		   )
     saveSkillPath=getSkillPath()
     setSkillPath(path)
 
     foreach(file bindKeyFileList
		  if(isFile(file) then
			   loadi(file)
			   )
		  )
     (let ((skillPath
         (list
          strcat(CPPSIMSHAREDHOME "/Skill")
         )))
      (setSkillPath (append (getSkillPath) skillPath)))
    )

printf("    -> Installing Cppsim GUI menu item under Schematic Options menu\n")
loadi("runCppSimForm.il")

;;; Open the Library Browser

printf("    -> Opening Library Manager\n")
dmbOpenLibBrowser()
printf("...Done.\n")

;;;; CppSim menu setup that does not require menus directory to be placed in user's home directory:

;; load strcat( getShellEnvVar( "CPPSIMSHAREDHOME" ) "/Skill/runCppSimForm.il" )
;; procedure( cppSimAddMenu( args )
;;     let( ( ( win args->window ) item1 menu )
;;         item1 = hiCreateMenuItem(
;;             ?name 'item1
;;             ?itemText "CppSim/VppSim Run Window"
;;             ?callback "runCppSimForm()"
;;         )
;;         menu = hiCreatePulldownMenu( 'cppSimMenu "CppSim" list( item1 ) )
;;         hiInsertBannerMenu( win menu length( hiGetBannerMenus( win ) ) )
;;     )
;; )
;; unless( member( 'cppSimAddMenu deGetAppInfo("schematic")->userMenuTrigList )
;;     deRegUserTriggers( "schematic" nil nil 'cppSimAddMenu )
;; )








