Changeset 443 for todo/trunk/util

Show
Ignore:
Timestamp:
06/28/07 07:07:14 (2 years ago)
Author:
athomas
Message:

Dev Todo:

  • A few bugfixes.
  • Added XML declaration parsing/saving. This is a stop-gap at best, but will
    hopefully be useful to some.
  • Removed reliance on builtin regex library. Hopefully the completely broken
    version of glibc that instigated the inclusion of it is now out of
    circulation.
  • Fixed a whole bunch of compiler warnings on more recent GCC versions.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • todo/trunk/util/Makefile.am

    r290 r443  
    11noinst_LTLIBRARIES=libutil.la 
    2 libutil_la_SOURCES=c_regex.c c_regex.h Terminal.cc Terminal.h Lexer.cc Lexer.h \ 
     2libutil_la_SOURCES=Terminal.cc Terminal.h Lexer.cc Lexer.h \ 
    33        Regex.cc Regex.h XML.cc XML.h Strings.cc Strings.h CommandArgs.cc CommandArgs.h 
    44 
  • todo/trunk/util/Regex.h

    r290 r443  
    1010#include <cassert> 
    1111#include <sys/types.h> 
    12 #include "c_regex.h" 
     12#include <regex.h> 
    1313 
    1414#ifndef CRASH_REGEX_CACHE_THRESHOLD 
  • todo/trunk/util/Strings.cc

    r290 r443  
    9797string replace(string const &match, string const &repl, string const &in) { 
    9898string out; 
    99 unsigned found = 0, lastfound = 0; 
     99string::size_type found = 0, lastfound = 0; 
    100100 
    101101        while ((found = in.find(match, found)) != string::npos) { 
  • todo/trunk/util/XML.cc

    r340 r443  
    3737        Lexer::iterator i = xmlScan.begin(str); 
    3838 
     39                if (i.type() == XmlDecl) { 
     40                        ++i; 
     41                } 
    3942                parseElement(i); 
    4043        } catch (Lexer::exception &e) { 
     
    4649        // Only initialise scanners once 
    4750        if (!initialised) { 
     51                // <?xml version="1.0" encoding="UTF-8" standalone="no"?> 
     52                xmlScan.addPattern(XmlDecl, "<\\?xml.*?>[[:space:]]*"); 
    4853                xmlScan.addPattern(XmlCommentBegin, "<!--"); 
    4954                xmlScan.addPattern(XmlBegin, "<[a-zA-Z0-9_-]+" 
  • todo/trunk/util/XML.h

    r290 r443  
    6565 
    6666                // Lexer constants 
    67                 enum { XmlCommentBegin = 256, XmlBegin, XmlEnd, XmlDataBegin, XmlContent }; 
     67                enum { XmlDecl = 256, XmlCommentBegin, XmlBegin, XmlEnd, XmlDataBegin, XmlContent }; 
    6868                enum { ElementWS = 256, ElementValue, ElementKey, ElementAssignment, ElementTerminator}; 
    6969                enum { CommentEnd = 256,  CommentBody };