![João Valverde](/assets/img/avatar_default.png)
This removes the last dependency of the logging subsystem on the preferences module. The latter is started much later than the former and this is an issue. The Windows-only preference "gui.console_open" is stored in the registry as HKEY_LOCAL_USER\Software\Wireshark\ConsoleOpen. The semantics are exactly the same. The preference is read by the logging subsystem for initialization and then again by the preferences (read/write) so the user can configure it as before. The code to store the preference also in the preferences file was kept, for backward compatibility and because it is not incompatible with using the Registry concurrently. The elimination of the prefs dependency also allows moving the Windows console logic to wsutil and add the functionality to wslog directly, thereby eliminating the superfluous Wireshark/Logray custom log handler. To be able to read the ws_log_console_open global variable from libwireshark it becomes necessary to add a new export macro symbol called WSUTIL_EXPORT.
74 lines
1.2 KiB
C
74 lines
1.2 KiB
C
/** @file
|
|
*
|
|
* Console support for MSWindows
|
|
*
|
|
* Wireshark - Network traffic analyzer
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
* Copyright 2002, Jeffrey C. Foster <jfoste@woodward.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef __CONSOLE_WIN32_H__
|
|
#define __CONSOLE_WIN32_H__
|
|
|
|
#include <wireshark.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
#ifdef _WIN32
|
|
|
|
/** @file
|
|
* Win32 specific console.
|
|
*/
|
|
|
|
/** Create Windows console.
|
|
*
|
|
*/
|
|
WS_DLL_PUBLIC
|
|
void create_console(void);
|
|
|
|
/** Connect to stdio if available.
|
|
*
|
|
*/
|
|
WS_DLL_PUBLIC
|
|
void restore_pipes(void);
|
|
|
|
/** Destroy Windows console.
|
|
*
|
|
*/
|
|
WS_DLL_PUBLIC
|
|
void destroy_console(void);
|
|
|
|
/** Set console wait. GTK+ only.
|
|
* @param console_wait set/no set console wait
|
|
*/
|
|
WS_DLL_PUBLIC
|
|
void set_console_wait(gboolean console_wait);
|
|
/** get console wait
|
|
* @return set/no set console wait
|
|
*/
|
|
WS_DLL_PUBLIC
|
|
gboolean get_console_wait(void);
|
|
|
|
/** Set stdin capture.
|
|
* @param console_wait set/no stdin_capture
|
|
*/
|
|
WS_DLL_PUBLIC
|
|
void set_stdin_capture(gboolean set_stdin_capture);
|
|
|
|
/** get stdin caputre
|
|
* @return set/no set stdin_capture
|
|
*/
|
|
WS_DLL_PUBLIC
|
|
gboolean get_stdin_capture(void);
|
|
#endif/* _WIN32 */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* __CONSOLE_WIN32_H__ */
|