// GetWinsize returns the window size based on the specified file descriptor.
773364
func GetWinsize(fd uintptr) (*Winsize, error) {
	info, err := winterm.GetConsoleScreenBufferInfo(fd)
	if err != nil {
		return nil, err
	}

	winsize := &Winsize{
		Width:  uint16(info.Window.Right - info.Window.Left + 1),
		Height: uint16(info.Window.Bottom - info.Window.Top + 1),
	}

	return winsize, nil
}
700481
func (v *Window) GetSize() (width int, height int) {
	var cwidth, cheight C.gint
	C.gtk_window_get_size(WINDOW(v), &cwidth, &cheight)
	return int(cwidth), int(cheight)
}
340165
func GetSize() (ws Size, err error) {
	_, _, ec := syscall.Syscall(syscall.SYS_IOCTL,
		uintptr(syscall.Stdout),
		uintptr(TIOCGWINSZ),
		uintptr(unsafe.Pointer(&ws)))

	err = getError(ec)

	if TIOCGWINSZ == 0 && err != nil {
		ws = Size{80, 25, 0, 0}
	}
	return ws, err
}
380787
func Setsize(t *os.File, ws *Winsize) error {
	return windowRectCall(ws, t.Fd(), syscall.TIOCSWINSZ)
}
1314984
func WindowSize() (w, h int) {
	width, height := Window.GetSize()
	return int(width), int(height)
}
354219
func getWidth(stdoutFd int) int {
	cols, _, err := GetSize(stdoutFd)
	if err != nil {
		return -1
	}
	return cols
}
1009381
func (d *Datastore) GetSize(k ds.Key) (int, error) {
	o, ok := d.buffer[k]
	if ok {
		if o.delete {
			return -1, ds.ErrNotFound
		}
		return len(o.value), nil
	}

	return d.child.GetSize(k)
}
986266
func getDivisibleSize(totalSizes []uint64) (result uint64) {
	gcd := func(x, y uint64) uint64 {
		for y != 0 {
			x, y = y, x%y
		}
		return x
	}
	result = totalSizes[0]
	for i := 1; i < len(totalSizes); i++ {
		result = gcd(result, totalSizes[i])
	}
	return result
}
924354
func (d *Descriptor) GetWidth(plane int) int {
	if plane < 0 || plane+1 > maxPlanes {
		panic(fmt.Errorf("invalid plane %v", plane))
	}
	if plane == 0 {
		return d.Width
	}
	switch d.Ratio {
	case Ratio410, Ratio411:
		return (d.Width + 3) >> 2
	case Ratio420, Ratio422:
		return (d.Width + 1) >> 1
	case Ratio440, Ratio444:
		return d.Width
	}
	panic(fmt.Errorf("invalid ratio %v", d.Ratio))
}
611686
func (c *Column) GetWidth() int {
	if c.Width < c.MaxLen {
		return c.MaxLen
	}
	return c.Width

}
1023363
func GetFileSize(path string) (int64, error) {
	fi, err := os.Lstat(path)
	if err != nil {
		return 0, err
	}
	return fi.Size(), nil
}
692469
func (r *RepositoryContent) GetSize() int {
	if r == nil || r.Size == nil {
		return 0
	}
	return *r.Size
}
1301913
func (image *Image) GetSize() (size uint64, err error) {
	if image.image == nil {
		return 0, RbdErrorImageNotOpen
	}

	if ret := C.rbd_get_size(image.image, (*C.uint64_t)(&size)); ret < 0 {
		return 0, RBDError(ret)
	}

	return size, nil
}
1084833
func (cfp *ZipPool) GetSize(fileIndex int64) int64 {
	return cfp.container.Files[fileIndex].Size
}
592328
func (rb *Bitmap) GetSizeInBytes() uint64 {
	size := uint64(8)
	for _, c := range rb.highlowcontainer.containers {
		size += uint64(2) + uint64(c.getSizeInBytes())
	}
	return size
}
615370
func (writer *baseFileWriter) RotateSize() int64 {
	writer.lock.RLock()
	defer writer.lock.RUnlock()
	return writer.rotateSize
}
72919
func (document *Document) GetSize() (int, int) {
	width := C.long(0)
	heigth := C.long(0)
	C.get_document_size(document.handle, &width, &heigth)
	return int(width), int(heigth)
}