// Looks up the previous navigation entry from the history and navigates to it.
// Returns error if we could not find the previous entry or navigation failed
506873
func (t *Tab) Back() error {
	prev, err := t.BackEntry()
	if err != nil {
		return err
	}
	_, err = t.Page.NavigateToHistoryEntry(prev.Id)
	return err
}
779411
func (api *Client) GetChannelHistoryContext(ctx context.Context, channelID string, params HistoryParameters) (*History, error) {
	values := url.Values{
		"token":   {api.token},
		"channel": {channelID},
	}
	if params.Latest != DEFAULT_HISTORY_LATEST {
		values.Add("latest", params.Latest)
	}
	if params.Oldest != DEFAULT_HISTORY_OLDEST {
		values.Add("oldest", params.Oldest)
	}
	if params.Count != DEFAULT_HISTORY_COUNT {
		values.Add("count", strconv.Itoa(params.Count))
	}
	if params.Inclusive != DEFAULT_HISTORY_INCLUSIVE {
		if params.Inclusive {
			values.Add("inclusive", "1")
		} else {
			values.Add("inclusive", "0")
		}
	}

	if params.Unreads != DEFAULT_HISTORY_UNREADS {
		if params.Unreads {
			values.Add("unreads", "1")
		} else {
			values.Add("unreads", "0")
		}
	}

	response, err := api.channelRequest(ctx, "channels.history", values)
	if err != nil {
		return nil, err
	}
	return &response.History, nil
}
903725
func (h *history) _baseNextPrev(c byte) (line []rune, err error) {
	if h.li.Len() <= 0 {
		return line, ErrEmptyHist
	}

	new := new(list.Element)
	if c == 'p' {
		new = h.mark.Prev()
	} else if c == 'n' {
		new = h.mark.Next()
	} else {
		panic("history._baseNextPrev: wrong character choice")
	}

	if new != nil {
		h.mark = new
	} else {
		return nil, ErrNilElement
	}

	return []rune(new.Value.(string)), nil
}
205308
func (s *grpcAPIService) History(ctx context.Context, req *HistoryRequest) (*HistoryResponse, error) {
	return s.api.History(ctx, req), nil
}
747256
func (v *volumeClient) CloudBackupHistory(
	input *api.CloudBackupHistoryRequest,
) (*api.CloudBackupHistoryResponse, error) {
	historyResponse := &api.CloudBackupHistoryResponse{}
	req := v.c.Get().Resource(api.OsdBackupPath + "/history").Body(input)
	response := req.Do()
	if response.Error() != nil {
		return nil, response.FormatError()
	}

	if err := response.Unmarshal(&historyResponse); err != nil {
		return nil, err
	}
	return historyResponse, nil
}
1330864
func SetHistoryPath(fp string) {
	ins := getInstance()
	cfg := ins.Config.Clone()
	cfg.HistoryFile = fp
	ins.SetConfig(cfg)
}
476933
func (remote *RemoteDebugger) Navigate(url string) (string, error) {
	res, err := remote.SendRequest("Page.navigate", Params{
		"url": url,
	})
	if err != nil {
		return "", err
	}

	if errorText, ok := res["errorText"]; ok {
		return "", NavigationError(errorText.(string))
	}

	frameID, ok := res["frameId"]
	if !ok {
		return "", nil
	}
	return frameID.(string), nil
}
1096287
func LoadHistory(path string) error {
	p := C.CString(path)
	e := C.read_history(p)
	C.free(unsafe.Pointer(p))

	if e == 0 {
		return nil
	}
	return syscall.Errno(e)
}
435482
func (d *JSONDecoder) DecodeHistory(data []byte) (*HistoryRequest, error) {
	var p HistoryRequest
	err := json.Unmarshal(data, &p)
	if err != nil {
		return nil, err
	}
	return &p, nil
}
711761
func (tm *TrustMetric) HistoryJSON() MetricHistoryJSON {
	tm.mtx.Lock()
	defer tm.mtx.Unlock()

	return MetricHistoryJSON{
		NumIntervals: tm.numIntervals,
		History:      tm.history,
	}
}
501935
func (e *enumerator) Prev() (k uint64, v *Container, err error) {
	if err = e.err; err != nil {
		return 0, nil, err
	}

	if e.ver != e.t.ver {
		f, _ := e.t.Seek(e.k)
		*e = *f
		f.Close()
	}
	if e.q == nil {
		e.err, err = io.EOF, io.EOF
		return 0, nil, err
	}

	if !e.hit {
		// move to previous because Seek overshoots if there's no hit
		if err = e.prev(); err != nil {
			return 0, nil, err
		}
	}

	if e.i >= e.q.c {
		if err = e.prev(); err != nil {
			return 0, nil, err
		}
	}

	i := e.q.d[e.i]
	k, v = i.k, i.v
	e.k, e.hit = k, true
	// Any error returned would be stashed in e.err, and would come up
	// on the next call.
	_ = e.prev()
	return k, v, err
}
123858
func (h *history) reset() {
	h.b = h.b[:0]
	h.error = false
	h.recentOffsets = [3]int{1, 4, 8}
	if f := h.decoders.litLengths.fse; f != nil && !f.preDefined {
		fseDecoderPool.Put(f)
	}
	if f := h.decoders.offsets.fse; f != nil && !f.preDefined {
		fseDecoderPool.Put(f)
	}
	if f := h.decoders.matchLengths.fse; f != nil && !f.preDefined {
		fseDecoderPool.Put(f)
	}
	h.decoders = sequenceDecs{}
	if h.huffTree != nil {
		huffDecoderPool.Put(h.huffTree)
	}
	h.huffTree = nil
	//printf("history created: %+v (l: %d, c: %d)", *h, len(h.b), cap(h.b))
}
82697
func (c *Client) PreviousTrackResults(s *SearchResult) error {
	if s.Tracks == nil || s.Tracks.Previous == "" {
		return ErrNoMorePages
	}
	return c.get(s.Tracks.Previous, s)
}
222265
func MoveToHistory(job *AnalyzeJob) {
	analyzeStatus.Lock()
	delete(analyzeStatus.jobs, job)
	analyzeStatus.history = append(analyzeStatus.history, job)
	numJobs := len(analyzeStatus.history)
	if numJobs > numMaxHistoryJobs {
		analyzeStatus.history = analyzeStatus.history[numJobs-numMaxHistoryJobs:]
	}
	analyzeStatus.Unlock()
}
390389
func (r Hardware_Router) GetTransactionHistory() (resp []datatypes.Provisioning_Version1_Transaction_History, err error) {
	err = r.Session.DoRequest("SoftLayer_Hardware_Router", "getTransactionHistory", nil, &r.Options, &resp)
	return
}
211513
func (e *Event) GetPreviousValue(keys ...string) string {
	return getValue(e.Data.PreviousAttributes, keys)
}
996569
func (h *StatefulSetHistoryViewer) ViewHistory(namespace, name string, revision int64) (string, error) {
	_, history, err := statefulSetHistory(h.c.AppsV1(), namespace, name)
	if err != nil {
		return "", err
	}

	if len(history) <= 0 {
		return "No rollout history found.", nil
	}
	revisions := make([]int64, len(history))
	for _, revision := range history {
		revisions = append(revisions, revision.Revision)
	}
	sliceutil.SortInts64(revisions)

	return tabbedString(func(out io.Writer) error {
		fmt.Fprintf(out, "REVISION\n")
		for _, r := range revisions {
			fmt.Fprintf(out, "%d\n", r)
		}
		return nil
	})
}