zephyr/include/drivers/console/uart_console.h
Peter Bigot 6554a5e5b6 include: rearrange for standard use of extern "C" in various headers
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

The inclusion of the generated syscall files is placed outside the
extern "C" block as the generated file has its own extern "C" block.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-13 18:00:31 +02:00

58 lines
1.6 KiB
C

/* uart_console.h - uart console driver */
/*
* Copyright (c) 2011, 2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DRIVERS_CONSOLE_UART_CONSOLE_H_
#define ZEPHYR_INCLUDE_DRIVERS_CONSOLE_UART_CONSOLE_H_
#include <kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Register uart input processing
*
* Input processing is started when string is typed in the console.
* Carriage return is translated to NULL making string always NULL
* terminated. Application before calling register function need to
* initialize two fifo queues mentioned below.
*
* @param avail k_fifo queue keeping available input slots
* @param lines k_fifo queue of entered lines which to be processed
* in the application code.
* @param completion callback for tab completion of entered commands
*
* @return N/A
*/
void uart_register_input(struct k_fifo *avail, struct k_fifo *lines,
u8_t (*completion)(char *str, u8_t len));
/*
* Allows having debug hooks in the console driver for handling incoming
* control characters, and letting other ones through.
*/
#ifdef CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS
#define UART_CONSOLE_DEBUG_HOOK_HANDLED 1
#define UART_CONSOLE_OUT_DEBUG_HOOK_SIG(x) int(x)(char c)
typedef UART_CONSOLE_OUT_DEBUG_HOOK_SIG(uart_console_out_debug_hook_t);
void uart_console_out_debug_hook_install(
uart_console_out_debug_hook_t *hook);
typedef int (*uart_console_in_debug_hook_t) (u8_t);
void uart_console_in_debug_hook_install(uart_console_in_debug_hook_t hook);
#endif
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_DRIVERS_CONSOLE_UART_CONSOLE_H_ */