// Get console height
180235
func Height() int {
	ws, err := getWinsize()
	if err != nil {
		return -1
	}
	return int(ws.Row)
}
1256952
func GetConsole(c context.Context, proj, id string) (*Console, error) {
	con := Console{
		Parent: datastore.MakeKey(c, "Project", proj),
		ID:     id,
	}
	switch err := datastore.Get(c, &con); err {
	case datastore.ErrNoSuchEntity:
		return nil, ErrConsoleNotFound
	case nil:
		return &con, nil
	default:
		return nil, errors.Annotate(err, "getting project %q console %q", proj, id).Err()
	}
}
486517
func (surface *ImageSurface) GetHeight() int {
	ret := int(C.cairo_image_surface_get_height(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
948884
func GetSize(fd uintptr) *remotecommand.TerminalSize {
	winsize, err := term.GetWinsize(fd)
	if err != nil {
		runtime.HandleError(fmt.Errorf("unable to get terminal size: %v", err))
		return nil
	}

	return &remotecommand.TerminalSize{Width: winsize.Width, Height: winsize.Height}
}
1016639
def console_get_height_rect(
    con: tcod.console.Console, x: int, y: int, w: int, h: int, fmt: str
) -> int:
    
    return int(
        lib.TCOD_console_get_height_rect_fmt(
            _console(con), x, y, w, h, _fmt(fmt)
        )
    )
470793
func (d *Descriptor) GetHeight(plane int) int {
	if plane < 0 || plane+1 > maxPlanes {
		panic(fmt.Errorf("invalid plane %v", plane))
	}
	if plane == 0 {
		return d.Height
	}
	switch d.Ratio {
	case Ratio411, Ratio422, Ratio444:
		return d.Height
	case Ratio410, Ratio420, Ratio440:
		h := (d.Height + 1) >> 1
		if d.Interlaced && h&1 != 0 {
			h++
		}
		return h
	}
	panic(fmt.Errorf("invalid ratio %v", d.Ratio))
}
1080384
func getConsoleScreenBufferInfo(csbi *_CONSOLE_SCREEN_BUFFER_INFO) (err error) {
	var (
		bi _CONSOLE_SCREEN_BUFFER_INFO
		fd syscall.Handle
	)

	// Re-open CONOUT$ as in some instances, stdout may be closed and guaranteed an stdout
	if fd, err = syscall.Open("CONOUT$", syscall.O_RDWR, 0); err != nil {
		return err
	}
	defer syscall.Close(fd)

	// grab the dimensions for the console
	if err = kernel32_GetConsoleScreenBufferInfo(fd, &bi); err != nil {
		return err
	}

	*csbi = bi
	return nil
}
360323
func (p *MempoolMonitor) LastBlockHeight() int64 {
	p.mtx.RLock()
	defer p.mtx.RUnlock()
	return p.lastBlock.Height
}
508859
func GetTerminalWindowSize(file *os.File) (*Size, error) {
	var info consoleScreenBufferInfo
	_, _, e := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, file.Fd(), uintptr(unsafe.Pointer(&info)), 0)
	if e != 0 {
		return nil, error(e)
	}
	return &Size{
		Lines:   int(info.size.y),
		Columns: int(info.size.x),
	}, nil
}
751192
func (s *Status) Height() uint32 {
	s.RLock()
	defer s.RUnlock()
	return s.height
}
914090
func (s *Status) SetHeight(height uint32) {
	s.Lock()
	defer s.Unlock()
	s.ready = height == s.dbHeight
	s.height = height
}
904189
func (c *MempoolDataCache) GetHeight() uint32 {
	c.mtx.RLock()
	defer c.mtx.RUnlock()
	return c.height
}
822907
func (charts *ChartData) Height() int32 {
	charts.mtx.RLock()
	defer charts.mtx.RUnlock()
	return int32(len(charts.Blocks.Time)) - 1
}
201257
func GetTerminalSize() TerminalWindowSize {
	res, err := GetTerminalSizeErr()
	if err != nil {
		res = DefaultTerminalWindowSize
		warnTerminalSizeOnce.Do(func() {
			Log.Warnf("Failed to get terminal size: %v. Using default: %+v", err, DefaultTerminalWindowSize)
		})
	}
	return res
}
242988
func (msg *StateInfo) LedgerHeight() (uint64, error) {
	if msg.Properties != nil {
		return msg.Properties.LedgerHeight, nil
	}
	return 0, errors.New("properties undefined")
}
218826
func (_m *DataStore) LedgerHeight() (uint64, error) {
	ret := _m.Called()

	var r0 uint64
	if rf, ok := ret.Get(0).(func() uint64); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(uint64)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1364866
func getTtySize(terminalFd uintptr) (int, int) {
	ws, err := term.GetWinsize(terminalFd)
	if err != nil {
		if ws == nil {
			return 0, 0
		}
	}
	return int(ws.Height), int(ws.Width)
}