Remove dynamic exceptions
[anna.git] / source / core / internal / ModuleManager.cpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #include <string.h>
10
11 #include <anna/core/internal/ModuleManager.hpp>
12 #include <anna/config/defines.hpp>
13
14 #include <stdlib.h>
15
16 using namespace std;
17 using namespace anna;
18
19 void ModuleManager::insert(const char* module, const char* revision)
20 {
21   char* dup = strdup(module + anna_strlen("@(#)"));
22
23   /*
24      char* space;
25
26      if ((space = anna_strchr (dup, ' ')) != NULL)
27         *space = 0;
28   */
29   for(const_iterator ii = begin(), maxii = end(); ii != maxii; ii ++) {
30     if(anna_strcmp(dup, ModuleManager::module(ii)) == 0) {
31       free(dup);
32       return;
33     }
34   }
35
36   a_modules.push_back(Module(dup, revision));
37 }
38