Annotation of 43BSD/contrib/emacs/src/undo.h, revision 1.1.1.1

1.1       root        1: /* Definitions of objects used by the GNU Emacs undo facility.
                      2:    Copyright (C) 1985 Fen Labalme and Richard M. Stallman.
                      3: 
                      4: This file is part of GNU Emacs.
                      5: 
                      6: GNU Emacs is distributed in the hope that it will be useful,
                      7: but WITHOUT ANY WARRANTY.  No author or distributor
                      8: accepts responsibility to anyone for the consequences of using it
                      9: or for whether it serves any particular purpose or works at all,
                     10: unless he says so in writing.  Refer to the GNU Emacs General Public
                     11: License for full details.
                     12: 
                     13: Everyone is granted permission to copy, modify and redistribute
                     14: GNU Emacs, but only under the conditions described in the
                     15: GNU Emacs General Public License.   A copy of this license is
                     16: supposed to have been given to you along with GNU Emacs so you
                     17: can know your rights and responsibilities.  It should be in a
                     18: file named COPYING.  Among other things, the copyright notice
                     19: and this notice must be preserved on all copies.  */
                     20: 
                     21: 
                     22: enum Ukinds {                  /* The events that can exist in the undo
                     23:                                   queue. */
                     24:     Uboundary,                 /* A boundary between sets of undoable things
                     25:                                   */
                     26:     Unundoable,                        /* What's done is done -- some things can't
                     27:                                   be undone */
                     28:     Udelete,                   /* Delete characters to perform the undo */
                     29:     Uinsert,                   /* Insert .... */
                     30:     Uchange,                   /* Replace characters */
                     31:     Uunmod,                    /* Clear modification-flag to perform undo */
                     32: };
                     33: 
                     34: struct UndoRec {               /* A record of a single undo action */
                     35:     enum Ukinds kind;          /* the kind of action to be undone */
                     36:     int pos;                   /* Where dot is */
                     37:     int len;                   /* The extent of the undo (characters
                     38:                                   inserted or deleted) */
                     39: };
                     40: 
                     41: /* The undo history consists of two circular queues, one of characters and
                     42:    one of UndoRecs.  When Uinsert recs are added to UndoRQ characters get
                     43:    added to UndoCQ.  The position of the characters can be reconstructed by
                     44:    subtracting len from the fill pointer. */
                     45: 
                     46: #define NUndoR (((1 << 13) - 4) / sizeof (struct UndoRec))
                     47: #define NUndoC ((1 << 13) - 4)
                     48: 
                     49: /* Initially allocate them these sizes;
                     50:  if these sizes get filled up, make them full size */
                     51: 
                     52: #define InitNUndoR 8
                     53: #define InitNUndoC (512 - 4)
                     54: 
                     55: struct UndoData
                     56:   {
                     57:     struct UndoRec *undorecs;  /* The undo records, NUndoR of them */
                     58:     char *undochars;   /* And the characters associated, NUndoC in all */
                     59:     int nextrec;               /* Indices for storing in above two */
                     60:     int nextchar;
                     61:     int num_undorecs;          /* Sizes allocated */
                     62:     int num_undochars;
                     63:   };
                     64: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.