home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 10
/
Fresh_Fish_10_2352.bin
/
useful
/
util
/
edit
/
mg
/
src.lzh
/
h
/
buffer.h
next >
Wrap
C/C++ Source or Header
|
1990-05-23
|
2KB
|
74 lines
#ifndef BUFFER_H
#define BUFFER_H
/*
* Text is kept in buffers. A buffer header, described below, exists for
* every buffer in the system. The buffers are kept in a big list, so that
* commands that search for a buffer by name can find the buffer header.
* There is a safe store for the dot and mark in the header, but this is only
* valid if the buffer is not being displayed (that is, if "b_nwnd" is 0).
* The text for the buffer is kept in a circularly linked list of lines, with
* a pointer to the header line in "b_linep".
*/
#ifndef LIST_H
#include "list.h"
#endif
#ifndef KBD_H
#include "kbd.h"
#endif
#include "foob.h"
struct buffer {
struct list b_list; /* buffer list pointer */
struct buffer *b_altb; /* Link to alternate buffer */
struct line *b_dotp; /* Link to "." LINE structure */
struct line *b_markp;/* ditto for mark */
struct line *b_linep;/* Link to the header LINE */
struct maps *b_modes[PBMODES]; /* buffer modes */
#ifdef FOOB
FOOB b_foob; /* File Out Of Band Data */
#endif
short b_doto; /* Offset of "." in above LINE */
short b_marko;/* ditto for the "mark" */
short b_nmodes; /* number of non-fundamental modes */
char b_nwnd; /* Count of windows on buffer */
char b_flag; /* Flags */
char b_fname[NFILEN]; /* File name */
};
#define b_bufp b_list.l_p.x_bp
#define b_bname b_list.l_name
#define BFCHG 0x01 /* Changed. */
#define BFBAK 0x02 /* Need to make a backup. */
#define BFNOTAB 0x04 /* no tab mode */
#define BFOVERWRITE 0x08 /* overwrite mode */
/*
* Buffer externals.
*/
extern struct buffer *curbp;
extern struct buffer *bheadp;
extern struct buffer *bfind();
/*
* Prototypes for buffer functions.
*/
#ifndef NO_PROTO
struct buffer *makelist(VOID);
int addline(struct buffer * bp, char *text);
struct buffer *bfind(char *bname, int cflag);
int bclear(struct buffer * bp);
int popbuftop(struct buffer * bp);
int writeout(struct buffer * bp, char *fn);
struct buffer *findbuffer(char *fname);
int buffsave(struct buffer * bp);
VOID upmodes(struct buffer * bp);
/* Define things that need the buffer structure */
int ffputbuf(struct buffer * bp);
struct buffer *dired_ PROTO((char *));
#endif
#endif