frag1.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. // This program prepares the input to gperf for hashing IIDs
  17. #include <SLES/OpenSLES.h>
  18. #include "MPH.h"
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. extern const struct SLInterfaceID_ SL_IID_array[MPH_MAX];
  22. int main(int argc, char **argv)
  23. {
  24. int MPH;
  25. const struct SLInterfaceID_ *x = SL_IID_array;
  26. for (MPH = 0; MPH < MPH_MAX; ++MPH, ++x) {
  27. unsigned char *y = (unsigned char *) x;
  28. unsigned k;
  29. printf("\"");
  30. for (k = 0; k < sizeof(struct SLInterfaceID_); ++k)
  31. printf("\\x%02X", y[k]);
  32. printf("\"\n");
  33. }
  34. return EXIT_SUCCESS;
  35. }