1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17// This program prepares the input to gperf for hashing IIDs
18
19#include <SLES/OpenSLES.h>
20#include "MPH.h"
21#include <stdio.h>
22#include <stdlib.h>
23
24extern const struct SLInterfaceID_ SL_IID_array[MPH_MAX];
25
26int main(int argc, char **argv)
27{
28    int MPH;
29    const struct SLInterfaceID_ *x = SL_IID_array;
30    for (MPH = 0; MPH < MPH_MAX; ++MPH, ++x) {
31        unsigned char *y = (unsigned char *) x;
32        unsigned k;
33        printf("\"");
34        for (k = 0; k < sizeof(struct SLInterfaceID_); ++k)
35            printf("\\x%02X", y[k]);
36        printf("\"\n");
37    }
38    return EXIT_SUCCESS;
39}
40