Chromium Code Reviews| 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 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 750 * \param str A string. | 750 * \param str A string. |
| 751 * \param utf8 Returns the String represented as a utf8 encoded C | 751 * \param utf8 Returns the String represented as a utf8 encoded C |
| 752 * string. This C string is scope allocated and is only valid until | 752 * string. This C string is scope allocated and is only valid until |
| 753 * the next call to Dart_ExitScope. | 753 * the next call to Dart_ExitScope. |
| 754 * | 754 * |
| 755 * \return A valid handle if no error occurs during the operation. | 755 * \return A valid handle if no error occurs during the operation. |
| 756 */ | 756 */ |
| 757 DART_EXPORT Dart_Handle Dart_StringToCString(Dart_Handle str, | 757 DART_EXPORT Dart_Handle Dart_StringToCString(Dart_Handle str, |
| 758 const char** utf8); | 758 const char** utf8); |
| 759 | 759 |
| 760 // --- Arrays --- | 760 // --- Lists --- |
| 761 | 761 |
| 762 /** | 762 /** |
| 763 * Is this object an Array? | 763 * Is this object a List? |
| 764 */ | 764 */ |
| 765 DART_EXPORT bool Dart_IsArray(Dart_Handle object); | 765 DART_EXPORT bool Dart_IsList(Dart_Handle object); |
| 766 // TODO(turnidge): Rename Array -> List. | |
| 767 | 766 |
| 768 /** | 767 /** |
| 769 * Returns an Array of the desired length. | 768 * Returns a List of the desired length. |
| 770 * | 769 * |
| 771 * \param length The length of the array. | 770 * \param length The length of the list. |
| 772 * | 771 * |
| 773 * \return The Array object if no errors occurs. Otherwise returns | 772 * \return The List object if no errors occurs. Otherwise returns |
| 774 * an invalid handle. | 773 * an invalid handle. |
| 775 */ | 774 */ |
| 776 DART_EXPORT Dart_Handle Dart_NewArray(intptr_t length); | 775 DART_EXPORT Dart_Handle Dart_NewList(intptr_t length); |
| 777 // TODO(turnidge): Rename Array -> List. | |
| 778 | 776 |
| 779 /** | 777 /** |
| 780 * Gets the length of an Array. | 778 * Gets the length of a List. |
| 781 * | 779 * |
| 782 * \param array An Array. | 780 * \param list A List. |
| 783 * \param length Returns the length of the Array. | 781 * \param length Returns the length of the List. |
| 784 * | 782 * |
| 785 * \return A valid handle if no error occurs during the operation. | 783 * \return A valid handle if no error occurs during the operation. |
| 786 */ | 784 */ |
| 787 DART_EXPORT Dart_Handle Dart_GetLength(Dart_Handle array, intptr_t* length); | 785 DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t* length); |
| 788 // TODO(turnidge): Rename Array -> List. | |
| 789 | 786 |
| 790 /** | 787 /** |
| 791 * Gets the Object at some index of an Array. | 788 * Gets the Object at some index of a List. |
| 792 * | 789 * |
| 793 * If the index is out of bounds, an error occurs. | 790 * If the index is out of bounds, an error occurs. |
| 794 * | 791 * |
| 795 * \param array An Array. | 792 * \param list A List. |
| 796 * \param index A valid index into the Array. | 793 * \param index A valid index into the List. |
| 797 * | 794 * |
| 798 * \return The Object in the Array at the specified index if no errors | 795 * \return The Object in the List at the specified index if no errors |
| 799 * occurs. Otherwise returns an invalid handle. | 796 * occurs. Otherwise returns an invalid handle. |
| 800 */ | 797 */ |
| 801 DART_EXPORT Dart_Handle Dart_ArrayGetAt(Dart_Handle array, | 798 DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, |
| 802 intptr_t index); | 799 intptr_t index); |
| 803 // TODO(turnidge): Rename Array -> List. | |
| 804 | 800 |
| 805 /** | 801 /** |
| 806 * Sets the Object at some index of an Array. | 802 * Sets the Object at some index of a List. |
| 807 * | 803 * |
| 808 * If the index is out of bounds, an error occurs. | 804 * If the index is out of bounds, an error occurs. |
| 809 * | 805 * |
| 810 * \param array An Array. | 806 * \param array A List. |
| 811 * \param index A valid index into the Array. | 807 * \param index A valid index into the List. |
| 812 * \param value The Object to put in the Array. | 808 * \param value The Object to put in the List. |
| 813 * | 809 * |
| 814 * \return A valid handle if no error occurs during the operation. | 810 * \return A valid handle if no error occurs during the operation. |
| 815 */ | 811 */ |
| 816 DART_EXPORT Dart_Handle Dart_ArraySetAt(Dart_Handle array, | 812 DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list, |
| 817 intptr_t index, | 813 intptr_t index, |
| 818 Dart_Handle value); | 814 Dart_Handle value); |
| 819 // TODO(turnidge): Rename Array -> List. | |
| 820 | 815 |
| 821 // TODO(turnidge): Figure out what this is for. | 816 // TODO(turnidge): Figure out what this is for. |
| 822 DART_EXPORT Dart_Handle Dart_ArrayGet(Dart_Handle array, | 817 DART_EXPORT Dart_Handle Dart_ListGet(Dart_Handle list, |
|
turnidge
2011/11/03 17:45:40
As long as you are changing the name, can you rena
Mads Ager (google)
2011/11/04 11:20:50
I agree. Thanks. I'll remove the TODO as well. Thi
| |
| 823 intptr_t offset, | 818 intptr_t offset, |
| 824 uint8_t* native_array, | 819 uint8_t* native_array, |
| 825 intptr_t length); | 820 intptr_t length); |
| 826 | 821 |
| 827 // TODO(turnidge): Figure out what this is for. | 822 // TODO(turnidge): Figure out what this is for. |
| 828 DART_EXPORT Dart_Handle Dart_ArraySet(Dart_Handle array, | 823 DART_EXPORT Dart_Handle Dart_ListSet(Dart_Handle list, |
|
turnidge
2011/11/03 17:45:40
Similarly, rename to Dart_ListSetAsBytes.
Mads Ager (google)
2011/11/04 11:20:50
Done.
| |
| 829 intptr_t offset, | 824 intptr_t offset, |
| 830 uint8_t* native_array, | 825 uint8_t* native_array, |
| 831 intptr_t length); | 826 intptr_t length); |
| 832 | 827 |
| 833 // --- Closures --- | 828 // --- Closures --- |
| 834 | 829 |
| 835 /** | 830 /** |
| 836 * Is this object a Closure? | 831 * Is this object a Closure? |
| 837 */ | 832 */ |
| 838 DART_EXPORT bool Dart_IsClosure(Dart_Handle object); | 833 DART_EXPORT bool Dart_IsClosure(Dart_Handle object); |
| 839 | 834 |
| 840 /** | 835 /** |
| 841 * Invokes a Closure with the given arguments. | 836 * Invokes a Closure with the given arguments. |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1117 | 1112 |
| 1118 // --- Profiling support ---- | 1113 // --- Profiling support ---- |
| 1119 | 1114 |
| 1120 // External pprof support for gathering and dumping symbolic | 1115 // External pprof support for gathering and dumping symbolic |
| 1121 // information that can be used for better profile reports for | 1116 // information that can be used for better profile reports for |
| 1122 // dynamically generated code. | 1117 // dynamically generated code. |
| 1123 DART_EXPORT void Dart_InitPprofSupport(); | 1118 DART_EXPORT void Dart_InitPprofSupport(); |
| 1124 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1119 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1125 | 1120 |
| 1126 #endif // INCLUDE_DART_API_H_ | 1121 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |