#!/usr/bin/expectk -f
# TkSmb
#

#     This program is TclTk based SambA Browser made as shell for 'smbclient'
#
#     (C) Copyright 1998 Ivan Volosuk <ivan@rt.mipt.ru>
#
set   Version 0.8.8
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

puts "SambA Browser $Version for X (C) Copyright 1998 by Ivan Volosuk\n"

set font       {fixed}
set C_GROUP    {}
set C_HOST     localhost
set password   ""
set timeout    30
set BROADCAST  {}
set netbiosname anonymous
set mountparams	{}
set smbmountNew {smbmount}
set smbmountOld {smbmount}
set path	{}
set keeppw     {no}
set MountRoot	{/tmp}
set DOWNLOAD	{/tmp}
set USE_KFM      {Yes}
set USE_LAUNCHER {Yes}

## Data Structures:
##
##  NAME		TYPE		DESCRIPTION
## ------              ------          -------------
##  C_GROUP		<STRING>	Current Group
##  C_HOST		<STRING>	Current Host
##  C_SHARE		<STRING>	Name of current share
##
##  GROUPS		<LIST>		All Groups Found in Network
##  GR_$group_List	<LIST>		List of Computers in Group
##  GR_$group_Master	<STRING>	Master of Workgroup
##  H_$host_Descr	<STRING>	Description of Host
##  H_$host_Browse	<STRING>	host - if browsed as host,group -if browsed as Master, 
##						no - if not,  now - being browsed, failed - failed browse
##  H_$host_Shares	<LIST>		List of shares on host
##  H_$host_IP		<STRING>	IP address of host.
##  SH_$host_$share_Descr <STRING>	Description for share
##
##
##
##
##

set C_SHARE {}
match_max 20000
proc put param {}

catch { source ${path}tksmbrc }
catch { source $env(HOME)/.tksmbrc }

source ${path}base.tcl
source ${path}pattens.tcl
source ${path}frame.tcl
Frame
source ${path}open_share.tcl
source ${path}request.tcl
source ${path}tags.tcl
source ${path}operations.tcl
source ${path}viewhost.tcl

get_sysinfo
if {[catch custom_proc retcode] != "0" } {
	if  { $retcode != "invalid command name \"custom_proc\"" } {
	   	puts "\nTkSmb: Error in custom_proc:\n$retcode"
		} {
		puts "Default action: custom_proc not defined"
		viewhost $C_HOST $C_GROUP 1
		}
	}


