MHEG-5  19.3.0
MHEG-5 Documentation
fpa1_var.c
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  *******************************************************************************/
28 /*---includes for this file--------------------------------------------------*/
29 #include <stdio.h>
30 #include <stdlib.h>
31 
32 #include "vpa1_tgs.h"
33 #include "vpa1_rdf.h"
34 
35 #include "fpa1_cho.h"
36 #include "fpa1_set.h"
37 #include "fpa1_syn.h"
38 #include "fpa1_var.h"
39 #include "fpa1_BlockAlloc.h"
40 
41 /*---local typedef structs for this file-------------------------------------*/
42 
43 /*---constant definitions for this file--------------------------------------*/
44 #define VAR_SET_COMPS 4
45 #define ORI_VAR_CHOICE_COMPS 5
46 
47 
48 /*---local (static) variable declarations for this file----------------------*/
49 
50 int varSetCompsArr[ 2 * VAR_SET_COMPS + 1 ]
51  = { 2 * VAR_SET_COMPS, /* array limit */
52  /* Ingredient */
53  OBJECT_REFERENCE_TYPE, SYN_NEEDED,
54  INITACTIVE, SYN_DEFAULT,
55  SHARED, SYN_DEFAULT,
56  /* Variable */
57  OVALUE, SYN_NEEDED };
58 
59 int oriVarChoiceCompArr[ ORI_VAR_CHOICE_COMPS + 1 ]
60  = { ORI_VAR_CHOICE_COMPS + 1,
61  MHEG_BOOL,
62  INTEGER,
63  OCTETSTRING,
64  OBJREF,
65  CONTREF };
66 
67 /*---local function definitions----------------------------------------------*/
68 
69 /*---global function definitions---------------------------------------------*/
70 
75 fpa1_syntaxList* fpa1_decodeVariable( vpa1_filePos filePosLimit, int childTag )
76 {
77  fpa1_syntaxList *itemPtr;
78  fpa1_syntaxList *varListPtr;
79 
80  varListPtr = fpa1_setParse( varSetCompsArr, filePosLimit );
81 
82  itemPtr = varListPtr;
83 
84  while (itemPtr != NULL)
85  {
86  if (itemPtr->tag == OVALUE)
87  {
88  if (itemPtr->children->tag != childTag)
89  {
90  /* Free up memory */
91  fpa1_delList( varListPtr );
92  varListPtr = NULL;
93  }
94  break;
95  }
96 
97  itemPtr = itemPtr->next;
98  }
99 
100  return varListPtr;
101 }
102 
fpa1_syntaxList * fpa1_setParse(int *, vpa1_filePos)
Definition: fpa1_set.c:178
Contains functions/structure used to do MHEG-5 ASN.1 syntax parsing.
Typedefs for script reading functions.
Contains macros for MHEG-5 ASN.1 tags and structures.
syntax item block manager Contains functions to create a mini memory manager for allocating syntax li...
int fpa1_delList(fpa1_syntaxList *firstComp)
Contains functions used to parse MHEG-5 ASN.1 SETs. SETs can have components in any order and as such...
fpa1_syntaxList * fpa1_decodeVariable(vpa1_filePos filePosLimit, int childTag)
Definition: fpa1_var.c:75