included bincimap 1.3.3 to 1.3.4 diffs (mostly cosmetic)

This commit is contained in:
dockes 2006-11-05 18:02:02 +00:00
parent 0cf3b35435
commit 9cedfbf10e
19 changed files with 65 additions and 51 deletions

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* address.cc * address.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of the Address class. * Implementation of the Address class.
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* src/mailbox/address.h * src/mailbox/address.h
@ -6,7 +6,7 @@
* Description: * Description:
* Declaration of the Address class. * Declaration of the Address class.
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* convert.cc * convert.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of miscellaneous convertion functions. * Implementation of miscellaneous convertion functions.
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* src/util/convert.h * src/util/convert.h
@ -6,7 +6,7 @@
* Description: * Description:
* Declaration of miscellaneous convertion functions. * Declaration of miscellaneous convertion functions.
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -38,7 +38,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include "address.h" #include "address.h"
#include "depot.h" //#include "depot.h"
namespace Binc { namespace Binc {
@ -264,6 +264,9 @@ namespace Binc {
} else if (*i == '*') } else if (*i == '*')
regex += ".*?"; regex += ".*?";
else if (*i == '%') { else if (*i == '%') {
regex += "(\\";
regex += delimiter;
regex += "){0,1}";
regex += "[^\\"; regex += "[^\\";
regex += delimiter; regex += delimiter;
regex += "]*?"; regex += "]*?";

View File

@ -41,7 +41,8 @@ IODevice::IODevice(int f) : flags(f | IsEnabled),
maxOutputBufferSize(0), maxOutputBufferSize(0),
timeout(0), timeout(0),
readCount(0), writeCount(0), readCount(0), writeCount(0),
outputLevel(0), outputLevelLimit(0), outputLevel(ErrorLevel),
outputLevelLimit(ErrorLevel),
error(Unknown), errorString("Unknown error"), error(Unknown), errorString("Unknown error"),
dumpfd(0) dumpfd(0)
{ {
@ -161,25 +162,25 @@ unsigned int IODevice::getTimeout(void) const
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
void IODevice::setOutputLevel(unsigned int level) void IODevice::setOutputLevel(LogLevel level)
{ {
outputLevel = level; outputLevel = level;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
unsigned int IODevice::getOutputLevel(void) const IODevice::LogLevel IODevice::getOutputLevel(void) const
{ {
return outputLevel; return outputLevel;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
void IODevice::setOutputLevelLimit(unsigned int level) void IODevice::setOutputLevelLimit(LogLevel level)
{ {
outputLevelLimit = level; outputLevelLimit = level;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
unsigned int IODevice::getOutputLevelLimit(void) const IODevice::LogLevel IODevice::getOutputLevelLimit(void) const
{ {
return outputLevelLimit; return outputLevelLimit;
} }

View File

@ -1,4 +1,4 @@
/*-*-mode:c++-*-*/ /*-*-mode:c++;c-basic-offset:2-*-*/
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* src/iodevice.h * src/iodevice.h
@ -151,6 +151,13 @@ namespace Binc {
*/ */
unsigned int getTimeout(void) const; unsigned int getTimeout(void) const;
enum LogLevel {
ErrorLevel,
InfoLevel,
WarningLevel,
DebugLevel
};
/*! /*!
Sets the output level for the following write operations on this Sets the output level for the following write operations on this
device. device.
@ -172,14 +179,14 @@ namespace Binc {
\param level The output level \param level The output level
\sa getOutputLevel(), setOutputLevelLimit() \sa getOutputLevel(), setOutputLevelLimit()
*/ */
void setOutputLevel(unsigned int level); void setOutputLevel(LogLevel level);
/*! /*!
Returns the current output level. Returns the current output level.
\sa setOutputLevel() \sa setOutputLevel()
*/ */
unsigned int getOutputLevel(void) const; LogLevel getOutputLevel(void) const;
/*! /*!
Sets the current output level limit. Write operations with a Sets the current output level limit. Write operations with a
@ -188,14 +195,14 @@ namespace Binc {
\param level The output level limit \param level The output level limit
\sa setOutputLevel() \sa setOutputLevel()
*/ */
void setOutputLevelLimit(unsigned int level); void setOutputLevelLimit(LogLevel level);
/*! /*!
Returns the current output level limit. Returns the current output level limit.
\sa setOutputLevelLimit() \sa setOutputLevelLimit()
*/ */
unsigned int getOutputLevelLimit(void) const; LogLevel getOutputLevelLimit(void) const;
/*! /*!
Returns the number of bytes that have been read from this device Returns the number of bytes that have been read from this device
@ -209,6 +216,11 @@ namespace Binc {
*/ */
unsigned int getWriteCount(void) const; unsigned int getWriteCount(void) const;
/*!
Calling this function enables the built-in protocol dumping feature in
the device. All input and output to this device will be dumped to a file
in /tmp.
*/
void enableProtocolDumping(void); void enableProtocolDumping(void);
/*! /*!
@ -356,11 +368,11 @@ namespace Binc {
unsigned int readCount; unsigned int readCount;
unsigned int writeCount; unsigned int writeCount;
unsigned int outputLevel; LogLevel outputLevel;
unsigned int outputLevelLimit; LogLevel outputLevelLimit;
Error error; mutable Error error;
std::string errorString; mutable std::string errorString;
int dumpfd; int dumpfd;
}; };

View File

@ -28,8 +28,9 @@
#include <map> #include <map>
#include <string> #include <string>
#include "iodevice.h"
namespace Binc { namespace Binc {
class IODevice;
class IOFactory { class IOFactory {
public: public:
~IOFactory(void); ~IOFactory(void);
@ -55,14 +56,14 @@ namespace Binc {
#define bincDebug if (false) std::cout #define bincDebug if (false) std::cout
#else #else
#define bincError \ #define bincError \
IOFactory::getLogger().setOutputLevel(0);IOFactory::getLogger() IOFactory::getLogger().setOutputLevel(IODevice::ErrorLevel);IOFactory::getLogger()
#define bincWarning \ #define bincWarning \
IOFactory::getLogger().setOutputLevel(2);IOFactory::getLogger() IOFactory::getLogger().setOutputLevel(IODevice::WarningLevel);IOFactory::getLogger()
#define bincDebug \ #define bincDebug \
IOFactory::getLogger().setOutputLevel(3);IOFactory::getLogger() IOFactory::getLogger().setOutputLevel(IODevice::DebugLevel);IOFactory::getLogger()
#endif #endif
#define bincInfo \ #define bincInfo \
IOFactory::getLogger().setOutputLevel(1);IOFactory::getLogger() IOFactory::getLogger().setOutputLevel(IODevice::InfoLevel);IOFactory::getLogger()
#endif #endif

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime-getpart.cc * mime-getpart.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* src/mime-inputsource.h * src/mime-inputsource.h
@ -6,7 +6,7 @@
* Description: * Description:
* The base class of the MIME input source * The base class of the MIME input source
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -211,9 +211,6 @@ namespace Binc {
} }
} }
extern Binc::MimeInputSource *mimeSource; extern Binc::MimeInputSource *mimeSource;
#endif #endif

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime-parsefull.cc * mime-parsefull.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime-parseonlyheader.cc * mime-parseonlyheader.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime-printbody.cc * mime-printbody.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime-printdoc.cc * mime-printdoc.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime-printheader.cc * mime-printheader.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime.cc * mime.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* mime.cc * mime.cc
@ -6,7 +6,7 @@
* Description: * Description:
* Implementation of main mime parser components * Implementation of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* -*- Mode: c++; -*- */ /* -*- mode:c++;c-basic-offset:2 -*- */
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Filename: * Filename:
* src/parsers/mime/mime.h * src/parsers/mime/mime.h
@ -6,7 +6,7 @@
* Description: * Description:
* Declaration of main mime parser components * Declaration of main mime parser components
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Copyright 2002-2004 Andreas Aardal Hanssen * Copyright 2002-2005 Andreas Aardal Hanssen
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by