libs/gen/src/msgDict.cxx
// Add a pair of strings to the dictionary
Add a pair of strings to the dictionary
Add a pair of strings to the dictionary
msgDictEntry *msgDict::add(const char *key, const char *val)
{
  if (debugLevel > 0) {
    if (!key)
      msg("Trying to create message entry with NULL key.", warning_sev) << eom;
    if (!val)
      msg("Message key points to NULL value: \"$1\".", warning_sev) << (SAFE_STR((char *)key)) << eom;
  }
  int len1 = key ? OSapi_strlen(key) + 1 : 0;
  int len2 = val ? OSapi_strlen(val) + 1 : 0;
  char *st1 = len1 ? (char *)psetmalloc(len1) : NULL;
  char *st2 = len2 ? (char *)psetmalloc(len2) : NULL;
  if (st1) OSapi_bcopy(key, st1, len1);
  if (st2) OSapi_bcopy(val, st2, len2);
  msgDictEntry *entry = new msgDictEntry(st1, st2);
  os_list.add(*entry);
  return entry;
}
msgDictEntry * msgDict :: add ( const char * key , const char * val ) { if ( debugLevel > 0 ) { if ( ! key ) msg ( " " , warning_sev ) << eom ; if ( ! val ) msg ( " \" \" " , warning_sev ) << ( SAFE_STR ( ( char * ) key ) ) << eom ; } int len1 = key ? OSapi_strlen ( key ) + 1 : 0 ; int len2 = val ? OSapi_strlen ( val ) + 1 : 0 ; char * st1 = len1 ? ( char * ) psetmalloc ( len1 ) : NULL ; char * st2 = len2 ? ( char * ) psetmalloc ( len2 ) : NULL ; if ( st1 ) OSapi_bcopy ( key , st1 , len1 ) ; if ( st2 ) OSapi_bcopy ( val , st2 , len2 ) ; msgDictEntry * entry = new msgDictEntry ( st1 , st2 ) ; os_list . add ( * entry ) ; return entry ; }
Add a pair of strings to the dictionary
Add a pair of strings to the dictionary