コード例 #1
0
ファイル: tok.c プロジェクト: 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;
}
コード例 #2
0
ファイル: configimpl.cpp プロジェクト: Rogaven/jagpdf
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)));
}