X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=visor;a=blobdiff_plain;f=libvisor%2Finclude%2Fvisor.h;h=46de4d8daf50f43d026f09b4c116d02accc9a53e;hp=a9b3ec78f9e3035249d0f892534a3848a3bd057d;hb=1c7c43c39b2b6f9224bcd39e3a24b8e91ada2cae;hpb=a4536cf08230dba14f221b661abd7804fcc1ebbc diff --git a/libvisor/include/visor.h b/libvisor/include/visor.h index a9b3ec7..46de4d8 100644 --- a/libvisor/include/visor.h +++ b/libvisor/include/visor.h @@ -77,8 +77,8 @@ enum { VI_SEEK_SET, VI_SEEK_CUR, VI_SEEK_END }; struct vi_fileops { vi_file *(*open)(const char *path, unsigned int flags); - long (*size)(vi_file *file); void (*close)(vi_file *file); + long (*size)(vi_file *file); void *(*map)(vi_file *file); void (*unmap)(vi_file *file); long (*read)(vi_file *file, void *buf, long count); @@ -97,6 +97,7 @@ struct vi_ttyops { void (*del_back)(void *cls); void (*del_fwd)(void *cls); void (*status)(char *s, void *cls); + void (*flush)(void *cls); }; /* Create a new instance of the visor editor. @@ -111,6 +112,9 @@ void vi_destroy(struct visor *vi); void vi_set_fileops(struct visor *vi, struct vi_fileops *fop); void vi_set_ttyops(struct visor *vi, struct vi_ttyops *tty); +void vi_term_size(struct visor *vi, int xsz, int ysz); +void vi_redraw(struct visor *vi); + /* vi_new_buf creates a new buffer and inserts it in the buffer list. If the * path pointer is null, the new buffer will be empty, otherwise it's as if it * was followed by a vi_buf_read call to read a file into the buffer. @@ -142,8 +146,11 @@ int vi_buf_read(struct vi_buffer *vb, const char *path); int vi_buf_write(struct vi_buffer *vb, const char *path); long vi_buf_size(struct vi_buffer *vb); -/* find the span which corresponds to the specified text position */ -struct vi_span *vi_buf_find_span(struct vi_buffer *vb, vi_addr at); +/* find the span which corresponds to the specified text position + * if soffs is not null, the relative offset of the specified address from the + * start of the span is stored there. + */ +struct vi_span *vi_buf_find_span(struct vi_buffer *vb, vi_addr at, vi_addr *soffs); const char *vi_buf_span_text(struct vi_buffer *vb, struct vi_span *span); void vi_buf_ins_begin(struct vi_buffer *vb, vi_motion mot);