diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
| commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
| tree | 4def12e759965de927d963ac65840d663ef9d1ea /lib/LineEditor | |
| parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) | |
Notes
Diffstat (limited to 'lib/LineEditor')
| -rw-r--r-- | lib/LineEditor/LineEditor.cpp | 16 | ||||
| -rw-r--r-- | lib/LineEditor/Makefile | 15 |
2 files changed, 11 insertions, 20 deletions
diff --git a/lib/LineEditor/LineEditor.cpp b/lib/LineEditor/LineEditor.cpp index a50ccc388f15..533a928b2dfd 100644 --- a/lib/LineEditor/LineEditor.cpp +++ b/lib/LineEditor/LineEditor.cpp @@ -12,7 +12,9 @@ #include "llvm/Config/config.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" -#include <stdio.h> +#include <algorithm> +#include <cassert> +#include <cstdio> #ifdef HAVE_LIBEDIT #include <histedit.h> #endif @@ -106,7 +108,9 @@ struct LineEditor::InternalData { FILE *Out; }; -static const char *ElGetPromptFn(EditLine *EL) { +namespace { + +const char *ElGetPromptFn(EditLine *EL) { LineEditor::InternalData *Data; if (el_get(EL, EL_CLIENTDATA, &Data) == 0) return Data->LE->getPrompt().c_str(); @@ -117,7 +121,7 @@ static const char *ElGetPromptFn(EditLine *EL) { // // This function is really horrible. But since the alternative is to get into // the line editor business, here we are. -static unsigned char ElCompletionFn(EditLine *EL, int ch) { +unsigned char ElCompletionFn(EditLine *EL, int ch) { LineEditor::InternalData *Data; if (el_get(EL, EL_CLIENTDATA, &Data) == 0) { if (!Data->ContinuationOutput.empty()) { @@ -190,6 +194,8 @@ static unsigned char ElCompletionFn(EditLine *EL, int ch) { return CC_ERROR; } +} // end anonymous namespace + LineEditor::LineEditor(StringRef ProgName, StringRef HistoryPath, FILE *In, FILE *Out, FILE *Err) : Prompt((ProgName + "> ").str()), HistoryPath(HistoryPath), @@ -269,7 +275,7 @@ Optional<std::string> LineEditor::readLine() const { return std::string(Line, LineLen); } -#else +#else // HAVE_LIBEDIT // Simple fgets-based implementation. @@ -316,4 +322,4 @@ Optional<std::string> LineEditor::readLine() const { return Line; } -#endif +#endif // HAVE_LIBEDIT diff --git a/lib/LineEditor/Makefile b/lib/LineEditor/Makefile deleted file mode 100644 index c7ff6d8eaae1..000000000000 --- a/lib/LineEditor/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/LineEditor/Makefile -----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMLineEditor -BUILD_ARCHIVE := 1 - -include $(LEVEL)/Makefile.common - |
