interface
| 838 | |
| 839 | // interface |
| 840 | asIScriptFunction *asCModule::GetFunctionByName(const char *in_name) const |
| 841 | { |
| 842 | asCString name; |
| 843 | asSNameSpace *ns = 0; |
| 844 | if( m_engine->DetermineNameAndNamespace(in_name, m_defaultNamespace, name, ns) < 0 ) |
| 845 | return 0; |
| 846 | |
| 847 | // Search recursively in the given namespace, moving up to parent namespace until the function is found |
| 848 | while( ns ) |
| 849 | { |
| 850 | const asCArray<unsigned int> &idxs = m_globalFunctions.GetIndexes(ns, name); |
| 851 | if( idxs.GetLength() != 1 ) |
| 852 | return 0; |
| 853 | |
| 854 | const asIScriptFunction *func = m_globalFunctions.Get(idxs[0]); |
| 855 | if( func ) |
| 856 | return const_cast<asIScriptFunction*>(func); |
| 857 | |
| 858 | // Recursively search parent namespaces |
| 859 | ns = m_engine->GetParentNameSpace(ns); |
| 860 | } |
| 861 | |
| 862 | return 0; |
| 863 | } |
| 864 | |
| 865 | // interface |
| 866 | asUINT asCModule::GetImportedFunctionCount() const |