r23309: sync lib/replace with SAMBA_4_0
[tprouty/samba.git] / source / lib / replace / system / readline.h
1 #ifndef _system_readline_h
2 #define _system_readline_h
3 /* 
4    Unix SMB/CIFS implementation.
5
6    Readline wrappers
7    
8      ** NOTE! The following LGPL license applies to the replace
9      ** library. This does NOT imply that all of Samba is released
10      ** under the LGPL
11    
12    This library is free software; you can redistribute it and/or
13    modify it under the terms of the GNU Lesser General Public
14    License as published by the Free Software Foundation; either
15    version 2 of the License, or (at your option) any later version.
16
17    This library is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20    Lesser General Public License for more details.
21
22    You should have received a copy of the GNU Lesser General Public
23    License along with this library; if not, write to the Free Software
24    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
26 */
27
28 #ifdef HAVE_LIBREADLINE
29 #  ifdef HAVE_READLINE_READLINE_H
30 #    include <readline/readline.h>
31 #    ifdef HAVE_READLINE_HISTORY_H
32 #      include <readline/history.h>
33 #    endif
34 #  else
35 #    ifdef HAVE_READLINE_H
36 #      include <readline.h>
37 #      ifdef HAVE_HISTORY_H
38 #        include <history.h>
39 #      endif
40 #    else
41 #      undef HAVE_LIBREADLINE
42 #    endif
43 #  endif
44 #endif
45
46 #ifdef HAVE_NEW_LIBREADLINE
47 #  define RL_COMPLETION_CAST (rl_completion_func_t *)
48 #else
49 /* This type is missing from libreadline<4.0  (approximately) */
50 #  define RL_COMPLETION_CAST
51 #endif /* HAVE_NEW_LIBREADLINE */
52
53 #endif