MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
mh5variable.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2000 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
32 #ifndef _MH5VARIABLE_H
33 #define _MH5VARIABLE_H
34 
35 /*---includes for this file--------------------------------------------------*/
36 #include "mh5ingredient.h"
37 
38 /*---Constant and macro definitions for public use---------------------------*/
39 
40 /*---Enumerations for public use---------------------------------------------*/
41 
42 /*---Global type defs for public use-----------------------------------------*/
43 typedef struct
44 {
45  /* Base class */
46  MHEG5Ingredient ingredient;
47 
48  /* Exchanged attributes (from Variable class) */
49  MHEG5Bool originalValue;
50 
51  /* Internal attributes (from Variable class) */
52  MHEG5Bool value;
54 
55 
56 typedef struct
57 {
58  /* Base class */
59  MHEG5Ingredient ingredient;
60 
61  /* Exchanged attributes (from Variable class) */
62  MHEG5Int originalValue;
63 
64  /* Internal attributes (from Variable class) */
65  MHEG5Int value;
67 
68 
69 typedef struct
70 {
71  /* Base class */
72  MHEG5Ingredient ingredient;
73 
74  /* Exchanged attributes (from Variable class) */
75  MHEG5String originalValue;
76 
77  /* Internal attributes (from Variable class) */
78  MHEG5String value;
80 
81 
82 typedef struct
83 {
84  /* Base class */
85  MHEG5Ingredient ingredient;
86 
87  /* Exchanged attributes (from Variable class) */
88  MH5GroupRef originalValueGid;
89  MHEG5Int originalValueId;
90 
91  /* Internal attributes (from Variable class) */
92  MHEG5Int valueId;
93  MHEG5String valueGrp;
95 
96 
97 typedef struct
98 {
99  /* Base class */
100  MHEG5Ingredient ingredient;
101 
102  /* Exchanged attributes (from Variable class) */
103  MHEG5String originalContentData;
104 
105  /* Internal attributes (from Variable class) */
106  MHEG5String contentData;
108 
109 /*---Global variable declarations for public use-----------------------------*/
110 
111 /*---Global Function prototypes for public use-------------------------------*/
112 
124 
125 
133 
134 
143 
144 
151 
152 
160 
161 
170 
171 
178 
179 
187  MHEG5OctetStringVariable *variable);
188 
189 
198 
199 void MHEG5octetStringVariableDestruct(MHEG5OctetStringVariable *variable);
200 
207 
215  MHEG5ObjectRefVariable *variable);
216 
217 
226 
227 
234 
235 
243 
244 
253 
254 void MHEG5contentVariableDestruct(MHEG5ContentVariable *variable);
255 
256 void MHEG5objRefStoreValue( MHEG5ObjectRefVariable *objRef, MH5GroupRef ref, MHEG5Int id );
257 void MHEG5objRefStoreString( MHEG5ObjectRefVariable *objRef, MHEG5String ref, MHEG5Int id );
258 
259 /*
260  Internal behaviours
261  */
262 void MHEG5variablePrepare(MHEG5Ingredient *variable);
263 void MHEG5variableActivate(MHEG5Ingredient *variable);
265 void MHEG5variableDestruct(MHEG5Ingredient *variable);
266 
267 /*
268  Actions
269  */
270 MHEG5ErrorCode MHEG5setVariable(MHEG5Root *target, MHEG5GList *params);
271 MHEG5ErrorCode MHEG5testVariable(MHEG5Root *target, MHEG5GList *params);
272 MHEG5ErrorCode MHEG5add(MHEG5Root *target, MHEG5GList *params);
273 MHEG5ErrorCode MHEG5subtract(MHEG5Root *target, MHEG5GList *params);
274 MHEG5ErrorCode MHEG5multiply(MHEG5Root *target, MHEG5GList *params);
275 MHEG5ErrorCode MHEG5divide(MHEG5Root *target, MHEG5GList *params);
276 MHEG5ErrorCode MHEG5modulo(MHEG5Root *target, MHEG5GList *params);
277 MHEG5ErrorCode MHEG5append(MHEG5Root *target, MHEG5GList *params);
278 
279 /*
280  Store/Read Persistant helper functions
281  */
282 /*
283  Store the value of the Variable in the Buffer and Return number of Bytes used.
284  Return -1 for failure
285  */
286 MHEG5Int MHEG5variableStore(MHEG5Ingredient *v, void *buf, MHEG5Int bufLen);
287 
288 /*
289  Set the Variable to the Buffer values and Return the Number of Bytes read.
290  Return -1 for failure
291  */
292 MHEG5Int MHEG5variableRead(MHEG5Ingredient *v, char *buf, MHEG5Int max_size);
293 
294 /*
295  Debug
296  */
297 #ifdef MH5PRINTOUT
298 
305 void MHEG5variablePrint(MHEG5Ingredient *variable, char *out);
306 
314 void MHEG5booleanVariablePrint(MHEG5BooleanVariable *v, char *out);
315 
323 void MHEG5integerVariablePrint(MHEG5IntegerVariable *v, char *out);
324 
332 void MHEG5stringVariablePrint(MHEG5OctetStringVariable *v, char *out);
333 
341 void MHEG5oRefVariablePrint(MHEG5ObjectRefVariable *v, char *out);
342 
350 void MHEG5cRefVariablePrint(MHEG5ContentVariable *v, char *out);
351 
352 #endif /* MH5PRINTOUT */
353 
354 
355 #endif /*_MH5VARIABLE_H*/
Definition: mh5variable.h:97
MHEG5ErrorCode MHEG5subtract(MHEG5Root *target, MHEG5GList *params)
Subtract Value from Target Variable. Target variable is the first operand of the infix operation...
Definition: mh5variable.c:1145
MHEG5Int MHEG5variableStore(MHEG5Ingredient *v, void *buf, MHEG5Int bufLen)
This functions stores the value of a variable in the persistant storage. Implementation of the StoreP...
Definition: mh5variable.c:1437
void MHEG5contentVariableFree(MHEG5ContentVariable *variable)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5variable.c:622
Implementation of the Ingredient class.
void MHEG5octetStringVariablePrepare(MHEG5OctetStringVariable *variable)
Sets all internal attributes for the specified object to their default values.
Definition: mh5variable.c:458
void MHEG5contentVariablePrepare(MHEG5ContentVariable *variable)
Sets all internal attributes for the specified object to their default values.
Definition: mh5variable.c:606
Definition: mh5base.h:82
void MHEG5booleanVariablePrepare(MHEG5BooleanVariable *variable)
Sets all internal attributes for the specified object to their default values.
Definition: mh5variable.c:376
void MHEG5variableDestruct(MHEG5Ingredient *variable)
Destruct a variable object.
Definition: mh5variable.c:720
void MHEG5contentVariableInit(MHEG5ContentVariable *variable)
Initialise a contentVariable object with default values.
Definition: mh5variable.c:593
void MHEG5octetStringVariableFree(MHEG5OctetStringVariable *variable)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5variable.c:474
Definition: mh5ingredient.h:63
Definition: mh5variable.h:43
Definition: mh5variable.h:56
MHEG5Int MHEG5variableRead(MHEG5Ingredient *v, char *buf, MHEG5Int max_size)
This functions reads the value of a variable from the persistant storage. Implementation of the ReadP...
Definition: mh5variable.c:1509
void MHEG5objectRefVariableInit(MHEG5ObjectRefVariable *variable)
Initialise an objectRefVariable object with default values.
Definition: mh5variable.c:496
MHEG5ErrorCode MHEG5multiply(MHEG5Root *target, MHEG5GList *params)
Multiplies Target Variable by Value. Target variable is the first operand of the infix operation...
Definition: mh5variable.c:1183
MHEG5ErrorCode MHEG5divide(MHEG5Root *target, MHEG5GList *params)
Divides Target Variable by Value. Target variable is the first operand of the infix operation...
Definition: mh5variable.c:1218
void MHEG5booleanVariableInit(MHEG5BooleanVariable *variable)
<Function description>="">
Definition: mh5variable.c:363
Definition: mh5base.h:97
void MHEG5objectRefVariablePrepare(MHEG5ObjectRefVariable *variable)
Sets all internal attributes for the specified object to their default values.
Definition: mh5variable.c:560
void MHEG5integerVariableInit(MHEG5IntegerVariable *variable)
Initialise a integerVariable object with default values.
Definition: mh5variable.c:404
void MHEG5integerVariablePrepare(MHEG5IntegerVariable *variable)
Sets all internal attributes for the specified object to their default values.
Definition: mh5variable.c:417
Definition: mh5variable.h:69
MHEG5ErrorCode MHEG5add(MHEG5Root *target, MHEG5GList *params)
Add Target Variable to Value. Target variable is the first operand of the infix operation. Result is stored in Target Variable. Implementation of the Add (Value) action of the IntegerVariable class.
Definition: mh5variable.c:1107
Definition: mh5base.h:169
void MHEG5variableActivate(MHEG5Ingredient *variable)
Apply the activation behaviour of the Variable class. Apply the activation behaviour of the variable ...
Definition: mh5variable.c:665
void MHEG5variableDeactivate(MHEG5Ingredient *variable)
Apply the deactivation behaviour of the variable class. As this class has no own deactivation behavio...
Definition: mh5variable.c:708
MHEG5ErrorCode MHEG5testVariable(MHEG5Root *target, MHEG5GList *params)
This action tests variables agains each other or against values Implementation of the TestVariable (T...
Definition: mh5variable.c:923
void MHEG5octetStringVariableInit(MHEG5OctetStringVariable *variable)
Initialise an octetStringVariable object with default values.
Definition: mh5variable.c:445
MHEG5ErrorCode MHEG5setVariable(MHEG5Root *target, MHEG5GList *params)
Set the Value attribute of the Target object to NewVariableValue. Implementation of the SetVariable (...
Definition: mh5variable.c:761
void MHEG5integerVariableFree(MHEG5IntegerVariable *variable)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5variable.c:433
void MHEG5variablePrepare(MHEG5Ingredient *variable)
Apply the preparation behaviour of the variable class Apply the preparation behaviour of the variable...
Definition: mh5variable.c:653
void MHEG5objectRefVariableFree(MHEG5ObjectRefVariable *variable)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5variable.c:576
Definition: mh5root.h:43
MHEG5ErrorCode MHEG5modulo(MHEG5Root *target, MHEG5GList *params)
Returns the remainder modulo Value of Target - as defined by usual integer arithmetic rules...
Definition: mh5variable.c:1262
void MHEG5booleanVariableFree(MHEG5BooleanVariable *variable)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5variable.c:392
MHEG5ErrorCode MHEG5append(MHEG5Root *target, MHEG5GList *params)
Appends AppendValue to Target Variable. Target variable is the first operand of the infix operation...
Definition: mh5variable.c:1306
Definition: mh5variable.h:82