Example #1
0
void
Obj_Module::populate_sig_list (Sig_List &siglist,
                               int lines,
                               ACE_Message_Block *buf)
{
  char *c;
  ACE_CString temp;
  
  for (int i = 0; i < lines; i++)
    {
      for (c = buf->rd_ptr (); c != buf->wr_ptr () && *c != '\n'; ++c)
        {
          // No action.
        }
        
      temp += ACE_CString (buf->rd_ptr (), (c - buf->rd_ptr ()));
      buf->rd_ptr (c + 1);
      
      if (*c == '\n')
        {
          //      ACE_DEBUG ((LM_DEBUG, "%s\n",temp.c_str()));
          siglist.add (temp);
          temp.clear ();
        }
      else
        {
          buf = buf->cont ();
          
          if (buf == 0)
            {
              siglist.add (temp);
            }
        }
    }
}
Example #2
0
void
Library::resolve (Sig_List &undefs)
{
  if (num_modules_ < 1)
    return;

  for (const Signature *uname = undefs.first();
       undefs.hasmore();
       uname = undefs.next()) {
    if (exported_.index_of(uname) != -1) {
      undefs.remove_current();
    }
    else
      for (int i = 0; i < num_modules_; i++)
        if (modules_[i]->extref() == 0 &&
            modules_[i]->exports().index_of(uname) != -1)
          {
            undefs.remove_current();
            exported_.add (modules_[i]->exports());
            for (const Signature *needed = modules_[i]->imports().first();
                 modules_[i]->imports().hasmore();
                 needed = modules_[i]->imports().next())
              if (exported_.index_of(needed) == -1)
                undefs.add (needed->name());
            modules_[i]->add_extref();
            num_extrefs_++;
            break;
          }
  }
}