]> git.lyx.org Git - features.git/commitdiff
some white-space changes, enum changes because of ridance of definitions.h, block...
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 15 Nov 1999 10:54:16 +0000 (10:54 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 15 Nov 1999 10:54:16 +0000 (10:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@311 a592a061-630c-0410-9148-cb99ea01b6c8

18 files changed:
src/support/FileInfo.h
src/support/LIstream.h
src/support/LOstream.h
src/support/LSubstring.C
src/support/LSubstring.h
src/support/Makefile.am
src/support/block.h [new file with mode: 0644]
src/support/filetools.C
src/support/filetools.h
src/support/lstrings.C
src/support/lstrings.h
src/support/lyxlib.h
src/support/lyxstring.C
src/support/lyxstring.h
src/support/lyxsum.C
src/support/syscall.C
src/support/syscontr.C
src/support/textutils.h

index 9093601b1cec79f2be70e6568a589b87a87c8acd..614a8b159660d7368a0b727d96890e7094470634 100644 (file)
@@ -7,7 +7,7 @@
  *           Copyright 1995 Matthias Ettrich
  *           Copyright 1995-1999 The LyX Team.
  *
- * ======================================================*/
+ * ====================================================== */
 
 #ifndef FILE_INFO_H
 #define FILE_INFO_H
index 18be5e88832cf998138234f07754f2ce80212597..0abcb7490d112945b19eb3d7aab48e4677b8b579 100644 (file)
@@ -7,7 +7,7 @@
  *         Copyright (C) 1995 Matthias Ettrich
  *          Copyright (C) 1995-1999 The LyX Team.
  *
- *======================================================*/
+ * ====================================================== */
 
 
 #ifndef LISTREAM_H
index 0dd31d3b1e10b444ec555cce10f029d1730d1a77..2db23aeeba3661b3d5d1fbf6fb1883f30eb821d7 100644 (file)
@@ -7,7 +7,7 @@
  *         Copyright (C) 1995 Matthias Ettrich
  *          Copyright (C) 1995-1999 The LyX Team.
  *
- *======================================================*/
+ * ====================================================== */
 
 
 #ifndef LOSTREAM_H
index bff2fe8c0cfbd398bd867f3010a157c4ada70553..b2c2ef05de9133d01395e6c15a26c7ffbb022040 100644 (file)
@@ -6,7 +6,7 @@
  *         Copyright (C) 1995 Matthias Ettrich
  *          Copyright (C) 1995-1998 The LyX Team.
  *
- *======================================================*/
+ * ====================================================== */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 44463d32261eece011b37a1bf72ce1dec0d75dd8..96164f11b99631b50c9c01646a6083bc9eb40f10 100644 (file)
@@ -7,7 +7,7 @@
  *         Copyright (C) 1995 Matthias Ettrich
  *          Copyright (C) 1995-1998 The LyX Team.
  *
- *======================================================*/
+ * ====================================================== */
 
 // This one is heavily based on the substring class in The C++
 // Programming Language by Bjarne Stroustrup
index 3b13ab6e9a632a8d826a97108749184060065e3f..8bf8629e4320b727a04d6cc684cc6f763d45ae0f 100644 (file)
@@ -20,6 +20,7 @@ libsupport_a_SOURCES = \
        LRegex.h \
        LSubstring.C \
        LSubstring.h \
+       block.h \
        filetools.C \
        filetools.h \
        lstrings.C \
diff --git a/src/support/block.h b/src/support/block.h
new file mode 100644 (file)
index 0000000..49279b1
--- /dev/null
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+#ifndef BLOCK_H
+#define BLOCK_H
+
+#include "LAssert.h"
+
+template <class T, size_t s>
+class block {
+public:
+       typedef T value_type;
+       typedef size_t size_type;
+       typedef value_type * pointer;
+       typedef value_type const * const_pointer;
+       typedef value_type & reference;
+       typedef value_type const & const_reference;
+       typedef value_type * iterator;
+       typedef value_type const * const_iterator;
+       size_type size() const { return s; }
+       reference operator[](int i) { return arr[i]; }
+       const_reference operator[](int i) const { return arr[i]; }
+       void operator=(block const & b) {
+               Assert(b.size() == size());
+               for (size_t i = 0; i < size(); ++i) {
+                       arr[i] == b[i];
+               }
+       }
+       bool operator==(block const & b) const {
+               Assert(b.size() == size());
+               for (size_t i = 0; i < size(); ++i) {
+                       if (arr[i] != b[i]) return false;
+               }
+               return true;
+       }
+       iterator begin() { return arr[0]; }
+       iterator end() { return arr[s]; }
+       const_iterator begin() const { return arr[0]; }
+       const_iterator end() const { return arr[s]; }
+private:
+       value_type arr[s + 1];
+};
+
+#endif // BLOCK_H_
index c1e82424ab8e127cea1a862e341c760e49c949cd..0865d9dbbc00072667200eae465553a564e2f593 100644 (file)
@@ -105,9 +105,9 @@ string TmpFileName(string const & dir, string const & mask)
        // a short string...
        string ret;
        FileInfo fnfo;
-       for (int a='a'; a<= 'z'; ++a)
-               for (int b='a'; b<= 'z'; ++b)
-                       for (int c='a'; c<= 'z'; ++c) {
+       for (int a= 'a'; a<= 'z'; ++a)
+               for (int b= 'a'; b<= 'z'; ++b)
+                       for (int c= 'a'; c<= 'z'; ++c) {
                                // if this is not enough I have no idea what
                                // to do.
                                ret = tmpfl + char(a) + char(b) + char(c);
@@ -198,7 +198,7 @@ string FileOpenSearch (string const & path, string const & name,
        while (notfound && !path_element.empty()) {
                path_element = CleanupPath(path_element);
                if (!suffixIs(path_element, '/'))
-                       path_element+='/';
+                       path_element+= '/';
                path_element = subst(path_element, "$$LyX", system_lyxdir);
                path_element = subst(path_element, "$$User", user_lyxdir);
                
@@ -255,7 +255,7 @@ string FileSearch(string const & path, string const & name,
 string LibFileSearch(string const & dir, string const & name, 
                      string const & ext)
 {
-        string fullname = FileSearch(AddPath(user_lyxdir,dir), name,
+        string fullname = FileSearch(AddPath(user_lyxdir, dir), name,
                                      ext); 
        if (!fullname.empty())
                return fullname;
@@ -266,7 +266,7 @@ string LibFileSearch(string const & dir, string const & name,
        if (!fullname.empty())
                return fullname;
 
-       return FileSearch(AddPath(system_lyxdir,dir), name, ext);
+       return FileSearch(AddPath(system_lyxdir, dir), name, ext);
 }
 
 
@@ -348,7 +348,7 @@ int DeleteAllFilesInDir (string const & path)
        }
        while ((de = readdir(dir))) {
                string temp = de->d_name;
-               if (temp=="." || temp=="..") 
+               if (temp == "." || temp == "..") 
                        continue;
                string unlinkpath = AddName (path, temp);
 
@@ -497,7 +497,7 @@ string MakeAbsPath(string const & RelPath, string const & BasePath)
        // checks for already absolute path
        if (AbsolutePath(RelPath))
 #ifdef __EMX__
-               if(RelPath[0]!='/' && RelPath[0]!='\\')
+               if(RelPath[0]!= '/' && RelPath[0]!= '\\')
 #endif
                return RelPath;
 
@@ -534,8 +534,8 @@ string MakeAbsPath(string const & RelPath, string const & BasePath)
                // Split by next /
                RTemp = split(RTemp, Temp, '/');
                
-               if (Temp==".") continue;
-               if (Temp=="..") {
+               if (Temp == ".") continue;
+               if (Temp == "..") {
                        // Remove one level of TempBase
                        int i = TempBase.length()-2;
 #ifndef __EMX__
@@ -604,7 +604,7 @@ bool AbsolutePath(string const & path)
 #ifndef __EMX__
        return (!path.empty() && path[0] == '/');
 #else
-       return (!path.empty() && (path[0]=='/' || (isalpha(static_cast<unsigned char>(path[0])) && path.length()>1 && path[1]==':')));
+       return (!path.empty() && (path[0] == '/' || (isalpha(static_cast<unsigned char>(path[0])) && path.length()>1 && path[1] == ':')));
 #endif
 }
 
@@ -623,13 +623,13 @@ string ExpandPath(string const & path)
        string copy(RTemp);
 
        // Split by next /
-       RTemp=split(RTemp, Temp, '/');
+       RTemp= split(RTemp, Temp, '/');
 
-       if (Temp==".") {
+       if (Temp == ".") {
                return GetCWD() + '/' + RTemp;
-       } else if (Temp=="~") {
+       } else if (Temp == "~") {
                return GetEnvPath("HOME") + '/' + RTemp;
-       } else if (Temp=="..") {
+       } else if (Temp == "..") {
                return MakeAbsPath(copy);
        } else
                // Don't know how to handle this
@@ -656,14 +656,14 @@ string NormalizePath(string const & path)
                // Split by next /
                RTemp = split(RTemp, Temp, '/');
                
-               if (Temp==".") {
+               if (Temp == ".") {
                        TempBase = "./";
-               } else if (Temp=="..") {
+               } else if (Temp == "..") {
                        // Remove one level of TempBase
                        int i = TempBase.length()-2;
                        while (i>0 && TempBase[i] != '/')
                                --i;
-                       if (i>=0 && TempBase[i] == '/')
+                       if (i>= 0 && TempBase[i] == '/')
                                TempBase.erase(i+1, string::npos);
                        else
                                TempBase = "../";
@@ -706,14 +706,14 @@ string ReplaceEnvironmentPath(string const & path)
 //      Search Environmentvariable
 //      if found: Replace Strings
 //
-       const char CompareChar = '$';
-       const char FirstChar = '{'; 
-       const char EndChar = '}'; 
-       const char UnderscoreChar = '_'; 
+       char const CompareChar = '$';
+       char const FirstChar = '{'; 
+       char const EndChar = '}'; 
+       char const UnderscoreChar = '_'; 
        string EndString; EndString += EndChar;
        string FirstString; FirstString += FirstChar;
        string CompareString; CompareString += CompareChar;
-       const string RegExp("*}*"); // Exist EndChar inside a String?
+       string const RegExp("*}*"); // Exist EndChar inside a String?
 
 // first: Search for a '$' - Sign.
        //string copy(path);
@@ -741,7 +741,7 @@ string ReplaceEnvironmentPath(string const & path)
                        continue;
                }
                // check contents of res1
-               const char * res1_contents = res1.c_str();
+               char const * res1_contents = res1.c_str();
                if (*res1_contents != FirstChar) {
                        // Again No Environmentvariable
                        result1 += CompareString;
@@ -750,7 +750,7 @@ string ReplaceEnvironmentPath(string const & path)
 
                // Check for variable names
                // Situation ${} is detected as "No Environmentvariable"
-               const char * cp1 = res1_contents+1;
+               char const * cp1 = res1_contents+1;
                bool result = isalpha(*cp1) || (*cp1 == UnderscoreChar);
                ++cp1;
                while (*cp1 && result) {
@@ -804,8 +804,8 @@ string MakeRelPath(string const & abspath0, string const & basepath0)
 
        // Go back to last /
        if (i < abslen && i < baselen
-           || (i<abslen && abspath[i] != '/' && i==baselen)
-           || (i<baselen && basepath[i] != '/' && i==abslen))
+           || (i<abslen && abspath[i] != '/' && i == baselen)
+           || (i<baselen && basepath[i] != '/' && i == abslen))
        {
                if (i) --i;     // here was the last match
                while (i && abspath[i] != '/') --i;
@@ -885,7 +885,7 @@ string ChangeExtension(string const & oldname, string const & extension,
        string ext;
        // Make sure the extension starts with a dot
        if (!extension.empty() && extension[0] != '.')
-               ext='.' + extension;
+               ext= '.' + extension;
        else
                ext = extension;
        string ret_str;
@@ -955,7 +955,7 @@ bool LyXReadLink(string const & File, string & Link)
        char LinkBuffer[512];
                 // Should be PATH_MAX but that needs autconf support
        int nRead;
-       nRead = readlink(File.c_str(), LinkBuffer,sizeof(LinkBuffer)-1);
+       nRead = readlink(File.c_str(), LinkBuffer, sizeof(LinkBuffer)-1);
        if (nRead <= 0)
                return false;
        LinkBuffer[nRead] = 0;
index ad1002a37c07d6fc9135f9eec89d7683b6c314bb..4d0bbc6b38d9aad85b061538c8ca199345ea94fe 100644 (file)
@@ -70,7 +70,7 @@ public:
        /// automatic converson to FILE* if that is needed.
        operator FILE*() { return p; }
        ///
-       FilePtr & operator=(FILE * f) { p=f; return *this;}
+       FilePtr & operator=(FILE * f) { p= f; return *this;}
        ///
        FILE * operator()() { return p; }
 private:
@@ -94,7 +94,7 @@ private:
                // Should probably be rewritten to use open(2)
                if((p = fopen(name.c_str(), modestr.c_str()))) {
                        // file succesfully opened.
-                       if (fcntl(fileno(p),F_SETFD,FD_CLOEXEC) == -1) {
+                       if (fcntl(fileno(p), F_SETFD, FD_CLOEXEC) == -1) {
                                p = 0;
                        }
                } else {
@@ -252,7 +252,7 @@ string MakeAbsPath(string const & RelPath = string(),
 /** Creates a nice compact path for displaying. The parameter
   threshold, if given, specifies the maximal length of the path.
   */
-string MakeDisplayPath(string const & path, unsigned int threshold=1000);
+string MakeDisplayPath(string const & path, unsigned int threshold= 1000);
 
 /** Makes relative path out of absolute path.
   If it is deeper than basepath,
index eb98f513d803a406ecbdf4e0d83d061e6d8147fe..a369f7bf3ca36fe92ff8a9604cc011d54c928bf5 100644 (file)
@@ -209,7 +209,7 @@ int tokenPos(string const & a, char delim, string const & tok)
 
        while (!str.empty()) {
                str = split(str, tmptok, delim);
-               if (tok==tmptok)
+               if (tok == tmptok)
                        return i;
                ++i;
        }
@@ -224,12 +224,12 @@ bool regexMatch(string const & a, string const & pattern)
        if (a.empty())
                return false;
        
-       string::size_type si=0, pi=0;
+       string::size_type si= 0, pi= 0;
        string::size_type const sl = a.length();
        string::size_type const pl = pattern.length();  
 
        while (si < sl && pi < pl) {
-               if (pattern[pi]=='*') {
+               if (pattern[pi] == '*') {
                        // Skip all consequtive *s
                        while (pattern[pi] == '*') {
                                ++pi;
@@ -265,7 +265,7 @@ bool regexMatch(string const & a, string const & pattern)
                                        return false;
                                si += chunk.length()-1;
                                pi += chunk.length();
-                               if (si==sl && pi==pl-1)
+                               if (si == sl && pi == pl-1)
                                        return true;
                        }
                } else if (a[si++] != pattern[pi++]) {
index b51d33a84f5b1ad64fbcb23571c1ce2a383bcd3f..1a06b945f9f14389b1760fafb69703f879af7dba 100644 (file)
@@ -191,7 +191,7 @@ string frontStrip(string const & a, char const * p);
   The leading string up to delim is returned in piece (not including
   delim), while the original string is cut from after the delimiter.
   Example:
-  #s1=""; s2="a;bc".split(s1, ';') -> s1=="a"; s2 == "bc";#
+  #s1= ""; s2= "a;bc".split(s1, ';') -> s1 == "a"; s2 == "bc";#
   */
 string split(string const & a, string & piece, char delim);
 
index dc0a1cef3c2ca2954cb0b177b71b2dda4d2abae6..7fd7616275abcf269a95a2e77f032d0c44660fdc 100644 (file)
@@ -1,13 +1,13 @@
 // -*- C++ -*-
 /* This file is part of
- * ======================================================
+ * ====================================================== 
  * 
  *           LyX, The Document Processor
  *        
  *           Copyright (C) 1995 Matthias Ettrich
  *           Copyright (C) 1995-1999 The LyX Team.
  *
- * ======================================================*/
+ * ====================================================== */
 
 #ifndef LYX_LIB_H
 #define LYX_LIB_H
@@ -26,7 +26,7 @@ unsigned long lyxsum(char const * file);
 inline char * date() 
 {
        time_t tid;
-       if ((tid=time(0)) == (time_t)-1)
+       if ((tid= time(0)) == (time_t)-1)
                return (char*)0;
        else
                return (ctime(&tid));
@@ -56,7 +56,7 @@ struct lyx {
                return ::_getcwd2(buffer, size);
 #endif
        };
-       static int chdir(const char * name) {
+       static int chdir(char const * name) {
 #ifndef __EMX__
                return ::chdir(name);
 #else
index 21f77ae29d23b1111eedd6cd5b3ce0f0ed5a9a25..129cd75746b3b8bb366687bc7ff3cda8cb40a20f 100644 (file)
@@ -1,12 +1,12 @@
 /* This file is part of
- * ======================================================
+ * ====================================================== 
  * 
  *           LyX, The Document Processor
  *      
  *         Copyright (C) 1995 Matthias Ettrich
  *          Copyright (C) 1995-1999 The LyX Team.
  *
- * ======================================================*/
+ * ====================================================== */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -103,7 +103,7 @@ private:
 
 lyxstring::Srep::Srep(lyxstring::size_type nsz, const value_type * p)
 {
-// can be called with p==0 by lyxstring::assign(const value_type *, size_type)
+// can be called with p == 0 by lyxstring::assign(const value_type *, size_type)
 
        sz = nsz;
        ref = 1;
@@ -137,7 +137,7 @@ lyxstring::Srep::Srep(lyxstring::size_type nsz, value_type ch)
 
 void lyxstring::Srep::assign(lyxstring::size_type nsz, const value_type * p)
 {
-// can be called with p==0 by lyxstring::assign(const value_type *, size_type)
+// can be called with p == 0 by lyxstring::assign(const value_type *, size_type)
 
        if (res < nsz) {
                delete[] s;
@@ -256,7 +256,7 @@ void lyxstring::Srep::reserve(lyxstring::size_type res_arg)
 void lyxstring::Srep::replace(lyxstring::size_type i, lyxstring::size_type n,
                            value_type const * p, size_type n2)
 {
-// can be called with p=0 and n2=0
+// can be called with p= 0 and n2= 0
        n = min(sz - i, n);
        sz -= n;
        if (res >= n2 + sz) {
@@ -349,7 +349,7 @@ void lyxstringInvariant::helper() const
        Assert(object->rep->res);  // always some space allocated
        Assert(object->rep->sz <= object->rep->res);
        Assert(object->rep->ref >= 1);  // its in use so it must be referenced
-       Assert(object->rep->ref < static_cast<size_t>(1) << (8 * sizeof(object->rep->ref) - 1));
+       Assert(object->rep->ref < 1UL << (8UL * sizeof(object->rep->ref) - 1));
        // if it does ever == then we should be generating a new copy
        // and starting again.  (Is char always 8-bits?)
 }
@@ -523,7 +523,7 @@ void lyxstring::reserve(size_type res_arg)
 // Assignment
 ////////////////
 
-lyxstring & lyxstring::operator=(lyxstring const & x)
+lyxstring & lyxstring::operator= (lyxstring const & x)
 {
        TestlyxstringInvariant(this);
 
@@ -531,11 +531,11 @@ lyxstring & lyxstring::operator=(lyxstring const & x)
 }
 
 
-lyxstring & lyxstring::operator=(value_type const * s)
+lyxstring & lyxstring::operator= (value_type const * s)
 {
        Assert(s); // OURS!
        TestlyxstringInvariant(this);
-//     printf("lyxstring::operator=(value_type const *)\n");
+//     printf("lyxstring::operator= (value_type const *)\n");
 
        return assign(s);
 }
@@ -1424,7 +1424,7 @@ int lyxstring::internal_compare(size_type pos, size_type n,
 {
        if ((rep->sz == 0 || n == 0) && (!*s || n2 == 0)) return 0;
        if (!*s) return 1;
-       // since n > n2, min(n,n2) == 0, c == 0 (stops segfault also)
+       // since n > n2, min(n, n2) == 0, c == 0 (stops segfault also)
 
         // remember that n can very well be a lot larger than rep->sz
         // so we have to ensure that n is no larger than rep->sz
@@ -1432,7 +1432,7 @@ int lyxstring::internal_compare(size_type pos, size_type n,
        n2 = min(n2, slen);
         if (n == n2)
                return memcmp(&(rep->s[pos]), s, n);
-       int c = memcmp(&(rep->s[pos]), s, min(n,n2));
+       int c = memcmp(&(rep->s[pos]), s, min(n, n2));
        if (c)
                return c;
        if (n < n2)
index ec09b96a9feebc358d7899a05cc0257ab1f53dc2..22e0b88cc3a1af0790bd57a152a3c1d3245647ec 100644 (file)
@@ -7,7 +7,7 @@
  *         Copyright (C) 1995 Matthias Ettrich
  *          Copyright (C) 1995-1999 The LyX Team.
  *
- *======================================================*/
+ * ====================================================== */
 
 // This one is heavily based on the string class in The C++
 // Programming Language by Bjarne Stroustrup
@@ -415,18 +415,18 @@ public:
        // replace [(*this)[i], (*this)[i+n]] with other characters:
 
        ///
-       lyxstring & replace(size_type i,size_type n, lyxstring const & str);
+       lyxstring & replace(size_type i, size_type n, lyxstring const & str);
 
        ///
-       lyxstring & replace(size_type i,size_type n, lyxstring const & s,
+       lyxstring & replace(size_type i, size_type n, lyxstring const & s,
                          size_type i2, size_type n2);
 
        ///
-       lyxstring & replace(size_type i,size_type n, value_type const * p,
+       lyxstring & replace(size_type i, size_type n, value_type const * p,
                          size_type n2);
 
        ///
-       lyxstring & replace(size_type i,size_type n, value_type const * p);
+       lyxstring & replace(size_type i, size_type n, value_type const * p);
 
        ///
        lyxstring & replace(size_type i, size_type n,
index 602da11bbe6d501152e8ab9d0831add7073ed8e2..3bd9262e9833dbde75043456eb9c4816440e96e3 100644 (file)
@@ -9,7 +9,7 @@
  *
  *    Modified for use in LyX by Lars G. Bjønnes.
  *
- *======================================================
+ * ======================================================
  */
 
 
index 77521afacd516c78fe40dad2717e531b2784d4e4..295785f7135f3354f0376baa6442389e3fdd9f68 100644 (file)
@@ -209,7 +209,7 @@ int main(int, char**)
 {
        
        SystemcallsSingletoncontroller::Startcontroller starter; 
-       SystemcallsSingletoncontroller *contr=starter.GetController();
+       SystemcallsSingletoncontroller *contr= starter.GetController();
        
        Systemcalls one(Systemcalls::System, "ls -ltag", back);
        Systemcalls two(Systemcalls::Wait, "ls -ltag", back);
index 51c903a2e0c29a7845242f628107842820360118..192ef9058b04e1e361227c79d3d02a93583b55e1 100644 (file)
@@ -66,9 +66,9 @@ void
 SystemcallsSingletoncontroller::timer() {
        // check each entry of our list, if it's finished
         ControlledCalls *prev = 0;
-       for (ControlledCalls *actCall=sysCalls; actCall; actCall=actCall->next)
+       for (ControlledCalls *actCall= sysCalls; actCall; actCall= actCall->next)
        {
-               pid_t pid=actCall->call->getpid();
+               pid_t pid= actCall->call->getpid();
                int stat_loc;
                int waitrpid = waitpid(pid, &stat_loc, WNOHANG);
                if (waitrpid == -1) {
index 73d97cd59819db500362408bb1b604f2f9c0bd9d..89e1a5cf2781466969384b50530ce197a4830b4c 100644 (file)
  *      
  *         Copyright (C) 1995 Matthias Ettrich
  *
- *======================================================*/
-#ifndef _TEXTUTILS_H
-#define _TEXTUTILS_H
+ * ====================================================== */
 
-#include "definitions.h"
+#ifndef TEXTUTILS_H
+#define TEXTUTILS_H
+
+#include <cctype>
 
 ///
 inline bool IsNewlineChar(char c) {
-       return (c == LYX_META_NEWLINE);
+       return (c == LyXParagraph::META_NEWLINE);
 }
+
+
 ///
 inline bool IsSeparatorChar(char c) {
-       return (c == ' ' || c == LYX_META_PROTECTED_SEPARATOR);
+       return (c == ' ' || c == LyXParagraph::META_PROTECTED_SEPARATOR);
 }
+
+
 ///
 inline bool IsHfillChar(char c) {
-       return (c == LYX_META_HFILL);
+       return (c == LyXParagraph::META_HFILL);
 }
+
+
 ///
 inline bool IsInsetChar(char c) {
-       return (c == LYX_META_INSET);
+       return (c == LyXParagraph::META_INSET);
 }
+
+
 ///
 inline bool IsFloatChar(char c) {
-       return (c == LYX_META_FOOTNOTE
-               || c == LYX_META_MARGIN
-               || c == LYX_META_FIG
-               || c == LYX_META_TAB
-               || c == LYX_META_ALGORITHM
-               || c == LYX_META_WIDE_FIG
-               || c == LYX_META_WIDE_TAB);
+       return (c == LyXParagraph::META_FOOTNOTE
+               || c == LyXParagraph::META_MARGIN
+               || c == LyXParagraph::META_FIG
+               || c == LyXParagraph::META_TAB
+               || c == LyXParagraph::META_ALGORITHM
+               || c == LyXParagraph::META_WIDE_FIG
+               || c == LyXParagraph::META_WIDE_TAB);
 }
+
+
 ///
 inline bool IsLineSeparatorChar(char c) {
        return (c == ' ');
 }
+
+
 ///
 inline bool IsKommaChar(char c) {
        return (c == ',' 
-               || c=='('
-               || c==')'
-               || c=='['
-               || c==']'
-               || c=='{'
-               || c=='}'
-               || c==';'
-               || c=='.'
-               || c==':'
-               || c=='-'
-               || c=='?'
-               || c=='!'
-               || c=='&'
-               || c=='@'
-               || c=='+'
-               || c=='-'
-               || c=='~'
-               || c=='#'
-               || c=='%'
-               || c=='^'
-               || c=='/' 
-               || c=='\\'
-               || c==LYX_META_NEWLINE
-               || c==LYX_META_PROTECTED_SEPARATOR
+               || c == '('
+               || c == ')'
+               || c == '['
+               || c == ']'
+               || c == '{'
+               || c == '}'
+               || c == ';'
+               || c == '.'
+               || c == ':'
+               || c == '-'
+               || c == '?'
+               || c == '!'
+               || c == '&'
+               || c == '@'
+               || c == '+'
+               || c == '-'
+               || c == '~'
+               || c == '#'
+               || c == '%'
+               || c == '^'
+               || c == '/' 
+               || c == '\\'
+               || c == LyXParagraph::META_NEWLINE
+               || c == LyXParagraph::META_PROTECTED_SEPARATOR
                );
 }
+
+
 ///
 inline bool IsLetterChar(unsigned char c) {
-       return ((c>='A' && c<='Z')
-               || (c>='a' && c<='z')
-               || (c>=192)); // in iso-8859-x these are accented chars
+       return ((c >= 'A' && c <= 'Z')
+               || (c >= 'a' && c <= 'z')
+               || (c >= 192)); // in iso-8859-x these are accented chars
 }
+
+
 ///
 inline bool IsPrintable(unsigned char c) {
-       return (c>=' ');
+       return (c >= ' ');
 }
+
+
 /// Word is not IsSeparator or IsKomma or IsHfill or IsFloat or IsInset. 
 inline bool IsWordChar(unsigned char c) {
   return !( IsSeparatorChar( c ) 
-           ||  IsKommaChar( c )  
-           ||  IsHfillChar( c )  
-           ||  IsFloatChar( c )  
-           ||  IsInsetChar( c ) ) ;
+           || IsKommaChar( c )  
+           || IsHfillChar( c )  
+           || IsFloatChar( c )  
+           || IsInsetChar( c ) ) ;
+}
+
+
+///
+inline bool IsLetterCharOrDigit(char ch)
+{
+       return IsLetterChar(ch) || isdigit(ch);
 }
 #endif