OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_VM_OS_H_ | 5 #ifndef RUNTIME_VM_OS_H_ |
6 #define RUNTIME_VM_OS_H_ | 6 #define RUNTIME_VM_OS_H_ |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 | 9 |
10 // Forward declarations. | 10 // Forward declarations. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // | 114 // |
115 // The buffer will always be terminated by a '\0', unless the buffer | 115 // The buffer will always be terminated by a '\0', unless the buffer |
116 // is of size 0. The buffer might be NULL if the size is 0. | 116 // is of size 0. The buffer might be NULL if the size is 0. |
117 // | 117 // |
118 // This specification conforms to C99 standard which is implemented | 118 // This specification conforms to C99 standard which is implemented |
119 // by glibc 2.1+ with one exception: the C99 standard allows a | 119 // by glibc 2.1+ with one exception: the C99 standard allows a |
120 // negative return value. We will terminate the vm rather than let | 120 // negative return value. We will terminate the vm rather than let |
121 // that occur. | 121 // that occur. |
122 static int SNPrint(char* str, size_t size, const char* format, ...) | 122 static int SNPrint(char* str, size_t size, const char* format, ...) |
123 PRINTF_ATTRIBUTE(3, 4); | 123 PRINTF_ATTRIBUTE(3, 4); |
124 static int VSNPrint(char* str, size_t size, | 124 static int VSNPrint(char* str, size_t size, const char* format, va_list args); |
125 const char* format, | |
126 va_list args); | |
127 | 125 |
128 // Allocate a string and print formatted output into the buffer. | 126 // Allocate a string and print formatted output into the buffer. |
129 // Uses the zone for allocation if one if provided, and otherwise uses | 127 // Uses the zone for allocation if one if provided, and otherwise uses |
130 // malloc. | 128 // malloc. |
131 static char* SCreate(Zone* zone, const char* format, ...) | 129 static char* SCreate(Zone* zone, const char* format, ...) |
132 PRINTF_ATTRIBUTE(2, 3); | 130 PRINTF_ATTRIBUTE(2, 3); |
133 static char* VSCreate(Zone* zone, const char* format, va_list args); | 131 static char* VSCreate(Zone* zone, const char* format, va_list args); |
134 | 132 |
135 // Converts a C string which represents a valid dart integer into a 64 bit | 133 // Converts a C string which represents a valid dart integer into a 64 bit |
136 // value. | 134 // value. |
(...skipping 13 matching lines...) Expand all Loading... |
150 static void Shutdown(); | 148 static void Shutdown(); |
151 | 149 |
152 static void Abort(); | 150 static void Abort(); |
153 | 151 |
154 static void Exit(int code); | 152 static void Exit(int code); |
155 }; | 153 }; |
156 | 154 |
157 } // namespace dart | 155 } // namespace dart |
158 | 156 |
159 #endif // RUNTIME_VM_OS_H_ | 157 #endif // RUNTIME_VM_OS_H_ |
OLD | NEW |