162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci#ifndef __API_DEBUG_INTERNAL_H__ 362306a36Sopenharmony_ci#define __API_DEBUG_INTERNAL_H__ 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#include "debug.h" 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#define __pr(func, fmt, ...) \ 862306a36Sopenharmony_cido { \ 962306a36Sopenharmony_ci if ((func)) \ 1062306a36Sopenharmony_ci (func)("libapi: " fmt, ##__VA_ARGS__); \ 1162306a36Sopenharmony_ci} while (0) 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ciextern libapi_print_fn_t __pr_warn; 1462306a36Sopenharmony_ciextern libapi_print_fn_t __pr_info; 1562306a36Sopenharmony_ciextern libapi_print_fn_t __pr_debug; 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#define pr_warn(fmt, ...) __pr(__pr_warn, fmt, ##__VA_ARGS__) 1862306a36Sopenharmony_ci#define pr_info(fmt, ...) __pr(__pr_info, fmt, ##__VA_ARGS__) 1962306a36Sopenharmony_ci#define pr_debug(fmt, ...) __pr(__pr_debug, fmt, ##__VA_ARGS__) 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci#endif /* __API_DEBUG_INTERNAL_H__ */ 22