File: gb_undo.h

package info (click to toggle)
arb 6.0.2-1%2Bdeb8u1
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie
  • size: 65,916 kB
  • ctags: 53,258
  • sloc: ansic: 394,903; cpp: 250,252; makefile: 19,620; sh: 15,878; perl: 10,461; fortran: 6,019; ruby: 683; xml: 503; python: 53; awk: 32
file content (71 lines) | stat: -rw-r--r-- 2,142 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// =============================================================== //
//                                                                 //
//   File      : gb_undo.h                                         //
//   Purpose   :                                                   //
//                                                                 //
//   Institute of Microbiology (Technical University Munich)       //
//   http://www.arb-home.de/                                       //
//                                                                 //
// =============================================================== //

#ifndef GB_UNDO_H
#define GB_UNDO_H

#ifndef GB_LOCAL_H
#include "gb_local.h"
#endif

struct gb_transaction_save;
struct g_b_undo_list;

enum g_b_undo_entry_type {
    GB_UNDO_ENTRY_TYPE_DELETED,
    GB_UNDO_ENTRY_TYPE_CREATED,
    GB_UNDO_ENTRY_TYPE_MODIFY,
    GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY
};

struct g_b_undo_gbd {
    GBQUARK  key;
    GBDATA  *gbd;
};

struct g_b_undo_entry {
    g_b_undo_list  *father;
    g_b_undo_entry *next;
    short           type;
    short           flag;

    GBDATA *source;                                 // The original(changed) element or father(of deleted)
    int     gbm_index;
    long    sizeof_this;
    union {
        gb_transaction_save *ts;
        g_b_undo_gbd         gs;
    } d;
};

struct g_b_undo_header {
    g_b_undo_list *stack;
    long           sizeof_this;                     // the size of all existing undos
    long           nstack;                          // number of available undos
};

struct g_b_undo_list {
    g_b_undo_header *father;
    g_b_undo_entry  *entries;
    g_b_undo_list   *next;
    long             time_of_day;                   // the begin of the transaction
    long             sizeof_this;                   // the size of one undo
};

struct g_b_undo_mgr {
    long             max_size_of_all_undos;
    g_b_undo_list   *valid_u;
    g_b_undo_header *u;                             // undo
    g_b_undo_header *r;                             // redo
};

#else
#error gb_undo.h included twice
#endif // GB_UNDO_H