internal
| 1167 | |
| 1168 | // internal |
| 1169 | asSNameSpace *asCScriptEngine::AddNameSpace(const char *name) |
| 1170 | { |
| 1171 | // First check if it doesn't exist already |
| 1172 | asSNameSpace *ns = FindNameSpace(name); |
| 1173 | if( ns ) return ns; |
| 1174 | |
| 1175 | ns = asNEW(asSNameSpace); |
| 1176 | if( ns == 0 ) |
| 1177 | { |
| 1178 | // Out of memory |
| 1179 | return 0; |
| 1180 | } |
| 1181 | ns->name = name; |
| 1182 | |
| 1183 | // TODO: thread-safety: This can potentially be called from multiple threads so it must be protected with critical section |
| 1184 | nameSpaces.PushLast(ns); |
| 1185 | |
| 1186 | return ns; |
| 1187 | } |
| 1188 | |
| 1189 | // internal |
| 1190 | asSNameSpace *asCScriptEngine::FindNameSpace(const char *name) const |
no test coverage detected