//Deprecated since 2.14. Use PackStart() instead.
542262
func (v *Box) PackStartDefaults(child IWidget) {
	deprecated_since(2, 14, 0, "gtk_box_pack_start_defaults()")
	C.gtk_box_pack_start_defaults(BOX(v), ToNative(child))
}
536170
func CurrentPackage() string {
	for _, root := range gobuild.Default.SrcDirs() {
		if pkg, ok := hasSubdir(root, "."); ok {
			return pkg
		}
	}
	return ""
}
1056782
func (m *Debug) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	binary.Write(data, binary.LittleEndian, m.VALUE)
	binary.Write(data, binary.LittleEndian, m.IND)
	return data.Bytes()
}
943830
func (ts intSlice) PackList(buf BufferEx) (int, error) {
	size := 0
	for _, elem := range ts {
		n, err := PackInt64(buf, int64(elem))
		size += n
		if err != nil {
			return size, err
		}
	}
	return size, nil
}
919019
func PackBool(cmd BufferEx, val bool) (int, error) {
	return packBool(cmd, val)
}
9916
func PackString(cmd BufferEx, val string) (int, error) {
	return packString(cmd, val)
}
487476
func TypeByPackageName(pkgPath string, name string) Type {
	initOnce.Do(discoverTypes)
	pkgTypes := packages[pkgPath]
	if pkgTypes == nil {
		return nil
	}
	return Type2(pkgTypes[name])
}
629097
func PackTremove(fc *Fcall, fid uint32) error {
	p, err := packCommon(fc, 4, Tremove) /* fid[4] */
	if err != nil {
		return err
	}

	fc.Fid = fid
	p = pint32(fid, p)
	return nil
}
1251906
func packToWriter(srcPath string, w io.Writer, fn func(fullName string, fi os.FileInfo) error, includeDir bool) error {
	zw := zip.NewWriter(w)
	defer zw.Close()

	f, err := os.Open(srcPath)
	if err != nil {
		return err
	}
	defer f.Close()

	fi, err := f.Stat()
	if err != nil {
		return err
	}

	basePath := path.Base(srcPath)
	if fi.IsDir() {
		if includeDir {
			if err = packFile(srcPath, basePath, zw, fi); err != nil {
				return err
			}
		} else {
			basePath = ""
		}
		return packDir(srcPath, basePath, zw, fn)
	}
	return packFile(srcPath, basePath, zw, fi)
}
623304
func NewPackage(n string) *Env {
	return &Env{
		env:    make(map[string]reflect.Value),
		typ:    make(map[string]reflect.Type),
		parent: nil,
		name:   n,
	}
}
689955
func (w *Wrapper) allPackagesInOrder() []*PackageInfo {
	result := make([]*PackageInfo, 0, len(w.allPackages))
	names := make([]string, 0, len(w.allPackages))
	for name := range w.allPackages {
		names = append(names, name)
	}
	sort.Strings(names)
	for _, name := range names {
		result = append(result, w.allPackages[name])
	}
	return result
}
1298681
func (tm float64InterfaceMap) PackMap(buf BufferEx) (int, error) {
	size := 0
	for k, v := range tm {
		n, err := PackFloat64(buf, k)
		size += n
		if err != nil {
			return size, err
		}

		n, err = packObject(buf, v, false)
		size += n
		if err != nil {
			return size, err
		}
	}
	return size, nil
}
284444
func (m *GpsRawInt) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.LAT)
	binary.Write(data, binary.LittleEndian, m.LON)
	binary.Write(data, binary.LittleEndian, m.ALT)
	binary.Write(data, binary.LittleEndian, m.EPH)
	binary.Write(data, binary.LittleEndian, m.EPV)
	binary.Write(data, binary.LittleEndian, m.VEL)
	binary.Write(data, binary.LittleEndian, m.COG)
	binary.Write(data, binary.LittleEndian, m.FIX_TYPE)
	binary.Write(data, binary.LittleEndian, m.SATELLITES_VISIBLE)
	return data.Bytes()
}
855080
func packShortRaw(cmd BufferEx, val int16) (int, error) {
	if cmd != nil {
		return cmd.WriteInt16(val)
	}
	return 2, nil
}
822840
func (tm intInterfaceMap) PackMap(buf BufferEx) (int, error) {
	size := 0
	for k, v := range tm {
		n, err := PackInt64(buf, int64(k))
		size += n
		if err != nil {
			return size, err
		}

		n, err = packObject(buf, v, false)
		size += n
		if err != nil {
			return size, err
		}
	}
	return size, nil
}
731377
func PackTread(fc *Fcall, fid uint32, offset uint64, count uint32) error {
	size := 4 + 8 + 4 /* fid[4] offset[8] count[4] */
	p, err := packCommon(fc, size, Tread)
	if err != nil {
		return err
	}

	fc.Fid = fid
	fc.Offset = offset
	fc.Count = count
	p = pint32(fid, p)
	p = pint64(offset, p)
	p = pint32(count, p)
	return nil
}
782156
func (cli *Client) generatePacketID() (uint16, error) {
	// Define a Packet Identifier.
	id := minPacketID

	for {
		// Find a Packet Identifier which does not used.
		if _, exist := cli.sess.sendingPackets[id]; !exist {
			// Return the Packet Identifier.
			return id, nil
		}

		if id == maxPacketID {
			break
		}

		id++
	}

	// Return an error if available ids are not found.
	return 0, ErrPacketIDExhaused
}