MHEG5  18.9.0
MHEG5 Documentation
fpa1_cho.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  *******************************************************************************/
27 /*---includes for this file--------------------------------------------------*/
28 #include <stdio.h>
29 #include <stdlib.h>
30 
31 #include "vpa1_sys.h"
32 #include "vpa1_tgs.h"
33 #include "vpa1_rdf.h"
34 
35 #include "fpa1_app.h"
36 #include "fpa1_cho.h"
37 #include "fpa1_col.h"
38 #include "fpa1_ing.h"
39 #include "fpa1_lnk.h"
40 #include "fpa1_obj.h"
41 #include "fpa1_rdf.h"
42 #include "fpa1_seq.h"
43 #include "fpa1_syn.h"
44 #include "fpa1_tgs.h"
45 #include "fpa1_typ.h"
46 #include "fpa1_var.h"
47 
48 #include "fpa1_BlockAlloc.h"
49 
50 /*---local typedef structs for this file-------------------------------------*/
51 
52 /*---constant definitions for this file--------------------------------------*/
53 
54 
55 /*---local (static) variable declarations for this file----------------------*/
56 
57 /*---local function definitions----------------------------------------------*/
58 
59 /*---global function definitions---------------------------------------------*/
60 
66 /* for a CHOICE is filePosLimit needed? - only one selection is necessary! */
68 {
69  int tag = 0xffff, count = 1;
70  fpa1_syntaxList *knownPtr = NULL;
71  vpa1_filePos nextTagPosition,
72  curFilePosition = fpa1_rdfGetCurrentFilePosition();
73 
74  while ((count != choiceArr[0]) && (knownPtr == NULL))
75  {
76  /* get component array for item */
77  if (choiceArr[count] > MHEG5_TYPE)
78  {
79  knownPtr = fpa1_typeParse( choiceArr[count], fpa1_rdfGetNextTagPosn());
80  }
81  else
82  {
83  tag = fpa1_rdfGetTag();
84 
85  if (tag == choiceArr[count])
86  {
87  /* found a match create an item */
88  nextTagPosition = fpa1_rdfGetNextTagPosn();
89 
90  knownPtr = fpa1_synCreateListItem( tag, curFilePosition, nextTagPosition );
91 
92  /* test tag syntax */
93  if (fpa1_tagsParse( knownPtr ) == FALSE)
94  {
95  /* a failure of some sort - delete item */
96  fpa1_delList( knownPtr );
97  knownPtr = NULL;
98  }
99  }
100  }
101 
102  if (knownPtr == NULL)
103  {
104  /* re-establish file position */
105  fpa1_rdfSetNewFilePosition( curFilePosition );
106  }
107 
108  count++;
109  }
110 
111  return knownPtr;
112 }
113 
Contains functions to decode MHEG-5 ASN.1 types.
fpa1_syntaxList * fpa1_synCreateListItem(int, vpa1_filePos, vpa1_filePos)
Definition: fpa1_syn.c:161
vpa1_filePos fpa1_rdfGetCurrentFilePosition(void)
Definition: fpa1_rdf.c:253
Contains functions/globals used to read MHEG-5 ASN.1 scripts.
Contains functions to decode MHEG-5 ASN.1 Link class components.
Contains function to parse MHEG-5 ASN.1 tags.
vpa1_filePos fpa1_rdfGetNextTagPosn(void)
Definition: fpa1_rdf.c:336
fpa1_syntaxList * fpa1_typeParse(int, vpa1_filePos)
Definition: fpa1_typ.c:219
int fpa1_tagsParse(fpa1_syntaxList *)
Definition: fpa1_tgs.c:532
Contains functions/structure used to do MHEG-5 ASN.1 syntax parsing.
Typedefs, macros used by all of parser. These may be duplicated elsewhere.
Typedefs for script reading functions.
Contains macros for MHEG-5 ASN.1 tags and structures.
Contains functions to decode MHEG-5 ASN.1 Ingredient class components.
syntax item block manager Contains functions to create a mini memory manager for allocating syntax li...
Contains functions to decode MHEG-5 ASN.1 Object Reference, External Reference, Indirect Reference...
unsigned short count
int fpa1_delList(fpa1_syntaxList *firstComp)
int fpa1_rdfGetTag(void)
Definition: fpa1_rdf.c:142
Contains functions to decode MHEG-5 ASN.1 Application class components.
#define FALSE
Definition: techtype.h:68
long vpa1_filePos
Definition: vpa1_sys.h:47
Contains functions used to parse MHEG-5 ASN.1 SEQUENCEs. SEQUENCEs have components in order...
fpa1_syntaxList * fpa1_choiceParse(int *choiceArr)
Definition: fpa1_cho.c:67
int fpa1_rdfSetNewFilePosition(vpa1_filePos)
Definition: fpa1_rdf.c:375