OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // Provides basic file reading and parsing helpers for use in PlatformReader |
| 6 // and PlatformReader derived classes. Nothing fancy. |
| 7 |
| 8 #ifndef CROS_BOOT_MODE_HELPERS_H_ |
| 9 #define CROS_BOOT_MODE_HELPERS_H_ |
| 10 |
| 11 #include <sys/types.h> |
| 12 |
| 13 namespace cros_boot_mode { |
| 14 namespace helpers { |
| 15 |
| 16 // atoi, using sscanf |
| 17 int to_int(const char *str, size_t length); |
| 18 |
| 19 // very simple wrapper of fopen,fread,fclose. |
| 20 size_t read_file(const char *path, char *buf, size_t max_bytes); |
| 21 |
| 22 } // namespace helpers |
| 23 } // namespace cros_boot_mode |
| 24 #endif // CROS_BOOT_MODE_HELPERS_H_ |
OLD | NEW |