Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: runtime/include/dart_api.h

Issue 8492015: Allow printf-style arguments for Dart_Error and Api::Error. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.h » ('j') | runtime/vm/dart_api_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 INCLUDE_DART_API_H_ 5 #ifndef INCLUDE_DART_API_H_
6 #define INCLUDE_DART_API_H_ 6 #define INCLUDE_DART_API_H_
7 7
8 /** \mainpage Dart Embedding API Reference 8 /** \mainpage Dart Embedding API Reference
9 * 9 *
10 * Dart is a class-based programming language for creating structured 10 * Dart is a class-based programming language for creating structured
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 * \return A C string containing an error message if the handle is 113 * \return A C string containing an error message if the handle is
114 * invalid. An empty C string ("") if the handle is valid. This C 114 * invalid. An empty C string ("") if the handle is valid. This C
115 * String is scope allocated and is only valid until the next call 115 * String is scope allocated and is only valid until the next call
116 * to Dart_ExitScope. 116 * to Dart_ExitScope.
117 */ 117 */
118 DART_EXPORT const char* Dart_GetError(const Dart_Handle& handle); 118 DART_EXPORT const char* Dart_GetError(const Dart_Handle& handle);
119 119
120 /** 120 /**
121 * Produces an invalid handle with the provided error message. 121 * Produces an invalid handle with the provided error message.
122 * 122 *
123 * This function makes its own copy of the error message and does not
124 * claim ownership of the 'error' parameter.
125 *
126 * Requires there to be a current isolate. 123 * Requires there to be a current isolate.
127 * 124 *
128 * \param error A C string containing an error message. 125 * \param error A C string containing an error message.
129 */ 126 */
130 DART_EXPORT Dart_Handle Dart_Error(const char* error); 127 DART_EXPORT Dart_Handle Dart_Error(const char* format, ...);
131 // TODO(turnidge): Accept printf-style args here.
132 128
133 /** 129 /**
134 * Allocates a persistent handle for an object. 130 * Allocates a persistent handle for an object.
135 * 131 *
136 * This handle has the lifetime of the current isolate unless it is 132 * This handle has the lifetime of the current isolate unless it is
137 * explicitly deallocated by calling Dart_DeletePersistentHandle. 133 * explicitly deallocated by calling Dart_DeletePersistentHandle.
138 * 134 *
139 * Requires there to be a current isolate. 135 * Requires there to be a current isolate.
140 */ 136 */
141 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object); 137 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object);
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 1131
1136 // --- Profiling support ---- 1132 // --- Profiling support ----
1137 1133
1138 // External pprof support for gathering and dumping symbolic 1134 // External pprof support for gathering and dumping symbolic
1139 // information that can be used for better profile reports for 1135 // information that can be used for better profile reports for
1140 // dynamically generated code. 1136 // dynamically generated code.
1141 DART_EXPORT void Dart_InitPprofSupport(); 1137 DART_EXPORT void Dart_InitPprofSupport();
1142 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 1138 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
1143 1139
1144 #endif // INCLUDE_DART_API_H_ 1140 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.h » ('j') | runtime/vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698