15e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten/* 25e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * Copyright (C) 2010 The Android Open Source Project 35e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * 45e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * Licensed under the Apache License, Version 2.0 (the "License"); 55e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * you may not use this file except in compliance with the License. 65e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * You may obtain a copy of the License at 75e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * 85e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * http://www.apache.org/licenses/LICENSE-2.0 95e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * 105e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * Unless required by applicable law or agreed to in writing, software 115e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * distributed under the License is distributed on an "AS IS" BASIS, 125e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * See the License for the specific language governing permissions and 145e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten * limitations under the License. 155e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten */ 165e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten 175e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten// This program prepares the input to gperf for hashing IIDs 185e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten 19fcd29cb117d8fb08d4e4c15fd3e60caa0a3eddfcGlenn Kasten#include <SLES/OpenSLES.h> 205e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten#include "MPH.h" 215e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten#include <stdio.h> 225e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten#include <stdlib.h> 235e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten 245e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kastenextern const struct SLInterfaceID_ SL_IID_array[MPH_MAX]; 255e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten 265e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kastenint main(int argc, char **argv) 275e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten{ 285e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten int MPH; 295e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten const struct SLInterfaceID_ *x = SL_IID_array; 305e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten for (MPH = 0; MPH < MPH_MAX; ++MPH, ++x) { 315e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten unsigned char *y = (unsigned char *) x; 325e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten unsigned k; 335e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten printf("\""); 345e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten for (k = 0; k < sizeof(struct SLInterfaceID_); ++k) 355e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten printf("\\x%02X", y[k]); 365e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten printf("\"\n"); 375e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten } 385e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten return EXIT_SUCCESS; 395e1b1363249699753bf8706d5593bbb9ebb189ddGlenn Kasten} 40