View of xos/usr/lib/readline/line.h


XOS | Parent Directory | View | Download

/* Copyright (C) 2008  Emmanuel Varoquaux
 
   This file is part of XOS.
 
   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 3 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, see <http://www.gnu.org/licenses/>. */
 
#ifndef LINE_H
#define LINE_H
 
#include <stddef.h>
 
struct linebuf_struct {
  char *buf;
  size_t size;
};
 
extern char *line;
extern int line_end;
extern int point;
extern int mark;
 
void linebuf_init(struct linebuf_struct *linebuf, const char *s);
void linebuf_destroy(struct linebuf_struct *linebuf);
 
void line_set(struct linebuf_struct *linebuf);
void line_replace_region_with_char(int start, int end, char c);
void line_replace_region_with_text(int start, int end, const char *text);
void line_erase_region(int start, int end);
void line_delete_region(int start, int end);
void line_set_point(int newpoint);
void line_set_mark(int newmark);
void line_discard();
void line_release();
 
#endif