]> git.lizzy.rs Git - linenoise.git/commitdiff
New feature: Accessor for the history max len.
authorAndreas Kupries <akupries@shaw.ca>
Fri, 25 Jan 2013 02:54:38 +0000 (18:54 -0800)
committerSteve Bennett <steveb@workware.net.au>
Fri, 15 Feb 2013 02:42:01 +0000 (12:42 +1000)
linenoise.c
linenoise.h

index 39d8462ddcb80a9cac46a1236d4e08fc5e4675c9..21f62f5061b6250203062642b2d9224db3768eaf 100644 (file)
@@ -1288,6 +1288,10 @@ int linenoiseHistoryAdd(const char *line) {
     return 1;
 }
 
+int linenoiseHistoryGetMaxLen(void) {
+    return history_max_len;
+}
+
 int linenoiseHistorySetMaxLen(int len) {
     char **newHistory;
 
index 59f28976d67e5a7280526c803f8da71dee8533ce..1e81863b79ce17b5a43b67ece099123fd2a545f7 100644 (file)
@@ -51,6 +51,7 @@ void linenoiseAddCompletion(linenoiseCompletions *, const char *);
 char *linenoise(const char *prompt);
 int linenoiseHistoryAdd(const char *line);
 int linenoiseHistorySetMaxLen(int len);
+int linenoiseHistoryGetMaxLen(void);
 int linenoiseHistorySave(const char *filename);
 int linenoiseHistoryLoad(const char *filename);
 void linenoiseHistoryFree(void);