2 *------------------------------------------------------------------
3 * Copyright (c) 2005-2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 typedef struct cpel_file_header_ {
21 unsigned char endian_version;
23 unsigned short nsections;
27 #define CPEL_FILE_LITTLE_ENDIAN 0x80
28 #define CPEL_FILE_VERSION 0x01
29 #define CPEL_FILE_VERSION_MASK 0x7F
31 typedef struct cpel_section_header_ {
32 unsigned int section_type;
33 unsigned int data_length; /* does NOT include type and itself */
34 } cpel_section_header_t;
36 #define CPEL_SECTION_STRTAB 1
37 /* string at offset 0 is the name of the table */
39 #define CPEL_SECTION_SYMTAB 2
40 #define CPEL_SECTION_EVTDEF 3
42 typedef struct event_definition_section_header_ {
43 char string_table_name[64];
44 unsigned int number_of_event_definitions;
45 } event_definition_section_header_t;
47 typedef struct event_definition_ {
49 unsigned int event_format;
50 unsigned int datum_format;
53 #define CPEL_SECTION_TRACKDEF 4
55 typedef struct track_definition_section_header_ {
56 char string_table_name[64];
57 unsigned int number_of_track_definitions;
58 } track_definition_section_header_t;
60 typedef struct track_definition_ {
62 unsigned int track_format;
65 #define CPEL_SECTION_EVENT 5
67 typedef struct event_section_header_ {
68 char string_table_name[64];
69 unsigned int number_of_events;
70 unsigned int clock_ticks_per_second;
71 } event_section_header_t;
73 typedef struct event_entry_ {
76 unsigned int event_code;
77 unsigned int event_datum;
80 #define CPEL_NUM_SECTION_TYPES 5