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

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

Issue 8446009: Add Dart_Null, Dart_True, and Dart_False. (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') | no next file with comments »
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 /** 133 /**
134 * Allocates a persistent handle for an object. 134 * Allocates a persistent handle for an object.
135 * 135 *
136 * This handle has the lifetime of the current isolate unless it is 136 * This handle has the lifetime of the current isolate unless it is
137 * explicitly deallocated by calling Dart_DeletePersistentHandle. 137 * explicitly deallocated by calling Dart_DeletePersistentHandle.
138 * 138 *
139 * Requires there to be a current isolate. 139 * Requires there to be a current isolate.
140 */ 140 */
141 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object); 141 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object);
142 // TODO(turnidge): This function currently only works when passes a
143 // local handle. Make it work for both local and persistent handles.
144 142
145 /** 143 /**
146 * Deallocates a persistent handle. 144 * Deallocates a persistent handle.
147 * 145 *
148 * Requires there to be a current isolate. 146 * Requires there to be a current isolate.
149 */ 147 */
150 DART_EXPORT void Dart_DeletePersistentHandle(Dart_Handle object); 148 DART_EXPORT void Dart_DeletePersistentHandle(Dart_Handle object);
151 149
152 /** 150 /**
153 * Takes a persistent handle and makes it weak. 151 * Takes a persistent handle and makes it weak.
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 * 431 *
434 * The previous scope (if any) becomes the current scope. 432 * The previous scope (if any) becomes the current scope.
435 * 433 *
436 * Requires there to be a current isolate. 434 * Requires there to be a current isolate.
437 */ 435 */
438 DART_EXPORT void Dart_ExitScope(); 436 DART_EXPORT void Dart_ExitScope();
439 437
440 // --- Objects ---- 438 // --- Objects ----
441 439
442 /** 440 /**
441 * Returns the null object.
442 *
443 * Requires there to be a current isolate.
444 *
445 * \return A handle to the null object.
446 */
447 DART_EXPORT Dart_Handle Dart_Null();
448
449 /**
443 * Is this object null? 450 * Is this object null?
444 */ 451 */
445 DART_EXPORT bool Dart_IsNull(Dart_Handle object); 452 DART_EXPORT bool Dart_IsNull(Dart_Handle object);
446 453
447 /** 454 /**
448 * Converts an object to a string. 455 * Converts an object to a string.
449 * 456 *
450 * If an exception occurs during the conversion, this is treated as an 457 * If an exception occurs during the conversion, this is treated as an
451 * error. 458 * error.
452 * 459 *
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 * the next call to Dart_ExitScope. 567 * the next call to Dart_ExitScope.
561 * 568 *
562 * \return A valid handle if no error occurs during the operation. 569 * \return A valid handle if no error occurs during the operation.
563 */ 570 */
564 DART_EXPORT Dart_Handle Dart_IntegerValueHexCString(Dart_Handle integer, 571 DART_EXPORT Dart_Handle Dart_IntegerValueHexCString(Dart_Handle integer,
565 const char** value); 572 const char** value);
566 573
567 // --- Booleans ---- 574 // --- Booleans ----
568 575
569 /** 576 /**
577 * Returns the True object.
578 *
579 * Requires there to be a current isolate.
580 *
581 * \return A handle to the True object.
582 */
583 DART_EXPORT Dart_Handle Dart_True();
584
585 /**
586 * Returns the False object.
587 *
588 * Requires there to be a current isolate.
589 *
590 * \return A handle to the False object.
591 */
592 DART_EXPORT Dart_Handle Dart_False();
593
594 /**
570 * Is this object a Boolean? 595 * Is this object a Boolean?
571 */ 596 */
572 DART_EXPORT bool Dart_IsBoolean(Dart_Handle object); 597 DART_EXPORT bool Dart_IsBoolean(Dart_Handle object);
573 598
574 /** 599 /**
575 * Returns a Boolean with the provided value. 600 * Returns a Boolean with the provided value.
576 * 601 *
577 * \param value true or false. 602 * \param value true or false.
578 * 603 *
579 * \return The Boolean object if no errors occurs. Otherwise returns 604 * \return The Boolean object if no errors occurs. Otherwise returns
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 1142
1118 // --- Profiling support ---- 1143 // --- Profiling support ----
1119 1144
1120 // External pprof support for gathering and dumping symbolic 1145 // External pprof support for gathering and dumping symbolic
1121 // information that can be used for better profile reports for 1146 // information that can be used for better profile reports for
1122 // dynamically generated code. 1147 // dynamically generated code.
1123 DART_EXPORT void Dart_InitPprofSupport(); 1148 DART_EXPORT void Dart_InitPprofSupport();
1124 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 1149 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
1125 1150
1126 #endif // INCLUDE_DART_API_H_ 1151 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698