/*
 * readline.vapi
 *
 * Authored by Michael 'Mickey' Lauer <mlauer@vanille-media.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

[CCode (lower_case_cprefix = "rl_", cheader_filename = "readline/readline.h")]
namespace Readline
{
    static weak string readline_name;
    static weak string terminal_name;

    public string initialize();
    [CCode (cname = "readline" )]
    public string readline( string? prompt = null );

    /* Readline signal handling, from signal.c */
    public int set_signals();
    public int clear_signals();
    public void cleanup_after_signal();
    public void reset_after_signal();
    public void free_line_state();

    public int set_paren_blink_timeout( int timeout );

    /* History */
    [CCode (cname = "history_length", cheader_filename = "readline/history.h")]
    static weak int history_length;
    [CCode (cname = "history_max_entries", cheader_filename = "readline/history.h")]
    static weak int history_max_entries;

    [CCode (cname = "read_history", cheader_filename = "readline/history.h")]
    public int read_history( string filename );
    [CCode (cname = "write_history", cheader_filename = "readline/history.h")]
    public int write_history( string filename );

    [CCode (cname = "add_history", cheader_filename = "readline/history.h")]
    public int add_history( string filename );

    /* only available in readline 6
    [CCode (cname = "get_history_length", cheader_filename = "readline/history.h")]
    public int get_history_length();
    [CCode (cname = "get_current_history_length", cheader_filename = "readline/history.h")]
    public int get_current_history_length();
    [CCode (cname = "set_history_length", cheader_filename = "readline/history.h")]
    public int set_history_length( int length );
    */
}
