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

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

Issue 227433004: Add runtime and native entry tags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months 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 | « runtime/bin/test_extension.c ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 * for details. All rights reserved. Use of this source code is governed by a 3 * for details. All rights reserved. Use of this source code is governed by a
4 * BSD-style license that can be found in the LICENSE file. 4 * BSD-style license that can be found in the LICENSE file.
5 */ 5 */
6 6
7 #ifndef INCLUDE_DART_API_H_ 7 #ifndef INCLUDE_DART_API_H_
8 #define INCLUDE_DART_API_H_ 8 #define INCLUDE_DART_API_H_
9 9
10 /** \mainpage Dart Embedding API Reference 10 /** \mainpage Dart Embedding API Reference
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 * for the native function. 2205 * for the native function.
2206 * 2206 *
2207 * See Dart_SetNativeResolver. 2207 * See Dart_SetNativeResolver.
2208 */ 2208 */
2209 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, 2209 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name,
2210 int num_of_arguments, 2210 int num_of_arguments,
2211 bool* auto_setup_scope); 2211 bool* auto_setup_scope);
2212 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or 2212 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or
2213 * NativeResolver. */ 2213 * NativeResolver. */
2214 2214
2215 /**
2216 * Native entry symbol lookup callback.
2217 *
2218 * For libraries and scripts which have native functions, the embedder
2219 * can provide a callback for mapping a native entry to a symbol. This callback
2220 * maps a native function entry PC to the native function name. If no native
2221 * entry symbol can be found, the callback should return NULL.
2222 *
2223 * The parameters to the native reverse resolver function are:
2224 * \param nf A Dart_NativeFunction.
2225 *
2226 * \return A const UTF-8 string containing the symbol name or NULL.
2227 *
2228 * See Dart_SetNativeResolver.
2229 */
2230 typedef const uint8_t* (*Dart_NativeEntrySymbol)(Dart_NativeFunction nf);
2231
2232
2215 /* 2233 /*
2216 * =========== 2234 * ===========
2217 * Environment 2235 * Environment
2218 * =========== 2236 * ===========
2219 */ 2237 */
2220 2238
2221 /** 2239 /**
2222 * An environment lookup callback function. 2240 * An environment lookup callback function.
2223 * 2241 *
2224 * \param name The name of the value to lookup in the environment. 2242 * \param name The name of the value to lookup in the environment.
(...skipping 16 matching lines...) Expand all
2241 /** 2259 /**
2242 * Sets the callback used to resolve native functions for a library. 2260 * Sets the callback used to resolve native functions for a library.
2243 * 2261 *
2244 * \param library A library. 2262 * \param library A library.
2245 * \param resolver A native entry resolver. 2263 * \param resolver A native entry resolver.
2246 * 2264 *
2247 * \return A valid handle if the native resolver was set successfully. 2265 * \return A valid handle if the native resolver was set successfully.
2248 */ 2266 */
2249 DART_EXPORT Dart_Handle Dart_SetNativeResolver( 2267 DART_EXPORT Dart_Handle Dart_SetNativeResolver(
2250 Dart_Handle library, 2268 Dart_Handle library,
2251 Dart_NativeEntryResolver resolver); 2269 Dart_NativeEntryResolver resolver,
2270 Dart_NativeEntrySymbol symbol);
2252 /* TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? */ 2271 /* TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? */
2253 2272
2254 2273
2255 /* 2274 /*
2256 * ===================== 2275 * =====================
2257 * Scripts and Libraries 2276 * Scripts and Libraries
2258 * ===================== 2277 * =====================
2259 */ 2278 */
2260 /* TODO(turnidge): Finish documenting this section. */ 2279 /* TODO(turnidge): Finish documenting this section. */
2261 2280
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 * NOTE: If multiple callbacks with the same name are registered, only the 2560 * NOTE: If multiple callbacks with the same name are registered, only the
2542 * last callback registered will be remembered. 2561 * last callback registered will be remembered.
2543 */ 2562 */
2544 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( 2563 DART_EXPORT void Dart_RegisterRootServiceRequestCallback(
2545 const char* name, 2564 const char* name,
2546 Dart_ServiceRequestCallback callback, 2565 Dart_ServiceRequestCallback callback,
2547 void* user_data); 2566 void* user_data);
2548 2567
2549 2568
2550 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ 2569 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */
OLDNEW
« no previous file with comments | « runtime/bin/test_extension.c ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698