From 5df79c53745fde5d6c3340a2979b1429cd5892c1 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 8 Oct 2011 20:30:28 +0200 Subject: Initial import of htcd system 1.0 Signed-off-by: Henrik Rydberg --- src/mt/msmap.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/mt/msmap.h (limited to 'src/mt/msmap.h') diff --git a/src/mt/msmap.h b/src/mt/msmap.h new file mode 100644 index 0000000..a719a7b --- /dev/null +++ b/src/mt/msmap.h @@ -0,0 +1,89 @@ +/************************************************************************* + * + * HTCd - Copyright (C) 1998-2006 Henrik Rydberg + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef MSMAPH +#define MSMAPH + +#include +#include + +struct rrstring { + sref first,second; + rrstring() : first(),second() {} + explicit rrstring(const sref& a) : first(a),second() {} + rrstring(const sref& a,const sref& b) : first(a),second(b) {} +}; +inline bool operator<(const rrstring& a,const rrstring& b) { return a.first rrpile; + +struct rrmap : public rrpile +{ + typedef rrpile::iterator iterator; + typedef rrpile::const_iterator const_iterator; + + const sref* get(const sref& t) const; + const sref* add(const sref& t,const sref& s); + void sort(); +}; + +////////////////////////////////////////////////////////////////// + +struct rimap_t { + sref name; + int at; + rimap_t() : name(),at(0) {} + explicit rimap_t(const sref& a) : name(a),at(0) {} + rimap_t(const sref& a,int p) : name(a),at(p) {} +}; +inline bool operator<(const rimap_t& a,const rimap_t& b) { return a.name +{ + typedef mrvec::iterator iterator; + typedef mrvec::const_iterator const_iterator; + + int get(const sref& t) const; + int add(const sref& t,int at); + void sort(); +}; + +////////////////////////////////////////////////////////////////// + +struct sstring { + mstring first,second; + sstring() : first(),second() {} + explicit sstring(const mstring& a) : first(a),second() {} + sstring(const mstring& a,const mstring& b) : first(a),second(b) {} +}; +inline bool operator<(const sstring& a,const sstring& b) { return a.first sspile; + +struct ssmap : public sspile +{ + typedef sspile::iterator iterator; + typedef sspile::const_iterator const_iterator; + + const mstring* get(const mstring& t) const; + const mstring* add(const mstring& t,const mstring& s); + void sort(); +}; + +#endif -- cgit v1.2.3