/[ascend]/trunk/pygtk/library.cpp
ViewVC logotype

Diff of /trunk/pygtk/library.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1664 by jpye, Sat Jun 30 23:21:49 2007 UTC revision 1665 by jpye, Mon Dec 17 00:45:59 2007 UTC
# Line 13  extern "C"{ Line 13  extern "C"{
13  #include <utilities/ascConfig.h>  #include <utilities/ascConfig.h>
14    
15  #include <general/list.h>  #include <general/list.h>
 #include <compiler/slist.h>  
16  #include <compiler/ascCompiler.h>  #include <compiler/ascCompiler.h>
 #include <compiler/fractions.h>  
17    
18  /* #include <compiler/redirectFile.h> */  /* #include <compiler/redirectFile.h> */
 #include <compiler/module.h>  
19  #include <compiler/prototype.h>  #include <compiler/prototype.h>
20  #include <compiler/dump.h>  #include <compiler/dump.h>
 #include <compiler/dimen.h>  
 #include <compiler/child.h>  
21  #include <compiler/childio.h>  #include <compiler/childio.h>
22  #include <compiler/type_desc.h>  #include <compiler/type_desc.h>
23  #include <compiler/typedef.h>  #include <compiler/typedef.h>
24  #include <compiler/library.h>  #include <compiler/library.h>
 #include <compiler/childinfo.h>  
25  #include <system/slv_types.h>  #include <system/slv_types.h>
26  #include <system/system.h>  #include <system/system.h>
27  #include <utilities/ascEnvVar.h>  #include <utilities/ascEnvVar.h>
# Line 248  Library::findType(const SymChar &sym){ Line 242  Library::findType(const SymChar &sym){
242      return *t2;      return *t2;
243  }  }
244    
245    static int module_sort_cmp(const void *a, const void *b){
246        return strcmp((char *)a, (char *)b);
247    }
248    
249  /**  /**
250      This could be quite a bit more efficient if we could get a gl_list_t of TypeDescription rather than names      This could be quite a bit more efficient if we could get a gl_list_t of TypeDescription rather than names
251  */  */
# Line 256  Library::getModuleTypes(const Module &m) Line 254  Library::getModuleTypes(const Module &m)
254      //cerr << "GET MODULE TYPES\n" << endl;      //cerr << "GET MODULE TYPES\n" << endl;
255      vector<Type> v;      vector<Type> v;
256      struct gl_list_t *l =  Asc_TypeByModule(m.getInternalType());      struct gl_list_t *l =  Asc_TypeByModule(m.getInternalType());
257    
258        gl_sort(l, &module_sort_cmp);
259    
260      for(int i=0,end=gl_length(l); i<end; ++i){      for(int i=0,end=gl_length(l); i<end; ++i){
261          char *name = (char *)gl_fetch(l,i+1);          char *name = (char *)gl_fetch(l,i+1);
262          //CONSOLE_DEBUG("Found type %s",name);          //CONSOLE_DEBUG("Found type %s",name);

Legend:
Removed from v.1664  
changed lines
  Added in v.1665

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22