Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/*** action.c --- Action ADT.
32
 *
33
 ** Author: Steve Folkes <smf@hermes.mod.uk>
34
 *
35
 *** Commentary:
36
 *
37
 * This file implements the action manipulation routines.
38
 *
39
 *** Change Log:
40
 * $Log: action.c,v $
41
 * Revision 1.1.1.1  1998/01/17  15:57:46  release
42
 * First version to be checked into rolling release.
43
 *
44
 * Revision 1.2  1994/12/15  09:57:54  smf
45
 * Brought into line with OSSG C Coding Standards Document, as per
46
 * "CR94_178.sid+tld-update".
47
 *
48
 * Revision 1.1.1.1  1994/07/25  16:04:29  smf
49
 * Initial import of SID 1.8 non shared files.
50
 *
51
**/
52
 
53
/****************************************************************************/
54
 
55
#include "action.h"
56
#include "basic.h"
57
#include "name.h"
58
#include "rule.h"
59
#include "type.h"
60
 
61
/*--------------------------------------------------------------------------*/
62
 
63
ActionP
64
action_create PROTO_Z ()
65
{
66
    ActionP action = ALLOCATE (ActionT);
67
 
68
    types_init (action_param (action));
69
    types_init (action_result (action));
70
    action->code = NIL (GenericP);
71
    return (action);
72
}
73
 
74
#ifdef FS_FAST
75
#undef action_param
76
#endif /* defined (FS_FAST) */
77
TypeTupleP
78
action_param PROTO_N ((action))
79
	     PROTO_T (ActionP action)
80
{
81
    return (&(action->param));
82
}
83
#ifdef FS_FAST
84
#define action_param(a) (&((a)->param))
85
#endif /* defined (FS_FAST) */
86
 
87
#ifdef FS_FAST
88
#undef action_result
89
#endif /* defined (FS_FAST) */
90
TypeTupleP
91
action_result PROTO_N ((action))
92
	      PROTO_T (ActionP action)
93
{
94
    return (&(action->result));
95
}
96
#ifdef FS_FAST
97
#define action_result(a) (&((a)->result))
98
#endif /* defined (FS_FAST) */
99
 
100
#ifdef FS_FAST
101
#undef action_get_code
102
#endif /* defined (FS_FAST) */
103
GenericP
104
action_get_code PROTO_N ((action))
105
		PROTO_T (ActionP action)
106
{
107
    return (action->code);
108
}
109
#ifdef FS_FAST
110
#define action_get_code(a) ((a)->code)
111
#endif /* defined (FS_FAST) */
112
 
113
#ifdef FS_FAST
114
#undef action_set_code
115
#endif /* defined (FS_FAST) */
116
void
117
action_set_code PROTO_N ((action, code))
118
		PROTO_T (ActionP  action X
119
			 GenericP code)
120
{
121
    action->code = code;
122
}
123
#ifdef FS_FAST
124
#define action_set_code(a, c) ((a)->code = (c))
125
#endif /* defined (FS_FAST) */
126
 
127
void
128
action_iter_for_table PROTO_N ((action, full, proc, closure))
129
		      PROTO_T (ActionP  action X
130
			       BoolT    full X
131
			       void   (*proc) PROTO_S ((EntryP, GenericP)) X
132
			       GenericP closure)
133
{
134
    if (full) {
135
	types_iter_for_table (action_param (action), proc, closure);
136
	types_iter_for_table (action_result (action), proc, closure);
137
    }
138
}
139
 
140
/*
141
 * Local variables(smf):
142
 * eval: (include::add-path-entry "../os-interface" "../library")
143
 * eval: (include::add-path-entry "../generated")
144
 * end:
145
**/