test_dr.c 36.2 KB
Newer Older
1 2 3 4 5 6 7

/* This file is generated by applying the dr.xsl stylesheet to the dr.xml
 * description file. DO NOT EDIT !!! */

#include "config.h"

#include <stdio.h>
8
#include <stdbool.h>
9 10 11
#include <stdlib.h>
#include <string.h>
#include <time.h>
12

13 14 15 16 17 18
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
#elif defined(HAVE_STDINT_H)
#include <stdint.h>
#endif

19 20 21 22 23 24 25 26 27 28 29 30 31
/* the libdvbpsi distribution defines DVBPSI_DIST */
#ifdef DVBPSI_DIST
#include "../src/dvbpsi.h"
#include "../src/descriptor.h"
#include "../src/descriptors/dr.h"
#else
#include <dvbpsi/dvbpsi.h>
#include <dvbpsi/descriptor.h>
#include <dvbpsi/dr.h>
#endif

#include "test_dr.h"

32
  
33
/* video stream (b_mpeg2 = false) */
34
static int main_vstream_1(void)
35 36
{
  BOZO_VARS(vstream);
37
  BOZO_START(video stream (b_mpeg2 = false));
38

39
  
40 41 42
  /* check b_multiple_frame_rate */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
43
  s_decoded.b_mpeg2 = false;
44 45
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
46
  BOZO_begin_boolean(b_multiple_frame_rate)
47 48 49 50 51 52 53 54
    BOZO_DOJOB(VStream);
    BOZO_check_boolean(b_multiple_frame_rate)
    BOZO_CLEAN();
  BOZO_end_boolean(b_multiple_frame_rate)

  /* check i_frame_rate_code */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
55
  s_decoded.b_mpeg2 = false;
56 57
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
58
  BOZO_begin_integer(i_frame_rate_code, 4)
59 60 61
    BOZO_DOJOB(VStream);
    BOZO_check_integer(i_frame_rate_code, 4)
    BOZO_CLEAN();
62
  BOZO_end_integer(i_frame_rate_code, 4)
63 64 65 66

  /* check b_constrained_parameter */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
67
  s_decoded.b_mpeg2 = false;
68 69
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
70
  BOZO_begin_boolean(b_constrained_parameter)
71 72 73 74
    BOZO_DOJOB(VStream);
    BOZO_check_boolean(b_constrained_parameter)
    BOZO_CLEAN();
  BOZO_end_boolean(b_constrained_parameter)
75

76 77 78
  /* check b_still_picture */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
79
  s_decoded.b_mpeg2 = false;
80 81 82
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_begin_boolean(b_still_picture)
83
    BOZO_DOJOB(VStream);
84 85 86 87 88 89 90 91 92
    BOZO_check_boolean(b_still_picture)
    BOZO_CLEAN();
  BOZO_end_boolean(b_still_picture)


  BOZO_END(video stream (b_mpeg2 = false));

  return i_err;
}
93

94
/* video stream (b_mpeg2 = true) */
95
static int main_vstream_2(void)
96 97 98 99
{
  BOZO_VARS(vstream);
  BOZO_START(video stream (b_mpeg2 = true));

100
  
101 102 103
  /* check b_multiple_frame_rate */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
104
  s_decoded.b_mpeg2 = true;
105 106 107 108 109 110 111
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_init_integer(i_profile_level_indication, 0);
  BOZO_init_integer(i_chroma_format, 0);
  BOZO_init_boolean(b_frame_rate_extension, 0);
  BOZO_begin_boolean(b_multiple_frame_rate)
    BOZO_DOJOB(VStream);
112
    BOZO_check_boolean(b_multiple_frame_rate)
113 114 115 116 117 118
    BOZO_CLEAN();
  BOZO_end_boolean(b_multiple_frame_rate)

  /* check i_frame_rate_code */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
119
  s_decoded.b_mpeg2 = true;
120 121 122 123 124
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_init_integer(i_profile_level_indication, 0);
  BOZO_init_integer(i_chroma_format, 0);
  BOZO_init_boolean(b_frame_rate_extension, 0);
125
  BOZO_begin_integer(i_frame_rate_code, 4)
126
    BOZO_DOJOB(VStream);
127
    BOZO_check_integer(i_frame_rate_code, 4)
128
    BOZO_CLEAN();
129
  BOZO_end_integer(i_frame_rate_code, 4)
130 131 132 133

  /* check b_constrained_parameter */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
134
  s_decoded.b_mpeg2 = true;
135 136 137 138 139 140 141
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_init_integer(i_profile_level_indication, 0);
  BOZO_init_integer(i_chroma_format, 0);
  BOZO_init_boolean(b_frame_rate_extension, 0);
  BOZO_begin_boolean(b_constrained_parameter)
    BOZO_DOJOB(VStream);
142
    BOZO_check_boolean(b_constrained_parameter)
143 144 145 146 147 148
    BOZO_CLEAN();
  BOZO_end_boolean(b_constrained_parameter)

  /* check b_still_picture */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
149
  s_decoded.b_mpeg2 = true;
150 151 152 153 154 155 156
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_init_integer(i_profile_level_indication, 0);
  BOZO_init_integer(i_chroma_format, 0);
  BOZO_init_boolean(b_frame_rate_extension, 0);
  BOZO_begin_boolean(b_still_picture)
    BOZO_DOJOB(VStream);
157
    BOZO_check_boolean(b_still_picture)
158 159 160 161 162 163
    BOZO_CLEAN();
  BOZO_end_boolean(b_still_picture)

  /* check i_profile_level_indication */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
164
  s_decoded.b_mpeg2 = true;
165 166 167 168 169
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_init_integer(i_profile_level_indication, 0);
  BOZO_init_integer(i_chroma_format, 0);
  BOZO_init_boolean(b_frame_rate_extension, 0);
170
  BOZO_begin_integer(i_profile_level_indication, 8)
171
    BOZO_DOJOB(VStream);
172
    BOZO_check_integer(i_profile_level_indication, 8)
173
    BOZO_CLEAN();
174
  BOZO_end_integer(i_profile_level_indication, 8)
175 176 177 178

  /* check i_chroma_format */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
179
  s_decoded.b_mpeg2 = true;
180 181 182 183 184
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_init_integer(i_profile_level_indication, 0);
  BOZO_init_integer(i_chroma_format, 0);
  BOZO_init_boolean(b_frame_rate_extension, 0);
185
  BOZO_begin_integer(i_chroma_format, 2)
186
    BOZO_DOJOB(VStream);
187
    BOZO_check_integer(i_chroma_format, 2)
188
    BOZO_CLEAN();
189
  BOZO_end_integer(i_chroma_format, 2)
190 191 192 193

  /* check b_frame_rate_extension */
  BOZO_init_boolean(b_multiple_frame_rate, 0);
  BOZO_init_integer(i_frame_rate_code, 0);
194
  s_decoded.b_mpeg2 = true;
195 196 197 198 199 200 201
  BOZO_init_boolean(b_constrained_parameter, 0);
  BOZO_init_boolean(b_still_picture, 0);
  BOZO_init_integer(i_profile_level_indication, 0);
  BOZO_init_integer(i_chroma_format, 0);
  BOZO_init_boolean(b_frame_rate_extension, 0);
  BOZO_begin_boolean(b_frame_rate_extension)
    BOZO_DOJOB(VStream);
202 203 204 205
    BOZO_check_boolean(b_frame_rate_extension)
    BOZO_CLEAN();
  BOZO_end_boolean(b_frame_rate_extension)

206 207

  BOZO_END(video stream (b_mpeg2 = true));
208 209 210 211 212

  return i_err;
}

/* audio stream */
213
static int main_astream_(void)
214 215 216 217
{
  BOZO_VARS(astream);
  BOZO_START(audio stream);

218
  
219 220 221 222
  /* check b_free_format */
  BOZO_init_boolean(b_free_format, 0);
  BOZO_init_integer(i_id, 0);
  BOZO_init_integer(i_layer, 0);
223 224 225
  BOZO_begin_boolean(b_free_format)
    BOZO_DOJOB(AStream);
    BOZO_check_boolean(b_free_format)
226 227 228 229 230 231 232
    BOZO_CLEAN();
  BOZO_end_boolean(b_free_format)

  /* check i_id */
  BOZO_init_boolean(b_free_format, 0);
  BOZO_init_integer(i_id, 0);
  BOZO_init_integer(i_layer, 0);
233
  BOZO_begin_integer(i_id, 1)
234
    BOZO_DOJOB(AStream);
235
    BOZO_check_integer(i_id, 1)
236
    BOZO_CLEAN();
237
  BOZO_end_integer(i_id, 1)
238

239 240 241 242
  /* check i_layer */
  BOZO_init_boolean(b_free_format, 0);
  BOZO_init_integer(i_id, 0);
  BOZO_init_integer(i_layer, 0);
243
  BOZO_begin_integer(i_layer, 2)
244 245
    BOZO_DOJOB(AStream);
    BOZO_check_integer(i_layer, 2)
246
    BOZO_CLEAN();
247
  BOZO_end_integer(i_layer, 2)
248 249 250 251 252 253 254 255


  BOZO_END(audio stream);

  return i_err;
}

/* hierarchy */
256
static int main_hierarchy_(void)
257 258 259 260
{
  BOZO_VARS(hierarchy);
  BOZO_START(hierarchy);

261
  
262 263 264 265 266
  /* check i_h_type */
  BOZO_init_integer(i_h_type, 0);
  BOZO_init_integer(i_h_layer_index, 0);
  BOZO_init_integer(i_h_embedded_layer, 0);
  BOZO_init_integer(i_h_priority, 0);
267
  BOZO_begin_integer(i_h_type, 4)
268 269
    BOZO_DOJOB(Hierarchy);
    BOZO_check_integer(i_h_type, 4)
270
    BOZO_CLEAN();
271
  BOZO_end_integer(i_h_type, 4)
272 273 274 275 276 277

  /* check i_h_layer_index */
  BOZO_init_integer(i_h_type, 0);
  BOZO_init_integer(i_h_layer_index, 0);
  BOZO_init_integer(i_h_embedded_layer, 0);
  BOZO_init_integer(i_h_priority, 0);
278
  BOZO_begin_integer(i_h_layer_index, 6)
279
    BOZO_DOJOB(Hierarchy);
280
    BOZO_check_integer(i_h_layer_index, 6)
281
    BOZO_CLEAN();
282
  BOZO_end_integer(i_h_layer_index, 6)
283 284 285 286 287 288

  /* check i_h_embedded_layer */
  BOZO_init_integer(i_h_type, 0);
  BOZO_init_integer(i_h_layer_index, 0);
  BOZO_init_integer(i_h_embedded_layer, 0);
  BOZO_init_integer(i_h_priority, 0);
289
  BOZO_begin_integer(i_h_embedded_layer, 6)
290
    BOZO_DOJOB(Hierarchy);
291
    BOZO_check_integer(i_h_embedded_layer, 6)
292
    BOZO_CLEAN();
293
  BOZO_end_integer(i_h_embedded_layer, 6)
294 295 296 297 298 299

  /* check i_h_priority */
  BOZO_init_integer(i_h_type, 0);
  BOZO_init_integer(i_h_layer_index, 0);
  BOZO_init_integer(i_h_embedded_layer, 0);
  BOZO_init_integer(i_h_priority, 0);
300
  BOZO_begin_integer(i_h_priority, 6)
301
    BOZO_DOJOB(Hierarchy);
302 303
    BOZO_check_integer(i_h_priority, 6)
    BOZO_CLEAN();
304
  BOZO_end_integer(i_h_priority, 6)
305 306 307 308 309 310 311 312


  BOZO_END(hierarchy);

  return i_err;
}

/* registration */
313
static int main_registration_(void)
314 315 316 317
{
  BOZO_VARS(registration);
  BOZO_START(registration);

318
  
319
  /* check i_format_identifier */
320
  s_decoded.i_additional_length = 0;
321
  BOZO_init_integer(i_format_identifier, 0);
322
  BOZO_begin_integer(i_format_identifier, 32)
323
    BOZO_DOJOB(Registration);
324
    BOZO_check_integer(i_format_identifier, 32)
325
    BOZO_CLEAN();
326
  BOZO_end_integer(i_format_identifier, 32)
327 328 329 330 331 332 333 334


  BOZO_END(registration);

  return i_err;
}

/* data stream alignment */
335
static int main_ds_alignment_(void)
336 337 338 339
{
  BOZO_VARS(ds_alignment);
  BOZO_START(data stream alignment);

340
  
341 342
  /* check i_alignment_type */
  BOZO_init_integer(i_alignment_type, 0);
343
  BOZO_begin_integer(i_alignment_type, 8)
344 345 346
    BOZO_DOJOB(DSAlignment);
    BOZO_check_integer(i_alignment_type, 8)
    BOZO_CLEAN();
347
  BOZO_end_integer(i_alignment_type, 8)
348 349 350 351 352 353 354 355


  BOZO_END(data stream alignment);

  return i_err;
}

/* target background grid */
356
static int main_target_bg_grid_(void)
357 358 359 360
{
  BOZO_VARS(target_bg_grid);
  BOZO_START(target background grid);

361
  
362 363 364 365
  /* check i_horizontal_size */
  BOZO_init_integer(i_horizontal_size, 0);
  BOZO_init_integer(i_vertical_size, 0);
  BOZO_init_integer(i_pel_aspect_ratio, 0);
366
  BOZO_begin_integer(i_horizontal_size, 14)
367 368
    BOZO_DOJOB(TargetBgGrid);
    BOZO_check_integer(i_horizontal_size, 14)
369
    BOZO_CLEAN();
370
  BOZO_end_integer(i_horizontal_size, 14)
371 372 373 374 375

  /* check i_vertical_size */
  BOZO_init_integer(i_horizontal_size, 0);
  BOZO_init_integer(i_vertical_size, 0);
  BOZO_init_integer(i_pel_aspect_ratio, 0);
376
  BOZO_begin_integer(i_vertical_size, 14)
377
    BOZO_DOJOB(TargetBgGrid);
378
    BOZO_check_integer(i_vertical_size, 14)
379
    BOZO_CLEAN();
380
  BOZO_end_integer(i_vertical_size, 14)
381

382 383 384 385
  /* check i_pel_aspect_ratio */
  BOZO_init_integer(i_horizontal_size, 0);
  BOZO_init_integer(i_vertical_size, 0);
  BOZO_init_integer(i_pel_aspect_ratio, 0);
386
  BOZO_begin_integer(i_pel_aspect_ratio, 4)
387 388
    BOZO_DOJOB(TargetBgGrid);
    BOZO_check_integer(i_pel_aspect_ratio, 4)
389
    BOZO_CLEAN();
390
  BOZO_end_integer(i_pel_aspect_ratio, 4)
391 392 393 394 395 396 397 398


  BOZO_END(target background grid);

  return i_err;
}

/* video window */
399
static int main_vwindow_(void)
400 401 402 403
{
  BOZO_VARS(vwindow);
  BOZO_START(video window);

404
  
405 406 407 408
  /* check i_horizontal_offset */
  BOZO_init_integer(i_horizontal_offset, 0);
  BOZO_init_integer(i_vertical_offset, 0);
  BOZO_init_integer(i_window_priority, 0);
409
  BOZO_begin_integer(i_horizontal_offset, 14)
410 411
    BOZO_DOJOB(VWindow);
    BOZO_check_integer(i_horizontal_offset, 14)
412
    BOZO_CLEAN();
413
  BOZO_end_integer(i_horizontal_offset, 14)
414 415 416 417 418

  /* check i_vertical_offset */
  BOZO_init_integer(i_horizontal_offset, 0);
  BOZO_init_integer(i_vertical_offset, 0);
  BOZO_init_integer(i_window_priority, 0);
419
  BOZO_begin_integer(i_vertical_offset, 14)
420
    BOZO_DOJOB(VWindow);
421
    BOZO_check_integer(i_vertical_offset, 14)
422
    BOZO_CLEAN();
423
  BOZO_end_integer(i_vertical_offset, 14)
424

425 426 427 428
  /* check i_window_priority */
  BOZO_init_integer(i_horizontal_offset, 0);
  BOZO_init_integer(i_vertical_offset, 0);
  BOZO_init_integer(i_window_priority, 0);
429
  BOZO_begin_integer(i_window_priority, 4)
430 431
    BOZO_DOJOB(VWindow);
    BOZO_check_integer(i_window_priority, 4)
432
    BOZO_CLEAN();
433
  BOZO_end_integer(i_window_priority, 4)
434 435 436 437 438 439 440 441


  BOZO_END(video window);

  return i_err;
}

/* conditional access */
442
static int main_ca_(void)
443 444 445 446
{
  BOZO_VARS(ca);
  BOZO_START(conditional access);

447
  
448
  /* check i_ca_system_id */
449
  s_decoded.i_private_length = 0;
450 451
  BOZO_init_integer(i_ca_system_id, 0);
  BOZO_init_integer(i_ca_pid, 0);
452
  BOZO_begin_integer(i_ca_system_id, 16)
453 454
    BOZO_DOJOB(CA);
    BOZO_check_integer(i_ca_system_id, 16)
455
    BOZO_CLEAN();
456
  BOZO_end_integer(i_ca_system_id, 16)
457

458 459 460 461
  /* check i_ca_pid */
  s_decoded.i_private_length = 0;
  BOZO_init_integer(i_ca_system_id, 0);
  BOZO_init_integer(i_ca_pid, 0);
462
  BOZO_begin_integer(i_ca_pid, 13)
463 464
    BOZO_DOJOB(CA);
    BOZO_check_integer(i_ca_pid, 13)
465
    BOZO_CLEAN();
466
  BOZO_end_integer(i_ca_pid, 13)
467

468 469 470 471
  /* check i_private_data */
  s_decoded.i_private_length = 0;
  BOZO_init_integer(i_ca_system_id, 0);
  BOZO_init_integer(i_ca_pid, 0);
472
  BOZO_begin_array(i_private_data, i_private_length, 0)
473
    BOZO_DOJOB(CA);
474 475
    BOZO_check_array_begin(i_private_data, i_private_length)
    BOZO_check_array_gen(i_private_data, i_private_length)
476
    BOZO_CLEAN();
477
  BOZO_end_array(i_private_data, ARRAY_SIZE(s_decoded.i_private_data))
478

479 480 481 482 483
  BOZO_END(conditional access);

  return i_err;
}

484 485 486 487 488 489 490 491 492 493
/* ISO 639 language */
static int main_iso639_(void)
{
  BOZO_VARS(iso639);
  BOZO_START(ISO 639 language);


  /* check code */
  BOZO_begin_array(code, i_code_count, 1)
    BOZO_DOJOB(ISO639);
494 495
    BOZO_check_array_begin(code, i_code_count)
    BOZO_check_array_gen(code, i_code_count)
496
    BOZO_CLEAN();
497
  BOZO_end_array(code, ARRAY_SIZE(s_decoded.code))
498 499 500 501 502 503

  BOZO_END(ISO 639 language);

  return i_err;
}

504
/* system clock */
505
static int main_system_clock_(void)
506 507 508 509
{
  BOZO_VARS(system_clock);
  BOZO_START(system clock);

510
  
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547
  /* check b_external_clock_ref */
  BOZO_init_boolean(b_external_clock_ref, 0);
  BOZO_init_integer(i_clock_accuracy_integer, 0);
  BOZO_init_integer(i_clock_accuracy_exponent, 0);
  BOZO_begin_boolean(b_external_clock_ref)
    BOZO_DOJOB(SystemClock);
    BOZO_check_boolean(b_external_clock_ref)
    BOZO_CLEAN();
  BOZO_end_boolean(b_external_clock_ref)

  /* check i_clock_accuracy_integer */
  BOZO_init_boolean(b_external_clock_ref, 0);
  BOZO_init_integer(i_clock_accuracy_integer, 0);
  BOZO_init_integer(i_clock_accuracy_exponent, 0);
  BOZO_begin_integer(i_clock_accuracy_integer, 6)
    BOZO_DOJOB(SystemClock);
    BOZO_check_integer(i_clock_accuracy_integer, 6)
    BOZO_CLEAN();
  BOZO_end_integer(i_clock_accuracy_integer, 6)

  /* check i_clock_accuracy_exponent */
  BOZO_init_boolean(b_external_clock_ref, 0);
  BOZO_init_integer(i_clock_accuracy_integer, 0);
  BOZO_init_integer(i_clock_accuracy_exponent, 0);
  BOZO_begin_integer(i_clock_accuracy_exponent, 3)
    BOZO_DOJOB(SystemClock);
    BOZO_check_integer(i_clock_accuracy_exponent, 3)
    BOZO_CLEAN();
  BOZO_end_integer(i_clock_accuracy_exponent, 3)


  BOZO_END(system clock);

  return i_err;
}

/* multiplex buffer utilization */
548
static int main_mx_buff_utilization_(void)
549 550 551 552
{
  BOZO_VARS(mx_buff_utilization);
  BOZO_START(multiplex buffer utilization);

553
  
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590
  /* check b_mdv_valid */
  BOZO_init_boolean(b_mdv_valid, 0);
  BOZO_init_integer(i_mx_delay_variation, 0);
  BOZO_init_integer(i_mx_strategy, 0);
  BOZO_begin_boolean(b_mdv_valid)
    BOZO_DOJOB(MxBuffUtilization);
    BOZO_check_boolean(b_mdv_valid)
    BOZO_CLEAN();
  BOZO_end_boolean(b_mdv_valid)

  /* check i_mx_delay_variation */
  BOZO_init_boolean(b_mdv_valid, 0);
  BOZO_init_integer(i_mx_delay_variation, 0);
  BOZO_init_integer(i_mx_strategy, 0);
  BOZO_begin_integer(i_mx_delay_variation, 15)
    BOZO_DOJOB(MxBuffUtilization);
    BOZO_check_integer(i_mx_delay_variation, 15)
    BOZO_CLEAN();
  BOZO_end_integer(i_mx_delay_variation, 15)

  /* check i_mx_strategy */
  BOZO_init_boolean(b_mdv_valid, 0);
  BOZO_init_integer(i_mx_delay_variation, 0);
  BOZO_init_integer(i_mx_strategy, 0);
  BOZO_begin_integer(i_mx_strategy, 3)
    BOZO_DOJOB(MxBuffUtilization);
    BOZO_check_integer(i_mx_strategy, 3)
    BOZO_CLEAN();
  BOZO_end_integer(i_mx_strategy, 3)


  BOZO_END(multiplex buffer utilization);

  return i_err;
}

/* copyright */
591
static int main_copyright_(void)
592 593 594 595
{
  BOZO_VARS(copyright);
  BOZO_START(copyright);

596
  
597 598 599 600 601 602 603 604 605
  /* check i_copyright_identifier */
  s_decoded.i_additional_length = 0;
  BOZO_init_integer(i_copyright_identifier, 0);
  BOZO_begin_integer(i_copyright_identifier, 32)
    BOZO_DOJOB(Copyright);
    BOZO_check_integer(i_copyright_identifier, 32)
    BOZO_CLEAN();
  BOZO_end_integer(i_copyright_identifier, 32)

606 607 608 609 610
  /* check i_additional_info */
  s_decoded.i_additional_length = 0;
  BOZO_init_integer(i_copyright_identifier, 0);
  BOZO_begin_array(i_additional_info, i_additional_length, 0)
    BOZO_DOJOB(Copyright);
611 612
    BOZO_check_array_begin(i_additional_info, i_additional_length)
    BOZO_check_array_gen(i_additional_info, i_additional_length)
613
    BOZO_CLEAN();
614
  BOZO_end_array(i_additional_info, ARRAY_SIZE(s_decoded.i_additional_info))
615

616 617 618 619 620 621
  BOZO_END(copyright);

  return i_err;
}

/* maximum bitrate */
622
static int main_max_bitrate_(void)
623 624 625 626
{
  BOZO_VARS(max_bitrate);
  BOZO_START(maximum bitrate);

627
  
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642
  /* check i_max_bitrate */
  BOZO_init_integer(i_max_bitrate, 0);
  BOZO_begin_integer(i_max_bitrate, 22)
    BOZO_DOJOB(MaxBitrate);
    BOZO_check_integer(i_max_bitrate, 22)
    BOZO_CLEAN();
  BOZO_end_integer(i_max_bitrate, 22)


  BOZO_END(maximum bitrate);

  return i_err;
}

/* private data indicator */
643
static int main_private_data_(void)
644 645 646 647
{
  BOZO_VARS(private_data);
  BOZO_START(private data indicator);

648
  
649 650 651 652 653 654 655 656 657 658 659 660 661 662
  /* check i_private_data */
  BOZO_init_integer(i_private_data, 0);
  BOZO_begin_integer(i_private_data, 32)
    BOZO_DOJOB(PrivateData);
    BOZO_check_integer(i_private_data, 32)
    BOZO_CLEAN();
  BOZO_end_integer(i_private_data, 32)


  BOZO_END(private data indicator);

  return i_err;
}

663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696
/* smoothing buffer */
static int main_smoothing_buffer_(void)
{
  BOZO_VARS(smoothing_buffer);
  BOZO_START(smoothing buffer);


  #define dvbpsi_GenSmoothingBufferDr(x,y) \
    dvbpsi_GenSmoothingBufferDr(x)

  /* check i_sb_leak_rate */
  BOZO_init_integer(i_sb_leak_rate, 0);
  BOZO_init_integer(i_sb_size, 0);
  BOZO_begin_integer(i_sb_leak_rate, 22)
    BOZO_DOJOB(SmoothingBuffer);
    BOZO_check_integer(i_sb_leak_rate, 22)
    BOZO_CLEAN();
  BOZO_end_integer(i_sb_leak_rate, 22)

  /* check i_sb_size */
  BOZO_init_integer(i_sb_leak_rate, 0);
  BOZO_init_integer(i_sb_size, 0);
  BOZO_begin_integer(i_sb_size, 22)
    BOZO_DOJOB(SmoothingBuffer);
    BOZO_check_integer(i_sb_size, 22)
    BOZO_CLEAN();
  BOZO_end_integer(i_sb_size, 22)


  BOZO_END(smoothing buffer);

  return i_err;
}

697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720
/* STD */
static int main_std_(void)
{
  BOZO_VARS(std);
  BOZO_START(STD);


  #define dvbpsi_GenSTDDr(x,y) \
    dvbpsi_GenSTDDr(x)

  /* check b_leak_valid_flag */
  BOZO_init_boolean(b_leak_valid_flag, 0);
  BOZO_begin_boolean(b_leak_valid_flag)
    BOZO_DOJOB(STD);
    BOZO_check_boolean(b_leak_valid_flag)
    BOZO_CLEAN();
  BOZO_end_boolean(b_leak_valid_flag)


  BOZO_END(STD);

  return i_err;
}

721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766
/* IBP */
static int main_ibp_(void)
{
  BOZO_VARS(ibp);
  BOZO_START(IBP);


  #define dvbpsi_GenIBPDr(x,y) \
    dvbpsi_GenIBPDr(x)

  /* check b_closed_gop_flag */
  BOZO_init_boolean(b_closed_gop_flag, 0);
  BOZO_init_boolean(b_identical_gop_flag, 0);
  BOZO_init_integer(i_max_gop_length, 1);
  BOZO_begin_boolean(b_closed_gop_flag)
    BOZO_DOJOB(IBP);
    BOZO_check_boolean(b_closed_gop_flag)
    BOZO_CLEAN();
  BOZO_end_boolean(b_closed_gop_flag)

  /* check b_identical_gop_flag */
  BOZO_init_boolean(b_closed_gop_flag, 0);
  BOZO_init_boolean(b_identical_gop_flag, 0);
  BOZO_init_integer(i_max_gop_length, 1);
  BOZO_begin_boolean(b_identical_gop_flag)
    BOZO_DOJOB(IBP);
    BOZO_check_boolean(b_identical_gop_flag)
    BOZO_CLEAN();
  BOZO_end_boolean(b_identical_gop_flag)

  /* check i_max_gop_length */
  BOZO_init_boolean(b_closed_gop_flag, 0);
  BOZO_init_boolean(b_identical_gop_flag, 0);
  BOZO_init_integer(i_max_gop_length, 1);
  BOZO_begin_integer(i_max_gop_length, 14)
    BOZO_DOJOB(IBP);
    BOZO_check_integer(i_max_gop_length, 14)
    BOZO_CLEAN();
  BOZO_end_integer(i_max_gop_length, 14)


  BOZO_END(IBP);

  return i_err;
}

767
/* MPEG-4 video */
768 769 770
static int main_mpeg4_video_(void)
{
  BOZO_VARS(mpeg4_video);
771
  BOZO_START(MPEG-4 video);
772 773 774 775 776 777 778 779 780 781 782 783 784 785


  #define dvbpsi_GenMPEG4VideoDr(x,y) \
    dvbpsi_GenMPEG4VideoDr(x)

  /* check i_mpeg4_visual_profile_and_level */
  BOZO_init_integer(i_mpeg4_visual_profile_and_level, 0);
  BOZO_begin_integer(i_mpeg4_visual_profile_and_level, 8)
    BOZO_DOJOB(MPEG4Video);
    BOZO_check_integer(i_mpeg4_visual_profile_and_level, 8)
    BOZO_CLEAN();
  BOZO_end_integer(i_mpeg4_visual_profile_and_level, 8)


786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810
  BOZO_END(MPEG-4 video);

  return i_err;
}

/* MPEG-4 audio */
static int main_mpeg4_audio_(void)
{
  BOZO_VARS(mpeg4_audio);
  BOZO_START(MPEG-4 audio);


  #define dvbpsi_GenMPEG4AudioDr(x,y) \
    dvbpsi_GenMPEG4AudioDr(x)

  /* check i_mpeg4_audio_profile_and_level */
  BOZO_init_integer(i_mpeg4_audio_profile_and_level, 0);
  BOZO_begin_integer(i_mpeg4_audio_profile_and_level, 8)
    BOZO_DOJOB(MPEG4Audio);
    BOZO_check_integer(i_mpeg4_audio_profile_and_level, 8)
    BOZO_CLEAN();
  BOZO_end_integer(i_mpeg4_audio_profile_and_level, 8)


  BOZO_END(MPEG-4 audio);
811 812 813 814

  return i_err;
}

815 816 817 818 819 820 821 822 823 824
/* network name */
static int main_network_name_(void)
{
  BOZO_VARS(network_name);
  BOZO_START(network name);


  /* check i_name_byte */
  BOZO_begin_array(i_name_byte, i_name_length, 0)
    BOZO_DOJOB(NetworkName);
825 826
    BOZO_check_array_begin(i_name_byte, i_name_length)
    BOZO_check_array_gen(i_name_byte, i_name_length)
827 828 829 830 831 832 833 834
    BOZO_CLEAN();
  BOZO_end_array(i_name_byte, ARRAY_SIZE(s_decoded.i_name_byte))

  BOZO_END(network name);

  return i_err;
}

835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854
/* service list */
static int main_service_list_(void)
{
  BOZO_VARS(service_list);
  BOZO_START(service list);


  /* check i_service */
  BOZO_begin_array(i_service, i_service_count, 1)
    BOZO_DOJOB(ServiceList);
    BOZO_check_array_begin(i_service, i_service_count)
    BOZO_check_array_cmp(i_service, i_service_count, dvbpsi_service_list_service_s)
    BOZO_CLEAN();
  BOZO_end_array(i_service, ARRAY_SIZE(s_decoded.i_service))

  BOZO_END(service list);

  return i_err;
}

855 856 857 858 859 860 861 862 863 864
/* stuffing */
static int main_stuffing_(void)
{
  BOZO_VARS(stuffing);
  BOZO_START(stuffing);


  /* check i_stuffing_byte */
  BOZO_begin_array(i_stuffing_byte, i_stuffing_length, 0)
    BOZO_DOJOB(Stuffing);
865 866
    BOZO_check_array_begin(i_stuffing_byte, i_stuffing_length)
    BOZO_check_array_gen(i_stuffing_byte, i_stuffing_length)
867
    BOZO_CLEAN();
868
  BOZO_end_array(i_stuffing_byte, ARRAY_SIZE(s_decoded.i_stuffing_byte))
869 870 871 872 873 874

  BOZO_END(stuffing);

  return i_err;
}

875
/* satellite delivery system */
876 877 878
static int main_sat_deliv_sys_(void)
{
  BOZO_VARS(sat_deliv_sys);
879
  BOZO_START(satellite delivery system);
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026


  /* check i_frequency */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_frequency, 32)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_frequency, 32)
    BOZO_CLEAN();
  BOZO_end_integer(i_frequency, 32)

  /* check i_orbital_position */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_orbital_position, 16)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_orbital_position, 16)
    BOZO_CLEAN();
  BOZO_end_integer(i_orbital_position, 16)

  /* check i_west_east_flag */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_west_east_flag, 1)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_west_east_flag, 1)
    BOZO_CLEAN();
  BOZO_end_integer(i_west_east_flag, 1)

  /* check i_polarization */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_polarization, 2)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_polarization, 2)
    BOZO_CLEAN();
  BOZO_end_integer(i_polarization, 2)

  /* check i_roll_off */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_roll_off, 2)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_roll_off, 2)
    BOZO_CLEAN();
  BOZO_end_integer(i_roll_off, 2)

  /* check i_modulation_system */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_modulation_system, 1)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_modulation_system, 1)
    BOZO_CLEAN();
  BOZO_end_integer(i_modulation_system, 1)

  /* check i_modulation_type */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_modulation_type, 2)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_modulation_type, 2)
    BOZO_CLEAN();
  BOZO_end_integer(i_modulation_type, 2)

  /* check i_symbol_rate */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_symbol_rate, 28)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_symbol_rate, 28)
    BOZO_CLEAN();
  BOZO_end_integer(i_symbol_rate, 28)

  /* check i_fec_inner */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_orbital_position, 0);
  BOZO_init_integer(i_west_east_flag, 0);
  BOZO_init_integer(i_polarization, 0);
  BOZO_init_integer(i_roll_off, 0);
  BOZO_init_integer(i_modulation_system, 0);
  BOZO_init_integer(i_modulation_type, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_begin_integer(i_fec_inner, 4)
    BOZO_DOJOB(SatDelivSys);
    BOZO_check_integer(i_fec_inner, 4)
    BOZO_CLEAN();
  BOZO_end_integer(i_fec_inner, 4)


1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100
  BOZO_END(satellite delivery system);

  return i_err;
}

/* cable delivery system */
static int main_cable_deliv_sys_(void)
{
  BOZO_VARS(cable_deliv_sys);
  BOZO_START(cable delivery system);


  /* check i_frequency */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_modulation, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_init_integer(i_fec_outer, 0);
  BOZO_begin_integer(i_frequency, 32)
    BOZO_DOJOB(CableDelivSys);
    BOZO_check_integer(i_frequency, 32)
    BOZO_CLEAN();
  BOZO_end_integer(i_frequency, 32)

  /* check i_modulation */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_modulation, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_init_integer(i_fec_outer, 0);
  BOZO_begin_integer(i_modulation, 8)
    BOZO_DOJOB(CableDelivSys);
    BOZO_check_integer(i_modulation, 8)
    BOZO_CLEAN();
  BOZO_end_integer(i_modulation, 8)

  /* check i_symbol_rate */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_modulation, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_init_integer(i_fec_outer, 0);
  BOZO_begin_integer(i_symbol_rate, 28)
    BOZO_DOJOB(CableDelivSys);
    BOZO_check_integer(i_symbol_rate, 28)
    BOZO_CLEAN();
  BOZO_end_integer(i_symbol_rate, 28)

  /* check i_fec_inner */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_modulation, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_init_integer(i_fec_outer, 0);
  BOZO_begin_integer(i_fec_inner, 4)
    BOZO_DOJOB(CableDelivSys);
    BOZO_check_integer(i_fec_inner, 4)
    BOZO_CLEAN();
  BOZO_end_integer(i_fec_inner, 4)

  /* check i_fec_outer */
  BOZO_init_integer(i_frequency, 0);
  BOZO_init_integer(i_modulation, 0);
  BOZO_init_integer(i_symbol_rate, 0);
  BOZO_init_integer(i_fec_inner, 0);
  BOZO_init_integer(i_fec_outer, 0);
  BOZO_begin_integer(i_fec_outer, 4)
    BOZO_DOJOB(CableDelivSys);
    BOZO_check_integer(i_fec_outer, 4)
    BOZO_CLEAN();
  BOZO_end_integer(i_fec_outer, 4)


  BOZO_END(cable delivery system);
1101 1102 1103 1104

  return i_err;
}

1105 1106 1107 1108 1109 1110 1111 1112 1113 1114
/* bouquet name */
static int main_bouquet_name_(void)
{
  BOZO_VARS(bouquet_name);
  BOZO_START(bouquet name);


  /* check i_char */
  BOZO_begin_array(i_char, i_name_length, 0)
    BOZO_DOJOB(BouquetName);
1115 1116
    BOZO_check_array_begin(i_char, i_name_length)
    BOZO_check_array_gen(i_char, i_name_length)
1117
    BOZO_CLEAN();
1118
  BOZO_end_array(i_char, ARRAY_SIZE(s_decoded.i_char))
1119 1120 1121 1122 1123 1124

  BOZO_END(bouquet name);

  return i_err;
}

1125 1126
/* service (i_service_provider_name) */
static int main_service_1(void)
1127 1128
{
  BOZO_VARS(service);
1129
  BOZO_START(service (i_service_provider_name));
1130

1131
  
1132 1133 1134 1135 1136 1137 1138 1139 1140
  /* check i_service_type */
  s_decoded.i_service_name_length = 0;
  BOZO_init_integer(i_service_type, 0);
  BOZO_begin_integer(i_service_type, 8)
    BOZO_DOJOB(Service);
    BOZO_check_integer(i_service_type, 8)
    BOZO_CLEAN();
  BOZO_end_integer(i_service_type, 8)

1141 1142 1143 1144 1145
  /* check i_service_provider_name */
  s_decoded.i_service_name_length = 0;
  BOZO_init_integer(i_service_type, 0);
  BOZO_begin_array(i_service_provider_name, i_service_provider_name_length, 0)
    BOZO_DOJOB(Service);
1146 1147
    BOZO_check_array_begin(i_service_provider_name, i_service_provider_name_length)
    BOZO_check_array_gen(i_service_provider_name, i_service_provider_name_length)
1148
    BOZO_CLEAN();
1149
  BOZO_end_array(i_service_provider_name, ARRAY_SIZE(s_decoded.i_service_provider_name))
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176

  BOZO_END(service (i_service_provider_name));

  return i_err;
}

/* service (i_service_name) */
static int main_service_2(void)
{
  BOZO_VARS(service);
  BOZO_START(service (i_service_name));


  /* check i_service_type */
  s_decoded.i_service_provider_name_length = 0;
  BOZO_init_integer(i_service_type, 0);
  BOZO_begin_integer(i_service_type, 8)
    BOZO_DOJOB(Service);
    BOZO_check_integer(i_service_type, 8)
    BOZO_CLEAN();
  BOZO_end_integer(i_service_type, 8)

  /* check i_service_name */
  s_decoded.i_service_provider_name_length = 0;
  BOZO_init_integer(i_service_type, 0);
  BOZO_begin_array(i_service_name, i_service_name_length, 0)
    BOZO_DOJOB(Service);
1177 1178
    BOZO_check_array_begin(i_service_name, i_service_name_length)
    BOZO_check_array_gen(i_service_name, i_service_name_length)
1179
    BOZO_CLEAN();
1180
  BOZO_end_array(i_service_name, ARRAY_SIZE(s_decoded.i_service_name))
1181 1182

  BOZO_END(service (i_service_name));
1183 1184 1185 1186

  return i_err;
}

1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207
/* service (both names) */
static int main_service_3(void)
{
  BOZO_VARS(service);
  BOZO_START(service (both names));


  /* check i_service_type */
  s_decoded.i_service_provider_name_length = 0;
  BOZO_init_integer(i_service_type, 0);
  BOZO_begin_integer(i_service_type, 8)
    BOZO_DOJOB(Service);
    BOZO_check_integer(i_service_type, 8)
    BOZO_CLEAN();
  BOZO_end_integer(i_service_type, 8)

  /* check i_service_name */
  s_decoded.i_service_provider_name_length = 0;
  BOZO_init_integer(i_service_type, 0);
  BOZO_begin_array(i_service_name, i_service_name_length, 0)
    BOZO_DOJOB(Service);
1208 1209
    BOZO_check_array_begin(i_service_name, i_service_name_length)
    BOZO_check_array_gen(i_service_name, i_service_name_length)
1210 1211 1212 1213 1214 1215 1216
    BOZO_CLEAN();
  BOZO_end_array(i_service_name, 126)
  /* check i_service_provider_name */
  s_decoded.i_service_provider_name_length = 0;
  BOZO_init_integer(i_service_type, 0);
  BOZO_begin_array(i_service_provider_name, i_service_provider_name_length, 0)
    BOZO_DOJOB(Service);
1217 1218
    BOZO_check_array_begin(i_service_provider_name, i_service_provider_name_length)
    BOZO_check_array_gen(i_service_provider_name, i_service_provider_name_length)
1219 1220 1221 1222 1223 1224 1225 1226
    BOZO_CLEAN();
  BOZO_end_array(i_service_provider_name, 126)

  BOZO_END(service (both names));

  return i_err;
}

1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287
/* linkage (information service) */
static int main_linkage_0(void)
{
  BOZO_VARS(linkage);
  BOZO_START(linkage (information service));


  /* check i_transport_stream_id */
  s_decoded.i_linkage_type = 1;

  BOZO_init_integer(i_transport_stream_id, 0);
  BOZO_init_integer(i_original_network_id, 0);
  BOZO_init_integer(i_service_id, 0);
  BOZO_begin_integer(i_transport_stream_id, 16)
    BOZO_DOJOB(Linkage);
    BOZO_check_integer(i_transport_stream_id, 16)
    BOZO_CLEAN();
  BOZO_end_integer(i_transport_stream_id, 16)

  /* check i_original_network_id */
  s_decoded.i_linkage_type = 1;

  BOZO_init_integer(i_transport_stream_id, 0);
  BOZO_init_integer(i_original_network_id, 0);
  BOZO_init_integer(i_service_id, 0);
  BOZO_begin_integer(i_original_network_id, 16)
    BOZO_DOJOB(Linkage);
    BOZO_check_integer(i_original_network_id, 16)
    BOZO_CLEAN();
  BOZO_end_integer(i_original_network_id, 16)

  /* check i_service_id */
  s_decoded.i_linkage_type = 1;

  BOZO_init_integer(i_transport_stream_id, 0);
  BOZO_init_integer(i_original_network_id, 0);
  BOZO_init_integer(i_service_id, 0);
  BOZO_begin_integer(i_service_id, 16)
    BOZO_DOJOB(Linkage);
    BOZO_check_integer(i_service_id, 16)
    BOZO_CLEAN();
  BOZO_end_integer(i_service_id, 16)

  /* check i_private_data */
  s_decoded.i_linkage_type = 1;

  BOZO_init_integer(i_transport_stream_id, 0);
  BOZO_init_integer(i_original_network_id, 0);
  BOZO_init_integer(i_service_id, 0);
  BOZO_begin_array(i_private_data, i_private_data_length, 0)
    BOZO_DOJOB(Linkage);
    BOZO_check_array_begin(i_private_data, i_private_data_length)
    BOZO_check_array_gen(i_private_data, i_private_data_length)
    BOZO_CLEAN();
  BOZO_end_array(i_private_data, ARRAY_SIZE(s_decoded.i_private_data))

  BOZO_END(linkage (information service));

  return i_err;
}

1288 1289

/* main function */
1290
int main(void)
1291 1292
{
  int i_err = 0;
1293
  srand(time(NULL));
1294
  
1295 1296 1297 1298 1299 1300 1301 1302 1303
  i_err |= main_vstream_1();
  i_err |= main_vstream_2();
  i_err |= main_astream_();
  i_err |= main_hierarchy_();
  i_err |= main_registration_();
  i_err |= main_ds_alignment_();
  i_err |= main_target_bg_grid_();
  i_err |= main_vwindow_();
  i_err |= main_ca_();
1304
  i_err |= main_iso639_();
1305 1306 1307 1308 1309
  i_err |= main_system_clock_();
  i_err |= main_mx_buff_utilization_();
  i_err |= main_copyright_();
  i_err |= main_max_bitrate_();
  i_err |= main_private_data_();
1310
  i_err |= main_smoothing_buffer_();
1311
  i_err |= main_std_();
1312
  i_err |= main_ibp_();
1313
  i_err |= main_mpeg4_video_();
1314
  i_err |= main_mpeg4_audio_();
1315
  i_err |= main_network_name_();
1316
  i_err |= main_service_list_();
1317
  i_err |= main_stuffing_();
1318
  i_err |= main_sat_deliv_sys_();
1319
  i_err |= main_cable_deliv_sys_();
1320
  i_err |= main_bouquet_name_();
1321 1322
  i_err |= main_service_1();
  i_err |= main_service_2();
1323
  i_err |= main_service_3();
1324
  i_err |= main_linkage_0();
1325

1326 1327 1328 1329 1330
  if(i_err)
    fprintf(stderr, "At least one test has FAILED !!!\n");
  else
    fprintf(stdout, "All tests succeeded.\n");

1331 1332 1333
  return i_err;
}