libcsdbg  1.28
C++ exception (and generic) stack trace debug library
dictionary * csdbg::parser::get_dictionary ( const i8 nm) const
virtual

Get a dictionary, indexed by name.

Parameters
[in]nmthe dictionary name
Returns
the dictionary or NULL if no such dictionary is registered

Definition at line 375 of file parser.cpp.

References __D_ASSERT, likely, m_dictionaries, csdbg::dictionary::name(), and unlikely.

Referenced by lookup().

376 {
377  __D_ASSERT(nm != NULL);
378  if ( unlikely(nm == NULL) )
379  return NULL;
380 
381  for (u32 i = 0, sz = m_dictionaries->size(); likely(i < sz); i++) {
382  dictionary *dict = m_dictionaries->at(i);
383  if ( unlikely(strcmp(dict->name(), nm) == 0) )
384  return dict;
385  }
386 
387  return NULL;
388 }
chain< dictionary > * m_dictionaries
Dictionary collection.
Definition: parser.hpp:42
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
#define __D_ASSERT(x)
Assertion macro.
Definition: config.hpp:268

+ Here is the call graph for this function:

+ Here is the caller graph for this function: