func (c *Client) SetWorkgroup(wg string) {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	C.smbc_setWorkgroup(c.ctx, C.CString(wg))
}
SetWorkgroup sets the work group to use for the session.
package libsmbclient
import (
	"fmt"
	"io"
	"sync"
	"unsafe"
)
import "C"
type SmbcType int
const (
	SmbcWorkgroup SmbcType = C.SMBC_WORKGROUP
	SmbcFileShare = C.SMBC_FILE_SHARE
	SmbcPrinterShare = C.SMBC_PRINTER_SHARE
	SmbcCommsShare = C.SMBC_COMMS_SHARE
	SmbcIPCShare = C.SMBC_IPC_SHARE
	SmbcDir = C.SMBC_DIR
	SmbcFile = C.SMBC_FILE
	SmbcLink = C.SMBC_LINK
)
var smbMu = sync.Mutex{}
type Client struct {
	ctx          *C.SMBCCTX
	authCallback *AuthCallback
	smbMu *sync.Mutex
}
type Dirent struct {
	Type    SmbcType
	Comment string
	Name    string
}
type File struct {
	client   *Client
	smbcfile *C.SMBCFILE
}
func New() *Client {
	smbMu.Lock()
	defer smbMu.Unlock()
	c := &Client{
		ctx:   C.smbc_new_context(),
		smbMu: &smbMu,
	}
	C.smbc_init_context(c.ctx)
	return c
}
func (c *Client) Destroy() error {
	return c.Close()
}
func (c *Client) Close() error {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	var err error
	if c.ctx != nil {
		_, err = C.smbc_free_context(c.ctx, C.int(1))
		c.ctx = nil
	}
	return err
}
type AuthCallback = func(serverName, shareName string) (domain, username, password string)
func (c *Client) SetAuthCallback(f AuthCallback) {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	C.my_smbc_init_auth_callback(c.ctx, unsafe.Pointer(&f))
	c.authCallback = &f
}
func (c *Client) SetUseKerberos() {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	C.smbc_setOptionUseKerberos(c.ctx, C.int(1))
}
func (c *Client) GetDebug() int {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	return int(C.smbc_getDebug(c.ctx))
}
func (c *Client) SetDebug(level int) {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	C.smbc_setDebug(c.ctx, C.int(level))
}
func (c *Client) GetUser() string {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	return C.GoString(C.smbc_getUser(c.ctx))
}
func (c *Client) SetUser(user string) {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	C.smbc_setUser(c.ctx, C.CString(user))
}
func (c *Client) GetWorkgroup() string {
	c.smbMu.Lock()
	defer c.smbMu.Unlock()
	return C.GoString(C.smbc_getWorkgroup(c.ctx))
}