Debian Codegraph @

src/lib/ABWXMLTokenMap.cpp

raw
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libabw project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #include "ABWXMLTokenMap.h"
11 #include <string.h>
12
13 namespace
14 {
15
16 #include "tokenhash.h"
17
18 } // anonymous namespace
19
20 int libabw::ABWXMLTokenMap::getTokenId(const xmlChar *name)
21 {
22 const xmltoken *token = Perfect_Hash::in_word_set((const char *)name, (unsigned int)xmlStrlen(name));
23 if (token)
24 return token->tokenId;
25 else
26 return XML_TOKEN_INVALID;
27 }
28
29 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */