summaryrefslogtreecommitdiffstats
path: root/src/vf_modified.c
blob: 7cd1a5afd6c941f099555e0fbdc593b3589149f4 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/******************************************************************************

    (C) Nick Marley, 2001 -

    This software is distributed under the GNU Lesser General Public Licence.
    Please read and understand the comments at the top of vf_iface.h before use!

FILE
    $Workfile: vf_modified.c $
    $Revision: 1.4 $
    $Author: tilda $
         
ORIGINAL AUTHOR
    Nick Marley

DESCRIPTION
    Memory allocation system for vformat parser / editor.

REFERENCES
    (none)    

MODIFICATION HISTORY
 *  $Log: vf_modified.c,v $
 *  Revision 1.4  2002/11/02 18:29:26  tilda
 *  IID485157 - UI does character conversion based on CHARSET property.
 *
 *  Revision 1.3  2002/10/29 07:19:20  tilda
 *  Tidy headers.
 *
 *  Revision 1.2  2002/10/26 16:09:23  tilda
 *  IID629125 - Ensure string functions used are portable.
 *
 *  Revision 1.1  2002/10/11 20:29:25  tilda
 *  Include vf_modified.c
 *
 *******************************************************************************/

#ifndef NORCSID
static const char vf_modified_c_vss_id[] = "$Header: /cvsroot/vformat/src/vformat/src/vf_modified.c,v 1.4 2002/11/02 18:29:26 tilda Exp $";
#endif

/*=============================================================================*
 ANSI C & System-wide Header Files
 *============================================================================*/


/*============================================================================*
 Interface Header Files
 *============================================================================*/

#include "vformat/vf_iface.h"

/*============================================================================*
 Local Header File
 *============================================================================*/

#include "vf_config.h"
#include "vf_malloc.h"
#include "vf_internals.h"
#include "vf_modified.h"

/*============================================================================*
 Public Data
 *============================================================================*/
/* None */

/*============================================================================*
 Private Defines
 *============================================================================*/
/* None */

/*============================================================================*
 Private Data Types
 *============================================================================*/
/* None */

/*============================================================================*
 Private Function Prototypes
 *============================================================================*/
/* None */

/*============================================================================*
 Private Data
 *============================================================================*/
/* None */

/*============================================================================*
 Public Function Implementations
 *============================================================================*/

/*---------------------------------------------------------------------------*
 * NAME
 *      vf_is_modified()
 * 
 * DESCRIPTION
 *      Return the status of the modified flag for the indicated object.
 *
 * RETURNS
 *      TRUE/FALSE
 *---------------------------------------------------------------------------*/

bool_t vf_is_modified(
    VF_OBJECT_T *p_object
    )
{
    bool_t ret = FALSE;

    if (p_object)
    {
        ret = ((VOBJECT_T *)p_object)->modified;
    }

    return ret;
}




/*---------------------------------------------------------------------------*
 * NAME
 *      mark_property_modified()
 * 
 * DESCRIPTION
 *      Mark indicated property and it's owning object as modified.  If the
 *      recurse flag is st, then the owning object's parent object is also
 *      marked as modified recursively up to the top of the tree.
 *
 * RETURNS
 *      (none)
 *---------------------------------------------------------------------------*/

void mark_property_modified(
    VPROP_T *p_prop,        /* The property */
    bool_t recurse          /* Recurse? */
    )
{
    p_prop->modified = TRUE;
    p_prop->p_parent->modified = TRUE;

    if (recurse)
    {
        VOBJECT_T *p_parent = p_prop->p_parent->p_parent;

        for (;p_parent;p_parent = p_parent->p_parent)
        {
            p_parent->modified = TRUE;
        }
    }
}


/*============================================================================*
 Private Function Implementations
 *============================================================================*/

 /*============================================================================*
 End Of File
 *============================================================================*/