175584Sru// -*- C++ -*- 275584Sru/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. 375584Sru Written by James Clark (jjc@jclark.com) 475584Sru 575584SruThis file is part of groff. 675584Sru 775584Srugroff is free software; you can redistribute it and/or modify it under 875584Sruthe terms of the GNU General Public License as published by the Free 975584SruSoftware Foundation; either version 2, or (at your option) any later 1075584Sruversion. 1175584Sru 1275584Srugroff is distributed in the hope that it will be useful, but WITHOUT ANY 1375584SruWARRANTY; without even the implied warranty of MERCHANTABILITY or 1475584SruFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1575584Srufor more details. 1675584Sru 1775584SruYou should have received a copy of the GNU General Public License along 1875584Sruwith groff; see the file COPYING. If not, write to the Free Software 19151497SruFoundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */ 2075584Sru 2175584Sru#ifndef UCHAR_MAX 2275584Sru#define UCHAR_MAX 255 2375584Sru#endif 2475584Sru 2575584Sruenum cmap_builtin { CMAP_BUILTIN }; 2675584Sru 2775584Sruclass cmap { 2875584Srupublic: 2975584Sru cmap(); 3075584Sru cmap(cmap_builtin); 3175584Sru int operator()(unsigned char) const; 3275584Sru unsigned char &operator[](unsigned char); 3375584Sru 3475584Sru friend class cmap_init; 3575584Sruprivate: 3675584Sru unsigned char v[UCHAR_MAX+1]; 3775584Sru}; 3875584Sru 3975584Sruinline int cmap::operator()(unsigned char c) const 4075584Sru{ 4175584Sru return v[c]; 4275584Sru} 4375584Sru 4475584Sruinline unsigned char &cmap::operator[](unsigned char c) 4575584Sru{ 4675584Sru return v[c]; 4775584Sru} 4875584Sru 4975584Sruextern cmap cmlower; 5075584Sruextern cmap cmupper; 5175584Sru 5275584Srustatic class cmap_init { 5375584Sru static int initialised; 5475584Srupublic: 5575584Sru cmap_init(); 5675584Sru} _cmap_init; 57