Header And Logo

PostgreSQL
| The world's most advanced open source database.

input.h

Go to the documentation of this file.
00001 /*
00002  * psql - the PostgreSQL interactive terminal
00003  *
00004  * Copyright (c) 2000-2013, PostgreSQL Global Development Group
00005  *
00006  * src/bin/psql/input.h
00007  */
00008 #ifndef INPUT_H
00009 #define INPUT_H
00010 
00011 /*
00012  * If some other file needs to have access to readline/history, include this
00013  * file and save yourself all this work.
00014  *
00015  * USE_READLINE is the definite pointers regarding existence or not.
00016  */
00017 #ifdef HAVE_LIBREADLINE
00018 #define USE_READLINE 1
00019 
00020 #if defined(HAVE_READLINE_READLINE_H)
00021 #include <readline/readline.h>
00022 #if defined(HAVE_READLINE_HISTORY_H)
00023 #include <readline/history.h>
00024 #endif
00025 #elif defined(HAVE_EDITLINE_READLINE_H)
00026 #include <editline/readline.h>
00027 #if defined(HAVE_EDITLINE_HISTORY_H)
00028 #include <editline/history.h>
00029 #endif
00030 #elif defined(HAVE_READLINE_H)
00031 #include <readline.h>
00032 #if defined(HAVE_HISTORY_H)
00033 #include <history.h>
00034 #endif
00035 #endif   /* HAVE_READLINE_READLINE_H, etc */
00036 #endif   /* HAVE_LIBREADLINE */
00037 
00038 #include "pqexpbuffer.h"
00039 
00040 
00041 char       *gets_interactive(const char *prompt);
00042 char       *gets_fromFile(FILE *source);
00043 
00044 void        initializeInput(int flags);
00045 bool        saveHistory(char *fname, int max_lines, bool appendFlag, bool encodeFlag);
00046 
00047 void        pg_append_history(const char *s, PQExpBuffer history_buf);
00048 void        pg_send_history(PQExpBuffer history_buf);
00049 
00050 #endif   /* INPUT_H */