| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 | 1648 |
| 1649 // DEPRECATED: The API below is a temporary hack. | 1649 // DEPRECATED: The API below is a temporary hack. |
| 1650 DART_EXPORT int64_t Dart_ClosureSmrck(Dart_Handle object); | 1650 DART_EXPORT int64_t Dart_ClosureSmrck(Dart_Handle object); |
| 1651 | 1651 |
| 1652 // DEPRECATED: The API below is a temporary hack. | 1652 // DEPRECATED: The API below is a temporary hack. |
| 1653 DART_EXPORT void Dart_ClosureSetSmrck(Dart_Handle object, int64_t value); | 1653 DART_EXPORT void Dart_ClosureSetSmrck(Dart_Handle object, int64_t value); |
| 1654 | 1654 |
| 1655 // --- Methods and Fields --- | 1655 // --- Methods and Fields --- |
| 1656 | 1656 |
| 1657 /** | 1657 /** |
| 1658 * Invokes a method or function. |
| 1659 * |
| 1660 * The 'target' parameter may be an object, class, or library. If |
| 1661 * 'target' is an object, then this function will invoke an instance |
| 1662 * method. If 'target' is a class, then this function will invoke a |
| 1663 * static method. If 'target' is a library, then this function will |
| 1664 * invoke a top-level function from that library. |
| 1665 * |
| 1666 * This function ignores visibility (leading underscores in names). |
| 1667 * |
| 1668 * May generate an unhandled exception error. |
| 1669 * |
| 1670 * \param target An object, class, or library. |
| 1671 * \param name The name of the function or method to invoke. |
| 1672 * \param number_of_arguments Size of the arguments array. |
| 1673 * \param arguments An array of arguments to the function. |
| 1674 * |
| 1675 * \return If the function or method is called and completes |
| 1676 * successfully, then the return value is returned. If an error |
| 1677 * occurs during execution, then an error handle is returned. |
| 1678 */ |
| 1679 DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, |
| 1680 Dart_Handle name, |
| 1681 int number_of_arguments, |
| 1682 Dart_Handle* arguments); |
| 1683 /** |
| 1684 * DEPRECATED: Use Dart_Invoke instead. |
| 1685 * |
| 1658 * Invokes a static method with the given arguments. | 1686 * Invokes a static method with the given arguments. |
| 1659 * | 1687 * |
| 1660 * May generate an unhandled exception error. | 1688 * May generate an unhandled exception error. |
| 1661 * | 1689 * |
| 1662 * \return If no error occurs during execution, then the result of | 1690 * \return If no error occurs during execution, then the result of |
| 1663 * invoking the method is returned. If an error occurs during | 1691 * invoking the method is returned. If an error occurs during |
| 1664 * execution, then an error handle is returned. | 1692 * execution, then an error handle is returned. |
| 1665 */ | 1693 */ |
| 1666 DART_EXPORT Dart_Handle Dart_InvokeStatic(Dart_Handle library, | 1694 DART_EXPORT Dart_Handle Dart_InvokeStatic(Dart_Handle library, |
| 1667 Dart_Handle class_name, | 1695 Dart_Handle class_name, |
| 1668 Dart_Handle function_name, | 1696 Dart_Handle function_name, |
| 1669 int number_of_arguments, | 1697 int number_of_arguments, |
| 1670 Dart_Handle* arguments); | 1698 Dart_Handle* arguments); |
| 1671 | 1699 |
| 1672 /** | 1700 /** |
| 1701 * DEPRECATED: Use Dart_Invoke instead. |
| 1702 * |
| 1673 * Invokes an instance method with the given arguments. | 1703 * Invokes an instance method with the given arguments. |
| 1674 * | 1704 * |
| 1675 * May generate an unhandled exception error. | 1705 * May generate an unhandled exception error. |
| 1676 * | 1706 * |
| 1677 * \return If no error occurs during execution, then the result of | 1707 * \return If no error occurs during execution, then the result of |
| 1678 * invoking the method is returned. If an error occurs during | 1708 * invoking the method is returned. If an error occurs during |
| 1679 * execution, then an error handle is returned. | 1709 * execution, then an error handle is returned. |
| 1680 */ | 1710 */ |
| 1681 DART_EXPORT Dart_Handle Dart_InvokeDynamic(Dart_Handle receiver, | 1711 DART_EXPORT Dart_Handle Dart_InvokeDynamic(Dart_Handle receiver, |
| 1682 Dart_Handle function_name, | 1712 Dart_Handle function_name, |
| 1683 int number_of_arguments, | 1713 int number_of_arguments, |
| 1684 Dart_Handle* arguments); | 1714 Dart_Handle* arguments); |
| 1685 | 1715 |
| 1686 /** | 1716 /** |
| 1687 * Gets the value of a field. | 1717 * Gets the value of a field. |
| 1688 * | 1718 * |
| 1689 * The 'container' parameter may actually be an object, class, or | 1719 * The 'container' parameter may be an object, class, or library. If |
| 1690 * library. If 'container' is an object, then this function will | 1720 * 'container' is an object, then this function will access an |
| 1691 * access an instance field. If 'container' is a class, then this | 1721 * instance field. If 'container' is a class, then this function will |
| 1692 * function will access a static field. If 'container' is a library, | 1722 * access a static field. If 'container' is a library, then this |
| 1693 * then this function will access a top-level variable. | 1723 * function will access a top-level variable. |
| 1694 * | 1724 * |
| 1695 * This function ignores field visibility (leading underscores in names). | 1725 * This function ignores field visibility (leading underscores in names). |
| 1696 * | 1726 * |
| 1697 * May generate an unhandled exception error. | 1727 * May generate an unhandled exception error. |
| 1698 * | 1728 * |
| 1699 * \param container An object, class, or library. | 1729 * \param container An object, class, or library. |
| 1700 * \param name A field name | 1730 * \param name A field name. |
| 1701 * | 1731 * |
| 1702 * \return If no error occurs, then the value of the field is | 1732 * \return If no error occurs, then the value of the field is |
| 1703 * returned. Otherwise an error handle is returned. | 1733 * returned. Otherwise an error handle is returned. |
| 1704 */ | 1734 */ |
| 1705 DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, | 1735 DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, |
| 1706 Dart_Handle name); | 1736 Dart_Handle name); |
| 1707 | 1737 |
| 1708 /** | 1738 /** |
| 1709 * Sets the value of a field. | 1739 * Sets the value of a field. |
| 1710 * | 1740 * |
| 1711 * The 'container' parameter may actually be an object, class, or | 1741 * The 'container' parameter may actually be an object, class, or |
| 1712 * library. If 'container' is an object, then this function will | 1742 * library. If 'container' is an object, then this function will |
| 1713 * access an instance field. If 'container' is a class, then this | 1743 * access an instance field. If 'container' is a class, then this |
| 1714 * function will access a static field. If 'container' is a library, | 1744 * function will access a static field. If 'container' is a library, |
| 1715 * then this function will access a top-level variable. | 1745 * then this function will access a top-level variable. |
| 1716 * | 1746 * |
| 1717 * This function ignores field visibility (leading underscores in names). | 1747 * This function ignores field visibility (leading underscores in names). |
| 1718 * | 1748 * |
| 1719 * May generate an unhandled exception error. | 1749 * May generate an unhandled exception error. |
| 1720 * | 1750 * |
| 1721 * \param container An object, class, or library. | 1751 * \param container An object, class, or library. |
| 1722 * \param name A field name | 1752 * \param name A field name. |
| 1723 * \param value The new field value | 1753 * \param value The new field value. |
| 1724 * | 1754 * |
| 1725 * \return A valid handle if no error occurs. | 1755 * \return A valid handle if no error occurs. |
| 1726 */ | 1756 */ |
| 1727 DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container, | 1757 DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container, |
| 1728 Dart_Handle name, | 1758 Dart_Handle name, |
| 1729 Dart_Handle value); | 1759 Dart_Handle value); |
| 1730 | 1760 |
| 1731 /** | 1761 /** |
| 1732 * DEPRECATED: Use Dart_SetField/Dart_GetField instead. | 1762 * DEPRECATED: Use Dart_SetField/Dart_GetField instead. |
| 1733 * | 1763 * |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 | 2006 |
| 1977 // --- Profiling support ---- | 2007 // --- Profiling support ---- |
| 1978 | 2008 |
| 1979 // External pprof support for gathering and dumping symbolic | 2009 // External pprof support for gathering and dumping symbolic |
| 1980 // information that can be used for better profile reports for | 2010 // information that can be used for better profile reports for |
| 1981 // dynamically generated code. | 2011 // dynamically generated code. |
| 1982 DART_EXPORT void Dart_InitPprofSupport(); | 2012 DART_EXPORT void Dart_InitPprofSupport(); |
| 1983 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 2013 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1984 | 2014 |
| 1985 #endif // INCLUDE_DART_API_H_ | 2015 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |