1002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian/*
2002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * Copyright (C) 2005 The Android Open Source Project
3002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian *
4002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * Licensed under the Apache License, Version 2.0 (the "License");
5002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * you may not use this file except in compliance with the License.
6002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * You may obtain a copy of the License at
7002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian *
8002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian *      http://www.apache.org/licenses/LICENSE-2.0
9002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian *
10002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * Unless required by applicable law or agreed to in writing, software
11002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * distributed under the License is distributed on an "AS IS" BASIS,
12002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * See the License for the specific language governing permissions and
14002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian * limitations under the License.
15002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian */
16002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
17002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#ifndef ANDROID_BINDER_DEBUG_H
18002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#define ANDROID_BINDER_DEBUG_H
19002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
20002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#include <stdint.h>
21002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#include <sys/types.h>
22002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
23002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopiannamespace android {
24002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian// ---------------------------------------------------------------------------
25002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
26002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#ifdef __cplusplus
27002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopianextern "C" {
28002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#endif
29002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
30002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopianconst char* stringForIndent(int32_t indentLevel);
31002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
32002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopiantypedef void (*debugPrintFunc)(void* cookie, const char* txt);
33002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
34002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopianvoid printTypeCode(uint32_t typeCode,
35002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian    debugPrintFunc func = 0, void* cookie = 0);
36002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
37002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopianvoid printHexData(int32_t indent, const void *buf, size_t length,
38002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian    size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16,
39002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian    size_t alignment=0, bool cArrayStyle=false,
40002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian    debugPrintFunc func = 0, void* cookie = 0);
41002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
42002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#ifdef __cplusplus
43002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian}
44002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#endif
45002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
46002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian// ---------------------------------------------------------------------------
47002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian}; // namespace android
48002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian
49002e1e58dfe19dd3e49a59c6827cbf51573941a2Mathias Agopian#endif // ANDROID_BINDER_DEBUG_H
50