From c9c2cdb86945cb56878c2cd5b6cac391792587fe Mon Sep 17 00:00:00 2001 From: speedy Date: Tue, 25 Nov 2003 13:37:00 +0000 Subject: [PATCH] - headers & gcc3 fix Changed files: colortail-gcc3.patch -> 1.1 --- colortail-gcc3.patch | 345 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 345 insertions(+) create mode 100644 colortail-gcc3.patch diff --git a/colortail-gcc3.patch b/colortail-gcc3.patch new file mode 100644 index 0000000..b4735b0 --- /dev/null +++ b/colortail-gcc3.patch @@ -0,0 +1,345 @@ +diff -Naur CfgFileParser.cc.orig CfgFileParser.cc +--- CfgFileParser.cc.orig Tue Aug 3 14:40:44 1999 ++++ CfgFileParser.cc Sat Aug 24 16:03:58 2002 +@@ -19,12 +19,12 @@ + + #include "CfgFileParser.h" + +-#include +-#include ++#include + #include +-#include ++#include + #include + ++using namespace std; + + // ## class SearchData ## + +@@ -499,7 +499,7 @@ + + + +-int CfgFileParser::parse(char *filename) ++int CfgFileParser::parse(const char *filename) + { + // parses the cfg file and sets up the list of SearchData elements + // returns number of SearchData items created +diff -Naur CfgFileParser.h.orig CfgFileParser.h +--- CfgFileParser.h.orig Tue Aug 3 14:40:52 1999 ++++ CfgFileParser.h Sat Aug 24 16:03:21 2002 +@@ -25,7 +25,8 @@ + + #include + #include +-#include ++#include ++#include + + #ifdef HAVE_GNUREGEX_H + # include +@@ -80,7 +81,7 @@ + { + private: + List *m_items_list; +- ifstream m_infile; ++ std::ifstream m_infile; + char *m_filename; + int m_line; + +@@ -97,7 +98,7 @@ + CfgFileParser(); + ~CfgFileParser(); + +- int parse(char *filename); ++ int parse(const char *filename); + List* get_items_list(); + }; + +diff -Naur ColorTail.cc.orig ColorTail.cc +--- ColorTail.cc.orig Tue Aug 3 14:41:02 1999 ++++ ColorTail.cc Sat Aug 24 15:28:21 2002 +@@ -17,7 +17,7 @@ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#include ++#include + #include + #include + +@@ -26,6 +26,7 @@ + #include "OptionsParser.h" + #include "Colorizer.h" + ++using namespace std; + + // the constructor + ColorTail::ColorTail() +diff -Naur Colorizer.cc.orig Colorizer.cc +--- Colorizer.cc.orig Tue Aug 3 14:41:17 1999 ++++ Colorizer.cc Sat Aug 24 16:07:33 2002 +@@ -22,9 +22,10 @@ + #include "TailFile.h" + + #include +-#include +-#include ++#include ++#include + ++using namespace std; + + Colorizer::Colorizer() + { +@@ -58,7 +59,7 @@ + } + + +-Colorizer::Colorizer(char *cfg_file) ++Colorizer::Colorizer(const char *cfg_file) + { + // other constructor + +@@ -85,7 +86,7 @@ + free_items(); + } + +-char* Colorizer::colorize(char *str) ++const char* Colorizer::colorize(const char *str) + { + // colorize the string, returns a new string containing + // the colorized version of str +@@ -111,7 +112,7 @@ + ListIterator itr(*m_items_list); + + // will contain the new string +- ostrstream newstr; ++ ostringstream newstr; + + SearchData *current; + int i = 0; +@@ -174,7 +175,7 @@ + // write ansi reset str and a newline + newstr << ANSI_RESET_STR << endl << ends; + // return the new string +- return newstr.str(); ++ return newstr.str().c_str(); + } + } + } +@@ -196,7 +197,7 @@ + } + + // return the new string +- return newstr.str(); ++ return newstr.str().c_str(); + } + + // did we find submatches? +@@ -250,7 +251,7 @@ + // cout << "DEBUG: " << bla << " END DEBUG" << endl; + + +- return newstr.str(); ++ return newstr.str().c_str(); + + } + +diff -Naur Colorizer.h.orig Colorizer.h +--- Colorizer.h.orig Tue Aug 3 14:41:25 1999 ++++ Colorizer.h Sat Aug 24 16:07:43 2002 +@@ -35,10 +35,10 @@ + Colorizer(); + + public: +- Colorizer(char *cfg_file); ++ Colorizer(const char *cfg_file); + ~Colorizer(); + +- char* colorize(char *str); ++ const char* colorize(const char *str); + }; + + +diff -Naur Info.cc.orig Info.cc +--- Info.cc.orig Tue Aug 3 14:41:38 1999 ++++ Info.cc Sat Aug 24 15:58:29 2002 +@@ -17,11 +17,13 @@ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#include ++#include + + #include "Info.h" + #include "config.h" + ++using namespace std; ++ + Info::Info() + { + } +diff -Naur OptionsParser.cc.orig OptionsParser.cc +--- OptionsParser.cc.orig Wed Aug 4 18:23:39 1999 ++++ OptionsParser.cc Sat Aug 24 15:59:41 2002 +@@ -17,8 +17,8 @@ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#include +-#include ++#include ++#include + #include + #include + #include +@@ -27,6 +27,7 @@ + #include "Info.h" + #include "Usage.h" + ++using namespace std; + // methods for class Options + + Options::Options() +@@ -130,7 +131,7 @@ + int loop = 1; + while (loop) + { +- ostrstream filename; ++ ostringstream filename; + + while (1) + { +@@ -138,7 +139,7 @@ + { + // found seperator + // set filename in options class +- o->cfg_filenames[o->nr_cfg_files] = filename.str(); ++ o->cfg_filenames[o->nr_cfg_files] = filename.str().c_str(); + + // increase the nr_cfg_files counter + (o->nr_cfg_files)++; +@@ -154,7 +155,7 @@ + { + // found end of string + // set filename in options class +- o->cfg_filenames[o->nr_cfg_files] = filename.str(); ++ o->cfg_filenames[o->nr_cfg_files] = filename.str().c_str(); + + // increase the nr_cfg_files counter + (o->nr_cfg_files)++; +diff -Naur OptionsParser.h.orig OptionsParser.h +--- OptionsParser.h.orig Wed Aug 4 18:33:08 1999 ++++ OptionsParser.h Sat Aug 24 16:00:42 2002 +@@ -77,7 +77,7 @@ + int color; + int rows; + int verbose; +- char *cfg_filenames[MAX_FILES]; ++ const char *cfg_filenames[MAX_FILES]; + int nr_cfg_files; + int global_cfg_file; + +diff -Naur TailFile.cc.orig TailFile.cc +--- TailFile.cc.orig Wed Aug 4 18:09:38 1999 ++++ TailFile.cc Sat Aug 24 16:08:12 2002 +@@ -17,7 +17,7 @@ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#include ++#include + #include + #include + #include +@@ -25,6 +25,8 @@ + + #include "TailFile.h" + ++using namespace std; ++ + TailFile::TailFile() + { + m_filename = NULL; +@@ -375,7 +377,7 @@ + // check if there isn't a follow buffer + if (m_follow_buffer == NULL) + { +- m_follow_buffer = new ostrstream(); ++ m_follow_buffer = new ostringstream(); + } + + // make buffer +@@ -454,7 +456,7 @@ + m_follow_buffer->put('\0'); + + // get the string +- char *str = m_follow_buffer->str(); ++ const char *str = m_follow_buffer->str().c_str(); + + // print the line + print_to_stdout(str); +@@ -560,7 +562,7 @@ + // delete buf; + } + +-void TailFile::print_to_stdout(char *str) ++void TailFile::print_to_stdout(const char *str) + { + // checks if there is a colorizer. If so the string is colorized + // before it's printed. If not the string isn't colorized. +@@ -575,7 +577,7 @@ + if (m_colorizer) + { + // colorize the string +- char *buf = m_colorizer->colorize(str); ++ const char *buf = m_colorizer->colorize(str); + // print the new colorized string + cout << buf; + // free the mem +diff -Naur TailFile.h.orig TailFile.h +--- TailFile.h.orig Tue Aug 3 14:42:33 1999 ++++ TailFile.h Sat Aug 24 16:06:00 2002 +@@ -23,7 +23,7 @@ + #include "Colorizer.h" + + #include +-#include ++#include + + #define MAX_CHARS_READ 1024 + +@@ -40,12 +40,12 @@ + // the stream position + long m_position; + // the follow buffer, used in follow_print +- ostrstream *m_follow_buffer; ++ std::ostringstream *m_follow_buffer; + + // private methods + void find_position(int n); + long end_of_file_position(); +- void print_to_stdout(char *str); ++ void print_to_stdout(const char *str); + + // methods + public: +diff -Naur Usage.cc.orig Usage.cc +--- Usage.cc.orig Wed Aug 4 18:44:37 1999 ++++ Usage.cc Sat Aug 24 16:08:35 2002 +@@ -17,10 +17,12 @@ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#include ++#include + + #include "Usage.h" + ++using namespace std; ++ + Usage::Usage() + { + } -- 2.44.0