MHEG5  18.9.0
MHEG5 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 */
56  /* Variable */
57  OVALUE, SYN_NEEDED };
58 
61  MHEG_BOOL,
62  INTEGER,
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 
#define CONTREF
Definition: vpa1_tgs.h:118
fpa1_syntaxList * fpa1_setParse(int *, vpa1_filePos)
Definition: fpa1_set.c:178
#define SYN_NEEDED
Definition: fpa1_syn.h:34
#define OVALUE
Definition: vpa1_tgs.h:116
#define ORI_VAR_CHOICE_COMPS
Definition: fpa1_var.c:45
#define INTEGER
Definition: vpa1_tgs.h:40
#define OBJREF
Definition: vpa1_tgs.h:117
#define INITACTIVE
Definition: vpa1_tgs.h:105
Contains functions/structure used to do MHEG-5 ASN.1 syntax parsing.
struct fpa1_syntaxItem * children
Definition: fpa1_syn.h:53
#define SYN_DEFAULT
Definition: fpa1_syn.h:36
Typedefs for script reading functions.
#define OCTETSTRING
Definition: vpa1_tgs.h:41
Contains macros for MHEG-5 ASN.1 tags and structures.
#define SHARED
Definition: vpa1_tgs.h:108
#define VAR_SET_COMPS
Definition: fpa1_var.c:44
int oriVarChoiceCompArr[ORI_VAR_CHOICE_COMPS+1]
Definition: fpa1_var.c:60
syntax item block manager Contains functions to create a mini memory manager for allocating syntax li...
#define MHEG_BOOL
Definition: vpa1_tgs.h:39
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...
int varSetCompsArr[2 *VAR_SET_COMPS+1]
Definition: fpa1_var.c:51
long vpa1_filePos
Definition: vpa1_sys.h:47
struct fpa1_syntaxItem * next
Definition: fpa1_syn.h:52
fpa1_syntaxList * fpa1_decodeVariable(vpa1_filePos filePosLimit, int childTag)
Definition: fpa1_var.c:75