003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/include/lldb/Host
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
include
/
lldb
/
Host
/
📁
..
📄
Config.h.cmake
(1.2 KB)
📄
ConnectionFileDescriptor.h
(528 B)
📄
Debug.h
(4.44 KB)
📄
Editline.h
(12.4 KB)
📄
File.h
(15.26 KB)
📄
FileAction.h
(1.35 KB)
📄
FileCache.h
(1.29 KB)
📄
FileSystem.h
(6.84 KB)
📄
Host.h
(10.04 KB)
📄
HostGetOpt.h
(699 B)
📄
HostInfo.h
(2.6 KB)
📄
HostInfoBase.h
(4.05 KB)
📄
HostNativeProcess.h
(728 B)
📄
HostNativeProcessBase.h
(1.43 KB)
📄
HostNativeThread.h
(690 B)
📄
HostNativeThreadBase.h
(1.46 KB)
📄
HostNativeThreadForward.h
(753 B)
📄
HostProcess.h
(1.7 KB)
📄
HostThread.h
(1.32 KB)
📄
LZMA.h
(883 B)
📄
LockFile.h
(704 B)
📄
LockFileBase.h
(1.52 KB)
📄
MainLoop.h
(3.83 KB)
📄
MainLoopBase.h
(2.91 KB)
📄
MonitoringProcessLauncher.h
(1.12 KB)
📄
OptionParser.h
(1.51 KB)
📄
Pipe.h
(668 B)
📄
PipeBase.h
(2.26 KB)
📄
PosixApi.h
(743 B)
📄
ProcessLaunchInfo.h
(5.36 KB)
📄
ProcessLauncher.h
(735 B)
📄
ProcessRunLock.h
(2.02 KB)
📄
PseudoTerminal.h
(8.45 KB)
📄
SafeMachO.h
(3.25 KB)
📄
Socket.h
(4.56 KB)
📄
SocketAddress.h
(5.77 KB)
📄
StringConvert.h
(1.26 KB)
📄
Terminal.h
(5.12 KB)
📄
ThreadLauncher.h
(1.39 KB)
📄
Time.h
(718 B)
📄
XML.h
(4.7 KB)
📁
common
📁
freebsd
📁
netbsd
📁
openbsd
📁
posix
Editing: Terminal.h
//===-- Terminal.h ----------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLDB_HOST_TERMINAL_H #define LLDB_HOST_TERMINAL_H #if defined(__cplusplus) #include "lldb/Host/Config.h" #include "lldb/lldb-private.h" struct termios; namespace lldb_private { class Terminal { public: Terminal(int fd = -1) : m_fd(fd) {} ~Terminal() {} bool IsATerminal() const; int GetFileDescriptor() const { return m_fd; } void SetFileDescriptor(int fd) { m_fd = fd; } bool FileDescriptorIsValid() const { return m_fd != -1; } void Clear() { m_fd = -1; } bool SetEcho(bool enabled); bool SetCanonical(bool enabled); protected: int m_fd; // This may or may not be a terminal file descriptor }; /// \class State Terminal.h "lldb/Host/Terminal.h" /// A terminal state saving/restoring class. /// /// This class can be used to remember the terminal state for a file /// descriptor and later restore that state as it originally was. class TerminalState { public: /// Default constructor TerminalState(); /// Destructor ~TerminalState(); /// Save the TTY state for \a fd. /// /// Save the current state of the TTY for the file descriptor "fd" and if /// "save_process_group" is true, attempt to save the process group info for /// the TTY. /// /// \param[in] fd /// The file descriptor to save the state of. /// /// \param[in] save_process_group /// If \b true, save the process group settings, else do not /// save the process group settings for a TTY. /// /// \return /// Returns \b true if \a fd describes a TTY and if the state /// was able to be saved, \b false otherwise. bool Save(int fd, bool save_process_group); /// Restore the TTY state to the cached state. /// /// Restore the state of the TTY using the cached values from a previous /// call to TerminalState::Save(int,bool). /// /// \return /// Returns \b true if the TTY state was successfully restored, /// \b false otherwise. bool Restore() const; /// Test for valid cached TTY state information. /// /// \return /// Returns \b true if this object has valid saved TTY state /// settings that can be used to restore a previous state, /// \b false otherwise. bool IsValid() const; void Clear(); protected: /// Test if tflags is valid. /// /// \return /// Returns \b true if \a m_tflags is valid and can be restored, /// \b false otherwise. bool TFlagsIsValid() const; /// Test if ttystate is valid. /// /// \return /// Returns \b true if \a m_ttystate is valid and can be /// restored, \b false otherwise. bool TTYStateIsValid() const; /// Test if the process group information is valid. /// /// \return /// Returns \b true if \a m_process_group is valid and can be /// restored, \b false otherwise. bool ProcessGroupIsValid() const; // Member variables Terminal m_tty; ///< A terminal int m_tflags; ///< Cached tflags information. #if LLDB_ENABLE_TERMIOS std::unique_ptr<struct termios> m_termios_up; ///< Cached terminal state information. #endif lldb::pid_t m_process_group; ///< Cached process group information. }; /// \class TerminalStateSwitcher Terminal.h "lldb/Host/Terminal.h" /// A TTY state switching class. /// /// This class can be used to remember 2 TTY states for a given file /// descriptor and switch between the two states. class TerminalStateSwitcher { public: /// Constructor TerminalStateSwitcher(); /// Destructor ~TerminalStateSwitcher(); /// Get the number of possible states to save. /// /// \return /// The number of states that this TTY switcher object contains. uint32_t GetNumberOfStates() const; /// Restore the TTY state for state at index \a idx. /// /// \return /// Returns \b true if the TTY state was successfully restored, /// \b false otherwise. bool Restore(uint32_t idx) const; /// Save the TTY state information for the state at index \a idx. The TTY /// state is saved for the file descriptor \a fd and the process group /// information will also be saved if requested by \a save_process_group. /// /// \param[in] idx /// The index into the state array where the state should be /// saved. /// /// \param[in] fd /// The file descriptor for which to save the settings. /// /// \param[in] save_process_group /// If \b true, save the process group information for the TTY. /// /// \return /// Returns \b true if the save was successful, \b false /// otherwise. bool Save(uint32_t idx, int fd, bool save_process_group); protected: // Member variables mutable uint32_t m_currentState; ///< The currently active TTY state index. TerminalState m_ttystates[2]; ///< The array of TTY states that holds saved TTY info. }; } // namespace lldb_private #endif // #if defined(__cplusplus) #endif // LLDB_HOST_TERMINAL_H
Upload File
Create Folder