OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "apps/moterm/moterm_driver.h" | 5 #include "apps/moterm/moterm_driver.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "mojo/services/files/public/interfaces/ioctl.mojom.h" | 11 #include "mojo/services/files/interfaces/ioctl.mojom.h" |
12 #include "mojo/services/files/public/interfaces/ioctl_terminal.mojom.h" | 12 #include "mojo/services/files/interfaces/ioctl_terminal.mojom.h" |
13 | 13 |
14 // Character constants: | 14 // Character constants: |
15 const uint8_t kEOT = 4; | 15 const uint8_t kEOT = 4; |
16 const uint8_t kNL = 10; | 16 const uint8_t kNL = 10; |
17 const uint8_t kCR = 13; | 17 const uint8_t kCR = 13; |
18 const uint8_t kDEL = 127; | 18 const uint8_t kDEL = 127; |
19 | 19 |
20 // Short forms for various counts/indices used for the get/set settings ioctls. | 20 // Short forms for various counts/indices used for the get/set settings ioctls. |
21 const size_t kBaseFieldCount = mojo::files::kIoctlTerminalTermiosBaseFieldCount; | 21 const size_t kBaseFieldCount = mojo::files::kIoctlTerminalTermiosBaseFieldCount; |
22 const size_t kTotalFieldCount = | 22 const size_t kTotalFieldCount = |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 } | 482 } |
483 if (1 + kVEOFIdx < in_values.size()) { | 483 if (1 + kVEOFIdx < in_values.size()) { |
484 uint32_t value = in_values[1 + kVEOFIdx]; | 484 uint32_t value = in_values[1 + kVEOFIdx]; |
485 if (value > std::numeric_limits<uint8_t>::max()) | 485 if (value > std::numeric_limits<uint8_t>::max()) |
486 return mojo::files::Error::INVALID_ARGUMENT; | 486 return mojo::files::Error::INVALID_ARGUMENT; |
487 veof_ = static_cast<uint8_t>(value); | 487 veof_ = static_cast<uint8_t>(value); |
488 } | 488 } |
489 | 489 |
490 return mojo::files::Error::OK; | 490 return mojo::files::Error::OK; |
491 } | 491 } |
OLD | NEW |