Beispiel #1
0
Datei: tok.c Projekt: 8l/myrddin
static Tok *kwident(void)
{
    char buf[1024];
    Tok *t;

    if (!identstr(buf, sizeof buf))
        return NULL;
    t = mktok(kwd(buf));
    t->id = strdup(buf);
    return t;
}
Beispiel #2
0
void ConfigImpl::set_r(Char const* kwd_begin, Char const* kwd_end,
                        Char const* value_begin, Char const* value_end)
{
    // verify that the passed option is valid
    string_t kwd(kwd_begin, kwd_end);
    verify(kwd.c_str());

    // update the map
    config_map_t::iterator it = m_config_map.find(kwd);
    if (it != m_config_map.end())
        m_config_map.erase(it);

    m_config_map.insert(config_map_t::value_type(
                            kwd,
                            string_t(value_begin, value_end)));
}