File: hist.h

package info (click to toggle)
alpine 2.26%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 46,756 kB
  • sloc: ansic: 362,804; tcl: 26,297; sh: 4,910; javascript: 3,789; makefile: 1,935; perl: 159; python: 119; xml: 93; exp: 69; sed: 16; cpp: 7
file content (54 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * $Id: hist.h 768 2007-10-24 00:10:03Z hubert@u.washington.edu $
 *
 * ========================================================================
 * Copyright 2013-2022 Eduardo Chappa
 * Copyright 2006-2007 University of Washington
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * ========================================================================
 */

#ifndef PITH_HIST_INCLUDED
#define PITH_HIST_INCLUDED


#define HISTSIZE (20+1)

typedef struct one_hist {
    char      *str;
    unsigned   flags;
    void      *cntxt;
} ONE_HIST_S;


typedef struct history_s {
    int         histsize;
    int         origindex;
    int         curindex;
    ONE_HIST_S *hist[1];	/* has size histsize */
} HISTORY_S;


#define HISTORY_UP_KEYNAME  "Up"
#define HISTORY_DOWN_KEYNAME  "Down"
#define HISTORY_KEYLABEL N_("History")

void        init_hist(HISTORY_S **, int);
void        free_hist(HISTORY_S **);
char       *get_prev_hist(HISTORY_S *, char *, unsigned, void *);
char       *get_next_hist(HISTORY_S *, char *, unsigned, void *);
char 	   *hist_in_pos(int, char **, int, HISTORY_S *, int);
void        save_hist(HISTORY_S *, char *, unsigned, void *);
int         items_in_hist(HISTORY_S *);
void        add_to_histlist(HISTORY_S **);
void        free_histlist(void);
int         dirs_in_hist(HISTORY_S *);


#endif /* PITH_HIST_INCLUDED */