uvar32_64 CDiasAPIDensScales::Insert (CString name, CDensScale& scale) { int pos; if ((pos = NameLookup (name)) == uvar32_64(-1)) throw (0); if ((pos = NameLookup (scale.m_strName)) != uvar32_64(-1)) return ((uvar32_64)-1); CHash<CDensScale*,CDensScale>* p = new CHash<CDensScale*,CDensScale>(&scale); m_pHashHead->GetAt(pos)->InsertAfter (p); m_pHashHead = m_pHashHead->GetHead (); return ((uvar32_64)(p->GetPos ())); }
CDiasAPIChnlRange& CDiasAPIChannels::operator() (char* name, ...) { m_rngInt.Reset (); char* n = name; va_list items; va_start (items, name); while (!n) m_rngInt.Include (m_pHashHead->GetAt(NameLookup(n))); va_end (items); return (m_rngInt); }
uvar32_64 CDiasAPIDensScales::Add (CDensScale& scale) { int pos; if ((pos = NameLookup (scale.m_strName)) != uvar32_64(-1)) return ((uvar32_64)-1); CHash<CDensScale*,CDensScale>* p = new CHash<CDensScale*,CDensScale>(&scale); if (!m_pHashHead) m_pHashHead = p; else m_pHashHead->GetTail()->InsertAfter (p); return ((uvar32_64)(p->GetPos())); }
static void SetOption(char *line, BOOLEAN *option) { CARDINAL index, value; Name optionName; if (!initialised) { CopyName(0, "OFF", options); CopyName(1, "ON", options); CopyName(2, "HELP", options); CopyName(3, "QUIT", options); initialised = TRUE; }; /* if */ do { index = 0 ; if (!SymbolTest(line,&index,&optionName)) { WriteChs("Bad option name\\N") ; newLine[0] = CR ; return ; } if (NameLookup(options, optionName, TRUE, &value, NumberOfOptions)) { switch (value) { case 0: case 1: *option = value != 0; line += index; /* Something odd here */ return; case 2: WriteChs("Options available:\\NOn\\NOff\\NHelp\\NQuit\\N"); break; case 3: return; }; /* case */ } else { WriteChs("Unknown option\\N"); newLine[0] = CR; return; }; /* if */ *line = CR; } while (1); } /* End SetOption */