diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-05-05 18:26:14 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-05-05 18:26:14 +0000 |
commit | 5bdf8622148be4764cc0757fd5b3e41f4d73b2b2 (patch) | |
tree | ec69331983824d95160ec9a14f71d6bccd23ed42 /readline/history.h | |
parent | 7f8411279d59ee620d1e2e153329c0bd47c4ca86 (diff) | |
download | gdb-5bdf8622148be4764cc0757fd5b3e41f4d73b2b2.zip gdb-5bdf8622148be4764cc0757fd5b3e41f4d73b2b2.tar.gz gdb-5bdf8622148be4764cc0757fd5b3e41f4d73b2b2.tar.bz2 |
Readline 5.1 import for HEAD.
Diffstat (limited to 'readline/history.h')
-rw-r--r-- | readline/history.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/readline/history.h b/readline/history.h index 58b5de4..14ca2a9 100644 --- a/readline/history.h +++ b/readline/history.h @@ -1,5 +1,5 @@ -/* History.h -- the names of functions that you can call in history. */ -/* Copyright (C) 1989, 1992 Free Software Foundation, Inc. +/* history.h -- the names of functions that you can call in history. */ +/* Copyright (C) 1989-2003 Free Software Foundation, Inc. This file contains the GNU History Library (the Library), a set of routines for managing the text of previously typed lines. @@ -26,6 +26,8 @@ extern "C" { #endif +#include <time.h> /* XXX - for history timestamp code */ + #if defined READLINE_LIBRARY # include "rlstdc.h" # include "rltypedefs.h" @@ -43,9 +45,13 @@ typedef char *histdata_t; /* The structure used to store a history entry. */ typedef struct _hist_entry { char *line; + char *timestamp; /* char * rather than time_t for read/write */ histdata_t data; } HIST_ENTRY; +/* Size of the history-library-managed space in history entry HS. */ +#define HISTENT_BYTES(hs) (strlen ((hs)->line) + strlen ((hs)->timestamp)) + /* A structure used to pass the current state of the history stuff around. */ typedef struct _hist_state { HIST_ENTRY **entries; /* Pointer to the entries themselves. */ @@ -76,11 +82,19 @@ extern void history_set_history_state PARAMS((HISTORY_STATE *)); The associated data field (if any) is set to NULL. */ extern void add_history PARAMS((const char *)); +/* Change the timestamp associated with the most recent history entry to + STRING. */ +extern void add_history_time PARAMS((const char *)); + /* A reasonably useless function, only here for completeness. WHICH is the magic number that tells us which element to delete. The elements are numbered from 0. */ extern HIST_ENTRY *remove_history PARAMS((int)); +/* Free the history entry H and return any application-specific data + associated with it. */ +extern histdata_t free_history_entry PARAMS((HIST_ENTRY *)); + /* Make the history entry at WHICH have LINE and DATA. This returns the old entry so you can dispose of the data. In the case of an invalid WHICH, a NULL pointer is returned. */ @@ -119,6 +133,10 @@ extern HIST_ENTRY *current_history PARAMS((void)); array. OFFSET is relative to history_base. */ extern HIST_ENTRY *history_get PARAMS((int)); +/* Return the timestamp associated with the HIST_ENTRY * passed as an + argument */ +extern time_t history_get_time PARAMS((HIST_ENTRY *)); + /* Return the number of bytes that the primary history entries are using. This just adds up the lengths of the_history->lines. */ extern int history_total_bytes PARAMS((void)); @@ -231,6 +249,8 @@ extern char *history_no_expand_chars; extern char *history_search_delimiter_chars; extern int history_quotes_inhibit_expansion; +extern int history_write_timestamps; + /* Backwards compatibility */ extern int max_input_history; |