jadjustmentevent.h   jadjustmentevent.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_ADJUSTMENTEVENT_H #ifndef J_ADJUSTMENTEVENT_H
#define J_ADJUSTMENTEVENT_H #define J_ADJUSTMENTEVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jadjustment_type_t { enum jadjustment_type_t {
BLOCK_INCREMENT, BLOCK_INCREMENT,
BLOCK_DECREMENT, BLOCK_DECREMENT,
UNIT_INCREMENT, UNIT_INCREMENT,
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jadjustmentlistener.h   jadjustmentlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_ADJUSTMENTLISTENER_H #ifndef J_ADJUSTMENTLISTENER_H
#define J_ADJUSTMENTLISTENER_H #define J_ADJUSTMENTLISTENER_H
#include "jadjustmentevent.h" #include "jadjustmentevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class AdjustmentListener : public jcommon::Listener{ class AdjustmentListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 janimation.h   janimation.h 
skipping to change at line 36 skipping to change at line 36
#include "jthread.h" #include "jthread.h"
#include "jtextlistener.h" #include "jtextlistener.h"
#include "jcomponent.h" #include "jcomponent.h"
#include "joffscreenimage.h" #include "joffscreenimage.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <vector> #include <vector>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Animation : public Component, public jthread::Thread{ class Animation : public Component, public jthread::Thread{
private: private:
 End of changes. 1 change blocks. 
7 lines changed or deleted 0 lines changed or added


 jbitinputstream.h   jbitinputstream.h 
skipping to change at line 37 skipping to change at line 37
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class BitInputStream : public jio::InputStream{ class BitInputStream : public jio::InputStream{
private: private:
InputStream *stream; InputStream *stream;
bool haveByte;
bool show;
int currentMask;
int currentByte;
File *file; File *file;
int64_t currentMask,
currentByte;
bool haveByte,
show;
public: public:
/** /**
* \brief * \brief
*/ */
BitInputStream(std::string filename); BitInputStream(std::string filename);
/** /**
* \brief * \brief
*/ */
skipping to change at line 87 skipping to change at line 87
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t GetPosition(); virtual int64_t GetPosition();
/** /**
* \brief * \brief
* *
*/ */
virtual int Read(); virtual int64_t Read();
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Read(char *, int64_t size); virtual int64_t Read(char *, int64_t size);
/** /**
* \brief Salto relativo. * \brief Salto relativo.
* *
skipping to change at line 111 skipping to change at line 111
/** /**
* \brief * \brief
* *
*/ */
virtual void Reset(); virtual void Reset();
/** /**
* \brief * \brief
* *
*/ */
int ReadBit(); virtual int ReadBit();
/** /**
* \brief * \brief
* *
*/ */
int ReadBits(int num); virtual int ReadBits(int num);
/** /**
* \brief * \brief
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
 End of changes. 5 change blocks. 
7 lines changed or deleted 7 lines changed or added


 jbitoutputstream.h   jbitoutputstream.h 
skipping to change at line 76 skipping to change at line 76
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Available(); virtual int64_t Available();
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(int b); virtual int64_t Write(int b);
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Write(char *, int64_t size); virtual int64_t Write(char *, int64_t size);
/** /**
* \brief * \brief
* *
skipping to change at line 112 skipping to change at line 112
/** /**
* \brief * \brief
* *
*/ */
void WriteBits(int bits, int num); void WriteBits(int bits, int num);
/** /**
* \brief * \brief
* *
*/ */
int64_t GetSentBytes(); virtual int64_t GetSentBytes();
}; };
} }
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 jbitstream.h   jbitstream.h 
skipping to change at line 66 skipping to change at line 66
/** /**
* \brief * \brief
* *
*/ */
void Reset(); void Reset();
/** /**
* \brief * \brief
* *
*/ */
unsigned long long GetBits(int size); uint64_t GetBits(int size);
/** /**
* \brief * \brief
* *
*/ */
uint8_t* GetBitsArray(int size); uint8_t* GetBitsArray(int size);
/** /**
* \brief * \brief
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 jborderlayout.h   jborderlayout.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_BORDERLAYOUT_H #ifndef J_BORDERLAYOUT_H
#define J_BORDERLAYOUT_H #define J_BORDERLAYOUT_H
#include "jlayout.h"
#include "jcomponent.h" #include "jcomponent.h"
#include "jlayout.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added


 jbufferedreader.h   jbufferedreader.h 
skipping to change at line 65 skipping to change at line 65
/** /**
* \brief * \brief
* *
*/ */
bool IsEOF(); bool IsEOF();
/** /**
* \brief * \brief
* *
*/ */
int Available(); int64_t Available();
/** /**
* \brief * \brief
* *
*/ */
int Read(); int64_t Read();
/** /**
* \brief * \brief
* *
*/ */
int Read(char *, int size); int64_t Read(char *, int64_t size);
/** /**
* \brief * \brief
* *
*/ */
std::string ReadLine(std::string delim = "\n"); std::string ReadLine(std::string delim = "\n");
}; };
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 jbutton.h   jbutton.h 
skipping to change at line 28 skipping to change at line 28
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_BUTTON_H #ifndef J_BUTTON_H
#define J_BUTTON_H #define J_BUTTON_H
#include "jcomponent.h" #include "jcomponent.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class ButtonListener; class ButtonListener;
class ButtonEvent; class ButtonEvent;
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jbuttonevent.h   jbuttonevent.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_BUTTONEVENT_H #ifndef J_BUTTONEVENT_H
#define J_BUTTONEVENT_H #define J_BUTTONEVENT_H
#include "jbutton.h" #include "jbutton.h"
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class ButtonEvent : public jcommon::EventObject{ class ButtonEvent : public jcommon::EventObject{
private: private:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jbuttonlistener.h   jbuttonlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_BUTTONLISTENER_H #ifndef J_BUTTONLISTENER_H
#define J_BUTTONLISTENER_H #define J_BUTTONLISTENER_H
#include "jbuttonevent.h" #include "jbuttonevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class ButtonListener : public jcommon::Listener{ class ButtonListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jcalendar.h   jcalendar.h 
skipping to change at line 71 skipping to change at line 71
/** /**
* \brief * \brief
* *
*/ */
virtual ~Calendar(); virtual ~Calendar();
/** /**
* \brief * \brief
* *
*/ */
time_t GetTimeInSeconds();
/**
* \brief
*
*/
void SetTimeInSeconds(time_t secs);
/**
* \brief
*
*/
void SetTime(int day, int month, int year); void SetTime(int day, int month, int year);
/** /**
* \brief * \brief
* *
*/ */
int GetDay() ; int GetDay() ;
/** /**
* \brief * \brief
 End of changes. 1 change blocks. 
12 lines changed or deleted 0 lines changed or added


 jcalendardialogbox.h   jcalendardialogbox.h 
skipping to change at line 40 skipping to change at line 40
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jdate.h" #include "jdate.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
struct jcalendar_warnning_t { struct jcalendar_warnning_t {
int day; int day;
int month; int month;
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jcalendarevent.h   jcalendarevent.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CALENDAREVENT_H #ifndef J_CALENDAREVENT_H
#define J_CALENDAREVENT_H #define J_CALENDAREVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class CalendarEvent : public jcommon::EventObject{ class CalendarEvent : public jcommon::EventObject{
private: private:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jcalendarlistener.h   jcalendarlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CALENDARLISTENER_H #ifndef J_CALENDARLISTENER_H
#define J_CALENDARLISTENER_H #define J_CALENDARLISTENER_H
#include "jcalendarevent.h" #include "jcalendarevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class CalendarListener : public jcommon::Listener{ class CalendarListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jcanvas.h   jcanvas.h 
skipping to change at line 28 skipping to change at line 28
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CANVAS_H #ifndef J_CANVAS_H
#define J_CANVAS_H #define J_CANVAS_H
#include "jcomponent.h" #include "jcomponent.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Canvas : public Component{ class Canvas : public Component{
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jchannel.h   jchannel.h 
skipping to change at line 101 skipping to change at line 101
* *
*/ */
virtual int64_t Write(char *b, int64_t size, int64_t offset = 0); virtual int64_t Write(char *b, int64_t size, int64_t offset = 0);
/** /**
* \brief Transfers bytes into this channel's file from the given readable byte channel. * \brief Transfers bytes into this channel's file from the given readable byte channel.
* *
*/ */
virtual int64_t Transfer(Channel *in, int64_t count_in, int6 4_t position_int, Channel *out, int64_t count_out, int64_t position_out); virtual int64_t Transfer(Channel *in, int64_t count_in, int6 4_t position_int, Channel *out, int64_t count_out, int64_t position_out);
/**
* \brief
*
*/
virtual std::string what();
}; };
} }
#endif #endif
 End of changes. 1 change blocks. 
6 lines changed or deleted 0 lines changed or added


 jcharset.h   jcharset.h 
skipping to change at line 173 skipping to change at line 173
/* /*
* \brief Read a file into a UTF-8 char array, up to and inc luding * \brief Read a file into a UTF-8 char array, up to and inc luding
* the 'stop' character (or an EOF will end input). * the 'stop' character (or an EOF will end input).
* This function returns the alloc'd UTF-8 encoded string. * This function returns the alloc'd UTF-8 encoded string.
* The number of bytes in the returned string is placed in *nbytes. * The number of bytes in the returned string is placed in *nbytes.
* The number of characters in the returned string is place d in *nchars. * The number of characters in the returned string is place d in *nchars.
* If EOF is encountered immediately, the function returns NULL. * If EOF is encountered immediately, the function returns NULL.
* If the 'stop' character is EOF, this function reads the * If the 'stop' character is EOF, this function reads the
* entire file. * entire file.
*/ */
char * ReadLatin1File(FILE *f, long *nbytes, long *nchars, l ong stop); char * ReadLatin1File(FILE *f, int *nbytes, int *nchars, int stop);
/** /**
* \brief * \brief
* *
*/ */
char * ReadUTF8File(FILE *f, long *nbytes, long *nchars, lon g stop); char * ReadUTF8File(FILE *f, int *nbytes, int *nchars, int s top);
/* /*
* \brief Read an entire file into a memory char array. Retu rn NULL if the file is empty. * \brief Read an entire file into a memory char array. Retu rn NULL if the file is empty.
* *
*/ */
char * ReadLatin1Buffer(FILE *f, long *nbytes, long *nchars) ; char * ReadLatin1Buffer(FILE *f, int *nbytes, int *nchars);
/** /**
* \brief * \brief
* *
*/ */
char * ReadUTF8Buffer(FILE *f, long *nbytes, long *nchars); char * ReadUTF8Buffer(FILE *f, int *nbytes, int *nchars);
/* /*
* \brief A function for reading one line of input from a fi le. * \brief A function for reading one line of input from a fi le.
* This function returns the alloc'd string, and any * This function returns the alloc'd string, and any
* terminating newline character is included in the line. * terminating newline character is included in the line.
* The length of the returned string is placed into *length . * The length of the returned string is placed into *length .
* If EOF is encountered immediately, the function returns NULL. * If EOF is encountered immediately, the function returns NULL.
* If EOF is encountered before a newline character, the st ring * If EOF is encountered before a newline character, the st ring
* is returned without any terminating newline. * is returned without any terminating newline.
* Otherwise, a newline character will be the last characte r * Otherwise, a newline character will be the last characte r
* in the char array. * in the char array.
*/ */
char * ReadLatin1Line(FILE *f, long *nbytes, long *nchars); char * ReadLatin1Line(FILE *f, int *nbytes, int *nchars);
/** /**
* \brief * \brief
* *
*/ */
char * ReadUTF8Line(FILE *f, long *nbytes, long *nchars); char * ReadUTF8Line(FILE *f, int *nbytes, int *nchars);
/* /*
* \brief Write a UTF-8 char array to a file as ISO Latin 1 (non ISO-Latin-1 characters * \brief Write a UTF-8 char array to a file as ISO Latin 1 (non ISO-Latin-1 characters
* will be distorted by this process). Assume the UTF-8 char array is correct. * will be distorted by this process). Assume the UTF-8 char array is correct.
*/ */
int WriteLatin1(FILE *f, const char *utf8, long nbytes); int WriteLatin1(FILE *f, const char *utf8, int nbytes);
/* /*
* \brief Write a UTF-8 char array to a file as UTF-8. Assum e the UTF-8 char array is correct. * \brief Write a UTF-8 char array to a file as UTF-8. Assum e the UTF-8 char array is correct.
* *
*/ */
int WriteUTF8(FILE *f, const char *utf8, long nbytes); int WriteUTF8(FILE *f, const char *utf8, int nbytes);
/* /*
* Convert a UTF-8 char array to an ISO Latin 1 char array (non ISO Latin 1 characters * Convert a UTF-8 char array to an ISO Latin 1 char array (non ISO Latin 1 characters
* will be distorted by this process). Assume the UTF-8 cha r array is correct. * will be distorted by this process). Assume the UTF-8 cha r array is correct.
* This function creates a new string containing the ISO La tin 1 data. It returns NULL * This function creates a new string containing the ISO La tin 1 data. It returns NULL
* if it runs out of memory. * if it runs out of memory.
*/ */
char * UTF8ToLatin1(const char *utf8, int *bytes); char * UTF8ToLatin1(const char *utf8, int *bytes);
/* /*
* \brief Convert a (possibly ISO Latin 1) char array to a U TF-8 char array, as best we can. * \brief Convert a (possibly ISO Latin 1) char array to a U TF-8 char array, as best we can.
* If it is already correctly UTF 8 encoded, return the inpu t string unchanged. This function * If it is already correctly UTF 8 encoded, return the inpu t string unchanged. This function
* may create a new string containing the UTF-8 data. It ret urns NULL if it runs out of memory. * may create a new string containing the UTF-8 data. It ret urns NULL if it runs out of memory.
*/ */
char * CorrectUTF8(const char *s, int *bytes); char * CorrectUTF8(const char *s, int *bytes);
/* /*
* \brief Return non-zero (true) if the given UTF-8 char arr ay contains * \brief Return non-zero (true) if the given UTF-8 char arr ay contains
* only ASCII characters, otherwise return zero. * only ASCII characters, otherwise return zero.
*/ */
int IsASCII(const char *utf8, long nbytes); int IsASCII(const char *utf8, int nbytes);
/* /*
* \brief Return non-zero (true) if the given UTF-8 char arr ay contains * \brief Return non-zero (true) if the given UTF-8 char arr ay contains
* only ASCII and ISO Latin-1 characters, otherwise return zero. * only ASCII and ISO Latin-1 characters, otherwise return zero.
*/ */
int IsLatin1(const char *utf8, long nbytes); int IsLatin1(const char *utf8, int nbytes);
/** /**
* \brief * \brief
* *
*/ */
jcharset_result_t ConvertUTF32ToUTF16(const UTF32** sourceSt art, const UTF32* sourceEnd, UTF16** targetStart, UTF16* targetEnd, jcharse t_flags_t flags); jcharset_result_t ConvertUTF32ToUTF16(const UTF32** sourceSt art, const UTF32* sourceEnd, UTF16** targetStart, UTF16* targetEnd, jcharse t_flags_t flags);
/** /**
* \brief * \brief
* *
 End of changes. 10 change blocks. 
10 lines changed or deleted 10 lines changed or added


 jcheckbutton.h   jcheckbutton.h 
skipping to change at line 28 skipping to change at line 28
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CHECKButton_H #ifndef J_CHECKButton_H
#define J_CHECKButton_H #define J_CHECKButton_H
#include "jcomponent.h" #include "jcomponent.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
enum jcheckbox_type_t { enum jcheckbox_type_t {
CHECK_TYPE, CHECK_TYPE,
RADIO_TYPE RADIO_TYPE
}; };
class CheckButtonListener; class CheckButtonListener;
class CheckButtonEvent; class CheckButtonEvent;
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jcheckbuttonevent.h   jcheckbuttonevent.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CHECKBUTTONEVENT_H #ifndef J_CHECKBUTTONEVENT_H
#define J_CHECKBUTTONEVENT_H #define J_CHECKBUTTONEVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class CheckButtonEvent : public jcommon::EventObject{ class CheckButtonEvent : public jcommon::EventObject{
private: private:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jcheckbuttonlistener.h   jcheckbuttonlistener.h 
skipping to change at line 30 skipping to change at line 30
#ifndef J_CHECKBUTTONLISTENER_H #ifndef J_CHECKBUTTONLISTENER_H
#define J_CHECKBUTTONLISTENER_H #define J_CHECKBUTTONLISTENER_H
#include "jcheckbuttonevent.h" #include "jcheckbuttonevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class CheckButtonListener : public jcommon::Listener{ class CheckButtonListener : public jcommon::Listener{
 End of changes. 2 change blocks. 
5 lines changed or deleted 0 lines changed or added


 jcombobox.h   jcombobox.h 
skipping to change at line 34 skipping to change at line 34
#include "jitemcomponent.h" #include "jitemcomponent.h"
#include "jmenu.h" #include "jmenu.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
class ComboBox : public jgui::ItemComponent, public jgui::SelectListener{ class ComboBox : public jgui::ItemComponent, public jgui::SelectListener{
private: private:
Menu *_menu; Menu *_menu;
jhorizontal_align_t _halign; jhorizontal_align_t _halign;
jvertical_align_t _valign; jvertical_align_t _valign;
int _old_index; int _old_index;
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 jcommonlib.h   jcommonlib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_COMMONLIB_H #ifndef J_COMMONLIB_H
#define J_COMMONLIB_H #define J_COMMONLIB_H
#include "jmutex.h" #include "jbitstream.h"
#include "jcalendar.h"
#include "jcharset.h"
#include "jdate.h"
#include "jdynamiclink.h"
#include "jeventobject.h"
#include "jexception.h"
// #include "jgc.h"
#include "jhtmlparser.h"
#include "jinvalidargumentexception.h"
#include "jillegalargumentexception.h"
#include "jjson.h"
#include "jlistener.h"
#include "jnullpointerexception.h"
#include "jobject.h"
#include "jobservable.h"
#include "jobserver.h"
#include "joptions.h"
#include "joutofboundsexception.h"
#include "jpointer.h"
#include "jpolicies.h"
#include "jproperties.h"
// #include "jregexp.h"
#include "jruntimeexception.h"
#include "jstringtokenizer.h"
#include "jstringutils.h"
#include "jsystem.h"
#include "jtypes.h"
#include "junit.h"
#include "jurl.h"
#include "jxmlparser.h"
#ifdef _WIN32
#else
#include "jhttp.h"
#endif
#define JINFO 1 #define JINFO 1
#define JWARN 2 #define JWARN 2
#define JERRO 3 #define JERRO 3
#ifdef JDEBUG_ENABLED #ifdef JDEBUG_ENABLED
#define JDEBUG(t, args...) \ #define JDEBUG(t, args...) \
if (t == JINFO) { \ if (t == JINFO) { \
printf ("\033[37;40mINFO:: %s:%d [%s] \033[37;40m", __FILE__ , __LINE__, __PRETTY_FUNCTION__); \ printf ("\033[37;40mINFO:: %s:%d [%s] \033[37;40m", __FILE__ , __LINE__, __PRETTY_FUNCTION__); \
} else if (t == JWARN) { \ } else if (t == JWARN) { \
printf ("\033[33;40mWARN:: %s:%d [%s] \033[37;40m", __FILE__ , __LINE__, __PRETTY_FUNCTION__); \ printf ("\033[33;40mWARN:: %s:%d [%s] \033[37;40m", __FILE__ , __LINE__, __PRETTY_FUNCTION__); \
} else if (t == JERRO) { \ } else if (t == JERRO) { \
printf ("\033[31;40mERRO:: %s:%d [%s] \033[37;40m", __FILE__ , __LINE__, __PRETTY_FUNCTION__); \ printf ("\033[31;40mERRO:: %s:%d [%s] \033[37;40m", __FILE__ , __LINE__, __PRETTY_FUNCTION__); \
} \ } \
printf(args); \ printf(args); \
fflush(stdin); \ fflush(stdin); \
#else #else
#define JDEBUG(t, args...) #define JDEBUG(...) while (0) {} \
#endif #endif
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 37 lines changed or added


 jcomponent.h   jcomponent.h 
skipping to change at line 24 skipping to change at line 24
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_COMPONENT_H #ifndef J_COMPONENT_H
#define J_COMPONENT_H #define J_COMPONENT_H
#include "jobject.h" #include "jobject.h"
#include "jguilib.h"
#include "jkeyevent.h" #include "jkeyevent.h"
#include "jgraphics.h" #include "jgraphics.h"
#include "jmutex.h" #include "jmutex.h"
#include "jautolock.h" #include "jautolock.h"
#include "jcomponentlistener.h" #include "jcomponentlistener.h"
#include "jfont.h" #include "jfont.h"
#include "jgfxhandler.h" #include "jgfxhandler.h"
#include "jkeyevent.h" #include "jkeyevent.h"
#include "jmouseevent.h" #include "jmouseevent.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#define DEFAULT_COMPONENT_WIDTH 192 #define DEFAULT_COMPONENT_WIDTH 192
#define DEFAULT_COMPONENT_HEIGHT 54 #define DEFAULT_COMPONENT_HEIGHT 54
namespace jgui { namespace jgui {
enum jcomponent_alignment_t { enum jcomponent_alignment_t {
TOP_ALIGNMENT = 0, TOP_ALIGNMENT = 0,
CENTER_ALIGNMENT = 1, CENTER_ALIGNMENT = 1,
BOTTOM_ALIGNMENT = 2, BOTTOM_ALIGNMENT = 2,
LEFT_ALIGNMENT = 0, LEFT_ALIGNMENT = 0,
skipping to change at line 135 skipping to change at line 130
friend class Container; friend class Container;
friend class Frame; friend class Frame;
protected: protected:
jthread::Mutex _component_mutex; jthread::Mutex _component_mutex;
std::vector<FocusListener *> _focus_listeners; std::vector<FocusListener *> _focus_listeners;
std::vector<ComponentListener *> _component_listeners; std::vector<ComponentListener *> _component_listeners;
Component *_left, Component *_left,
*_right, *_right,
*_up, *_up,
*_down; *_down;
jgui::Container *_parent; jgui::Container *_parent;
jgui::Font *_font; jgui::Font *_font;
jpoint_t _location; jpoint_t _location;
jsize_t _size, jsize_t _size,
_preferred_size,
_minimum_size, _minimum_size,
_maximum_size; _maximum_size;
jcolor_t _bgcolor, jcolor_t _bgcolor,
_fgcolor, _fgcolor,
_focus_bgcolor, _focus_bgcolor,
_focus_fgcolor, _focus_fgcolor,
_border_color, _border_color,
_focus_border_color; _focus_border_color;
jcomponent_alignment_t _alignment_x, jcomponent_alignment_t _alignment_x,
_alignment_y; _alignment_y;
skipping to change at line 444 skipping to change at line 440
/** /**
* \brief * \brief
* *
*/ */
virtual void SetMaximumSize(jsize_t size); virtual void SetMaximumSize(jsize_t size);
/** /**
* \brief * \brief
* *
*/ */
virtual void SetPreferredSize(jsize_t size);
/**
* \brief
*
*/
virtual jsize_t GetMinimumSize(); virtual jsize_t GetMinimumSize();
/** /**
* \brief * \brief
* *
*/ */
virtual jsize_t GetMaximumSize(); virtual jsize_t GetMaximumSize();
/** /**
* \brief * \brief
 End of changes. 5 change blocks. 
8 lines changed or deleted 10 lines changed or added


 jcomponentevent.h   jcomponentevent.h 
skipping to change at line 32 skipping to change at line 32
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jcomponent_event_t { enum jcomponent_event_t {
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 jcomponentlistener.h   jcomponentlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_COMPONENTLISTENER_H #ifndef J_COMPONENTLISTENER_H
#define J_COMPONENTLISTENER_H #define J_COMPONENTLISTENER_H
#include "jcomponentevent.h" #include "jcomponentevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class ComponentListener : public jcommon::Listener{ class ComponentListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jcondition.h   jcondition.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CONDITION_H #ifndef J_CONDITION_H
#define J_CONDITION_H #define J_CONDITION_H
#include "jmutex.h" #include "jmutex.h"
#include "jobject.h"
#ifdef _WIN32 #ifdef _WIN32
#else #else
#include <pthread.h> #include <pthread.h>
#include <stdint.h> #include <stdint.h>
#endif #endif
namespace jthread { namespace jthread {
/** /**
* \brief Condition. * \brief Condition.
* *
* @author Jeff Ferr * @author Jeff Ferr
*/ */
class Condition : public virtual jcommon::Object{ class Condition : public virtual jcommon::Object{
private: private:
/** \brief Mutex */
Mutex _monitor;
#ifdef _WIN32 #ifdef _WIN32
CONDITION_VARIABLE _condition;
#else #else
/** \brief Descritor */ /** \brief Descritor */
pthread_cond_t _condition; pthread_cond_t _condition;
#endif #endif
/** \brief Mutex */
Mutex _monitor;
/** \brief Mutex */
int _count;
/** \brief Mutex */
int _nblock;
/** \brief */
bool _is_open;
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
Condition(int nblock = 1); Condition(int nblock = 1);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
skipping to change at line 83 skipping to change at line 77
*/ */
void Wait(Mutex *mutex = NULL); void Wait(Mutex *mutex = NULL);
/** /**
* \brief Lock semaphore. * \brief Lock semaphore.
* *
* \param time_ is an absolute time specification, z ero is the beginning of * \param time_ is an absolute time specification, z ero is the beginning of
* the epoch (00:00:00 GMT, January 1, 1970). * the epoch (00:00:00 GMT, January 1, 1970).
* *
*/ */
void Wait(long long time_, Mutex *mutex = NULL); void Wait(uint64_t time_, Mutex *mutex = NULL);
/** /**
* \brief Notify the locked semaphore. * \brief Notify the locked semaphore.
* *
*/ */
void Notify(); void Notify();
/** /**
* \brief Notify all the locked semaphores. * \brief Notify all the locked semaphores.
* *
 End of changes. 5 change blocks. 
11 lines changed or deleted 5 lines changed or added


 jconnectionpipe.h   jconnectionpipe.h 
skipping to change at line 30 skipping to change at line 30
#ifndef J_CONNECTIONPIPE_H #ifndef J_CONNECTIONPIPE_H
#define J_CONNECTIONPIPE_H #define J_CONNECTIONPIPE_H
#include "jthread.h" #include "jthread.h"
#include "jinetaddress.h" #include "jinetaddress.h"
#include "jsocketoption.h" #include "jsocketoption.h"
#include "jsocketinputstream.h" #include "jsocketinputstream.h"
#include "jsocketoutputstream.h" #include "jsocketoutputstream.h"
#include "jconnection.h" #include "jconnection.h"
#include "jobject.h"
#ifdef _WIN32
#else
#include <pthread.h>
#endif
#include <iostream>
#include <string> #include <string>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
#include <climits>
#include <unistd.h>
#include <stdint.h>
namespace jsocket { namespace jsocket {
/** /**
* \brief * \brief
* *
*/ */
enum jconnection_pipe_t { enum jconnection_pipe_t {
RECEIVER_PIPE, RECEIVER_PIPE,
SENDER_PIPE SENDER_PIPE
}; };
 End of changes. 3 change blocks. 
13 lines changed or deleted 0 lines changed or added


 jcontainer.h   jcontainer.h 
skipping to change at line 24 skipping to change at line 24
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CONTAINER_H #ifndef J_CONTAINER_H
#define J_CONTAINER_H #define J_CONTAINER_H
#include "jobject.h" #include "jobject.h"
#include "jguilib.h"
#include "jgraphics.h" #include "jgraphics.h"
#include "jcomponent.h" #include "jcomponent.h"
#include "jcontainerlistener.h" #include "jcontainerlistener.h"
#include "jcontainerevent.h" #include "jcontainerevent.h"
#include "jborderlayout.h" #include "jborderlayout.h"
#include "jgridbaglayout.h" #include "jgridbaglayout.h"
#include "jscrollbar.h" #include "jscrollbar.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class Layout; class Layout;
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
skipping to change at line 152 skipping to change at line 149
/** /**
* \brief * \brief
* *
*/ */
virtual jinsets_t GetInsets(); virtual jinsets_t GetInsets();
/** /**
* \brief * \brief
* *
*/ */
virtual void SetSize(int w, int h); virtual void SetSize(int width, int height);
/** /**
* \brief * \brief
* *
*/ */
virtual void SetInsets(jinsets_t insets); virtual void SetInsets(jinsets_t insets);
/** /**
* \brief * \brief
* *
 End of changes. 3 change blocks. 
4 lines changed or deleted 1 lines changed or added


 jcontainerevent.h   jcontainerevent.h 
skipping to change at line 30 skipping to change at line 30
#ifndef J_CONTAINEREVENT_H #ifndef J_CONTAINEREVENT_H
#define J_CONTAINEREVENT_H #define J_CONTAINEREVENT_H
#include "jcomponent.h" #include "jcomponent.h"
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jframe_event_t { enum jframe_event_t {
COMPONENT_ADDED_EVENT, COMPONENT_ADDED_EVENT,
COMPONENT_REMOVED_EVENT COMPONENT_REMOVED_EVENT
}; };
 End of changes. 1 change blocks. 
7 lines changed or deleted 0 lines changed or added


 jcontainerlistener.h   jcontainerlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_CONTAINERLISTENER_H #ifndef J_CONTAINERLISTENER_H
#define J_CONTAINERLISTENER_H #define J_CONTAINERLISTENER_H
#include "jcontainerevent.h" #include "jcontainerevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class ContainerListener : public jcommon::Listener{ class ContainerListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jcoordinatelayout.h   jcoordinatelayout.h 
skipping to change at line 58 skipping to change at line 58
private: private:
jcoordinate_layout_t _type; jcoordinate_layout_t _type;
int _width, int _width,
_height; _height;
public: public:
/** /**
* \brief * \brief
* *
*/ */
CoordinateLayout(int hgap = 10, int vgap = 10, jcoordinate_l ayout_t type = (jcoordinate_layout_t)(CL_HORIZONTAL | CL_VERTICAL)); CoordinateLayout(int width = -1, int height = -1, jcoordinat e_layout_t type = (jcoordinate_layout_t)(CL_HORIZONTAL | CL_VERTICAL));
/** /**
* \brief * \brief
* *
*/ */
virtual ~CoordinateLayout(); virtual ~CoordinateLayout();
/** /**
* \brief * \brief
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 jdatagramsocket.h   jdatagramsocket.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_DATAGRAM_SOCKET_H #ifndef J_DATAGRAM_SOCKET_H
#define J_DATAGRAM_SOCKET_H #define J_DATAGRAM_SOCKET_H
#include "jinetaddress.h" #include "jinetaddress.h"
#include "jsocketoption.h" #include "jsocketoption.h"
#include "jsocketinputstream.h" #include "jsocketinputstream.h"
#include "jsocketoutputstream.h" #include "jsocketoutputstream.h"
#include "jconnection.h" #include "jconnection.h"
#include "jobject.h"
#include <iostream>
#include <string> #include <string>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jsocket { namespace jsocket {
/** /**
* \brief Socket UDP. * \brief Socket UDP.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class DatagramSocket : public jsocket::Connection{ class DatagramSocket : public jsocket::Connection{
 End of changes. 3 change blocks. 
5 lines changed or deleted 0 lines changed or added


 jdataoutputstream.h   jdataoutputstream.h 
skipping to change at line 66 skipping to change at line 66
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Available(); virtual int64_t Available();
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(uint8_t data); virtual int64_t Write(uint8_t data);
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(uint16_t data); virtual int64_t Write(uint16_t data);
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(uint32_t data); virtual int64_t Write(uint32_t data);
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(uint64_t data); virtual int64_t Write(uint64_t data);
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Flush(); virtual int64_t Flush();
/** /**
* \brief * \brief
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
*/ */
int64_t GetSentBytes(); virtual int64_t GetSentBytes();
}; };
} }
#endif #endif
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 jdate.h   jdate.h 
skipping to change at line 56 skipping to change at line 56
SYSTEMTIME _zone; SYSTEMTIME _zone;
#else #else
/** \brief */ /** \brief */
struct tm *_zone; struct tm *_zone;
#endif #endif
/** \brief */ /** \brief */
time_t _time; time_t _time;
public: public:
/** /**
* \brief * \brief
* *
*/ */
Date(); Date();
/** /**
* \brief * \brief
* *
*/ */
Date(time_t time_); Date(time_t time_);
/** /**
* \brief * \brief
* *
*/ */
Date(int day, int month, int year); Date(int day, int month, int year);
/** /**
* \brief * \brief
* *
*/ */
Date(int day, int month, int year, int hours, int minutes, i
nt seconds);
/**
* \brief
*
*/
virtual ~Date(); virtual ~Date();
/** /**
* \brief * \brief
* *
*/ */
static uint64_t CurrentTimeSeconds(); static uint64_t CurrentTimeSeconds();
/** /**
* \brief * \brief
* *
*/ */
static uint64_t CurrentTimeMillis(); static uint64_t CurrentTimeMillis();
/** /**
* \brief * \brief
* *
*/ */
static uint64_t CurrentTimeMicros(); static uint64_t CurrentTimeMicros();
/** /**
* \brief * \brief
* *
*/ */
uint64_t GetTime();
/**
* \brief
*
*/
int GetDayOfMonth(); int GetDayOfMonth();
/** /**
* \brief * \brief
* *
*/ */
int GetMonth(); int GetMonth();
/** /**
* \brief The number of years since 1900. * \brief The number of years since 1900.
 End of changes. 8 change blocks. 
21 lines changed or deleted 34 lines changed or added


 jfile.h   jfile.h 
skipping to change at line 37 skipping to change at line 37
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#else #else
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#endif #endif
#include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
namespace jio { namespace jio {
/** /**
* \brief Tipo de arquivo. * \brief Tipo de arquivo.
* *
*/ */
enum file_type_t { enum file_type_t {
F_REGULAR, F_REGULAR,
F_DIRECTORY, F_DIRECTORY,
skipping to change at line 225 skipping to change at line 225
*/ */
std::string GetPath(); std::string GetPath();
/** /**
* \brief Retorna o caminho absoluto do arquivo/diretorio. * \brief Retorna o caminho absoluto do arquivo/diretorio.
* *
*/ */
std::string GetAbsolutePath(); std::string GetAbsolutePath();
/** /**
* \brief Retorna o identificador de usuario do arquivo.
*
*/
#ifdef _WIN32
#else
uid_t GetUserID();
#endif
/**
* \brief Retorna o identificador de grupo do arquivo.
*
*/
#ifdef _WIN32
#else
gid_t GetGroupID();
#endif
/**
* \brief Retorna a data do ultimo acesso do arquivo. * \brief Retorna a data do ultimo acesso do arquivo.
* *
*/ */
time_t GetTimeLastAccess(); time_t GetLastAccessTime();
/** /**
* \brief Retorna a data da ultima modificacao do arquivo. * \brief Retorna a data da ultima modificacao do arquivo.
* *
*/ */
time_t GetTimeLastModification(); time_t GetLastModificationTime();
/** /**
* \brief Retorna a data da ultima modificacao do status do arquivo. * \brief Retorna a data da ultima modificacao do status do arquivo.
* *
*/ */
time_t GetTimeLastStatusChange(); time_t GetLastStatusChangeTime();
/** /**
* \brief * \brief
* *
*/ */
int64_t Read(char *data_, int64_t length_); int64_t Read(char *data_, int64_t length_);
/** /**
* \brief * \brief
* *
skipping to change at line 312 skipping to change at line 294
/** /**
* \brief * \brief
* *
*/ */
bool IsClosed(); bool IsClosed();
/** /**
* \brief * \brief
* *
*/ */
void Move(std::string newpath_);
/**
* \brief
*
*/
void Rename(std::string newpath_); void Rename(std::string newpath_);
/** /**
* \brief * \brief
* *
*/ */
void Remove(); void Remove();
/** /**
* \brief * \brief
* *
*/ */
void Reset(); void Reset();
/** /**
* \brief * \brief
* *
*/ */
int64_t Tell();
/**
* \brief
*
*/
int64_t Seek(int64_t n); int64_t Seek(int64_t n);
/** /**
* \brief Find a file in the directory opened. * \brief Find a file in the directory opened.
* *
*/ */
bool ExistsFile(std::string file_); bool ExistsFile(std::string file_);
/** /**
* \brief * \brief
 End of changes. 8 change blocks. 
22 lines changed or deleted 16 lines changed or added


 jfilechooserdialogbox.h   jfilechooserdialogbox.h 
skipping to change at line 36 skipping to change at line 36
#include "jlabel.h" #include "jlabel.h"
#include "jmutex.h" #include "jmutex.h"
#include "jtextfield.h" #include "jtextfield.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jfilechooser_type_t { enum jfilechooser_type_t {
OPEN_FILE_DIALOG, OPEN_FILE_DIALOG,
SAVE_FILE_DIALOG SAVE_FILE_DIALOG
skipping to change at line 91 skipping to change at line 89
/** /**
* \brief * \brief
* *
*/ */
void ShowFiles(); void ShowFiles();
/** /**
* \brief * \brief
* *
*/ */
std::vector<std::string> ListFiles(std::string dirPath); std::vector<std::string> * ListFiles(std::string dirPath);
/** /**
* \brief * \brief
* *
*/ */
bool IsDirectory(std::string path); bool IsDirectory(std::string path);
/** /**
* \brief * \brief
* *
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added


 jfileinputstream.h   jfileinputstream.h 
skipping to change at line 93 skipping to change at line 93
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t GetPosition(); virtual int64_t GetPosition();
/** /**
* \brief * \brief
* *
*/ */
virtual int Read(); virtual int64_t Read();
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Read(char *, int64_t size); virtual int64_t Read(char *, int64_t size);
/** /**
* \brief Salto relativo. * \brief Salto relativo.
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 jfileoutputstream.h   jfileoutputstream.h 
skipping to change at line 36 skipping to change at line 36
namespace jio { namespace jio {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class FileOutputStream : public jio::OutputStream{ class FileOutputStream : public jio::OutputStream{
private: private:
/** \brief Seek */
int64_t _current;
/** \brief */ /** \brief */
File *_file; File *_file;
/** \brief */ /** \brief */
char *_buffer; char *_buffer;
/** \brief Seek */
int64_t _current;
/** \brief */ /** \brief */
int _buffer_length; int64_t _buffer_length;
/** \brief */ /** \brief */
int _current_index; int64_t _current_index;
/** \brief */ /** \brief */
int64_t _sent_bytes; int64_t _sent_bytes;
public: public:
/** /**
* \brief * \brief
* *
*/ */
FileOutputStream(std::string filename_); FileOutputStream(std::string filename_);
skipping to change at line 90 skipping to change at line 90
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t GetSize(); virtual int64_t GetSize();
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(int b); virtual int64_t Write(int64_t b);
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Write(const char *, int64_t size); virtual int64_t Write(const char *, int64_t size);
/** /**
* \brief * \brief
* *
skipping to change at line 120 skipping to change at line 120
/** /**
* \brief * \brief
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
*/ */
int64_t GetSentBytes(); virtual int64_t GetSentBytes();
}; };
} }
#endif #endif
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added


 jfocusevent.h   jfocusevent.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_FOCUSEVENT_H #ifndef J_FOCUSEVENT_H
#define J_FOCUSEVENT_H #define J_FOCUSEVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jfocus_event_t { enum jfocus_event_t {
GAINED_FOCUS_EVENT, GAINED_FOCUS_EVENT,
LOST_FOCUS_EVENT LOST_FOCUS_EVENT
}; };
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jfocuslistener.h   jfocuslistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_FOCUSLISTENER_H #ifndef J_FOCUSLISTENER_H
#define J_FOCUSLISTENER_H #define J_FOCUSLISTENER_H
#include "jfocusevent.h" #include "jfocusevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class FocusListener : public jcommon::Listener{ class FocusListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jframe.h   jframe.h 
skipping to change at line 41 skipping to change at line 41
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jdate.h" #include "jdate.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <map> #include <map>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jframe_buttons_t { enum jframe_buttons_t {
FB_NONE = 0, FB_NONE = 0,
FB_MAXIMIZE = 1, FB_MAXIMIZE = 1,
skipping to change at line 160 skipping to change at line 158
/** /**
* \brief * \brief
* *
*/ */
virtual ~Frame(); virtual ~Frame();
/** /**
* \brief * \brief
* *
*/ */
virtual void Pack(); virtual void Pack(bool fit = true);
/** /**
* \brief * \brief
* *
*/ */
virtual void Maximize(); virtual void Maximize();
/** /**
* \brief * \brief
* *
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added


 jgc.h   jgc.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_GC_H #ifndef J_GC_H
#define J_GC_H #define J_GC_H
#include "jobject.h" #include "jruntimeexception.h"
#include "jexception.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(disable : 4786) #pragma warning(disable : 4786)
#endif #endif
#if _MSC_VER >= 1000 #if _MSC_VER >= 1000
#pragma once #pragma once
#endif #endif
#if defined(_MSC_VER) && (_MSC_VER >= 1000) #if defined(_MSC_VER) && (_MSC_VER >= 1000)
skipping to change at line 50 skipping to change at line 49
#include <memory> #include <memory>
#include <climits> #include <climits>
#include <cstring> #include <cstring>
#include <limits> #include <limits>
#else #else
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <memory.h> #include <memory.h>
#include <string.h> #include <string.h>
#endif #endif
#include <set> #include <set>
#include <map> #include <map>
#include <vector> #include <vector>
#include <deque> #include <deque>
#include <utility> #include <utility>
#include <algorithm> #include <algorithm>
#include <exception> #include <exception>
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>
#include <functional>
#include <new>
#ifndef _SMGC_POOR_STL #ifndef _SMGC_POOR_STL
#include <cstdlib> #include <cstdlib>
#include <cstddef> #include <cstddef>
#else #else
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
#endif #endif
#include <exception>
#include <stdexcept>
#ifndef _SMGC_POOR_STL #ifndef _SMGC_POOR_STL
#include <cstdlib> #include <cstdlib>
#include <cstddef> #include <cstddef>
#include <climits> #include <climits>
#include <cassert> #include <cassert>
#else #else
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
#include <limits.h> #include <limits.h>
#include <assert.h> #include <assert.h>
#endif #endif
#include <exception>
#include <stdexcept>
#include <functional>
#include <new>
#if defined(_MSC_VER) && (_MSVC <= 1200) #if defined(_MSC_VER) && (_MSVC <= 1200)
#define _SMGC_NO_FRIEND_TEMPLATES #define _SMGC_NO_FRIEND_TEMPLATES
#define _SMGC_NO_ARRAY_NEW #define _SMGC_NO_ARRAY_NEW
#define _SMGC_POOR_TEMPLATES #define _SMGC_POOR_TEMPLATES
#endif #endif
#if defined(_SMGC_POOR_TEMPLATES) && !defined(_SMGC_NO_FRIEND_TEMPLATES) #if defined(_SMGC_POOR_TEMPLATES) && !defined(_SMGC_NO_FRIEND_TEMPLATES)
#define _SMGC_NO_FRIEND_TEMPLATES #define _SMGC_NO_FRIEND_TEMPLATES
#endif #endif
skipping to change at line 110 skipping to change at line 106
# ifdef DEBUG_COMPILER # ifdef DEBUG_COMPILER
# undef ASSERT_VALID # undef ASSERT_VALID
# undef ASSERT_SUPER_VALID # undef ASSERT_SUPER_VALID
# undef ASSERT_PTR_VALID # undef ASSERT_PTR_VALID
# define ASSERT_VALID assert(!destroyed) # define ASSERT_VALID assert(!destroyed)
# define ASSERT_SUPER_VALID assert(!super::destroyed) # define ASSERT_SUPER_VALID assert(!super::destroyed)
# define ASSERT_PTR_VALID(_p_) assert(!(_p_).destroyed) # define ASSERT_PTR_VALID(_p_) assert(!(_p_).destroyed)
# endif # endif
#endif #endif
using namespace std;
namespace jcommon { namespace jcommon {
template<typename T> class gc_ptr; template<typename T> class gc_ptr;
template<typename T> class const_gc_ptr; template<typename T> class const_gc_ptr;
template<typename T> class gc_arr; template<typename T> class gc_arr;
template<typename T> class const_gc_arr; template<typename T> class const_gc_arr;
template<typename T> class wk_ptr; template<typename T> class wk_ptr;
template<typename T> class const_wk_ptr; template<typename T> class const_wk_ptr;
template<typename T> class wk_arr; template<typename T> class wk_arr;
template<typename T> class const_wk_arr; template<typename T> class const_wk_arr;
void collect(); void collect();
void set_threshold(size_t bytes); void set_threshold(size_t bytes);
size_t get_threshold(); size_t get_threshold();
size_t get_dynamic_threshold(); size_t get_dynamic_threshold();
extern const size_t no_threshold; extern const size_t no_threshold;
extern const size_t default_threshold; extern const size_t default_threshold;
struct bad_reg: public exception {
virtual ~bad_reg() throw();
virtual const char *what() const throw();
};
struct no_space: public exception {
virtual ~no_space() throw();
virtual const char *what() const throw();
};
class mem_corrupt: public Exception {
char* msg;
public:
mem_corrupt(const char *txt="");
virtual ~mem_corrupt() throw();
virtual const char *what() const throw();
};
struct gc_t { struct gc_t {
}; };
struct gc_null_t { struct gc_null_t {
operator void* () const operator void* () const
{ {
return 0; return 0;
} }
}; };
skipping to change at line 185 skipping to change at line 161
} }
}; };
struct node_base { struct node_base {
}; };
struct pointer_base { struct pointer_base {
int pos; int pos;
#ifndef NDEBUG #ifndef NDEBUG
bool destroyed; bool destroyed;
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
char *trash; char *trash;
//void assert_valid() //void assert_valid()
//{ ASSERT_VALID; } //{ ASSERT_VALID; }
# endif #endif
#endif #endif
protected: protected:
pointer_base(); pointer_base();
pointer_base(const pointer_base& pb); pointer_base(const pointer_base& pb);
virtual ~pointer_base(); virtual ~pointer_base();
void operator= (const pointer_base& pb) void operator= (const pointer_base& pb)
{ {
} }
skipping to change at line 213 skipping to change at line 189
void swap(pointer_base &pb) void swap(pointer_base &pb)
{ {
ASSERT_VALID; ASSERT_VALID;
} }
}; };
struct weak_base { struct weak_base {
int pos; int pos;
#ifndef NDEBUG #ifndef NDEBUG
bool destroyed; bool destroyed;
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
char *trash; char *trash;
# endif #endif
#endif #endif
protected: protected:
weak_base(); weak_base();
weak_base(const weak_base& pb); weak_base(const weak_base& pb);
virtual ~weak_base(); virtual ~weak_base();
void operator= (const weak_base& pb) void operator= (const weak_base& pb)
{ {
} }
skipping to change at line 624 skipping to change at line 600
void swap(gc_ptr &p) void swap(gc_ptr &p)
{ {
ASSERT_SUPER_VALID; ASSERT_SUPER_VALID;
T* tmp = super::ptr; T* tmp = super::ptr;
super::ptr = p.ptr; super::ptr = p.ptr;
p.ptr = tmp; p.ptr = tmp;
super::swap(p); super::swap(p);
} }
}; };
/*
template<typename T>
class const_gc_ptr: public pointer_base
{
#ifdef _SMGC_NO_FRIEND_TEMPLATES
public:
#else
protected:
template<typename U> friend class const_gc_ptr;
template<typename U> friend class gc_ptr;
template<typename U> friend class const_wk_ptr;
template<typename U> friend class wk_ptr;
friend struct std::less<const_gc_ptr<T> >;
friend struct std::less<gc_ptr<T> >;
#endif
friend void collect();
T* ptr;
public:
typedef T element_type;
private:
typedef pointer_base super;
protected:
template <typename U>
void reset_node(const U* obj)
{
super::reset_node(obj, destructor<U>::destroy);
}
const_gc_ptr(const light_cons_t&) {}
public:
const_gc_ptr(): ptr(0) {}
const_gc_ptr(const gc_null_t&): ptr(0) {}
template<typename U>
explicit const_gc_ptr(const U *p)//: ptr(0)
{
reset(p);
}
template<typename U>
const_gc_ptr(const U *p, const dynamic_cast_t*)//: ptr(0)
{
reset(dynamic_cast<T*>(p));
}
template<typename U>
const_gc_ptr(const U *p, const static_cast_t*)//: ptr(0)
{
reset(static_cast<T*>(p));
}
const_gc_ptr(const T *p)//: ptr(0)
{
reset(p);
}
template<typename U>
const_gc_ptr(const const_gc_ptr<U> &p): super(p), ptr(implicit_cast<T*>
(p.ptr)) {}
template<typename U>
const_gc_ptr(const const_gc_ptr<U> &p, const dynamic_cast_t*):
super(p), ptr(dynamic_cast<T*>(p.ptr)) {}
template<typename U>
const_gc_ptr(const const_gc_ptr<U> &p, const static_cast_t*):
super(p), ptr(static_cast<T*>(p.ptr)) {}
#ifndef NDEBUG
~const_gc_ptr()
{
ptr=0;
}
#endif
const_gc_ptr<T>& operator = (const gc_null_t&)
{
ASSERT_VALID;
ptr = 0;
return *this;
}
template<typename U>
const_gc_ptr<T>& operator = (const U *p)
{
ASSERT_VALID;
reset(p);
return *this;
}
template<typename U>
const_gc_ptr<T>& operator = (const const_gc_ptr<U> &p)
{
ASSERT_VALID;
ptr = p.ptr;
return *this;
}
const T& operator * () const
{
ASSERT_VALID;
return *ptr;
}
const T* operator -> () const
{
ASSERT_VALID;
return ptr;
}
const T* get() const
{
ASSERT_VALID;
return ptr;
}
bool operator ! () const
{
ASSERT_VALID;
return ptr==0;
}
operator bool () const
{
ASSERT_VALID;
return ptr!=0;
}
bool operator ==(const gc_null_t&) const
{
ASSERT_VALID;
return ptr == 0;
}
bool operator !=(const gc_null_t&) const
{
ASSERT_VALID;
return ptr != 0;
}
template<typename U>
bool operator ==(const const_gc_ptr<U> &p) const
{
ASSERT_VALID;
return ptr == p.ptr;
}
template<typename U>
bool operator !=(const const_gc_ptr<U> &p) const
{
ASSERT_VALID;
return ptr != p.ptr;
}
template<typename U>
bool operator <=(const const_gc_ptr<U> &p) const
{
ASSERT_VALID;
return ptr <= p.ptr;
}
template<typename U>
bool operator >=(const const_gc_ptr<U> &p) const
{
ASSERT_VALID;
return ptr >= p.ptr;
}
template<typename U>
bool operator <(const const_gc_ptr<U> &p) const
{
ASSERT_VALID;
return ptr < p.ptr;
}
template<typename U>
bool operator >(const const_gc_ptr<U> &p) const
{
ASSERT_VALID;
return ptr > p.ptr;
}
template<typename U>
bool operator ==(const U *p) const
{
ASSERT_VALID;
return ptr == p;
}
template<typename U>
bool operator !=(const U *p) const
{
ASSERT_VALID;
return ptr != p;
}
#ifdef _SMGC_PTR_COMPARABLE
template<typename U>
bool operator <=(const U *p) const
{
ASSERT_VALID;
return ptr <= p;
}
template<typename U>
bool operator >=(const U *p) const
{
ASSERT_VALID;
return ptr >= p;
}
template<typename U>
bool operator <(const U *p) const
{
ASSERT_VALID;
return ptr < p;
}
template<typename U>
bool operator >(const U *p) const
{
ASSERT_VALID;
return ptr > p;
}
#endif
void reset(const T* p=0)
{
ASSERT_VALID;
reset_node(p);
ptr = const_cast<T*>(p);
}
void swap(const_gc_ptr &p)
{
ASSERT_VALID;
T* tmp = ptr;
ptr = p.ptr;
p.ptr = tmp;
super::swap(p);
}
};
template<typename T>
class gc_ptr: public const_gc_ptr<T>
{
public:
typedef T element_type;
private:
typedef const_gc_ptr<T> super;
public:
gc_ptr() {}
gc_ptr(const gc_null_t&) {}
template<typename U>
explicit gc_ptr(U *p): super(light_cons_t())
{
reset(p);
}
template<typename U>
gc_ptr(U *p, const dynamic_cast_t*): super(light_cons_t())
{
reset(dynamic_cast<T*>(p));
}
template<typename U>
gc_ptr(U *p, const static_cast_t*): super(light_cons_t())
{
reset(static_cast<T*>(p));
}
template<typename U>
gc_ptr(const U *p, const const_cast_t*): super(light_cons_t())
{
reset(const_cast<T*>(p));
}
gc_ptr(T *p): super(light_cons_t())
{
reset(p);
}
template<typename U>
gc_ptr(const gc_ptr<U> &p): super(p) {}
template<typename U>
gc_ptr(const gc_ptr<U> &p, const dynamic_cast_t*):
super(p, static_cast<dynamic_cast_t*>(0)) {}
template<typename U>
gc_ptr(const gc_ptr<U> &p, const static_cast_t*):
super(p, static_cast<static_cast_t*>(0)) {}
template<typename U>
gc_ptr(const const_gc_ptr<U> &p, const const_cast_t*):
super(p) {}
#ifndef NDEBUG
~gc_ptr()
{
ASSERT_SUPER_VALID;
super::ptr=0;
}
#endif
gc_ptr<T>& operator = (const gc_null_t&)
{
ASSERT_SUPER_VALID;
super::ptr = 0;
return *this;
}
template<typename U>
gc_ptr<T>& operator = (U *p)
{
ASSERT_SUPER_VALID;
reset(p);
return *this;
}
template<typename U>
gc_ptr<T>& operator = (const gc_ptr<U> &p)
{
ASSERT_SUPER_VALID;
super::ptr = const_cast<U*>(p.ptr);
return *this;
}
T& operator * () const
{
ASSERT_SUPER_VALID;
return *super::ptr;
}
T* operator -> () const
{
ASSERT_SUPER_VALID;
return super::ptr;
}
T* get() const
{
ASSERT_SUPER_VALID;
return super::ptr;
}
void reset(T* p=0)
{
ASSERT_SUPER_VALID;
reset_node(p);
super::ptr = p;
}
void swap(gc_ptr &p)
{
ASSERT_SUPER_VALID;
T* tmp = super::ptr;
super::ptr = p.ptr;
p.ptr = tmp;
super::swap(p);
}
};
*/
template<typename U>bool operator ==(const gc_null_t &l, const const_gc_ptr <U> &p) template<typename U>bool operator ==(const gc_null_t &l, const const_gc_ptr <U> &p)
{ {
return p.operator ==(l); return p.operator ==(l);
} }
template<typename U>bool operator !=(const gc_null_t &l, const const_gc_ptr <U> &p) template<typename U>bool operator !=(const gc_null_t &l, const const_gc_ptr <U> &p)
{ {
return p.operator !=(l); return p.operator !=(l);
} }
skipping to change at line 2072 skipping to change at line 1674
static void* operator new(size_t s); static void* operator new(size_t s);
static void* operator new(size_t s, void *place); static void* operator new(size_t s, void *place);
static void operator delete(void *n); static void operator delete(void *n);
static void operator delete(void *n, void *place) {} static void operator delete(void *n, void *place) {}
}; };
struct node_less { struct node_less {
bool operator()(const node_t* x, const node_t* y) const bool operator()(const node_t* x, const node_t* y) const
{ {
//return (static_cast<const char*>(x->base) + x->size) <= st atic_cast<const char*>(y->base); //return (static_cast<const char*>(x->base) + x->size) <= st atic_cast<const char*>(y->base);
static const less<const void*> cmp = less<const void*>(); static const std::less<const void*> cmp = std::less<const vo id*>();
return !cmp(static_cast<const char*>(y->base), static_cast<c onst char*>(x->base) + x->size); return !cmp(static_cast<const char*>(y->base), static_cast<c onst char*>(x->base) + x->size);
} }
} node_cmp; } node_cmp;
typedef pair<pointer_base*, node_t*> ptr_pair; typedef std::pair<pointer_base*, node_t*> ptr_pair;
typedef pair<weak_base*, node_t*> weak_pair; typedef std::pair<weak_base*, node_t*> weak_pair;
typedef fastvec<ptr_pair> ptr_vector; typedef fastvec<ptr_pair> ptr_vector;
typedef fastvec<node_t*> node_vector; typedef fastvec<node_t*> node_vector;
typedef fastvec<weak_pair> weak_vector; typedef fastvec<weak_pair> weak_vector;
typedef deque<ptr_vector::iterator> ptr_queue; typedef std::deque<ptr_vector::iterator> ptr_queue;
struct data_t { struct data_t {
data_t(): data_t():
threshold(default_threshold), threshold(default_threshold),
dynamic_threshold(default_threshold), dynamic_threshold(default_threshold),
allocated(0), allocated(0),
collecting(false), collecting(false),
current_mark(false) current_mark(false)
{ {
// InitializeCriticalSection(&cs); // InitializeCriticalSection(&cs);
skipping to change at line 2188 skipping to change at line 1790
{ {
bool internal = node->internal; bool internal = node->internal;
if(node->object && node->destroy) if(node->object && node->destroy)
node->destroy(node->object, const_cast<void*>(node->base), n ode->size); node->destroy(node->object, const_cast<void*>(node->base), n ode->size);
if(!internal) if(!internal)
free(static_cast<void*>(node)); free(static_cast<void*>(node));
} }
bool node_t::contains(const void* obj) bool node_t::contains(const void* obj)
{ {
static const less<const void*> cmp = less<const void*>(); static const std::less<const void*> cmp = std::less<const void*>();
if(cmp(obj, base)) if(cmp(obj, base))
return false; return false;
return cmp(obj, static_cast<const char*>(base) + size); return cmp(obj, static_cast<const char*>(base) + size);
} }
void * node_t::operator new(size_t s) void * node_t::operator new(size_t s)
{ {
void *res = malloc(s); void *res = malloc(s);
if(res == 0) if(res == 0)
throw bad_alloc(); throw std::bad_alloc();
return res; return res;
} }
void * node_t::operator new(size_t s, void *place) void * node_t::operator new(size_t s, void *place)
{ {
return place; return place;
} }
void node_t::operator delete(void *n) void node_t::operator delete(void *n)
{ {
#ifndef NDEBUG #ifndef NDEBUG
cerr << "Internal error -- badly written software" << endl; std::cerr << "Internal error -- badly written software" << std::endl ;
abort(); abort();
#endif #endif
} }
node_t* find_node(const void* obj) node_t* find_node(const void* obj)
{ {
// Construct a temporary node in order to search for the object's no de. // Construct a temporary node in order to search for the object's no de.
node_t temp(obj, 0); node_t temp(obj, 0);
// Use lower_bound to search for the "insertion point" and determine // Use lower_bound to search for the "insertion point" and determine
// if the node at this point contains the specified object. If the // if the node at this point contains the specified object. If the
// insertion point is at the end or does not contain the object then // insertion point is at the end or does not contain the object then
// we've failed to find the node and return an iterator to the end. // we've failed to find the node and return an iterator to the end.
node_vector::iterator i = lower_bound(data().new_nodes.begin(), data ().new_nodes.end(), &temp, node_cmp); node_vector::iterator i = std::lower_bound(data().new_nodes.begin(), data().new_nodes.end(), &temp, node_cmp);
if(i == data().new_nodes.end() || !(*i)->contains(obj)) if(i == data().new_nodes.end() || !(*i)->contains(obj))
{ {
i = lower_bound(data().old_nodes.begin(), data().old_nodes.e nd(), &temp, node_cmp); i = std::lower_bound(data().old_nodes.begin(), data().old_no des.end(), &temp, node_cmp);
if (i == data().old_nodes.end() || !(*i)->contains(obj)) if (i == data().old_nodes.end() || !(*i)->contains(obj))
return NULL; return NULL;
} }
// Return the found iterator. // Return the found iterator.
return *i; return *i;
} }
node_t* find_new_node(const void* obj) node_t* find_new_node(const void* obj)
{ {
// Construct a temporary node in order to search for the object's no de. // Construct a temporary node in order to search for the object's no de.
node_t temp(obj, 0); node_t temp(obj, 0);
// Use lower_bound to search for the "insertion point" and determine // Use lower_bound to search for the "insertion point" and determine
// if the node at this point contains the specified object. If the // if the node at this point contains the specified object. If the
// insertion point is at the end or does not contain the object then // insertion point is at the end or does not contain the object then
// we've failed to find the node and return an iterator to the end. // we've failed to find the node and return an iterator to the end.
node_vector::iterator i = lower_bound(data().new_nodes.begin(), data ().new_nodes.end(), &temp, node_cmp); node_vector::iterator i = std::lower_bound(data().new_nodes.begin(), data().new_nodes.end(), &temp, node_cmp);
if(i == data().new_nodes.end() || !(*i)->contains(obj)) if(i == data().new_nodes.end() || !(*i)->contains(obj))
return NULL; return NULL;
// Return the found iterator. // Return the found iterator.
return *i; return *i;
} }
node_vector::iterator find_born_node(const void* obj) node_vector::iterator find_born_node(const void* obj)
{ {
node_vector::iterator e = data().born_nodes.end(); node_vector::iterator e = data().born_nodes.end();
skipping to change at line 2308 skipping to change at line 1910
if (node->contains(j->first)) if (node->contains(j->first))
que.push_back(j); que.push_back(j);
else else
break; break;
} }
} }
} }
void presort_ptr_vect(ptr_vector::iterator begin, ptr_vector::iterator end) void presort_ptr_vect(ptr_vector::iterator begin, ptr_vector::iterator end)
{ {
static const less<pointer_base*> cmp = less<pointer_base*>(); static const std::less<pointer_base*> cmp = std::less<pointer_base*> ();
if(end-begin < 16) if(end-begin < 16)
return; return;
ptr_vector::iterator i = begin+((end-begin)>>1); ptr_vector::iterator i = begin+((end-begin)>>1);
ptr_pair pivot = *i; ptr_pair pivot = *i;
*i = *begin; *i = *begin;
*begin = pivot; *begin = pivot;
i = begin; i = begin;
ptr_vector::iterator j = end; ptr_vector::iterator j = end;
skipping to change at line 2349 skipping to change at line 1951
} }
*begin = *j; *begin = *j;
*j = pivot; *j = pivot;
presort_ptr_vect(begin, j); presort_ptr_vect(begin, j);
presort_ptr_vect(j+1, end); presort_ptr_vect(j+1, end);
} }
void sort_ptr_vect(ptr_vector &v) void sort_ptr_vect(ptr_vector &v)
{ {
static const less<pointer_base*> cmp = less<pointer_base*>(); static const std::less<pointer_base*> cmp = std::less<pointer_base*> ();
ptr_vector::iterator begin = v.begin(); ptr_vector::iterator begin = v.begin();
ptr_vector::iterator end = v.end(); ptr_vector::iterator end = v.end();
if(end-begin < 32) if(end-begin < 32)
{ {
sort(begin, end); sort(begin, end);
return; return;
} }
skipping to change at line 2395 skipping to change at line 1997
++i; ++i;
} }
#ifndef NDEBUG #ifndef NDEBUG
p = *begin; p = *begin;
for(i=begin+1; i<end; ++i) for(i=begin+1; i<end; ++i)
{ {
//if(cmp(i->first, p.first)) //if(cmp(i->first, p.first))
if(i->first <= p.first && p.first) if(i->first <= p.first && p.first)
{ {
throw mem_corrupt("smartpointer order lost"); throw jcommon::RuntimeException("smartpointer order lost");
//cerr << "Order lost at " << (i-begin) << endl; //cerr << "Order lost at " << (i-begin) << endl;
//abort(); //abort();
} }
p = *i; p = *i;
} }
#endif #endif
} }
void presort_node_vect(node_vector::iterator begin, node_vector::iterator e nd) void presort_node_vect(node_vector::iterator begin, node_vector::iterator e nd)
{ {
skipping to change at line 2450 skipping to change at line 2052
presort_node_vect(j+1, end); presort_node_vect(j+1, end);
} }
void sort_node_vect(node_vector &v) void sort_node_vect(node_vector &v)
{ {
node_vector::iterator begin = v.begin(); node_vector::iterator begin = v.begin();
node_vector::iterator end = v.end(); node_vector::iterator end = v.end();
if(end-begin < 32) if(end-begin < 32)
{ {
sort(begin, end, node_cmp); std::sort(begin, end, node_cmp);
return; return;
} }
presort_node_vect(begin, end); presort_node_vect(begin, end);
node_vector::iterator i = begin+1; node_vector::iterator i = begin+1;
node_vector::iterator j; node_vector::iterator j;
node_t *p = *begin; node_t *p = *begin;
for(j=i; j<begin+17; ++j) for(j=i; j<begin+17; ++j)
{ {
skipping to change at line 2510 skipping to change at line 2112
ops.erase(o, ops.end()); ops.erase(o, ops.end());
ops.resize(ops.size()+nps.size()/*, ptr_pair(0,0)*/); ops.resize(ops.size()+nps.size()/*, ptr_pair(0,0)*/);
// We do our own merge, not merge algorithm, because // We do our own merge, not merge algorithm, because
// we don't want to create new old_pointers vector // we don't want to create new old_pointers vector
// everytime, nor we want to go for inplace_merge, as // everytime, nor we want to go for inplace_merge, as
// it'd be slow. // it'd be slow.
ptr_vector::reverse_iterator r = ops.rbegin()+nps.size(); ptr_vector::reverse_iterator r = ops.rbegin()+nps.size();
ptr_vector::reverse_iterator n = nps.rbegin(); ptr_vector::reverse_iterator n = nps.rbegin();
size_t os = ops.size(); size_t os = ops.size();
#ifdef _SMGC_POOR_STL
#ifdef _WIN32
if (os > INT_MAX) if (os > INT_MAX)
#else #else
if ((int)os > numeric_limits<int>::max()) if ((int)os > std::numeric_limits<int>::max())
#endif #endif
throw no_space(); throw jcommon::RuntimeException("No space exception");
int s = (int)os; int s = (int)os;
while(r != ops.rend() && n != nps.rend()) { while(r != ops.rend() && n != nps.rend()) {
--s; --s;
if(*r > *n) if(*r > *n)
ops[s] = *r++; ops[s] = *r++;
else else
ops[s] = *n++; ops[s] = *n++;
ops[s].first->pos = -1-s; ops[s].first->pos = -1-s;
} }
skipping to change at line 2539 skipping to change at line 2143
ops[s].first->pos = -1-s; ops[s].first->pos = -1-s;
} }
while(n != nps.rend()) { while(n != nps.rend()) {
--s; --s;
ops[s] = *n++; ops[s] = *n++;
ops[s].first->pos = -1-s; ops[s].first->pos = -1-s;
} }
#ifndef NDEBUG #ifndef NDEBUG
if(s != 0) if(s != 0)
throw mem_corrupt("internal error in ptr_vectors merge"); throw jcommon::RuntimeException("internal error in ptr_vecto rs merge");
void *old = 0; void *old = 0;
end = ops.end(); end = ops.end();
for(ptr_vector::iterator c = ops.begin(); c != end; ++c) for(ptr_vector::iterator c = ops.begin(); c != end; ++c)
{ {
ASSERT_PTR_VALID(*(c->first)); ASSERT_PTR_VALID(*(c->first));
if(c->first == old) if(c->first == old)
throw mem_corrupt("duplicated pointer"); throw jcommon::RuntimeException("duplicated pointer" );
else if(c->first < old) else if(c->first < old)
throw mem_corrupt("pointer order lost"); throw jcommon::RuntimeException("pointer order lost" );
old = c->first; old = c->first;
} }
#endif #endif
nps.clear(); nps.clear();
} }
void clean_merge_nodes(size_t new_sweeped_out) void clean_merge_nodes(size_t new_sweeped_out)
{ {
// Clean old_nodes pulling off null references then // Clean old_nodes pulling off null references then
// merge old_nodes into new_nodes // merge old_nodes into new_nodes
skipping to change at line 2610 skipping to change at line 2214
if(*n == 0) if(*n == 0)
{ {
n++; n++;
continue; continue;
} }
--s; --s;
onv[s] = *n++; onv[s] = *n++;
} }
#ifndef NDEBUG #ifndef NDEBUG
if(s != 0) if(s != 0)
throw mem_corrupt("internal error in node_sets merge"); throw jcommon::RuntimeException("internal error in node_sets merge");
node_t *old = 0; node_t *old = 0;
end = onv.end(); end = onv.end();
for(node_vector::iterator c = onv.begin(); c != end; ++c) for(node_vector::iterator c = onv.begin(); c != end; ++c)
{ {
if(*c == old) if(*c == old)
throw mem_corrupt("duplicated node"); throw jcommon::RuntimeException("duplicated node");
else if(old && !node_cmp(old, *c)) else if(old && !node_cmp(old, *c))
throw mem_corrupt("node order lost"); throw jcommon::RuntimeException("node order lost");
old = *c; old = *c;
} }
#endif #endif
nnv.clear(); nnv.clear();
} }
template<class A>void* gnew(size_t size, const A& a) template<class A>void* gnew(size_t size, const A& a)
{ {
data_lock lock; data_lock lock;
skipping to change at line 2648 skipping to change at line 2252
} }
} }
// Attempt the first allocation. The standard requires new to throw // Attempt the first allocation. The standard requires new to throw
// on failure but user code may change this behavior and VC++ by def ault // on failure but user code may change this behavior and VC++ by def ault
// only returns 0. We'll catch exceptions and if we've already coll ected // only returns 0. We'll catch exceptions and if we've already coll ected
// re-throw the exception. // re-throw the exception.
void* obj = 0; void* obj = 0;
try { try {
obj = a.alloc(size); obj = a.alloc(size);
} catch(bad_alloc&) { } catch(std::bad_alloc&) {
if (collected) throw; if (collected) throw;
} }
// If we've failed to allocate but new didn't throw an exception and we've // If we've failed to allocate but new didn't throw an exception and we've
// not collected yet we'll collect and then re-try calling new. If new // not collected yet we'll collect and then re-try calling new. If new
// throws at this point we'll ignore it and let the caller handle it . // throws at this point we'll ignore it and let the caller handle it .
if (obj == 0 && !collected) { if (obj == 0 && !collected) {
collect(); collect();
obj = a.alloc(size); obj = a.alloc(size);
} }
// If we actually allocated memory then we need to add it to the nod e map. // If we actually allocated memory then we need to add it to the nod e map.
try { try {
if (obj != 0) { if (obj != 0) {
node_t *node; node_t *node;
if(a.internal_node()) if(a.internal_node())
node = new(static_cast<void*>(static_cast<ch ar*>(obj)+a.node_offset(size))) node_t(obj, size, true); node = new(static_cast<void*>(static_cast<ch ar*>(obj)+a.node_offset(size))) node_t(obj, size, true);
else else
node = new node_t(obj, size); node = new node_t(obj, size);
if(node == 0) // Dealing with VC++ 6.0 quirk if(node == 0) // Dealing with VC++ 6.0 quirk
throw bad_alloc(); throw std::bad_alloc();
data().born_nodes.push_back(node); data().born_nodes.push_back(node);
} }
} catch (...) { } catch (...) {
// If inserting into the map failed clean up and simply thro w // If inserting into the map failed clean up and simply thro w
// a bad_alloc exception. // a bad_alloc exception.
a.free(obj); a.free(obj);
throw bad_alloc(); throw std::bad_alloc();
} }
return obj; return obj;
} }
template<class A>void gfree(void* obj, const A &a) template<class A>void gfree(void* obj, const A &a)
{ {
data_lock lock; data_lock lock;
// Theoretically, none of this code will throw an exception. // Theoretically, none of this code will throw an exception.
skipping to change at line 2769 skipping to change at line 2373
alloc_array_t alloc_array; alloc_array_t alloc_array;
#endif #endif
pointer_base::pointer_base() pointer_base::pointer_base()
{ {
data_lock lock; data_lock lock;
#ifndef NDEBUG #ifndef NDEBUG
destroyed = false; destroyed = false;
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
trash = new char[1]; trash = new char[1];
# endif #endif
#endif #endif
ptr_vector &ps = data().new_pointers; ptr_vector &ps = data().new_pointers;
pos = ps.size(); pos = ps.size();
ps.push_back(ptr_pair(this, 0)); ps.push_back(ptr_pair(this, 0));
} }
pointer_base::pointer_base(const pointer_base &pb) pointer_base::pointer_base(const pointer_base &pb)
{ {
data_lock lock; data_lock lock;
#ifndef NDEBUG #ifndef NDEBUG
destroyed = false; destroyed = false;
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
trash = new char[3]; trash = new char[3];
# endif #endif
#endif #endif
ptr_vector &ps = data().new_pointers; ptr_vector &ps = data().new_pointers;
pos = ps.size(); pos = ps.size();
/*if(pb.pos >= 0) /*if(pb.pos >= 0)
ps.push_back(ptr_pair(this, ps[pb.pos].second)); ps.push_back(ptr_pair(this, ps[pb.pos].second));
else else
ps.push_back(ptr_pair(this, data().old_pointers[-1-pb.pos].second) ); ps.push_back(ptr_pair(this, data().old_pointers[-1-pb.pos].second) );
*/ */
ps.push_back(ptr_pair(this, 0)); ps.push_back(ptr_pair(this, 0));
} }
pointer_base::~pointer_base() pointer_base::~pointer_base()
{ {
data_lock lock; data_lock lock;
#ifndef NDEBUG #ifndef NDEBUG
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
delete[] trash; delete[] trash;
# endif #endif
destroyed = true; destroyed = true;
#endif #endif
if(pos >= 0) if(pos >= 0)
{ {
ptr_vector &ps = data().new_pointers; ptr_vector &ps = data().new_pointers;
if (pos == (int)(ps.size()-1)) { if (pos == (int)(ps.size()-1)) {
ps.pop_back(); ps.pop_back();
} else { } else {
ps[pos] = ps.back(); ps[pos] = ps.back();
#ifndef NDEBUG #ifndef NDEBUG
if(ps[pos].first->pos != (int)(ps.size()-1)) { if(ps[pos].first->pos != (int)(ps.size()-1)) {
//cerr << "GC: memory corrupted; smartpointe r lost!" << endl; //cerr << "GC: memory corrupted; smartpointe r lost!" << endl;
//abort(); //abort();
throw mem_corrupt("smartpointer lost"); throw jcommon::RuntimeException("smartpointe r lost");
} }
if(ps[pos].first->destroyed) { if(ps[pos].first->destroyed) {
//cerr << "GC: memory corrupted; smartpointe r destructed 2 times or overwritten!" << endl; //cerr << "GC: memory corrupted; smartpointe r destructed 2 times or overwritten!" << endl;
//abort(); //abort();
throw mem_corrupt("smartpointer overwritten or double destructed"); throw jcommon::RuntimeException("smartpointe r overwritten or double destructed");
} }
#endif #endif
ps[pos].first->pos = pos; ps[pos].first->pos = pos;
ps.pop_back(); ps.pop_back();
} }
} else { } else {
data().old_pointers[-1-pos].first = 0; data().old_pointers[-1-pos].first = 0;
} }
} }
skipping to change at line 2848 skipping to change at line 2452
data_lock lock; data_lock lock;
get_node(obj, destroy); get_node(obj, destroy);
} }
weak_base::weak_base() weak_base::weak_base()
{ {
data_lock lock; data_lock lock;
#ifndef NDEBUG #ifndef NDEBUG
destroyed = false; destroyed = false;
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
trash = new char[2]; trash = new char[2];
# endif #endif
#endif #endif
weak_vector &ps = data().weak_pointers; weak_vector &ps = data().weak_pointers;
pos = ps.size(); pos = ps.size();
ps.push_back(weak_pair(this, 0)); ps.push_back(weak_pair(this, 0));
} }
weak_base::weak_base(const weak_base &pb) weak_base::weak_base(const weak_base &pb)
{ {
data_lock lock; data_lock lock;
#ifndef NDEBUG #ifndef NDEBUG
destroyed = false; destroyed = false;
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
trash = new char[4]; trash = new char[4];
# endif #endif
#endif #endif
weak_vector &ps = data().weak_pointers; weak_vector &ps = data().weak_pointers;
pos = ps.size(); pos = ps.size();
ps.push_back(weak_pair(this, 0)); ps.push_back(weak_pair(this, 0));
} }
weak_base::~weak_base() weak_base::~weak_base()
{ {
data_lock lock; data_lock lock;
#ifndef NDEBUG #ifndef NDEBUG
# ifdef DEBUG_COMPILER #ifdef DEBUG_COMPILER
delete[] trash; delete[] trash;
# endif #endif
destroyed = true; destroyed = true;
#endif #endif
weak_vector &ps = data().weak_pointers; weak_vector &ps = data().weak_pointers;
if(pos == (int)(ps.size()-1)) { if(pos == (int)(ps.size()-1)) {
ps.pop_back(); ps.pop_back();
} else { } else {
ps[pos] = ps.back(); ps[pos] = ps.back();
#ifndef NDEBUG #ifndef NDEBUG
if(ps[pos].first->pos != (int)(ps.size()-1)) { if(ps[pos].first->pos != (int)(ps.size()-1)) {
throw mem_corrupt("weakpointer lost"); throw jcommon::RuntimeException("weakpointer lost");
} }
if(ps[pos].first->destroyed) { if(ps[pos].first->destroyed) {
throw mem_corrupt("weakpointer overwritten or double destructed"); throw jcommon::RuntimeException("weakpointer overwri tten or double destructed");
} }
#endif #endif
ps[pos].first->pos = pos; ps[pos].first->pos = pos;
ps.pop_back(); ps.pop_back();
} }
} }
// Register memory area in GC. Area must be freeable using supplied destroy function // Register memory area in GC. Area must be freeable using supplied destroy function
void reg(void *obj, size_t size, void (*destroy)(void*, void*, size_t)) void reg(void *obj, size_t size, void (*destroy)(void*, void*, size_t))
{ {
skipping to change at line 2926 skipping to change at line 2530
} }
} }
// If we actually allocated memory then we need to add it to the nod e map. // If we actually allocated memory then we need to add it to the nod e map.
try try
{ {
if (obj != 0) if (obj != 0)
{ {
node_t *node = new node_t(obj, size); node_t *node = new node_t(obj, size);
if(node == 0) if(node == 0)
throw bad_alloc(); throw std::bad_alloc();
data().new_nodes.push_back(node); data().new_nodes.push_back(node);
node->destroy = destroy; node->destroy = destroy;
node->object = const_cast<void*>(obj); node->object = const_cast<void*>(obj);
} }
} }
catch (...) catch (...)
{ {
// If inserting into the map failed simply throw // If inserting into the map failed simply throw
// a bad_reg exception. // a bad_reg exception.
throw bad_reg(); throw jcommon::RuntimeException("Bad reg exception");
} }
} }
bad_reg::~bad_reg() throw()
{
}
const char* bad_reg::what() const throw()
{
return "unable to register pointer in GC";
}
no_space::~no_space() throw()
{
}
const char* no_space::what() const throw()
{
return "out of pointer space";
}
mem_corrupt::mem_corrupt(const char *txt):
Exception("Memory corrupted exception")
{
msg = new char[strlen("GC detected memory corruption: ")+strlen(txt)
+1];
strcpy(msg, "GC detected memory corruption: ");
strcat(msg, txt);
}
mem_corrupt::~mem_corrupt() throw()
{
delete[] msg;
}
const char* mem_corrupt::what() const throw()
{
return msg;
}
#if (defined(_MSC_VER) && (_MSVC <= 1200)) || defined(_SMGC_POOR_STL) #if (defined(_MSC_VER) && (_MSVC <= 1200)) || defined(_SMGC_POOR_STL)
const size_t no_threshold = ~((size_t)0); const size_t no_threshold = ~((size_t)0);
#else #else
const size_t no_threshold = numeric_limits<size_t>::max(); const size_t no_threshold = std::numeric_limits<size_t>::max();
#endif #endif
const size_t default_threshold = (INT_MAX>=4194304*8)?4194304:(INT_MAX/8); const size_t default_threshold = (INT_MAX>=4194304*8)?4194304:(INT_MAX/8);
void collect() void collect()
{ {
data_lock lock; data_lock lock;
// During the sweep phase we'll be deleting objects that could cause // During the sweep phase we'll be deleting objects that could cause
// a recursive call to 'collect' which would cause invalid results. So // a recursive call to 'collect' which would cause invalid results. So
skipping to change at line 3259 skipping to change at line 2827
static less<T> cmp; static less<T> cmp;
ASSERT_PTR_VALID(l); ASSERT_PTR_VALID(l);
ASSERT_PTR_VALID(p); ASSERT_PTR_VALID(p);
return cmp(l.ptr, p.ptr); return cmp(l.ptr, p.ptr);
} }
}; };
#endif #endif
} }
#ifndef _SMGC_NO_PLACEMENT_NEW #ifndef _SMGC_NO_PLACEMENT_NEW
void* operator new(size_t s, const jcommon::gc_t&) throw (bad_alloc); void* operator new(size_t s, const jcommon::gc_t&) throw (std::bad_alloc);
void operator delete(void *obj, const jcommon::gc_t&) throw (); void operator delete(void *obj, const jcommon::gc_t&) throw ();
# ifndef _SMGC_NO_ARRAY_NEW #ifndef _SMGC_NO_ARRAY_NEW
void* operator new[](size_t s, const jcommon::gc_t&) throw (bad_alloc); void* operator new[](size_t s, const jcommon::gc_t&) throw (std::bad_alloc)
;
void operator delete[](void *obj, const jcommon::gc_t&) throw (); void operator delete[](void *obj, const jcommon::gc_t&) throw ();
#endif #endif
#endif #endif
#undef GC_INTERNAL #undef GC_INTERNAL
#endif
#ifndef _SMGC_NO_PLACEMENT_NEW #ifndef _SMGC_NO_PLACEMENT_NEW
void* operator new(size_t s, const jcommon::gc_t&) throw (bad_alloc) void* operator new(size_t s, const jcommon::gc_t&) throw (std::bad_alloc)
{ {
return gnew(s, jcommon::alloc_single); return gnew(s, jcommon::alloc_single);
} }
void operator delete(void *obj, const jcommon::gc_t&) throw () void operator delete(void *obj, const jcommon::gc_t&) throw ()
{ {
gfree(obj, jcommon::alloc_single); gfree(obj, jcommon::alloc_single);
} }
# ifndef _SMGC_NO_ARRAY_NEW #ifndef _SMGC_NO_ARRAY_NEW
void* operator new[](size_t s, const jcommon::gc_t&) throw (bad_alloc) void* operator new[](size_t s, const jcommon::gc_t&) throw (std::bad_alloc)
{ {
return gnew(s, jcommon::alloc_array); return gnew(s, jcommon::alloc_array);
} }
void operator delete[](void *obj, const jcommon::gc_t&) throw () void operator delete[](void *obj, const jcommon::gc_t&) throw ()
{ {
gfree(obj, jcommon::alloc_array); gfree(obj, jcommon::alloc_array);
} }
#endif #endif
#endif #endif
#endif
 End of changes. 63 change blocks. 
497 lines changed or deleted 62 lines changed or added


 jgfxhandler.h   jgfxhandler.h 
skipping to change at line 204 skipping to change at line 204
/** /**
* \brief * \brief
* *
*/ */
virtual Font * GetDefaultFont(); virtual Font * GetDefaultFont();
/** /**
* \brief * \brief
* *
*/ */
virtual int GetScreenWidth();
/**
* \brief
*
*/
virtual int GetScreenHeight();
/**
* \brief
*
*/
virtual void SetWorkingScreenSize(int width, int height); virtual void SetWorkingScreenSize(int width, int height);
/** /**
* \brief * \brief
* *
*/ */
virtual int GetScreenWidth(); virtual int GetWorkingScreenWidth();
/** /**
* \brief * \brief
* *
*/ */
virtual int GetScreenHeight(); virtual int GetWorkingScreenHeight();
/** /**
* \brief * \brief
* *
*/ */
virtual jpoint_t GetMousePosition(); virtual jpoint_t GetMousePosition();
/** /**
* \brief * \brief
* *
 End of changes. 3 change blocks. 
2 lines changed or deleted 14 lines changed or added


 jgraphics.h   jgraphics.h 
skipping to change at line 292 skipping to change at line 292
/** /**
* \brief * \brief
* *
*/ */
virtual ~Graphics(); virtual ~Graphics();
/** /**
* \brief * \brief
* *
*/ */
static bool GetImageSize(std::string img, int *width, int *h
eight);
/**
* \brief
*
*/
virtual void * GetNativeSurface(); virtual void * GetNativeSurface();
/** /**
* \brief * \brief
* *
*/ */
virtual void SetNativeSurface(void *surface); virtual void SetNativeSurface(void *surface);
/** /**
* \brief * \brief
skipping to change at line 340 skipping to change at line 346
/** /**
* \brief * \brief
* *
*/ */
virtual jpoint_t Translate(); virtual jpoint_t Translate();
/** /**
* \brief * \brief
* *
*/ */
virtual void SetClip(int x1, int y1, int width, int height); virtual void SetClip(int x, int y, int width, int height);
/** /**
* \brief * \brief
* *
*/ */
virtual jregion_t GetClip(); virtual jregion_t GetClip();
/** /**
* \brief * \brief
* *
skipping to change at line 592 skipping to change at line 598
/** /**
* \brief * \brief
* *
*/ */
virtual void DrawGlyph(int symbol, int xp, int yp); virtual void DrawGlyph(int symbol, int xp, int yp);
/** /**
* \brief * \brief
* *
*/ */
virtual bool GetImageSize(std::string img, int *real_width,
int *real_height, int *scaled_width, int *scaled_height);
/**
* \brief
*
*/
virtual bool DrawImage(std::string img, int x, int y, int al pha = 0xff); virtual bool DrawImage(std::string img, int x, int y, int al pha = 0xff);
/** /**
* \brief * \brief
* *
*/ */
virtual bool DrawImage(std::string img, int x, int y, int w, int h, int alpha = 0xff); virtual bool DrawImage(std::string img, int x, int y, int w, int h, int alpha = 0xff);
/** /**
* \brief * \brief
 End of changes. 3 change blocks. 
8 lines changed or deleted 8 lines changed or added


 jguilib.h   jguilib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_GUILIB_H #ifndef J_GUILIB_H
#define J_GUILIB_H #define J_GUILIB_H
#include "jadjustmentevent.h"
#include "jadjustmentlistener.h"
#include "janimation.h"
#include "jborderlayout.h"
#include "jbutton.h"
#include "jbuttonevent.h"
#include "jbuttonlistener.h"
#include "jcalendardialogbox.h"
#include "jcalendarevent.h"
#include "jcalendarlistener.h"
#include "jcanvas.h"
#include "jcardlayout.h"
#include "jcheckbutton.h"
#include "jcheckbuttonevent.h"
#include "jcheckbuttongroup.h"
#include "jcheckbuttonlistener.h"
#include "jcombobox.h"
#include "jcomponent.h"
#include "jcomponentevent.h"
#include "jcomponentlistener.h"
#include "jcontainer.h"
#include "jcontainerevent.h"
#include "jcontainerlistener.h"
#include "jcoordinatelayout.h"
#include "jfilechooserdialogbox.h"
#include "jflowlayout.h"
#include "jfocusevent.h"
#include "jfocuslistener.h"
#include "jfont.h"
#include "jframe.h"
#include "jframeinputlistener.h"
#include "jgfxhandler.h"
#include "jgraphics.h"
#include "jgridbaglayout.h"
#include "jgridlayout.h"
#include "jicon.h"
#include "jimagebutton.h"
#include "jinputdialogbox.h"
#include "jinputmanager.h"
#include "jitemcomponent.h"
#include "jkeyboard.h"
#include "jkeyboardevent.h"
#include "jkeyboardlistener.h"
#include "jkeyevent.h"
#include "jkeylistener.h"
#include "jlabel.h"
#include "jlayout.h"
#include "jlistbox.h"
#include "jmarquee.h"
#include "jmenu.h"
#include "jmenugroup.h"
#include "jmessagedialogbox.h"
#include "jmouseevent.h"
#include "jmouselistener.h"
#include "jnullgraphics.h"
#include "jnulllayout.h"
#include "joffscreenimage.h"
#include "jpanel.h"
#include "jprogressbar.h"
#include "jscrollbar.h"
#include "jscrollpane.h"
#include "jselectevent.h"
#include "jselectlistener.h"
#include "jslider.h"
#include "jspin.h"
#include "jtable.h"
#include "jtextarea.h"
#include "jtextcomponent.h"
#include "jtextdialogbox.h"
#include "jtextevent.h"
#include "jtextfield.h"
#include "jtextlistener.h"
#include "jtheme.h"
#include "jthemeevent.h"
#include "jthemelistener.h"
#include "jthememanager.h"
#include "jtooglebutton.h"
#include "jtree.h"
#include "jwatch.h"
#include "jwindow.h"
#include "jwindowevent.h"
#include "jwindowlistener.h"
#include "jwindowmanager.h"
#include "jyesnodialogbox.h"
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 85 lines changed or added


 jimagebutton.h   jimagebutton.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_IMAGEBUTTON_H #ifndef J_IMAGEBUTTON_H
#define J_IMAGEBUTTON_H #define J_IMAGEBUTTON_H
#include "jbutton.h" #include "jbutton.h"
#include "joffscreenimage.h" #include "joffscreenimage.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class ButtonListener; class ButtonListener;
class ButtonEvent; class ButtonEvent;
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class ImageButton : public Button{ class ImageButton : public Button{
protected: protected:
OffScreenImage *prefetch1, OffScreenImage *_image_icon,
*prefetch2; *_image_focus_icon;
std::string _image, std::string _image,
_image_focus; _image_focus;
public: public:
/** /**
* \brief * \brief
* *
*/ */
ImageButton(std::string label, std::string image, int x = 0, int y = 0, int width = DEFAULT_COMPONENT_WIDTH, int height = DEFAULT_COMPO NENT_HEIGHT); ImageButton(std::string label, std::string image, int x = 0, int y = 0, int width = DEFAULT_COMPONENT_WIDTH, int height = DEFAULT_COMPO NENT_HEIGHT);
 End of changes. 2 change blocks. 
4 lines changed or deleted 2 lines changed or added


 jindexedbuffer.h   jindexedbuffer.h 
skipping to change at line 66 skipping to change at line 66
* *
*/ */
struct jringbuffer_t { struct jringbuffer_t {
uint8_t *data; // buffer uint8_t *data; // buffer
int size; // size of buffer int size; // size of buffer
}; };
/** /**
* \brief IndexedBuffer. * \brief IndexedBuffer.
* *
* WARNNING:: add -DSINGLE_WAIT_CONDITION to Makefile flags
*
* @author Jeff Ferr * @author Jeff Ferr
*/ */
class IndexedBuffer : public virtual jcommon::Object{ class IndexedBuffer : public virtual jcommon::Object{
private: private:
/** \brief */ /** \brief */
jringbuffer_t *_buffer; jringbuffer_t *_buffer;
/** \brief */ /** \brief */
int _buffer_size; int _buffer_size;
/** \brief */ /** \brief */
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jinetaddress.h   jinetaddress.h 
skipping to change at line 32 skipping to change at line 32
#include "jobject.h" #include "jobject.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock2.h>
#elif __CYGWIN32__ #elif __CYGWIN32__
#include <netdb.h> #include <netdb.h>
#include <cygwin/socket.h> #include <cygwin/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#else #else
#include <netdb.h> #include <netdb.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
namespace jsocket { namespace jsocket {
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 jinputdialogbox.h   jinputdialogbox.h 
skipping to change at line 38 skipping to change at line 38
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jdate.h" #include "jdate.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class InputDialogBox : public jgui::Frame, public jgui::ButtonListener{ class InputDialogBox : public jgui::Frame, public jgui::ButtonListener{
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jinputmanager.h   jinputmanager.h 
skipping to change at line 176 skipping to change at line 176
* \brief * \brief
* *
*/ */
int TranslateToDFBKeyID(DFBInputDeviceKeyIdentifier id); int TranslateToDFBKeyID(DFBInputDeviceKeyIdentifier id);
/** /**
* \brief * \brief
* *
*/ */
jkey_symbol_t TranslateToDFBKeySymbol(DFBInputDeviceKeySymbo l symbol); jkey_symbol_t TranslateToDFBKeySymbol(DFBInputDeviceKeySymbo l symbol);
/**
* \brief
*
*/
void ProcessInputEvent(DFBInputEvent event);
/**
* \brief
*
*/
void ProcessWindowEvent(DFBWindowEvent event);
#endif #endif
public: public:
/** /**
* \brief * \brief
* *
*/ */
virtual ~InputManager(); virtual ~InputManager();
/** /**
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added


 jinputstream.h   jinputstream.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_INPUTSTREAM_H #ifndef J_INPUTSTREAM_H
#define J_INPUTSTREAM_H #define J_INPUTSTREAM_H
#include "jinputstream.h"
#include "jobject.h" #include "jobject.h"
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
namespace jio { namespace jio {
/** /**
* \brief * \brief
* *
skipping to change at line 99 skipping to change at line 98
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t GetPosition() = 0; virtual int64_t GetPosition() = 0;
/** /**
* \brief * \brief
* *
*/ */
virtual int Read() = 0; virtual int64_t Read() = 0;
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Read(char *, int64_t size) = 0; virtual int64_t Read(char *, int64_t size) = 0;
/** /**
* \brief * \brief
* *
*/ */
virtual std::string Read(int size); virtual std::string Read(int64_t size);
/** /**
* \brief Salto relativo. * \brief Salto relativo.
* *
*/ */
virtual void Skip(int64_t skip) = 0; virtual void Skip(int64_t skip) = 0;
/** /**
* \brief * \brief
* *
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added


 jiolib.h   jiolib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_IOLIB_H #ifndef J_IOLIB_H
#define J_IOLIB_H #define J_IOLIB_H
#include "jbitinputstream.h"
#include "jbitoutputstream.h"
#include "jbufferedreader.h"
#include "jchannel.h"
#include "jdatainputstream.h"
#include "jdataoutputstream.h"
#include "jfile.h"
#include "jfileexception.h"
#include "jfileinputstream.h"
#include "jfileoutputstream.h"
#include "jinputstream.h"
#include "jioexception.h"
#include "jmemoryinputstream.h"
#include "jmemoryoutputstream.h"
#include "jobjectinputstream.h"
#include "jobjectoutputstream.h"
#include "joutputstream.h"
#include "jpipeexception.h"
#include "jpipestream.h"
#include "jprintstream.h"
#include "jserializable.h"
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 22 lines changed or added


 jitemcomponent.h   jitemcomponent.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_ITEMCOMPONENT_H #ifndef J_ITEMCOMPONENT_H
#define J_ITEMCOMPONENT_H #define J_ITEMCOMPONENT_H
#include "jcomponent.h" #include "jcomponent.h"
#include "joffscreenimage.h" #include "joffscreenimage.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h> #include <stdio.h>
#define DEFAULT_ITEM_SIZE 48 #define DEFAULT_ITEM_SIZE 48
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 jkeyboard.h   jkeyboard.h 
skipping to change at line 38 skipping to change at line 38
#include "jframe.h" #include "jframe.h"
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jkeyboard_type_t { enum jkeyboard_type_t {
FULL_ALPHA_NUMERIC_KEYBOARD, FULL_ALPHA_NUMERIC_KEYBOARD,
SMALL_ALPHA_NUMERIC_KEYBOARD, SMALL_ALPHA_NUMERIC_KEYBOARD,
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jkeyboardevent.h   jkeyboardevent.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_KEYBOARDEVENT_H #ifndef J_KEYBOARDEVENT_H
#define J_KEYBOARDEVENT_H #define J_KEYBOARDEVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include "jbutton.h" #include "jbutton.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class KeyboardEvent : public jcommon::EventObject{ class KeyboardEvent : public jcommon::EventObject{
private: private:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jkeyboardlistener.h   jkeyboardlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_KEYBOARDLISTENER_H #ifndef J_KEYBOARDLISTENER_H
#define J_KEYBOARDLISTENER_H #define J_KEYBOARDLISTENER_H
#include "jkeyboardevent.h" #include "jkeyboardevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class KeyboardListener : public jcommon::Listener{ class KeyboardListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jkeyevent.h   jkeyevent.h 
skipping to change at line 32 skipping to change at line 32
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jkey_type_t { enum jkey_type_t {
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 jlabel.h   jlabel.h 
skipping to change at line 28 skipping to change at line 28
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_LABEL_H #ifndef J_LABEL_H
#define J_LABEL_H #define J_LABEL_H
#include "jcomponent.h" #include "jcomponent.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class ButtonListener; class ButtonListener;
class ButtonEvent; class ButtonEvent;
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jlistbox.h   jlistbox.h 
skipping to change at line 36 skipping to change at line 36
#include "joffscreenimage.h" #include "joffscreenimage.h"
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jlist_scroll_type_t { enum jlist_scroll_type_t {
NONE_SCROLL, NONE_SCROLL,
SCROLL_ARROW, SCROLL_ARROW,
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jloggerlib.h   jloggerlib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_LOGGERLIB_H #ifndef J_LOGGERLIB_H
#define J_LOGGERLIB_H #define J_LOGGERLIB_H
#include "jconsolehandler.h"
#include "jfilehandler.h"
#include "jformatter.h"
#include "jhandler.h"
#include "jlogger.h"
#include "jloggerexception.h"
#include "jloggermanager.h"
#include "jlogrecord.h"
#include "jmemoryhandler.h"
#include "jsimpleformatter.h"
#include "jsockethandler.h"
#include "jstreamhandler.h"
#include "jxmlformatter.h"
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 14 lines changed or added


 jmarquee.h   jmarquee.h 
skipping to change at line 38 skipping to change at line 38
#include "jtextlistener.h" #include "jtextlistener.h"
#include "jcomponent.h" #include "jcomponent.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jmarquee_type_t { enum jmarquee_type_t {
LOOP_TEXT, LOOP_TEXT,
BOUNCE_TEXT BOUNCE_TEXT
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 jmemoryinputstream.h   jmemoryinputstream.h 
skipping to change at line 85 skipping to change at line 85
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t GetPosition(); virtual int64_t GetPosition();
/** /**
* \brief * \brief
* *
*/ */
virtual int Read(); virtual int64_t Read();
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Read(char *, int64_t size); virtual int64_t Read(char *, int64_t size);
/** /**
* \brief Salto relativo. * \brief Salto relativo.
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 jmemorymap.h   jmemorymap.h 
skipping to change at line 28 skipping to change at line 28
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_MEMORYMAP_H #ifndef J_MEMORYMAP_H
#define J_MEMORYMAP_H #define J_MEMORYMAP_H
#include "jobject.h" #include "jobject.h"
#include <iostream> #include <iostream>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
#ifdef _WIN32
#else
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#endif
namespace jshared { namespace jshared {
enum jmemory_perms_t { enum jmemory_perms_t {
MEM_EXEC = 0x01, MEM_EXEC = 0x01,
MEM_READ = 0x02, MEM_READ = 0x02,
MEM_WRITE = 0x04, MEM_WRITE = 0x04,
MEM_READ_WRITE = 0x08, MEM_READ_WRITE = 0x08,
MEM_NONE = 0x10 MEM_NONE = 0x10
}; };
skipping to change at line 68 skipping to change at line 60
/** /**
* \brief Socket. * \brief Socket.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class MemoryMap : public virtual jcommon::Object{ class MemoryMap : public virtual jcommon::Object{
private: private:
#ifdef _WIN32 #ifdef _WIN32
/** \brief Socket handler. */ /** \brief Socket handler. */
HANDLE _fd; HANDLE _fd;
#else #else
/** \brief Socket handler. */ /** \brief Socket handler. */
int _fd; int _fd;
#endif #endif
/** \brief */ /** \brief */
void *_start; struct stat _stats;
/** \brief */ /** \brief */
std::string _filename; void *_start;
/** \brief */ /** \brief */
bool _is_open; std::string _filename;
/** \brief */ /** \brief */
int _timeout; int _timeout;
/** \brief */ /** \brief */
struct stat _stats; jmemory_perms_t _perms;
/** \brief */ /** \brief */
jmemory_perms_t _perms; bool _is_open;
public: public:
/** /**
* \brief Constructor. * \brief Constructor.
* *
*/ */
MemoryMap(std::string sharedfile_, jmemory_flags_t flags_ = MemoryMap(std::string sharedfile_, jmemory_flags_t f
MEM_OPEN, jmemory_perms_t perms_ = MEM_READ_WRITE, bool private_ = true); lags_ = MEM_OPEN, jmemory_perms_t perms_ = MEM_READ_WRITE, bool private_ =
true);
/** /**
* \brief Constructor. * \brief Constructor.
* *
*/ */
MemoryMap(std::string sharedfile_); MemoryMap(std::string sharedfile_);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~MemoryMap(); virtual ~MemoryMap();
/** /**
* \brief * \brief
* *
*/ */
long long Get(char *data_, int size_, int offset_); int64_t Get(char *data_, int64_t size_, int64_t offs
et_);
/** /**
* \brief * \brief
* *
*/ */
long long Put(const char *data_, int size_, int offset_); int64_t Put(const char *data_, int64_t size_, int64_
t offset_);
/** /**
* \brief * \brief
* *
*/ */
void SetPermission(jmemory_perms_t perms_); void SetPermission(jmemory_perms_t perms_);
/** /**
* \brief * \brief
* *
*/ */
long long GetSize(); int64_t GetSize();
/** /**
* \brief * \brief
* *
*/ */
void Release(); void Release();
}; };
} }
#endif #endif
 End of changes. 15 change blocks. 
69 lines changed or deleted 64 lines changed or added


 jmemoryoutputstream.h   jmemoryoutputstream.h 
skipping to change at line 73 skipping to change at line 73
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Available(); virtual int64_t Available();
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(int b); virtual int64_t Write(int64_t b);
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Write(char *, int64_t size); virtual int64_t Write(char *, int64_t size);
/** /**
* \brief * \brief
* *
skipping to change at line 97 skipping to change at line 97
/** /**
* \brief * \brief
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
*/ */
int64_t GetSentBytes(); virtual int64_t GetSentBytes();
}; };
} }
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 jmenu.h   jmenu.h 
skipping to change at line 35 skipping to change at line 35
#include "joffscreenimage.h" #include "joffscreenimage.h"
#include "jmouselistener.h" #include "jmouselistener.h"
#include "jitemcomponent.h" #include "jitemcomponent.h"
#include "jthememanager.h" #include "jthememanager.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jmenu_align_t { enum jmenu_align_t {
MENU_ALIGN, MENU_ALIGN,
SUBMENU_ALIGN SUBMENU_ALIGN
skipping to change at line 67 skipping to change at line 65
jthread::Mutex _menu_mutex; jthread::Mutex _menu_mutex;
jthread::Condition _menu_sem; jthread::Condition _menu_sem;
std::vector<Menu *> _menus; std::vector<Menu *> _menus;
jgui::Frame *_frame; jgui::Frame *_frame;
jgui::OffScreenImage *prefetch; jgui::OffScreenImage *prefetch;
jmenu_align_t _menu_align; jmenu_align_t _menu_align;
std::string _title; std::string _title;
int _top_index, int _top_index,
_item_size, _item_size,
_visible_items, _visible_items;
_centered_interaction; bool _centered_interaction;
private: private:
/** /**
* \brief * \brief
* *
*/ */
virtual void MousePressed(MouseEvent *event); virtual void MousePressed(MouseEvent *event);
/** /**
* \brief * \brief
skipping to change at line 136 skipping to change at line 134
/** /**
* \brief * \brief
* *
*/ */
virtual void SetLocation(int x, int y); virtual void SetLocation(int x, int y);
/** /**
* \brief * \brief
* *
*/ */
virtual void SetSize(int w, int h); virtual void SetSize(int width, int height);
/** /**
* \brief * \brief
* *
*/ */
virtual void Move(int x, int y); virtual void Move(int x, int y);
/** /**
* \brief * \brief
* *
 End of changes. 3 change blocks. 
5 lines changed or deleted 3 lines changed or added


 jmessagedialogbox.h   jmessagedialogbox.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_MESSAGEDIALOGBOX_H #ifndef J_MESSAGEDIALOGBOX_H
#define J_MESSAGEDIALOGBOX_H #define J_MESSAGEDIALOGBOX_H
#include "jbutton.h" #include "jbutton.h"
#include "jbuttonlistener.h" #include "jbuttonlistener.h"
#include "jlabel.h" #include "jlabel.h"
#include "jframe.h" #include "jframe.h"
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jdate.h" #include "jdate.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class MessageDialogBox : public jgui::Frame, public jgui::ButtonListener{ class MessageDialogBox : public jgui::Frame, public jgui::ButtonListener{
 End of changes. 2 change blocks. 
3 lines changed or deleted 0 lines changed or added


 jmessagequeue.h   jmessagequeue.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_MESSAGEQUEUE_H #ifndef J_MESSAGEQUEUE_H
#define J_MESSAGEQUEUE_H #define J_MESSAGEQUEUE_H
#include "jobject.h" #include "jobject.h"
#include <iostream>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h>
#include <winsock.h>
#else #else
#include <sys/stat.h> #include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/msg.h> #include <sys/msg.h>
#include <sys/socket.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
#define MAX_PACKET_SIZE 256 #define MAX_PACKET_SIZE 256
namespace jshared { namespace jshared {
struct jpage_msg_t { struct jpage_msg_t {
long mtype; long mtype;
char msg[MAX_PACKET_SIZE]; char msg[MAX_PACKET_SIZE];
}; };
 End of changes. 5 change blocks. 
7 lines changed or deleted 1 lines changed or added


 jmonitor.h   jmonitor.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_MONITOR_H #ifndef J_MONITOR_H
#define J_MONITOR_H #define J_MONITOR_H
#include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jsemaphore.h"
#include <map>
namespace jthread { namespace jthread {
/** struct jmonitor_map_t {
* \brief Monitor. Condition sem;
* bool signalled;
* @author Jeff Ferr };
*/
class Monitor : public virtual jcommon::Object{
public: class Monitor {
private:
jmonitor_map_t * GetCurrentThread();
protected:
/** \brief */ /** \brief */
Mutex *mutex; Mutex _mutex;
/** \brief */ /** \brief */
int state; jmonitor_map_t *_holder;
/** \brief */
int _lock_count;
/** \brief */
std::vector<jmonitor_map_t *> waitQ,
readyQ;
public: #ifdef _WIN32
std::map<HANDLE, jmonitor_map_t *> threadQ;
#else
std::map<pthread_t, jmonitor_map_t *> threadQ;
#endif
protected:
/** /**
* \brief * \brief
* *
*/ */
Monitor(): Monitor(const Monitor&);
jcommon::Object()
{
jcommon::Object::SetClassName("jthread::Monitor");
state = 0; /**
mutex = NULL; * \brief
} *
*/
Monitor & operator=(const Monitor&);
/** /**
* \brief * \brief
* *
*/ */
virtual ~Monitor() void GrantMonitor();
{
if ((void *)mutex != NULL) {
mutex->Unlock();
}
}
}; public:
/**
* \brief Creates a Monitor Object.
*
*/
explicit Monitor();
inline Mutex * cast2mutex(const int v) /**
{ * \brief Destroys a Monitor object.
return (Mutex *)v; *
} */
virtual ~Monitor();
inline Mutex * cast2mutex(Mutex *V) /**
{ * \brief Requests a lock on the Monitor object. Will block
return V; if Lock is not available.
} *
*/
void Enter();
} /**
* \brief Requests a lock on the Monitor object. Will retur
n false if Lock is not
* available. Returns true if lock was acquired.
*
*/
bool TryEnter();
jthread::Mutex mutexmonitormutex; /**
* \brief Requester must be a holder of the lock. If the Unl
ock succeeds, the lock is
* granted to the oldest waiting thread on the ReadyQ.
*
*/
void Exit();
#define monitor(mvar) /**
\ * \brief Requester must be a holder of the lock. The lock i
for(jthread::Monitor mutexmonitor; s released and requester put
\ * to sleep until the Monitor is signalled. Lock is re-acqui
mutexmonitor.state<2; \ red before control returns to
mutexmonitor.state++) \ * the caller.
*/
void Wait();
\
if (mutexmonitor.state==0) \ /**
{ \ * \brief Requester must be a holder of the lock. The lock i
if ((mvar)!=0) { s released and requester put
\ * to sleep until the Monitor is signalled or the timeout ex
mutexmonitor.mutex=jthread::cast2mutex(mvar); \ pires. Lock is re-acquired
jthread::cast2mutex(mvar)->Lock(); * before control returns to the caller.
\ */
} else { bool Wait(uint64_t secs);
\ /**
static jthread::Mutex *mutex; * \brief Signals and wakes up one thread waiting on the Mon
\ itor object. The thread woken
static bool firsttime=true; \ * up may not be the one signalled.
if (firsttime) { \ *
mutexmonitormutex.Lock(); */
\ void Notify();
static jthread::Mutex smutex; /* Complier makes su
re that static */ \ /**
mutexmonitormutex.Unlock(); /* vars are * \brief Signalls all waiting threads and wakes up one thre
initialized once */ \ ad.
mutex=&smutex; */
/* We make sure that only one thread */ \ void NotifyAll();
firsttime=false;
/* can attempt initialization at a time */ \ };
} \
mutexmonitor.mutex=mutex; \ }
mutex->Lock(); \
};
\
} else
#endif #endif
 End of changes. 16 change blocks. 
74 lines changed or deleted 101 lines changed or added


 jmouseevent.h   jmouseevent.h 
skipping to change at line 32 skipping to change at line 32
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jmouse_event_t { enum jmouse_event_t {
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 jmpegexception.h   jmpegexception.h 
skipping to change at line 20 skipping to change at line 20
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_RUNTIMEEXCEPTION_H #ifndef J_MPEGEXCEPTION_H
#define J_RUNTIMEEXCEPTION_H #define J_MPEGEXCEPTION_H
#include "jexception.h"
#include <stdexcept> #include "jruntimeexception.h"
#include <string>
namespace jcommon { namespace jcommon {
/** /**
* \brief Exception. * \brief Exception.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class MpegException : public jcommon::Exception, std::runtime_error{ class MpegException : public jcommon::RuntimeException{
private: private:
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
MpegException(std::string reason); MpegException(std::string reason);
/**
* \brief Destrutor virtual.
*
*/
virtual ~MpegException() throw();
/** /**
* \brief * \brief Destrutor virtual.
* *
*/ */
virtual std::string what(); virtual ~MpegException() throw();
}; };
} }
#endif #endif
 End of changes. 5 change blocks. 
23 lines changed or deleted 14 lines changed or added


 jmpeglib.h   jmpeglib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_MPEGLIB_H #ifndef J_MPEGLIB_H
#define J_MPEGLIB_H #define J_MPEGLIB_H
#include "jadaptationfield.h"
#include "jmpegexception.h"
#include "jprogramassociationsection.h"
#include "jprogramassociationtable.h"
#include "jprogramelementarystreamsection.h"
#include "jprogrammapsection.h"
#include "jprogramsysteminformationsection.h"
#include "jprogramsysteminformationtable.h"
#include "jsection.h"
#include "jtransportstreampacket.h"
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 11 lines changed or added


 jmulticastsocket.h   jmulticastsocket.h 
skipping to change at line 225 skipping to change at line 225
* *
*/ */
void SetMulticastTTL(char ttl_); void SetMulticastTTL(char ttl_);
/** /**
* \brief * \brief
* *
*/ */
SocketOption * GetSocketOption(); SocketOption * GetSocketOption();
/**
* \brief
*
*/
std::string what();
}; };
} }
#endif #endif
 End of changes. 1 change blocks. 
6 lines changed or deleted 0 lines changed or added


 jmutex.h   jmutex.h 
skipping to change at line 55 skipping to change at line 55
PROTECT_PROT_MUTEX PROTECT_PROT_MUTEX
}; };
/** /**
* \brief Monitor. * \brief Monitor.
* *
* @author Jeff Ferr * @author Jeff Ferr
*/ */
class Mutex : public virtual jcommon::Object{ class Mutex : public virtual jcommon::Object{
friend class Condition; friend class Condition;
friend class Event;
private: private:
#ifdef _WIN32 #ifdef _WIN32
HANDLE _mutex; CRITICAL_SECTION _mutex;
#else #else
/** \brief */ /** \brief */
pthread_mutex_t _mutex; pthread_mutex_t _mutex;
#endif #endif
/** \brief */ /** \brief */
jmutex_type_t _type; jmutex_type_t _type;
/** \brief */ /** \brief */
int _lock_count; int _lock_count;
public: public:
skipping to change at line 106 skipping to change at line 107
* *
*/ */
void Unlock(); void Unlock();
/** /**
* \brief Try lock the critical section. * \brief Try lock the critical section.
* *
*/ */
bool TryLock(); bool TryLock();
/**
* \brief
*
*/
std::string what();
}; };
} }
#endif #endif
 End of changes. 3 change blocks. 
7 lines changed or deleted 3 lines changed or added


 jnullgraphics.h   jnullgraphics.h 
skipping to change at line 77 skipping to change at line 77
/** /**
* \brief * \brief
* *
*/ */
virtual OffScreenImage * Create(); virtual OffScreenImage * Create();
/** /**
* \brief * \brief
* *
*/ */
virtual void SetClip(int x1, int y1, int width, int height); virtual void SetClip(int x, int y, int width, int height);
/** /**
* \brief * \brief
* *
*/ */
virtual jregion_t GetClipBounds(); virtual jregion_t GetClipBounds();
/** /**
* \brief * \brief
* *
skipping to change at line 371 skipping to change at line 371
/** /**
* \brief * \brief
* *
*/ */
virtual void DrawGlyph(int symbol, int xp, int yp); virtual void DrawGlyph(int symbol, int xp, int yp);
/** /**
* \brief * \brief
* *
*/ */
virtual bool GetImageSize(std::string img, int *real_width,
int *real_height, int *scaled_width, int *scaled_height);
/**
* \brief
*
*/
virtual bool DrawImage(std::string img, int x, int y, int al pha = 0xff); virtual bool DrawImage(std::string img, int x, int y, int al pha = 0xff);
/** /**
* \brief * \brief
* *
*/ */
virtual bool DrawImage(std::string img, int x, int y, int w, int h, int alpha = 0xff); virtual bool DrawImage(std::string img, int x, int y, int w, int h, int alpha = 0xff);
/** /**
* \brief * \brief
 End of changes. 2 change blocks. 
8 lines changed or deleted 1 lines changed or added


 jobjectoutputstream.h   jobjectoutputstream.h 
skipping to change at line 66 skipping to change at line 66
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Available(); virtual int64_t Available();
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(Object *object); virtual int64_t Write(Object *object);
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Flush(); virtual int64_t Flush();
/** /**
* \brief * \brief
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
*/ */
int64_t GetSentBytes(); virtual int64_t GetSentBytes();
}; };
} }
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 joutputstream.h   joutputstream.h 
skipping to change at line 92 skipping to change at line 92
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t GetSize() = 0; virtual int64_t GetSize() = 0;
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(int b) = 0; virtual int64_t Write(int64_t b) = 0;
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Write(const char *, int64_t size) = 0; virtual int64_t Write(const char *, int64_t size) = 0;
/** /**
* \brief * \brief
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 jpanel.h   jpanel.h 
skipping to change at line 28 skipping to change at line 28
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_PANEL_H #ifndef J_PANEL_H
#define J_PANEL_H #define J_PANEL_H
#include "jcontainer.h" #include "jcontainer.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Panel : public Container{ class Panel : public Container{
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jpipe.h   jpipe.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_PIPE_H #ifndef J_PIPE_H
#define J_PIPE_H #define J_PIPE_H
#include "jobject.h" #include "jobject.h"
#include <iostream> #include <iostream>
#ifdef _WIN32
#include <windows.h>
#include <winsock.h>
#else
#include <sys/socket.h>
#endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jshared { namespace jshared {
/** /**
* \brief Socket. * \brief Socket.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Pipe : public virtual jcommon::Object{ class Pipe : public virtual jcommon::Object{
 End of changes. 1 change blocks. 
8 lines changed or deleted 0 lines changed or added


 jprintstream.h   jprintstream.h 
skipping to change at line 63 skipping to change at line 63
/** /**
* \brief * \brief
* *
*/ */
void Flush(); void Flush();
/** /**
* \brief * \brief
* *
*/ */
int Write(char c); int64_t Write(char c);
/** /**
* \brief * \brief
* *
*/ */
int Write(char *, int size); int64_t Write(char *, int size);
}; };
} }
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 jprivateprocess.h   jprivateprocess.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_PRIVATEPROCESS_H #ifndef J_PRIVATEPROCESS_H
#define J_PRIVATEPROCESS_H #define J_PRIVATEPROCESS_H
#include "jobject.h" #include "jobject.h"
#include <iostream> #include <iostream>
#ifdef _WIN32
#include <windows.h>
#include <winsock.h>
#else
#include <sys/socket.h>
#endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jshared { namespace jshared {
enum jprocess_flag_t { enum jprocess_flag_t {
PROCESS_BLOCKING, /** \brief Create a new process */ PROCESS_BLOCKING, /** \brief Create a new process */
PROCESS_NONBLOCK /** \brief Create a new process and block pa rent */ PROCESS_NONBLOCK /** \brief Create a new process and block pa rent */
}; };
enum jprocess_type_t { enum jprocess_type_t {
skipping to change at line 100 skipping to change at line 92
/** /**
* \brief * \brief
* *
*/ */
void WaitProcess(); void WaitProcess();
/** /**
* \brief * \brief
* *
*/ */
#ifdef _WIN32
HANDLE GetPID();
#else
pid_t GetPID(); pid_t GetPID();
#endif
/** /**
* \brief * \brief
* *
*/ */
#ifdef _WIN32
HANDLE GetParentPID();
#else
pid_t GetParentPID(); pid_t GetParentPID();
#endif
/** /**
* \brief * \brief
* *
*/ */
bool IsRunning(); bool IsRunning();
/** /**
* \brief * \brief
* *
 End of changes. 5 change blocks. 
8 lines changed or deleted 8 lines changed or added


 jprogressbar.h   jprogressbar.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_PROGRESSBAR_H #ifndef J_PROGRESSBAR_H
#define J_PROGRESSBAR_H #define J_PROGRESSBAR_H
#include "jcomponent.h" #include "jcomponent.h"
#include "jthread.h" #include "jthread.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jprogress_type_t { enum jprogress_type_t {
BOTTOM_UP_DIRECTION, BOTTOM_UP_DIRECTION,
LEFT_RIGHT_DIRECTION LEFT_RIGHT_DIRECTION
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jproperties.h   jproperties.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_PROPERTIES_H #ifndef J_PROPERTIES_H
#define J_PROPERTIES_H #define J_PROPERTIES_H
#include "jobject.h" #include "jmutex.h"
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <map> #include <map>
namespace jcommon { namespace jcommon {
struct jproperty_t { struct jproperty_t {
std::string key; std::string key;
std::string value; std::string value;
skipping to change at line 46 skipping to change at line 46
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Properties : public virtual jcommon::Object{ class Properties : public virtual jcommon::Object{
private: private:
/** \brief */ /** \brief */
jthread::Mutex _mutex;
/** \brief */
std::map<std::string, std::string> _props; std::map<std::string, std::string> _props;
/** \brief */ /** \brief */
std::vector<struct jproperty_t> properties; std::vector<struct jproperty_t> properties;
/** \brief */ /** \brief */
std::string _filename; std::string _filename;
/** \brief */ /** \brief */
std::string _escape; std::string _escape;
/** /**
* \brief Construtor default. * \brief Construtor default.
skipping to change at line 101 skipping to change at line 103
/** /**
* \brief * \brief
* *
*/ */
void Save(std::string escape = "="); void Save(std::string escape = "=");
/** /**
* \brief * \brief
* *
*/ */
std::vector<std::string> GetProperties(); void SetPropertyByName(std::string key, std::string value);
/** /**
* \brief * \brief
* *
*/ */
std::string GetProperty(std::string key, std::string reserv = std::string("")); void SetPropertyByIndex(int index, std::string value);
/** /**
* \brief * \brief
* *
*/ */
void SetProperty(std::string key, std::string value); std::string GetPropertyByName(std::string key, std::string r
eserv = std::string(""));
/**
* \brief
*
*/
std::string GetPropertyByIndex(int index, std::string reserv
= std::string(""));
/**
* \brief
*
*/
void RemovePropertyByName(std::string key);
/**
* \brief
*
*/
void RemovePropertyByIndex(int index);
/**
* \brief
*
*/
std::vector<std::string> * GetProperties();
}; };
} }
#endif #endif
 End of changes. 5 change blocks. 
4 lines changed or deleted 32 lines changed or added


 jrawsocket.h   jrawsocket.h 
skipping to change at line 46 skipping to change at line 46
#include <winsock.h> #include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/ip.h> #include <netinet/ip.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <net/if.h> #include <net/if.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jsocket { namespace jsocket {
/** /**
* \brief * \brief
* *
*/ */
struct jip_hdr_t { struct jip_hdr_t {
unsigned int ip_hl:4, unsigned int ip_hl:4,
 End of changes. 2 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jregexp.h   jregexp.h 
skipping to change at line 24 skipping to change at line 24
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
a************************************************************************* **/ a************************************************************************* **/
#ifndef J_REGEXP_H #ifndef J_REGEXP_H
#define J_REGEXP_H #define J_REGEXP_H
#include "jobject.h" #include "jobject.h"
#include "jcompileexception.h"
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <list> #include <list>
#include <vector> #include <vector>
#include <map> #include <map>
#include <climits> #include <climits>
#include <memory> #include <memory>
skipping to change at line 126 skipping to change at line 125
virtual bool is_valid() const = 0; virtual bool is_valid() const = 0;
//! Used for owned objects manipulation, redefined in \ref b asic_object_parser //! Used for owned objects manipulation, redefined in \ref b asic_object_parser
virtual void invalidate() = 0; virtual void invalidate() = 0;
/* /*
* \brief The parse method using which the input buffer is s earched and the value * \brief The parse method using which the input buffer is s earched and the value
* is copied from buffer into parsed objects manipulated by \ref * is copied from buffer into parsed objects manipulated by \ref
* basic_object_parser. For parse method is used different i mplementation * basic_object_parser. For parse method is used different i mplementation
* depending on type of parser - if terminal_type, non_termi nal_type or choice_type. * depending on type of parser - if terminal_type, non_termi nal_type or choice_type.
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ) = 0; virtual uint64_t parse( const E *buf, const uint64_t buf_len gth ) = 0;
/* /*
* \brief The parse method using which the input stream is s earched and the value * \brief The parse method using which the input stream is s earched and the value
* is copied from buffer into parsed objects manipulated by \ref basic_object_parser. * is copied from buffer into parsed objects manipulated by \ref basic_object_parser.
* For parse method is used different implementatiobase_pars ersn depending on type of * For parse method is used different implementatiobase_pars ersn depending on type of
* parser - if terminal_type, non_terminal_type or choice_ty pe * parser - if terminal_type, non_terminal_type or choice_ty pe
*/ */
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ) = 0; virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ) = 0;
/* /*
* \brief Used for formatting the class to output stream * \brief Used for formatting the class to output stream
* *
*/ */
virtual std::basic_ostream<E>& format( std::basic_ostream<E> & os ) = 0; virtual std::basic_ostream<E>& format( std::basic_ostream<E> & os ) = 0;
/* /*
* \brief Returns the size of buffer succesfully parsed last time. * \brief Returns the size of buffer succesfully parsed last time.
* *
*/ */
unsigned long parsed_size() const uint64_t parsed_size() const
{ {
return this->m_parsed_size; return this->m_parsed_size;
} }
/* /*
* \brief Returns the size of data succesfully formatted int o output. * \brief Returns the size of data succesfully formatted int o output.
* *
*/ */
unsigned long formatted_size() const uint64_t formatted_size() const
{ {
return this->m_formatted_size; return this->m_formatted_size;
} }
/* /*
* \brief Identifies whether last call to \ref parse() was s uccesfull or not * \brief Identifies whether last call to \ref parse() was s uccesfull or not
* *
* Usually it is possible to check return value of \ref pars e method - * Usually it is possible to check return value of \ref pars e method -
* the size of parsed buffer, if greater then zero, the obje ct was * the size of parsed buffer, if greater then zero, the obje ct was
* succesfully parsed. This is not valid for \ref basic_subs et - if * succesfully parsed. This is not valid for \ref basic_subs et - if
skipping to change at line 230 skipping to change at line 229
virtual void set_to_begin() virtual void set_to_begin()
{ {
} }
protected: protected:
//! Flag identifyng the result of last call to \ref parse() method. //! Flag identifyng the result of last call to \ref parse() method.
bool m_is_parsed; bool m_is_parsed;
//! Flag identifyng the result of last call to \ref format() method. //! Flag identifyng the result of last call to \ref format() method.
bool m_is_formatted; bool m_is_formatted;
//! The size of succesfully parsed data, can be zero, if \re f parse() failed. //! The size of succesfully parsed data, can be zero, if \re f parse() failed.
unsigned long m_parsed_size; uint64_t m_parsed_size;
//! The size of succesfully formatted data, can be zero, if \ref format() failed. //! The size of succesfully formatted data, can be zero, if \ref format() failed.
unsigned long m_formatted_size; uint64_t m_formatted_size;
//! Used for trace and/or debugging //! Used for trace and/or debugging
const char *m_name; const char *m_name;
/* /*
* \brief The type of grammar symbol * \brief The type of grammar symbol
* *
* Specific for parsing algorithm. Used in \ref basic_contex t_free_grammar_strategy for finding terminal types in definition * Specific for parsing algorithm. Used in \ref basic_contex t_free_grammar_strategy for finding terminal types in definition
* *
*/ */
symbol_type m_type; symbol_type m_type;
skipping to change at line 286 skipping to change at line 285
this->m_is_formatted = the_formatted_flag; this->m_is_formatted = the_formatted_flag;
return b; return b;
} }
/* /*
* \brief Allows to change the size of succesfully parsed da ta * \brief Allows to change the size of succesfully parsed da ta
* \param the_parsed_size new size value * \param the_parsed_size new size value
* \return previous size value * \return previous size value
* *
*/ */
unsigned long change_parsed_size( const unsigned long the_pa rsed_size ) uint64_t change_parsed_size( const uint64_t the_parsed_size )
{ {
unsigned long size = this->m_parsed_size; uint64_t size = this->m_parsed_size;
this->m_parsed_size = the_parsed_size; this->m_parsed_size = the_parsed_size;
return size; return size;
} }
/* /*
* \brief Allows to change the size of succesfully formatted data * \brief Allows to change the size of succesfully formatted data
* \param the_formatted_size new size value * \param the_formatted_size new size value
* \return previous size value * \return previous size value
* *
*/ */
unsigned long change_formatted_size( const unsigned long the _formatted_size ) uint64_t change_formatted_size( const uint64_t the_formatted _size )
{ {
unsigned long size = this->m_formatted_size; uint64_t size = this->m_formatted_size;
this->m_formatted_size = the_formatted_size; this->m_formatted_size = the_formatted_size;
return size; return size;
} }
/* /*
* \brief Used for trace/debugging * \brief Used for trace/debugging
* *
*/ */
void set_name( const char* name ) void set_name( const char* name )
{ {
skipping to change at line 507 skipping to change at line 506
basic_non_terminal( const basic_non_terminal& rhs ); basic_non_terminal( const basic_non_terminal& rhs );
//! The destructor //! The destructor
~basic_non_terminal(); ~basic_non_terminal();
/* /*
* \brief This parse method is taking symbols from the begin of buffer to the end, * \brief This parse method is taking symbols from the begin of buffer to the end,
* doesn't require that the whole input is parsed. The input will be copied into * doesn't require that the whole input is parsed. The input will be copied into
* parsed objects manipulated by \sa basic_object_parser, wh ich inherits from auto_ptr. * parsed objects manipulated by \sa basic_object_parser, wh ich inherits from auto_ptr.
* *
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
/* /*
* \brief This parse method is taking symbols from the begin of istream to the end, * \brief This parse method is taking symbols from the begin of istream to the end,
* doesn't require that the whole input is parsed The input will be copied into parsed objects * doesn't require that the whole input is parsed The input will be copied into parsed objects
* manipulated by \sa basic_object_parser. * manipulated by \sa basic_object_parser.
* *
*/ */
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
/* /*
skipping to change at line 598 skipping to change at line 597
* *
*/ */
template <typename E,typename A> template <typename E,typename A>
class basic_subset : public basic_non_terminal<E, A> class basic_subset : public basic_non_terminal<E, A>
{ {
public: public:
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
typedef typename basic_parser<E>::parser_list_iterator parse r_list_iterator; typedef typename basic_parser<E>::parser_list_iterator parse r_list_iterator;
basic_subset(); basic_subset();
~basic_subset(); ~basic_subset();
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_lenght ); virtual uint64_t parse( const E *buf, const uint64_t buf_len ght );
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
}; };
template< typename E, typename A > template< typename E, typename A >
basic_subset<E,A>::basic_subset() basic_subset<E,A>::basic_subset()
: basic_non_terminal<E,A>() : basic_non_terminal<E,A>()
{ {
} }
template< typename E, typename A > template< typename E, typename A >
basic_subset<E,A>::~basic_subset() basic_subset<E,A>::~basic_subset()
{ {
} }
template< typename E, typename A > template< typename E, typename A >
unsigned long basic_subset<E,A>::parse( const E *buf, const unsigned long b uf_length ) uint64_t basic_subset<E,A>::parse( const E *buf, const uint64_t buf_length )
{ {
this->prepare_for_parsing(); this->prepare_for_parsing();
bool is_parsed = true; bool is_parsed = true;
parser_list symbols; parser_list symbols;
parser_list_iterator parse_iterator = this->m_symbols.begin(); parser_list_iterator parse_iterator = this->m_symbols.begin();
// copy symbols to temporary list seems to be best to me // copy symbols to temporary list seems to be best to me
while( parse_iterator != this->m_symbols.end() ) while( parse_iterator != this->m_symbols.end() )
symbols.push_back( *(parse_iterator++) ); symbols.push_back( *(parse_iterator++) );
skipping to change at line 741 skipping to change at line 740
basic_object_parser<E,E,F>(ASCII_RANGE_TERMINAL) {}; basic_object_parser<E,E,F>(ASCII_RANGE_TERMINAL) {};
~basic_ascii_range_terminal() {}; ~basic_ascii_range_terminal() {};
/* /*
* \brief The input is succesfully parsed, if first item in buffer is within the range specified in template parameters range from A to B * \brief The input is succesfully parsed, if first item in buffer is within the range specified in template parameters range from A to B
* \param[in] buf Buffer to be parsed * \param[in] buf Buffer to be parsed
* \param[in] buf_length Length of the buffer * \param[in] buf_length Length of the buffer
* \return The lenght of the buffer part, which was parsed ( ==1), 0 if parse failed. * \return The lenght of the buffer part, which was parsed ( ==1), 0 if parse failed.
*/ */
unsigned long parse( const E *buf, const unsigned long buf_l ength ); uint64_t parse( const E *buf, const uint64_t buf_length );
std::basic_istream<E>& parse( std::basic_istream<E>& is ); std::basic_istream<E>& parse( std::basic_istream<E>& is );
/* /*
* \brief Formats the previously parsed or stored value into output stream * \brief Formats the previously parsed or stored value into output stream
* *
*/ */
std::basic_ostream<E>& format( std::basic_ostream<E>& os ); std::basic_ostream<E>& format( std::basic_ostream<E>& os );
const char* get_name() const const char* get_name() const
{ {
skipping to change at line 876 skipping to change at line 875
friend inline tracer& operator << (tracer& a_tracer, unsigne d int i) friend inline tracer& operator << (tracer& a_tracer, unsigne d int i)
{ {
if( a_tracer.to_trace() ) if( a_tracer.to_trace() )
{ {
a_tracer.intend( trace_context::get().get_sc ope() ); a_tracer.intend( trace_context::get().get_sc ope() );
std::cout << i; std::cout << i;
} }
return a_tracer; return a_tracer;
} }
friend inline tracer& operator << (tracer& a_tracer, unsigne d long i) friend inline tracer& operator << (tracer& a_tracer, uint64_ t i)
{ {
if( a_tracer.to_trace() ) if( a_tracer.to_trace() )
{ {
a_tracer.intend( trace_context::get().get_sc ope() ); a_tracer.intend( trace_context::get().get_sc ope() );
std::cout << i; std::cout << i;
} }
return a_tracer; return a_tracer;
} }
friend inline tracer& operator << (tracer& a_tracer, long i) friend inline tracer& operator << (tracer& a_tracer, long i)
skipping to change at line 1000 skipping to change at line 999
} }
}; };
template<typename TracedObject> tracer<TracedObject>& endl(tracer<TracedObj ect>& a_tracer) template<typename TracedObject> tracer<TracedObject>& endl(tracer<TracedObj ect>& a_tracer)
{ {
return a_tracer.endl(a_tracer); return a_tracer.endl(a_tracer);
} }
template< typename E, E A, E B, typename F > template< typename E, E A, E B, typename F >
unsigned long basic_ascii_range_terminal<E,A,B,F>::parse( const E *buf, con st unsigned long buf_length ) uint64_t basic_ascii_range_terminal<E,A,B,F>::parse( const E *buf, const ui nt64_t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_ascii_range_terminal<E,A,B,F> > t(*this, "parse", __FIL E__, __LINE__); tracer<basic_ascii_range_terminal<E,A,B,F> > t(*this, "parse", __FIL E__, __LINE__);
t << "input="; t << "input=";
t << buf[0]; t << buf[0];
t << ", buf_length="; t << ", buf_length=";
t << (int)buf_length; t << (int)buf_length;
t << endl; t << endl;
#endif #endif
this->prepare_for_parsing(); this->prepare_for_parsing();
skipping to change at line 1159 skipping to change at line 1158
//! Destructor //! Destructor
virtual ~basic_choice(); virtual ~basic_choice();
/* /*
* \brief The method tries to parse any of the symbols, stop s when finds the first successive parser * \brief The method tries to parse any of the symbols, stop s when finds the first successive parser
* \param *buf Buffer containing the word to be parsed * \param *buf Buffer containing the word to be parsed
* \param buf_length The length of word, size of buffer * \param buf_length The length of word, size of buffer
* \return The length of succesfully parsed word * \return The length of succesfully parsed word
* *
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
/* /*
* \brief The method tries to parse any of the symbols, stop s when finds the first successive parser * \brief The method tries to parse any of the symbols, stop s when finds the first successive parser
* *
*/ */
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
const char* get_name() const const char* get_name() const
{ {
std::stringstream ss; std::stringstream ss;
skipping to change at line 1194 skipping to change at line 1193
*/ */
template< typename E, typename except_choice > template< typename E, typename except_choice >
class basic_except_terminal : public basic_object_parser<E,E> class basic_except_terminal : public basic_object_parser<E,E>
{ {
public: public:
basic_except_terminal() : basic_object_parser<E,E>("ExceptTe rminal") {}; basic_except_terminal() : basic_object_parser<E,E>("ExceptTe rminal") {};
/* /*
* \brief The method succeedes if input word is not recogniz ed by except_choice. * \brief The method succeedes if input word is not recogniz ed by except_choice.
*/ */
unsigned long parse( const E *buf, const unsigned long buf_l ength ) uint64_t parse( const E *buf, const uint64_t buf_length )
{ {
this->prepare_for_parsing(); this->prepare_for_parsing();
basic_choice<E,except_choice> except; basic_choice<E,except_choice> except;
except.parse( buf, buf_length ); except.parse( buf, buf_length );
if( !except.is_parsed() && buf_length > 0 ) if( !except.is_parsed() && buf_length > 0 )
{ {
this->m_parsed_object = new E(buf[0]); this->m_parsed_object = new E(buf[0]);
this->m_parsed_size = 1; this->m_parsed_size = 1;
this->m_is_parsed = true; this->m_is_parsed = true;
skipping to change at line 1298 skipping to change at line 1297
* *
*/ */
template <typename E, typename A> template <typename E, typename A>
class basic_set : public basic_non_terminal<E, A> class basic_set : public basic_non_terminal<E, A>
{ {
public: public:
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
typedef typename basic_parser<E>::parser_list_iterator parse r_list_iterator; typedef typename basic_parser<E>::parser_list_iterator parse r_list_iterator;
basic_set(); basic_set();
virtual ~basic_set(); virtual ~basic_set();
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
}; };
template< typename E, typename A > template< typename E, typename A >
basic_set<E,A>::basic_set() : basic_non_terminal<E,A>() basic_set<E,A>::basic_set() : basic_non_terminal<E,A>()
{ {
} }
template< typename E, typename A > template< typename E, typename A >
unsigned long basic_set<E,A>::parse( const E *buf, const unsigned long buf_ length ) uint64_t basic_set<E,A>::parse( const E *buf, const uint64_t buf_length )
{ {
this->prepare_for_parsing(); this->prepare_for_parsing();
parser_list symbols; parser_list symbols;
parser_list_iterator parse_iterator = this->m_symbols.begin(); parser_list_iterator parse_iterator = this->m_symbols.begin();
bool is_parsed = true; bool is_parsed = true;
// copy symbols to temporary list seems to be best to me // copy symbols to temporary list seems to be best to me
while( parse_iterator != this->m_symbols.end() ) symbols.push_back( *(parse_iterator++) ); while( parse_iterator != this->m_symbols.end() ) symbols.push_back( *(parse_iterator++) );
while( !symbols.empty() && is_parsed ) while( !symbols.empty() && is_parsed )
skipping to change at line 1444 skipping to change at line 1443
} }
~basic_repeated_sequence() ~basic_repeated_sequence()
{ {
} }
/* /*
* \brief The parse method tries to parse the subsequence as may times as possible * \brief The parse method tries to parse the subsequence as may times as possible
* *
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
/* /*
* \brief The parse method tries to parse the subsequence as may times as possible * \brief The parse method tries to parse the subsequence as may times as possible
* *
*/ */
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
/* /*
* \brief Calls format of each subsequence's parser * \brief Calls format of each subsequence's parser
* *
skipping to change at line 1558 skipping to change at line 1557
} }
#ifdef TRACE #ifdef TRACE
// always parsed (possible empty sequence is accepted // always parsed (possible empty sequence is accepted
t << "parser succeeded " << endl; t << "parser succeeded " << endl;
#endif #endif
return is; return is;
} }
template<typename E, typename P, typename F > template<typename E, typename P, typename F >
unsigned long basic_repeated_sequence<E,P,F>::parse( const E *buf, const un signed long buf_length ) uint64_t basic_repeated_sequence<E,P,F>::parse( const E *buf, const uint64_ t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_repeated_sequence<E,P,F> > tracer<basic_repeated_sequence<E,P,F> >
t(*this, "parse", __FILE__, __LINE__); t(*this, "parse", __FILE__, __LINE__);
#endif #endif
prepare_for_parsing(); prepare_for_parsing();
this->m_is_parsed = true; this->m_is_parsed = true;
P p; P p;
while( this->m_is_parsed ) while( this->m_is_parsed )
skipping to change at line 1767 skipping to change at line 1766
{ {
os.clear(); os.clear();
os.seekp( streamPos ); os.seekp( streamPos );
this->m_formatted_size = 0; this->m_formatted_size = 0;
} }
else this->m_is_formatted = true; else this->m_is_formatted = true;
return os; return os;
} }
template< typename E, typename A, typename F > template< typename E, typename A, typename F >
unsigned long basic_non_terminal<E,A,F> uint64_t basic_non_terminal<E,A,F>
::parse( const E *buf, const unsigned long buf_length ) ::parse( const E *buf, const uint64_t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_non_terminal<E,A,F> > t(*this, "parse", __FILE__, __LIN E__); tracer<basic_non_terminal<E,A,F> > t(*this, "parse", __FILE__, __LIN E__);
#endif #endif
this->prepare_for_parsing(); this->prepare_for_parsing();
parser_list_iterator parse_iterator = this->m_symbols.begin(); parser_list_iterator parse_iterator = this->m_symbols.begin();
bool is_parsed = true; bool is_parsed = true;
while( parse_iterator != this->m_symbols.end() && is_parsed ) while( parse_iterator != this->m_symbols.end() && is_parsed )
skipping to change at line 1870 skipping to change at line 1869
{ {
} }
/* /*
* \brief The method compares the pattern, passed as constru ctor parameter, with string stored in input buffer. * \brief The method compares the pattern, passed as constru ctor parameter, with string stored in input buffer.
* \param *buf the buffer containing input string * \param *buf the buffer containing input string
* \param buf_length the length of buffer * \param buf_length the length of buffer
* \return the size of parsed string, if succesfullt, otherw ise zero * \return the size of parsed string, if succesfullt, otherw ise zero
* *
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
/* /*
* \brief The method succeedes if input is same as pattern p assed to constructor * \brief The method succeedes if input is same as pattern p assed to constructor
* *
*/ */
std::basic_istream<E>& parse( std::basic_istream<E>& is ); std::basic_istream<E>& parse( std::basic_istream<E>& is );
std::basic_string<E> widen( const char* pattern ) std::basic_string<E> widen( const char* pattern )
{ {
// TODO - use constructor with input of pattern, as it must be stored // TODO - use constructor with input of pattern, as it must be stored
skipping to change at line 1949 skipping to change at line 1948
} }
else else
{ {
return false; return false;
} }
} }
}; };
template< typename E > template< typename E >
unsigned long basic_pattern_parser<E>::parse( const E *buf, const unsigned long buf_length ) uint64_t basic_pattern_parser<E>::parse( const E *buf, const uint64_t buf_l ength )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_pattern_parser<E> > t(*this, "parse", __FILE__, __LINE_ _); tracer<basic_pattern_parser<E> > t(*this, "parse", __FILE__, __LINE_ _);
t << "input="; t << "input=";
#endif #endif
this->prepare_for_parsing(); this->prepare_for_parsing();
typename string_type::iterator it = this->get_valid().begin(); typename string_type::iterator it = this->get_valid().begin();
while( this->m_parsed_size < buf_length && while( this->m_parsed_size < buf_length &&
skipping to change at line 2122 skipping to change at line 2121
* one specific terminal character (value template parameter) * one specific terminal character (value template parameter)
* *
*/ */
template< typename E, E value, typename F=default_factory<E> > template< typename E, E value, typename F=default_factory<E> >
class basic_terminal : public basic_object_parser< E, E, F > class basic_terminal : public basic_object_parser< E, E, F >
{ {
public: public:
basic_terminal(); basic_terminal();
virtual ~basic_terminal(); virtual ~basic_terminal();
virtual unsigned long parse( const E *buf, virtual uint64_t parse( const E *buf,
const unsigned long buf_length ) const uint64_t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_terminal<E,value> > t(*this, "parse", _ _FILE__, __LINE__); tracer<basic_terminal<E,value> > t(*this, "parse", _ _FILE__, __LINE__);
t << "input="; t << "input=";
t << buf[0]; t << buf[0];
t << ", buf_length="; t << ", buf_length=";
t << (int)buf_length; t << (int)buf_length;
t << endl; t << endl;
#endif #endif
basic_object_parser< E, E, F >::prepare_for_parsing( ); basic_object_parser< E, E, F >::prepare_for_parsing( );
skipping to change at line 2303 skipping to change at line 2302
* *
*/ */
template <typename E, typename A> template <typename E, typename A>
class basic_option : public basic_non_terminal<E, A> class basic_option : public basic_non_terminal<E, A>
{ {
public: public:
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
typedef typename basic_parser<E>::parser_list_iterator parse r_list_iterator; typedef typename basic_parser<E>::parser_list_iterator parse r_list_iterator;
basic_option(); basic_option();
virtual ~basic_option(); virtual ~basic_option();
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
const char* get_name() const const char* get_name() const
{ {
return OPTION; return OPTION;
} }
}; };
template< typename E, typename A > template< typename E, typename A >
basic_option<E,A>::basic_option() : basic_non_terminal<E,A>() basic_option<E,A>::basic_option() : basic_non_terminal<E,A>()
{ {
} }
template< typename E, typename A > template< typename E, typename A >
unsigned long basic_option<E,A>::parse( const E *buf, const unsigned long b uf_length ) uint64_t basic_option<E,A>::parse( const E *buf, const uint64_t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_option<E,A> > t(*this, "parse", __FILE__, __LINE__); tracer<basic_option<E,A> > t(*this, "parse", __FILE__, __LINE__);
#endif #endif
this->prepare_for_parsing(); this->prepare_for_parsing();
parser_list symbols; parser_list symbols;
parser_list_iterator parse_iterator = this->m_symbols.begin(); parser_list_iterator parse_iterator = this->m_symbols.begin();
this->m_is_parsed = true; this->m_is_parsed = true;
skipping to change at line 2516 skipping to change at line 2515
this->set_name( CHOICE ); this->set_name( CHOICE );
}; };
template< typename E, typename A, typename F > template< typename E, typename A, typename F >
basic_choice<E,A,F>::~basic_choice() basic_choice<E,A,F>::~basic_choice()
{ {
this->set_name( CHOICE ); this->set_name( CHOICE );
} }
template< typename E, typename A, typename F > template< typename E, typename A, typename F >
unsigned long basic_choice<E,A,F>::parse( const E *buf, uint64_t basic_choice<E,A,F>::parse( const E *buf,
const unsigned long buf_length ) const uint64_t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_choice<E,A,F> > t(*this, "parse", __FILE__, __LINE__); tracer<basic_choice<E,A,F> > t(*this, "parse", __FILE__, __LINE__);
#endif #endif
this->prepare_for_parsing(); this->prepare_for_parsing();
parser_list_iterator parse_iterator = this->m_symbols.begin(); parser_list_iterator parse_iterator = this->m_symbols.begin();
while( parse_iterator != this->m_symbols.end() && !this->m_is_parsed ) while( parse_iterator != this->m_symbols.end() && !this->m_is_parsed )
{ {
// try to parse any of the symbols, stop when // try to parse any of the symbols, stop when
skipping to change at line 2611 skipping to change at line 2610
* i.e. if typename A is int, and input is "5=5", it stores 5, input re st will be "=5" * i.e. if typename A is int, and input is "5=5", it stores 5, input re st will be "=5"
* *
*/ */
template< typename E, typename A > template< typename E, typename A >
class basic_value_parser : public basic_default_type_parser<E,A> class basic_value_parser : public basic_default_type_parser<E,A>
{ {
public: public:
basic_value_parser(); basic_value_parser();
~basic_value_parser(); ~basic_value_parser();
virtual unsigned long parse( const E* buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E* buf, const uint64_t buf_len gth );
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
}; };
template<typename E> template<typename E>
class basic_string_parser : class basic_string_parser :
public basic_value_parser< E, std::basic_string<E> > public basic_value_parser< E, std::basic_string<E> >
{ {
public: public:
typedef std::basic_string<E> std_string; typedef std::basic_string<E> std_string;
skipping to change at line 2653 skipping to change at line 2652
STRING = NONE, STRING = NONE,
NORMALIZED_STRING = NO_CARRIAGE_RETURNS | NO_LINE_FE EDS | NO_TABS, NORMALIZED_STRING = NO_CARRIAGE_RETURNS | NO_LINE_FE EDS | NO_TABS,
TOKEN = NO_SPACES | NO_LINE_FEEDS | NO_TABS, TOKEN = NO_SPACES | NO_LINE_FEEDS | NO_TABS,
NMTOKEN = NO_SPACES | NO_LINE_FEEDS | NO_TABS NMTOKEN = NO_SPACES | NO_LINE_FEEDS | NO_TABS
}; };
basic_string_parser(); basic_string_parser();
basic_string_parser(const E separator, int a_directives); basic_string_parser(const E separator, int a_directives);
~basic_string_parser(); ~basic_string_parser();
unsigned long parse( const E* buf, const unsigned long buf_l ength ); uint64_t parse( const E* buf, const uint64_t buf_length );
std::basic_istream<E>& parse( std::basic_istream<E>& is ); std::basic_istream<E>& parse( std::basic_istream<E>& is );
operator std::basic_string<E>() operator std::basic_string<E>()
{ {
return this->get_valid(); return this->get_valid();
} }
protected: protected:
E m_separator; E m_separator;
int m_directives; int m_directives;
skipping to change at line 2685 skipping to change at line 2684
basic_value_parser< E, std::basic_string<E> >(), m_separator(separat or), m_directives(a_directives) basic_value_parser< E, std::basic_string<E> >(), m_separator(separat or), m_directives(a_directives)
{ {
} }
template< typename E > template< typename E >
basic_string_parser<E>::~basic_string_parser() basic_string_parser<E>::~basic_string_parser()
{ {
} }
template< typename E > template< typename E >
unsigned long basic_string_parser<E>::parse( const E* buf, const unsigned l ong buf_length ) uint64_t basic_string_parser<E>::parse( const E* buf, const uint64_t buf_le ngth )
{ {
this->prepare_for_parsing(); this->prepare_for_parsing();
this->m_is_parsed = true; this->m_is_parsed = true;
int i = 0; int i = 0;
for( i=0; i<(int)buf_length && buf[i] != this->m_separator; i++ ) for( i=0; i<(int)buf_length && buf[i] != this->m_separator; i++ )
{ {
if( this->m_directives & NO_NEW_LINES && buf[i] == NEW_LINE if( ((this->m_directives & NO_NEW_LINES) && (buf[i] == NEW_L
|| INE)) ||
this->m_directives & NO_SPACES && buf[i] == ((this->m_directives & NO_SPACES) && (buf[i]
SPACE || == SPACE)) ||
this->m_directives & NO_TABS && buf[i] == TA ((this->m_directives & NO_TABS) && (buf[i] =
B || = TAB)) ||
this->m_directives & NO_CARRIAGE_RETURNS && ((this->m_directives & NO_CARRIAGE_RETURNS)
buf[i] == CARRIAGE_RETURN || && (buf[i] == CARRIAGE_RETURN)) ||
this->m_directives & NO_LINE_FEEDS && buf[i] ((this->m_directives & NO_LINE_FEEDS) && (bu
== LINE_FEED ) f[i] == LINE_FEED)) )
{ {
this->m_is_parsed = false; this->m_is_parsed = false;
break; break;
} }
}; };
if( this->m_is_parsed ) if( this->m_is_parsed )
{ {
this->get_valid() = std::basic_string<E>( buf, i ); this->get_valid() = std::basic_string<E>( buf, i );
skipping to change at line 2728 skipping to change at line 2727
std::streampos str_pos = is.tellg(); std::streampos str_pos = is.tellg();
std::basic_stringbuf<E> buf; std::basic_stringbuf<E> buf;
is.get( buf, this->m_separator ); is.get( buf, this->m_separator );
typename std_string::iterator it = buf.str().begin(); typename std_string::iterator it = buf.str().begin();
this->m_is_parsed = true; this->m_is_parsed = true;
E input = 0; E input = 0;
while( it != buf.str().end() ) while( it != buf.str().end() )
{ {
input = (*it); input = (*it);
if( this->m_directives & NO_NEW_LINES && input == NEW_LINE | // WARN:: para remover os warnnings foram adicionados parent
| eses no 'if' abaixo
this->m_directives & NO_SPACES && input == S if( ((this->m_directives & NO_NEW_LINES) && (input == NEW_LI
PACE || NE)) ||
this->m_directives & NO_TABS && input == TAB ((this->m_directives & NO_SPACES) && (input
|| == SPACE)) ||
this->m_directives & NO_CARRIAGE_RETURNS && ((this->m_directives & NO_TABS) && (input ==
input == CARRIAGE_RETURN || TAB)) ||
this->m_directives & NO_LINE_FEEDS && input ((this->m_directives & NO_CARRIAGE_RETURNS)
== LINE_FEED ) && (input == CARRIAGE_RETURN)) ||
((this->m_directives & NO_LINE_FEEDS) && (in
put == LINE_FEED)) )
{ {
this->m_is_parsed = false; this->m_is_parsed = false;
break; break;
} }
it++; it++;
}; };
if( this->m_is_parsed ) if( this->m_is_parsed )
{ {
this->get_valid() = buf.str(); this->get_valid() = buf.str();
skipping to change at line 2797 skipping to change at line 2797
basic_factor_with_repetition(const basic_factor_with_repetit ion& rhs ) : basic_factor_with_repetition(const basic_factor_with_repetit ion& rhs ) :
basic_object_parser<E,vector_P,F>(rhs) basic_object_parser<E,vector_P,F>(rhs)
{ {
} }
/* /*
* \brief The parse method tries to parse the sequence repre sented by factor * \brief The parse method tries to parse the sequence repre sented by factor
* (template parameter) the number of times defined by templ ate parameter P. * (template parameter) the number of times defined by templ ate parameter P.
* *
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
/* /*
* \brief The parse method tries to parse the sequence repre sented by factor * \brief The parse method tries to parse the sequence repre sented by factor
* (template parameter) the number of times defined by templ ate parameter P. * (template parameter) the number of times defined by templ ate parameter P.
* *
*/ */
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
/* /*
* \brief Calls format of each parser in set of parsers. * \brief Calls format of each parser in set of parsers.
skipping to change at line 2926 skipping to change at line 2926
{ {
#ifdef TRACE #ifdef TRACE
this->m_is_parsed = true; this->m_is_parsed = true;
t << "parser succeeded " << endl; t << "parser succeeded " << endl;
#endif #endif
} }
return is; return is;
} }
template<typename E, unsigned int N, typename P, typename F > template<typename E, unsigned int N, typename P, typename F >
unsigned long basic_factor_with_repetition<E,N,P,F>::parse( uint64_t basic_factor_with_repetition<E,N,P,F>::parse(
const E *buf, const E *buf,
const unsigned long buf_length ) const uint64_t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_factor_with_repetition<E,N,P,F> > tracer<basic_factor_with_repetition<E,N,P,F> >
t(*this, "parse", __FILE__, __LINE__); t(*this, "parse", __FILE__, __LINE__);
#endif #endif
prepare_for_parsing(); prepare_for_parsing();
vector_P_iterator it = this->get_valid().begin(); vector_P_iterator it = this->get_valid().begin();
while( it != this->get_valid().end() ) while( it != this->get_valid().end() )
{ {
(*it).parse(buf+this->m_parsed_size,buf_length-this->m_parse d_size); (*it).parse(buf+this->m_parsed_size,buf_length-this->m_parse d_size);
skipping to change at line 3020 skipping to change at line 3020
basic_object_parser<E,A,F>(rhs) basic_object_parser<E,A,F>(rhs)
{ {
} }
/* /*
* \brief The parse method tries to parse exception at first - if exception is found * \brief The parse method tries to parse exception at first - if exception is found
* at the beginning of the input, the parse method fails. If exception is not found, * at the beginning of the input, the parse method fails. If exception is not found,
* continues parsing the term. * continues parsing the term.
* *
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ); virtual uint64_t parse( const E *buf, const uint64_t buf_len gth );
/* /*
* \brief The parse method tries to parse exception at first - if exception is found * \brief The parse method tries to parse exception at first - if exception is found
* at the beginning of the input, the parse method fails. If exception is not found, * at the beginning of the input, the parse method fails. If exception is not found,
* continues parsing the term. * continues parsing the term.
*/ */
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ); virtual std::basic_istream<E>& parse( std::basic_istream<E>& is );
/* /*
* \brief Does the same as A::format(). (A is parsed defined in template parameter list) * \brief Does the same as A::format(). (A is parsed defined in template parameter list)
skipping to change at line 3122 skipping to change at line 3122
this->get_valid().parse( is ); this->get_valid().parse( is );
if( this->get_valid().is_parsed() ) if( this->get_valid().is_parsed() )
{ {
this->m_is_parsed = true; this->m_is_parsed = true;
this->m_parsed_size = this->get_valid().parsed_size(); this->m_parsed_size = this->get_valid().parsed_size();
} }
return is; return is;
} }
template< typename E, typename A, typename B, typename F > template< typename E, typename A, typename B, typename F >
unsigned long basic_term_with_exception<E,A,B,F>::parse( const E *buf, cons t unsigned long buf_length ) uint64_t basic_term_with_exception<E,A,B,F>::parse( const E *buf, const uin t64_t buf_length )
{ {
#ifdef TRACE #ifdef TRACE
tracer<basic_term_with_exception<E,A,B> > t(*this, "parse", __FILE__ , __LINE__); tracer<basic_term_with_exception<E,A,B> > t(*this, "parse", __FILE__ , __LINE__);
#endif #endif
this->prepare_for_parsing(); this->prepare_for_parsing();
B exception; B exception;
exception.parse( buf, buf_length ); exception.parse( buf, buf_length );
if( exception.is_parsed() ) if( exception.is_parsed() )
{ {
skipping to change at line 3160 skipping to change at line 3160
basic_default_type_parser<E,A>(VALUE_PARSER) basic_default_type_parser<E,A>(VALUE_PARSER)
{ {
} }
template< typename E, typename A > template< typename E, typename A >
basic_value_parser<E,A>::~basic_value_parser() basic_value_parser<E,A>::~basic_value_parser()
{ {
} }
template< typename E, typename A > template< typename E, typename A >
unsigned long basic_value_parser<E,A>::parse( const E* buf, uint64_t basic_value_parser<E,A>::parse( const E* buf,
const unsigned long buf_length ) const uint64_t buf_length )
{ {
this->prepare_for_parsing(); this->prepare_for_parsing();
std::auto_ptr< std::basic_stringbuf<E> > strbufptr( std::auto_ptr< std::basic_stringbuf<E> > strbufptr(
new std::basic_stringbuf<E>( std::basic_string<E>( ( const E*)buf, buf_length ) ) ); new std::basic_stringbuf<E>( std::basic_string<E>( ( const E*)buf, buf_length ) ) );
std::basic_istream<E> is(strbufptr.get()); std::basic_istream<E> is(strbufptr.get());
std::streampos begin = is.tellg(); std::streampos begin = is.tellg();
is >> this->get_valid(); is >> this->get_valid();
if( !(this->m_is_parsed = ( !is.fail() && if( !(this->m_is_parsed = ( !is.fail() &&
skipping to change at line 3226 skipping to change at line 3226
template< typename A > template< typename A >
class wvalue_parser : public basic_value_parser<wchar_t,A> class wvalue_parser : public basic_value_parser<wchar_t,A>
{ {
public: public:
wvalue_parser() : basic_value_parser<wchar_t,A>() {}; wvalue_parser() : basic_value_parser<wchar_t,A>() {};
~wvalue_parser () {}; ~wvalue_parser () {};
}; };
class match class match
{ {
unsigned long m_pos; uint64_t m_pos;
unsigned long m_size; uint64_t m_size;
bool m_is_valid; bool m_is_valid;
public: public:
match() : m_pos(0), m_size(0), m_is_valid(false) {}; match() : m_pos(0), m_size(0), m_is_valid(false) {};
match( unsigned long pos, unsigned long size ) : match( uint64_t pos, uint64_t size ) :
m_pos(pos), m_pos(pos),
m_size(size), m_size(size),
m_is_valid(true) m_is_valid(true)
{ {
} }
virtual ~match() virtual ~match()
{ {
} }
unsigned long get_pos() const uint64_t get_pos() const
{ {
return this->m_pos; return this->m_pos;
} }
unsigned long get_size() const uint64_t get_size() const
{ {
return this->m_size; return this->m_size;
} }
void set_pos( unsigned long pos ) void set_pos( uint64_t pos )
{ {
this->m_pos = pos; this->m_pos = pos;
} }
void set_size( unsigned long size ) void set_size( uint64_t size )
{ {
this->m_size = size; this->m_size = size;
} }
const match& operator = ( const match& m ) const match& operator = ( const match& m )
{ {
this->m_pos = m.get_pos(); this->m_pos = m.get_pos();
this->m_size = m.get_size(); this->m_size = m.get_size();
return m; return m;
skipping to change at line 3361 skipping to change at line 3361
} }
}; };
template< typename E > template< typename E >
class ere_base class ere_base
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
protected: protected:
unsigned long m_rec_size; uint64_t m_rec_size;
unsigned long m_rec_pos; uint64_t m_rec_pos;
bool m_is_rec; bool m_is_rec;
public: public:
ere_base() ere_base()
// CHANGE:: m_is_rec(false), // CHANGE:: m_is_rec(false),
// CHANGE:: m_rec_pos(0), // CHANGE:: m_rec_pos(0),
// CHANGE:: m_rec_size(0) // CHANGE:: m_rec_size(0)
{ {
m_is_rec = false; m_is_rec = false;
m_rec_pos = 0; m_rec_pos = 0;
m_rec_size = 0; m_rec_size = 0;
skipping to change at line 3389 skipping to change at line 3389
bool is_recognized() bool is_recognized()
{ {
return this->m_is_rec; return this->m_is_rec;
} }
void unset() void unset()
{ {
this->m_is_rec = false; this->m_is_rec = false;
} }
void set( const unsigned long pos, const unsigned long size ) void set( const uint64_t pos, const uint64_t size )
{ {
this->m_is_rec = true; this->m_is_rec = true;
this->m_rec_pos = pos; this->m_rec_pos = pos;
this->m_rec_size = size; this->m_rec_size = size;
} }
unsigned long recognized_size() uint64_t recognized_size()
{ {
return this->m_rec_size; return this->m_rec_size;
} }
unsigned long recognized_position() uint64_t recognized_position()
{ {
return this->m_rec_pos; return this->m_rec_pos;
} }
const match& get_match() const match& get_match()
{ {
return this->m_match( this->m_rec_pos, this->m_rec_size ); return this->m_match( this->m_rec_pos, this->m_rec_size );
} }
virtual void assign_matches( matches::match_key parent_address, unsi virtual void assign_matches( matches::match_key parent_address, uint
gned long& branch_pos, matches& m ) = 0; 64_t& branch_pos, matches& m ) = 0;
virtual unsigned long recognize( const E* buf, const unsigned long b virtual uint64_t recognize( const E* buf, const uint64_t buf_length,
uf_length, const unsigned long buf_offset, bool try_positions = true ) = 0; const uint64_t buf_offset, bool try_positions = true ) = 0;
virtual void push_parsers( parser_list& l ) = 0; virtual void push_parsers( parser_list& l ) = 0;
std::string to_str( const unsigned long i ) std::string to_str( const uint64_t i )
{ {
std::stringstream ss; std::stringstream ss;
ss << i; ss << i;
return ss.str(); return ss.str();
} }
}; };
template< typename E > class extended_reg_exp; template< typename E > class extended_reg_exp;
skipping to change at line 3453 skipping to change at line 3453
*/ */
template<typename E> template<typename E>
class ere_dupl_symbol class ere_dupl_symbol
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
class dup_count class dup_count
{ {
protected: protected:
basic_terminal<E,'{'> m_le ft_bracket; basic_terminal<E,'{'> m_le ft_bracket;
basic_value_parser<E,unsigned long> m_repeat_min ; basic_value_parser<E,uint64_t> m_repeat_min;
basic_terminal<E,'}'> m_ri ght_bracket; basic_terminal<E,'}'> m_ri ght_bracket;
public: public:
virtual ~dup_count() virtual ~dup_count()
{ {
} }
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_left_bracket); l.push_back(&this->m_left_bracket);
l.push_back(&this->m_repeat_min); l.push_back(&this->m_repeat_min);
l.push_back(&this->m_right_bracket); l.push_back(&this->m_right_bracket);
} }
const char* get_name() const { return "{repeat_min}" ; } const char* get_name() const { return "{repeat_min}" ; }
virtual unsigned long get_min() virtual uint64_t get_min()
{ {
return this->m_repeat_min.get_valid(); return this->m_repeat_min.get_valid();
} }
virtual unsigned long get_max() virtual uint64_t get_max()
{ {
return this->m_repeat_min.get_valid(); return this->m_repeat_min.get_valid();
} }
}; };
class dup_count_unbound : public dup_count class dup_count_unbound : public dup_count
{ {
protected: protected:
basic_terminal<E,','> m_sep; basic_terminal<E,','> m_sep;
public: public:
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_left_bracket); l.push_back(&this->m_left_bracket);
l.push_back(&this->m_repeat_min); l.push_back(&this->m_repeat_min);
l.push_back(&this->m_sep); l.push_back(&this->m_sep);
l.push_back(&this->m_right_bracket); l.push_back(&this->m_right_bracket);
} }
const char* get_name() const { return "{repeat_min,} "; } const char* get_name() const { return "{repeat_min,} "; }
unsigned long get_max() uint64_t get_max()
{ {
// TODO - find the maximum integer // TODO - find the maximum integer
long i = -1; long i = -1;
return (unsigned long)i; return (uint64_t)i;
// return MAX_INT; // return MAX_INT;
} }
}; };
class dup_count_max : public dup_count_unbound class dup_count_max : public dup_count_unbound
{ {
protected: protected:
basic_value_parser<E,unsigned long> m_repeat_max; basic_value_parser<E,uint64_t> m_repeat_max;
public: public:
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_left_bracket); l.push_back(&this->m_left_bracket);
l.push_back(&this->m_repeat_min); l.push_back(&this->m_repeat_min);
l.push_back(&this->m_sep); l.push_back(&this->m_sep);
l.push_back(&this->m_repeat_max); l.push_back(&this->m_repeat_max);
l.push_back(&this->m_right_bracket); l.push_back(&this->m_right_bracket);
} }
const char* get_name() const { return "{repeat_min,r epeat_max}"; } const char* get_name() const { return "{repeat_min,r epeat_max}"; }
unsigned long get_max() uint64_t get_max()
{ {
return this->m_repeat_max.get_valid(); return this->m_repeat_max.get_valid();
} }
}; };
class lazy_star class lazy_star
{ {
basic_terminal<E, '*'> m_star; basic_terminal<E, '*'> m_star;
basic_terminal<E, '?'> m_lazy; basic_terminal<E, '?'> m_lazy;
skipping to change at line 3561 skipping to change at line 3561
basic_non_terminal<E, lazy_plus> m_lazy_plus; basic_non_terminal<E, lazy_plus> m_lazy_plus;
basic_terminal<E,'*'> m_star; basic_terminal<E,'*'> m_star;
basic_terminal<E,'+'> m_plus; basic_terminal<E,'+'> m_plus;
basic_terminal<E,'?'> m_question_mark; basic_terminal<E,'?'> m_question_mark;
basic_non_terminal<E,dup_count> m_dup; basic_non_terminal<E,dup_count> m_dup;
basic_non_terminal<E,dup_count_unbound> basic_non_terminal<E,dup_count_unbound>
m_dup_unbound; m_dup_unbound;
basic_non_terminal<E,dup_count_max> basic_non_terminal<E,dup_count_max>
m_dup_max; m_dup_max;
unsigned long m_rep; uint64_t m_rep;
public: public:
ere_dupl_symbol() : ere_dupl_symbol() :
m_lazy_star(), m_lazy_star(),
m_lazy_plus(), m_lazy_plus(),
m_dup(), m_dup(),
m_dup_unbound(), m_dup_unbound(),
m_dup_max() m_dup_max()
{ {
} }
virtual ~ere_dupl_symbol() virtual ~ere_dupl_symbol()
{ {
} }
bool is_lazy() bool is_lazy()
{ {
return this->m_lazy_star.is_parsed() || this->m_lazy_plus.is _parsed(); return this->m_lazy_star.is_parsed() || this->m_lazy_plus.is _parsed();
} }
unsigned long get_min() uint64_t get_min()
{ {
if( this->m_star.is_parsed() ) return 0; if( this->m_star.is_parsed() ) return 0;
else if( this->m_plus.is_parsed() ) return 1; else if( this->m_plus.is_parsed() ) return 1;
else if( this->m_lazy_star.is_parsed() ) return 0; else if( this->m_lazy_star.is_parsed() ) return 0;
else if( this->m_lazy_plus.is_parsed() ) return 1; else if( this->m_lazy_plus.is_parsed() ) return 1;
else if( this->m_question_mark.is_parsed() ) return 0; else if( this->m_question_mark.is_parsed() ) return 0;
else if( this->m_dup.is_parsed() ) return this->m_dup->get_m in(); else if( this->m_dup.is_parsed() ) return this->m_dup->get_m in();
else if( this->m_dup_unbound.is_parsed() ) return this->m_du p_unbound->get_min(); else if( this->m_dup_unbound.is_parsed() ) return this->m_du p_unbound->get_min();
else return this->m_dup_max->get_min(); else return this->m_dup_max->get_min();
} }
unsigned long get_max() uint64_t get_max()
{ {
if( this->m_star.is_parsed() ) return INT_MAX; if( this->m_star.is_parsed() ) return INT_MAX;
else if( this->m_plus.is_parsed() ) return INT_MAX; else if( this->m_plus.is_parsed() ) return INT_MAX;
else if( this->m_lazy_star.is_parsed() ) return INT_MAX; else if( this->m_lazy_star.is_parsed() ) return INT_MAX;
else if( this->m_lazy_plus.is_parsed() ) return INT_MAX; else if( this->m_lazy_plus.is_parsed() ) return INT_MAX;
else if( this->m_question_mark.is_parsed() ) return 1; else if( this->m_question_mark.is_parsed() ) return 1;
else if( this->m_dup.is_parsed() ) return this->m_dup->get_m ax(); else if( this->m_dup.is_parsed() ) return this->m_dup->get_m ax();
else if( this->m_dup_unbound.is_parsed() ) return this->m_du p_unbound->get_max(); else if( this->m_dup_unbound.is_parsed() ) return this->m_du p_unbound->get_max();
else return this->m_dup_max->get_max(); else return this->m_dup_max->get_max();
} }
void set_recognized_dup( unsigned long rec_dup ) void set_recognized_dup( uint64_t rec_dup )
{ {
this->m_rep = rec_dup; this->m_rep = rec_dup;
} }
unsigned long get_recognized_dup() uint64_t get_recognized_dup()
{ {
return this->m_rep; return this->m_rep;
} }
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_lazy_star); l.push_back(&this->m_lazy_star);
l.push_back(&this->m_lazy_plus); l.push_back(&this->m_lazy_plus);
l.push_back(&this->m_star); l.push_back(&this->m_star);
l.push_back(&this->m_plus); l.push_back(&this->m_plus);
skipping to change at line 3659 skipping to change at line 3659
'.' | bracket_expr \n '.' | bracket_expr \n
special_chars => '.' | '[' | '\' | '(' | ')' | '*' | '+' | '?' | ' {' special_chars => '.' | '[' | '\' | '(' | ')' | '*' | '+' | '?' | ' {'
| '}' | '|' | '^' | '$' \n | '}' | '|' | '^' | '$' \n
*/ */
template< typename E > template< typename E >
class ere_dups class ere_dups
{ {
typedef typename basic_parser<E>::parser_list typedef typename basic_parser<E>::parser_list
parser_list; parser_list;
unsigned long m_rep; uint64_t m_rep;
class dup_and_dup_branch class dup_and_dup_branch
{ {
basic_choice<E,ere_dupl_symbol<E> > basic_choice<E,ere_dupl_symbol<E> >
m_dup; m_dup;
basic_choice<E,ere_dups<E> > m_dups; basic_choice<E,ere_dups<E> > m_dups;
public: public:
void push_parsers( parser_list& l ) void push_parsers( parser_list& l )
{ {
l.push_back( &this->m_dup ); l.push_back( &this->m_dup );
l.push_back( &this->m_dups ); l.push_back( &this->m_dups );
} }
const char* get_name() const { return "ere_dup,ere_dups"; } const char* get_name() const { return "ere_dup,ere_dups"; }
unsigned long get_max() uint64_t get_max()
{ {
double max = this->m_dup->get_max(); double max = this->m_dup->get_max();
if( max == INT_MAX ) if( max == INT_MAX )
return INT_MAX; return INT_MAX;
double max_from_branch = this->m_dups->get_max(); double max_from_branch = this->m_dups->get_max();
if( max_from_branch == INT_MAX ) if( max_from_branch == INT_MAX )
return INT_MAX; return INT_MAX;
max = max * max_from_branch; max = max * max_from_branch;
if( max >= INT_MAX ) if( max >= INT_MAX )
return INT_MAX; return INT_MAX;
return (unsigned long)max; return (uint64_t)max;
} }
bool is_lazy() bool is_lazy()
{ {
return (this->m_dup.is_parsed() && this->m_dup->is_l azy()) || return (this->m_dup.is_parsed() && this->m_dup->is_l azy()) ||
(this->m_dups.is_parsed() && this->m_dups->i s_lazy()); (this->m_dups.is_parsed() && this->m_dups->i s_lazy());
} }
unsigned long get_min() uint64_t get_min()
{ {
return this->m_dup->get_min() * this->m_dups->get_mi n(); return this->m_dup->get_min() * this->m_dups->get_mi n();
} }
}; };
basic_non_terminal<E, dup_and_dup_branch > m_dup_and_dups; basic_non_terminal<E, dup_and_dup_branch > m_dup_and_dups;
basic_choice<E,ere_dupl_symbol<E> > m_dup; basic_choice<E,ere_dupl_symbol<E> > m_dup;
public: public:
skipping to change at line 3724 skipping to change at line 3724
{ {
l.push_back( &this->m_dup_and_dups ); l.push_back( &this->m_dup_and_dups );
l.push_back( &this->m_dup ); l.push_back( &this->m_dup );
} }
const char* get_name() const const char* get_name() const
{ {
return "ere_dups"; return "ere_dups";
} }
void set_recognized_dup( unsigned long rec_dup ) void set_recognized_dup( uint64_t rec_dup )
{ {
this->m_rep = rec_dup; this->m_rep = rec_dup;
} }
unsigned long get_recognized_dup() uint64_t get_recognized_dup()
{ {
return this->m_rep; return this->m_rep;
} }
unsigned long get_max() uint64_t get_max()
{ {
if( this->m_dup_and_dups.is_parsed() ) if( this->m_dup_and_dups.is_parsed() )
return this->m_dup_and_dups->get_max(); return this->m_dup_and_dups->get_max();
else else
return this->m_dup->get_max(); return this->m_dup->get_max();
} }
unsigned long get_min() uint64_t get_min()
{ {
if( this->m_dup_and_dups.is_parsed() ) if( this->m_dup_and_dups.is_parsed() )
return this->m_dup_and_dups->get_min(); return this->m_dup_and_dups->get_min();
else else
return this->m_dup->get_min(); return this->m_dup->get_min();
} }
ere_dups() : m_rep(0) ere_dups() : m_rep(0)
{ {
} }
skipping to change at line 3781 skipping to change at line 3781
~meta_char_choice() {}; ~meta_char_choice() {};
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back( &this->m_circumflex ); l.push_back( &this->m_circumflex );
l.push_back( &this->m_hyphen ); l.push_back( &this->m_hyphen );
l.push_back( &this->m_right_bracket ); l.push_back( &this->m_right_bracket );
} }
const char* get_name() const { return "^|-|]"; } const char* get_name() const { return "^|-|]"; }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
if( this->m_hyphen.is_parsed() ) if( this->m_hyphen.is_parsed() )
{ {
if( std::use_facet< std::collate<E> >(std::locale()) .compare(buf, buf+1, this->m_hyphen.get(), this->m_hyphen.get()+1 ) == 0 ) if( std::use_facet< std::collate<E> >(std::locale()) .compare(buf, buf+1, this->m_hyphen.get(), this->m_hyphen.get()+1 ) == 0 )
{ {
return 1; return 1;
} }
else else
{ {
return 0; return 0;
skipping to change at line 3853 skipping to change at line 3853
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_open); l.push_back(&this->m_open);
l.push_back(&this->m_left_dot); l.push_back(&this->m_left_dot);
l.push_back(&this->m_coll_elem_single); l.push_back(&this->m_coll_elem_single);
l.push_back(&this->m_right_dot); l.push_back(&this->m_right_dot);
l.push_back(&this->m_close); l.push_back(&this->m_close);
} }
const char* get_name() const { return "'[','.',collating_ele ment_single,'.',']'"; } const char* get_name() const { return "'[','.',collating_ele ment_single,'.',']'"; }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
int ret = std::use_facet< std::collate<E> >(std::loc ale()).compare(buf, buf, this->m_coll_elem_single.get(), this->m_coll_elem_ single.get() ); int ret = std::use_facet< std::collate<E> >(std::loc ale()).compare(buf, buf, this->m_coll_elem_single.get(), this->m_coll_elem_ single.get() );
if( ret == 0 ) if( ret == 0 )
this->m_size =1; this->m_size =1;
else else
this->m_size = 0; this->m_size = 0;
return ret; return ret;
} }
}; };
skipping to change at line 3892 skipping to change at line 3892
l.push_back(&this->m_coll_elem_multi); l.push_back(&this->m_coll_elem_multi);
l.push_back(&this->m_right_dot); l.push_back(&this->m_right_dot);
l.push_back(&this->m_close); l.push_back(&this->m_close);
} }
const char* get_name() const const char* get_name() const
{ {
return "'[','.',collating_element_multi,'.',']'"; return "'[','.',collating_element_multi,'.',']'";
} }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
unsigned long to_compare_length = uint64_t to_compare_length =
collating_symbol<E>::get_symbol_len(buf,buf_ length); collating_symbol<E>::get_symbol_len(buf,buf_ length);
std::basic_string<E> multichar = *(m_coll_elem_multi .get()); std::basic_string<E> multichar = *(m_coll_elem_multi .get());
// check the size of element in buf - try the longe st // check the size of element in buf - try the longe st
int ret = std::use_facet< std::collate<E> >(std::loc ale()).compare(buf, buf+to_compare_length, multichar.c_str(), multichar.c_s tr() + multichar.length() ); int ret = std::use_facet< std::collate<E> >(std::loc ale()).compare(buf, buf+to_compare_length, multichar.c_str(), multichar.c_s tr() + multichar.length() );
this->m_size = to_compare_length; this->m_size = to_compare_length;
return ret; return ret;
} }
}; };
class opendot_metachar_dotclose : public collating_base class opendot_metachar_dotclose : public collating_base
skipping to change at line 3923 skipping to change at line 3923
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_open); l.push_back(&this->m_open);
l.push_back(&this->m_left_dot); l.push_back(&this->m_left_dot);
l.push_back(&this->m_meta_char); l.push_back(&this->m_meta_char);
l.push_back(&this->m_right_dot); l.push_back(&this->m_right_dot);
l.push_back(&this->m_close); l.push_back(&this->m_close);
} }
const char* get_name() const { return "'[','.',meta_char,'.' ,']'"; } const char* get_name() const { return "'[','.',meta_char,'.' ,']'"; }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
int ret = this->m_meta_char->compare(buf,buf_length) ; int ret = this->m_meta_char->compare(buf,buf_length) ;
this->m_size = 1; //this->m_meta_char->matched_size( ); this->m_size = 1; //this->m_meta_char->matched_size( );
return ret; return ret;
} }
}; };
basic_non_terminal<E, opendot_coll_elem_single_dotclose> m_coll_elem _single; basic_non_terminal<E, opendot_coll_elem_single_dotclose> m_coll_elem _single;
basic_non_terminal<E, opendot_coll_elem_multi_dotclose> m_multichar; basic_non_terminal<E, opendot_coll_elem_multi_dotclose> m_multichar;
basic_non_terminal<E, opendot_metachar_dotclose> m_metachar; basic_non_terminal<E, opendot_metachar_dotclose> m_metachar;
skipping to change at line 3951 skipping to change at line 3951
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_multichar); l.push_back(&this->m_multichar);
l.push_back(&this->m_metachar); l.push_back(&this->m_metachar);
l.push_back(&this->m_coll_elem_single); l.push_back(&this->m_coll_elem_single);
} }
const char* get_name() const { return "collating_symbol"; } const char* get_name() const { return "collating_symbol"; }
int matched_size() { return this->m_size; } int matched_size() { return this->m_size; }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
int ret = 0; int ret = 0;
if( this->m_coll_elem_single.is_parsed() ) if( this->m_coll_elem_single.is_parsed() )
{ {
ret = this->m_coll_elem_single->compare( buf, buf_le ngth ); ret = this->m_coll_elem_single->compare( buf, buf_le ngth );
this->m_size = this->m_coll_elem_single->matched_siz e(); this->m_size = this->m_coll_elem_single->matched_siz e();
} }
else if( this->m_multichar.is_parsed() ) else if( this->m_multichar.is_parsed() )
{ {
ret = this->m_multichar->compare( buf, buf_length ); ret = this->m_multichar->compare( buf, buf_length );
this->m_size = this->m_multichar->matched_size(); this->m_size = this->m_multichar->matched_size();
} }
else else
{ {
ret = this->m_metachar->compare( buf, buf_length ); ret = this->m_metachar->compare( buf, buf_length );
this->m_size = this->m_metachar->matched_size(); this->m_size = this->m_metachar->matched_size();
} }
return ret; return ret;
} }
static unsigned long get_symbol_len( const E* buf, const unsigned lo ng buf_length ) static uint64_t get_symbol_len( const E* buf, const uint64_t buf_len gth )
{ {
return 1; // TODO - see below commented out methods for the problem return 1; // TODO - see below commented out methods for the problem
} }
}; };
template<typename E> template<typename E>
class collating_choice class collating_choice
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
typedef std::ctype_base ctypebase; typedef std::ctype_base ctypebase;
skipping to change at line 4027 skipping to change at line 4027
} }
const char* get_name() const { return "escaped_circumflex"; } const char* get_name() const { return "escaped_circumflex"; }
}; };
basic_non_terminal<E,escaped_right_bracket> m_escaped_right_brac ket; basic_non_terminal<E,escaped_right_bracket> m_escaped_right_brac ket;
basic_non_terminal<E,escaped_hyphen> m_escaped_hy phen; basic_non_terminal<E,escaped_hyphen> m_escaped_hy phen;
basic_non_terminal<E,escaped_circumflex> m_escaped_ci rcumflex; basic_non_terminal<E,escaped_circumflex> m_escaped_ci rcumflex;
basic_except_terminal<E,meta_char_choice<E> > m_non_metas; basic_except_terminal<E,meta_char_choice<E> > m_non_metas;
basic_choice<E,collating_symbol<E> > m_collating_symbol; basic_choice<E,collating_symbol<E> > m_collating_symbol;
unsigned long m_size; uint64_t m_size;
public: public:
collating_choice() : m_size(0) collating_choice() : m_size(0)
{ {
} }
virtual ~collating_choice() virtual ~collating_choice()
{ {
} }
int matched_size() int matched_size()
{ {
return this->m_size; return this->m_size;
} }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
int ret = -1; int ret = -1;
this->m_size = 0; this->m_size = 0;
if( this->m_non_metas.is_parsed() ) if( this->m_non_metas.is_parsed() )
{ {
unsigned long to_compare_length = uint64_t to_compare_length =
collating_symbol<E>::get_symbol_len(buf,buf_ length); collating_symbol<E>::get_symbol_len(buf,buf_ length);
ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf, buf+to_compare_length, this->m_non_metas.get(), this->m _non_metas.get()+1 ); ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf, buf+to_compare_length, this->m_non_metas.get(), this->m _non_metas.get()+1 );
this->m_size = to_compare_length; this->m_size = to_compare_length;
} }
else if( this->m_escaped_right_bracket.is_parsed() ) else if( this->m_escaped_right_bracket.is_parsed() )
{ {
unsigned long to_compare_length = uint64_t to_compare_length =
collating_symbol<E>::get_symbol_len(buf,buf_ length); collating_symbol<E>::get_symbol_len(buf,buf_ length);
const E i(']'); const E i(']');
ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf,buf+to_compare_length,&i, &i+1 ); ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf,buf+to_compare_length,&i, &i+1 );
this->m_size = 1; this->m_size = 1;
this->m_size = 1; this->m_size = 1;
} }
else if( this->m_escaped_hyphen.is_parsed() ) else if( this->m_escaped_hyphen.is_parsed() )
{ {
unsigned long to_compare_length = uint64_t to_compare_length =
collating_symbol<E>::get_symbol_len(buf,buf_ length); collating_symbol<E>::get_symbol_len(buf,buf_ length);
const E i('-'); const E i('-');
ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf,buf+to_compare_length,&i,&i+1 ); ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf,buf+to_compare_length,&i,&i+1 );
this->m_size = 1; this->m_size = 1;
} }
else if( this->m_escaped_circumflex.is_parsed() ) else if( this->m_escaped_circumflex.is_parsed() )
{ {
unsigned long to_compare_length = uint64_t to_compare_length =
collating_symbol<E>::get_symbol_len(buf,buf_ length); collating_symbol<E>::get_symbol_len(buf,buf_ length);
const E i('^'); const E i('^');
ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf,buf+to_compare_length,&i,&i+1 ); ret = std::use_facet< std::collate<E> >(std::locale( )).compare(buf,buf+to_compare_length,&i,&i+1 );
this->m_size = 1; this->m_size = 1;
} }
else else
{ {
ret = this->m_collating_symbol->compare(buf,buf_leng th); ret = this->m_collating_symbol->compare(buf,buf_leng th);
this->m_size = this->m_collating_symbol->matched_siz e(); this->m_size = this->m_collating_symbol->matched_siz e();
} }
skipping to change at line 4161 skipping to change at line 4161
l.push_back(&this->m_graph); l.push_back(&this->m_graph);
l.push_back(&this->m_punct); l.push_back(&this->m_punct);
l.push_back(&this->m_xdigit); l.push_back(&this->m_xdigit);
} }
const char * get_name() const const char * get_name() const
{ {
return "class_name"; return "class_name";
} }
unsigned long compare( const E* buf, const unsigned long buf_length ) uint64_t compare( const E* buf, const uint64_t buf_length )
{ {
// CHANGE:: std::ctype_base t; // CHANGE:: std::ctype_base t;
// CHANGE:: int ret = 0; // CHANGE:: int ret = 0;
ctypebase::mask m; ctypebase::mask m;
if( this->m_alnum.is_parsed() ) m=ctypebase::alnum; if( this->m_alnum.is_parsed() ) m=ctypebase::alnum;
if( this->m_cntrl.is_parsed() ) m=ctypebase::cntrl; if( this->m_cntrl.is_parsed() ) m=ctypebase::cntrl;
if( this->m_lower.is_parsed() ) m=ctypebase::lower; if( this->m_lower.is_parsed() ) m=ctypebase::lower;
if( this->m_space.is_parsed() ) m=ctypebase::space; if( this->m_space.is_parsed() ) m=ctypebase::space;
if( this->m_alpha.is_parsed() ) m=ctypebase::alpha; if( this->m_alpha.is_parsed() ) m=ctypebase::alpha;
skipping to change at line 4223 skipping to change at line 4223
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_open); l.push_back(&this->m_open);
l.push_back(&this->m_open_colon); l.push_back(&this->m_open_colon);
l.push_back(&this->m_class_name); l.push_back(&this->m_class_name);
l.push_back(&this->m_close_colon); l.push_back(&this->m_close_colon);
l.push_back(&this->m_close); l.push_back(&this->m_close);
} }
const char* get_name() const { return "'[',':',class_name,':',']'"; } const char* get_name() const { return "'[',':',class_name,':',']'"; }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
return this->m_class_name->compare(buf,buf_length); return this->m_class_name->compare(buf,buf_length);
} }
unsigned long matched_size() { return this->m_class_name->matched_si ze(); } uint64_t matched_size() { return this->m_class_name->matched_size(); }
}; };
template<typename E> template<typename E>
class equivalence_class class equivalence_class
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
class equivalence_base class equivalence_base
{ {
skipping to change at line 4266 skipping to change at line 4266
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_open); l.push_back(&this->m_open);
l.push_back(&this->m_left_equal); l.push_back(&this->m_left_equal);
l.push_back(&this->m_coll_elem_single); l.push_back(&this->m_coll_elem_single);
l.push_back(&this->m_right_equal); l.push_back(&this->m_right_equal);
l.push_back(&this->m_close); l.push_back(&this->m_close);
} }
const char* get_name() const { return "'[','=',collating_ele m_single,'=',']'"; } const char* get_name() const { return "'[','=',collating_ele m_single,'=',']'"; }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
int ret = std::use_facet< std::collate<E> >(std::loc ale()).compare( int ret = std::use_facet< std::collate<E> >(std::loc ale()).compare(
buf, buf,
buf, buf,
m_coll_elem_single.get(), m_coll_elem_single.get(),
m_coll_elem_single.get() ); m_coll_elem_single.get() );
if( ret == 0 ) if( ret == 0 )
this->m_size = 1; this->m_size = 1;
else else
this->m_size = 0; this->m_size = 0;
skipping to change at line 4302 skipping to change at line 4302
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_open); l.push_back(&this->m_open);
l.push_back(&this->m_left_equal); l.push_back(&this->m_left_equal);
l.push_back(&this->m_coll_elem_multi); l.push_back(&this->m_coll_elem_multi);
l.push_back(&this->m_right_equal); l.push_back(&this->m_right_equal);
l.push_back(&this->m_close); l.push_back(&this->m_close);
} }
const char* get_name() const { return "'[','.',collating_ele m_multi,'.',']'"; } const char* get_name() const { return "'[','.',collating_ele m_multi,'.',']'"; }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
unsigned long to_compare_length = 0; uint64_t to_compare_length = 0;
// check the size of element in buf - try the longe st // check the size of element in buf - try the longe st
while( to_compare_length < buf_length ) while( to_compare_length < buf_length )
{ {
to_compare_length++; to_compare_length++;
ctypebase::mask m = ctypebase::print; ctypebase::mask m = ctypebase::print;
if( !std::use_facet< std::ctype<E> >(std::lo cale()).is( buf, if( !std::use_facet< std::ctype<E> >(std::lo cale()).is( buf,
buf+to_compare_lengt h, &m ) ) buf+to_compare_lengt h, &m ) )
{ {
break; break;
} }
skipping to change at line 4355 skipping to change at line 4355
{ {
l.push_back(&this->m_coll_elem_single); l.push_back(&this->m_coll_elem_single);
l.push_back(&this->m_multichar); l.push_back(&this->m_multichar);
} }
const char * get_name() const const char * get_name() const
{ {
return "equivalence_class"; return "equivalence_class";
} }
int compare( const E* buf, const unsigned long buf_length ) int compare( const E* buf, const uint64_t buf_length )
{ {
int ret = 0; int ret = 0;
if( this->m_coll_elem_single.is_parsed() ) if( this->m_coll_elem_single.is_parsed() )
{ {
ret = this->m_coll_elem_single->compare( buf, buf_le ngth ); ret = this->m_coll_elem_single->compare( buf, buf_le ngth );
this->m_size = this->m_coll_elem_single->matched_siz e(); this->m_size = this->m_coll_elem_single->matched_siz e();
} }
else else
{ {
ret = this->m_multichar->compare( buf, buf_length ); ret = this->m_multichar->compare( buf, buf_length );
skipping to change at line 4382 skipping to change at line 4382
template<typename E> template<typename E>
class single_expression class single_expression
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
basic_choice<E,collating_choice<E> > m_collating_choice; basic_choice<E,collating_choice<E> > m_collating_choice;
basic_non_terminal<E,character_class<E> > m_character_class; basic_non_terminal<E,character_class<E> > m_character_class;
basic_choice<E,equivalence_class<E> > m_equivalence_class; basic_choice<E,equivalence_class<E> > m_equivalence_class;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
int ret = 0; int ret = 0;
int size = 0; int size = 0;
if( this->m_collating_choice.is_parsed() ) if( this->m_collating_choice.is_parsed() )
{ {
ret = this->m_collating_choice->compare(buf,buf_leng th); ret = this->m_collating_choice->compare(buf,buf_leng th);
size = this->m_collating_choice->matched_size(); size = this->m_collating_choice->matched_size();
} }
else if( this->m_character_class.is_parsed() ) else if( this->m_character_class.is_parsed() )
{ {
skipping to change at line 4438 skipping to change at line 4438
template<typename E> template<typename E>
class start_range class start_range
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
basic_choice<E,collating_choice<E> > m_collating_choice; basic_choice<E,collating_choice<E> > m_collating_choice;
basic_terminal<E,'-'> m_hyphen; basic_terminal<E,'-'> m_hyphen;
int m_size; int m_size;
public: public:
int compare(const E* buf, const unsigned long buf_length) int compare(const E* buf, const uint64_t buf_length)
{ {
// CHANGE:: int ret = this->m_collating_choice->compare(buf, buf_length); // CHANGE:: int ret = this->m_collating_choice->compare(buf, buf_length);
this->m_size = this->m_collating_choice->matched_size(); this->m_size = this->m_collating_choice->matched_size();
// CHANGE:: // CHANGE::
return 0; return 0;
} }
int matched_size() int matched_size()
skipping to change at line 4485 skipping to change at line 4485
class range_expression class range_expression
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
class start_range_and_end_range class start_range_and_end_range
{ {
basic_non_terminal<E,start_range<E> > m_start_range; basic_non_terminal<E,start_range<E> > m_start_range;
basic_choice<E,collating_choice<E> > m_end_range; basic_choice<E,collating_choice<E> > m_end_range;
public: public:
unsigned long recognize( const E* buf, const unsigned long b uf_length ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
int start_ret = this->m_start_range->compare(buf,buf _length); int start_ret = this->m_start_range->compare(buf,buf _length);
int size = this->m_start_range->matched_size(); int size = this->m_start_range->matched_size();
while( start_ret < 0 && size > 1) while( start_ret < 0 && size > 1)
{ {
size--; size--;
// while the buf is not higher as start rang e, try smaller - // while the buf is not higher as start rang e, try smaller -
// collating symbol in buffer // collating symbol in buffer
start_ret = this->m_start_range->compare(buf ,size); start_ret = this->m_start_range->compare(buf ,size);
} }
skipping to change at line 4531 skipping to change at line 4531
const char* get_name() const { return "start_range,end_range "; } const char* get_name() const { return "start_range,end_range "; }
}; };
class start_range_and_hyphen class start_range_and_hyphen
{ {
basic_non_terminal<E,start_range<E> > m_start_range; basic_non_terminal<E,start_range<E> > m_start_range;
basic_terminal<E,'-'> m_hyphen; basic_terminal<E,'-'> m_hyphen;
public: public:
unsigned long recognize( const E* buf, const unsigned long b uf_length ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
int start_ret = this->m_start_range->compare(buf,buf _length); int start_ret = this->m_start_range->compare(buf,buf _length);
int size = this->m_start_range->matched_size(); int size = this->m_start_range->matched_size();
while( start_ret < 0 && size > 1) while( start_ret < 0 && size > 1)
{ {
size--; size--;
// while the buf is not higher as start rang e, try smaller - // while the buf is not higher as start rang e, try smaller -
// collating symbol in buffer // collating symbol in buffer
start_ret = this->m_start_range->compare(buf ,size); start_ret = this->m_start_range->compare(buf ,size);
} }
skipping to change at line 4593 skipping to change at line 4593
{ {
return "start_range,-"; return "start_range,-";
} }
}; };
basic_non_terminal<E,start_range_and_end_range > m_start_end_range; basic_non_terminal<E,start_range_and_end_range > m_start_end_range;
basic_non_terminal<E,start_range_and_hyphen > m_start_and_hyphen; basic_non_terminal<E,start_range_and_hyphen > m_start_and_hyphen;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
if( this->m_start_end_range.is_parsed() ) if( this->m_start_end_range.is_parsed() )
{ {
return this->m_start_end_range->recognize(buf,buf_le ngth); return this->m_start_end_range->recognize(buf,buf_le ngth);
} }
else else
{ {
return this->m_start_and_hyphen->recognize(buf,buf_l ength); return this->m_start_and_hyphen->recognize(buf,buf_l ength);
} }
} }
skipping to change at line 4626 skipping to change at line 4626
template<typename E> template<typename E>
class expression_term class expression_term
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
basic_choice<E,single_expression<E> > basic_choice<E,single_expression<E> >
m_single_expression; m_single_expression;
basic_choice<E,range_expression<E> > basic_choice<E,range_expression<E> >
m_range_expression; m_range_expression;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
if( this->m_single_expression.is_parsed() ) if( this->m_single_expression.is_parsed() )
{ {
return this->m_single_expression->recognize(buf,buf_ length); return this->m_single_expression->recognize(buf,buf_ length);
} }
else else
{ {
return this->m_range_expression->recognize(buf,buf_l ength); return this->m_range_expression->recognize(buf,buf_l ength);
} }
} }
skipping to change at line 4670 skipping to change at line 4670
class follow_list class follow_list
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
public: public:
class follow_list_and_expression_term class follow_list_and_expression_term
{ {
basic_choice<E,follow_list<E> > m_follow_lis t; basic_choice<E,follow_list<E> > m_follow_lis t;
basic_choice<E,expression_term<E> > m_expression _term; basic_choice<E,expression_term<E> > m_expression _term;
public: public:
unsigned long recognize( const E* buf, const unsigned long b uf_length ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
unsigned long size = this->m_follow_list->recognize( buf,buf_length); uint64_t size = this->m_follow_list->recognize(buf,b uf_length);
if( size == 0 ) if( size == 0 )
{ {
size = this->m_expression_term->recognize(bu f,buf_length); size = this->m_expression_term->recognize(bu f,buf_length);
} }
return size; return size;
} }
follow_list_and_expression_term() follow_list_and_expression_term()
{ {
} }
skipping to change at line 4705 skipping to change at line 4705
{ {
return "follow_list,expression_term"; return "follow_list,expression_term";
} }
}; };
basic_choice<E,expression_term<E> > m_expression_term; basic_choice<E,expression_term<E> > m_expression_term;
basic_non_terminal<E,follow_list_and_expression_term > m_follow_and_ expression; basic_non_terminal<E,follow_list_and_expression_term > m_follow_and_ expression;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
if( this->m_expression_term.is_parsed() ) if( this->m_expression_term.is_parsed() )
{ {
return this->m_expression_term->recognize(buf,buf_le ngth); return this->m_expression_term->recognize(buf,buf_le ngth);
} }
else else
{ {
return this->m_follow_and_expression->recognize(buf, buf_length); return this->m_follow_and_expression->recognize(buf, buf_length);
} }
} }
skipping to change at line 4750 skipping to change at line 4750
class bracket_list class bracket_list
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
class follow_list_and_hyphen class follow_list_and_hyphen
{ {
basic_choice<E,follow_list<E> > m_follow_list; basic_choice<E,follow_list<E> > m_follow_list;
basic_terminal<E,'-'> m_hyphen; basic_terminal<E,'-'> m_hyphen;
public: public:
unsigned long recognize( const E* buf, const unsigned long b uf_length ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
unsigned long size = this->m_follow_list->recognize( buf,buf_length); uint64_t size = this->m_follow_list->recognize(buf,b uf_length);
if( size == 0 ) if( size == 0 )
{ {
if( buf[0] == this->m_hyphen.get_valid() ) if( buf[0] == this->m_hyphen.get_valid() )
{ {
size = 1; size = 1;
} }
} }
return size; return size;
} }
follow_list_and_hyphen() {}; follow_list_and_hyphen() {};
skipping to change at line 4779 skipping to change at line 4779
} }
const char* get_name() const { return "follow_list,'-'"; } const char* get_name() const { return "follow_list,'-'"; }
}; };
class hyphen_and_follow_list class hyphen_and_follow_list
{ {
basic_terminal<E,'-'> m_hy phen; basic_terminal<E,'-'> m_hy phen;
basic_choice<E,follow_list<E> > m_follow_lis t; basic_choice<E,follow_list<E> > m_follow_lis t;
public: public:
unsigned long recognize( const E* buf, const unsigned long b uf_length ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
if( buf[0] == this->m_hyphen.get_valid() ) if( buf[0] == this->m_hyphen.get_valid() )
{ {
return 1; return 1;
} }
else else
{ {
return this->m_follow_list->recognize(buf,bu f_length); return this->m_follow_list->recognize(buf,bu f_length);
} }
} }
skipping to change at line 4809 skipping to change at line 4809
{ {
protected: protected:
basic_terminal<E,'-'> m_hyphen; basic_terminal<E,'-'> m_hyphen;
basic_terminal<E,'-'> m_sep; basic_terminal<E,'-'> m_sep;
basic_choice<E,collating_choice<E> > m_en d_range; basic_choice<E,collating_choice<E> > m_en d_range;
public: public:
virtual ~hyphen_hyphen_end_range() virtual ~hyphen_hyphen_end_range()
{ {
} }
virtual unsigned long recognize( const E* buf, const unsigned long buf_length ) virtual uint64_t recognize( const E* buf, const uint 64_t buf_length )
{ {
std::locale l; std::locale l;
int end_ret = this->m_end_range->compare(buf ,buf_length); int end_ret = this->m_end_range->compare(buf ,buf_length);
int size = this->m_end_range->matched_size() ; int size = this->m_end_range->matched_size() ;
while( end_ret > 0 && size > 1) while( end_ret > 0 && size > 1)
{ {
size--; size--;
// while the buf is not higher as st art range, try smaller - // while the buf is not higher as st art range, try smaller -
// collating symbol in buffer // collating symbol in buffer
skipping to change at line 4857 skipping to change at line 4857
class hyphen_hyphen_endrange_follow_list : public hyphen_hyphen_end_ range class hyphen_hyphen_endrange_follow_list : public hyphen_hyphen_end_ range
{ {
protected: protected:
basic_choice<E,follow_list<E> > m_follow_list; basic_choice<E,follow_list<E> > m_follow_list;
public: public:
virtual ~hyphen_hyphen_endrange_follow_list() virtual ~hyphen_hyphen_endrange_follow_list()
{ {
} }
virtual unsigned long recognize( const E* buf, const unsigned long buf_length ) virtual uint64_t recognize( const E* buf, const uint 64_t buf_length )
{ {
int ret = hyphen_hyphen_end_range::recognize (buf,buf_length); int ret = hyphen_hyphen_end_range::recognize (buf,buf_length);
if( ret == 0 ) if( ret == 0 )
{ {
return this->m_follow_list->recogniz e(buf,buf_length); return this->m_follow_list->recogniz e(buf,buf_length);
} }
else else
{ {
return ret; return ret;
} }
skipping to change at line 4892 skipping to change at line 4892
class right_bracket_follow_list class right_bracket_follow_list
{ {
protected: protected:
basic_terminal<E,']'> m_right_bracket; basic_terminal<E,']'> m_right_bracket;
basic_choice<E,follow_list<E> > m_fo llow_list; basic_choice<E,follow_list<E> > m_fo llow_list;
public: public:
virtual ~right_bracket_follow_list() virtual ~right_bracket_follow_list()
{ {
} }
virtual unsigned long recognize( const E* buf, const unsigned long buf_length ) virtual uint64_t recognize( const E* buf, const uint 64_t buf_length )
{ {
if( buf_length > 0 && buf[0] == ']' ) if( buf_length > 0 && buf[0] == ']' )
{ {
return this->m_follow_list->recogniz e(buf+1,buf_length-1); return this->m_follow_list->recogniz e(buf+1,buf_length-1);
} }
else else
{ {
return 0; return 0;
} }
} }
skipping to change at line 4920 skipping to change at line 4920
basic_choice<E,follow_list<E> > m_follow_list; basic_choice<E,follow_list<E> > m_follow_list;
basic_non_terminal<E,follow_list_and_hyphen > m_follow_list_hyphen ; basic_non_terminal<E,follow_list_and_hyphen > m_follow_list_hyphen ;
basic_non_terminal<E,hyphen_and_follow_list > m_hyphen_follow_list ; basic_non_terminal<E,hyphen_and_follow_list > m_hyphen_follow_list ;
basic_non_terminal<E,hyphen_hyphen_end_range> m_hyphen_hyphen_end_ range; basic_non_terminal<E,hyphen_hyphen_end_range> m_hyphen_hyphen_end_ range;
basic_non_terminal<E,hyphen_hyphen_endrange_follow_list> m_hyphen_hy phen_endrange_follow; basic_non_terminal<E,hyphen_hyphen_endrange_follow_list> m_hyphen_hy phen_endrange_follow;
basic_non_terminal<E,right_bracket_follow_list> m_right_bracket_foll ow_list; basic_non_terminal<E,right_bracket_follow_list> m_right_bracket_foll ow_list;
basic_terminal<E,']'> m_right_bracket; basic_terminal<E,']'> m_right_bracket;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
if( this->m_follow_list.is_parsed() ) if( this->m_follow_list.is_parsed() )
{ {
return this->m_follow_list->recognize(buf,buf_length ); return this->m_follow_list->recognize(buf,buf_length );
} }
else if( this->m_follow_list_hyphen.is_parsed() ) else if( this->m_follow_list_hyphen.is_parsed() )
{ {
return this->m_follow_list_hyphen->recognize(buf,buf _length); return this->m_follow_list_hyphen->recognize(buf,buf _length);
} }
else if( this->m_hyphen_follow_list.is_parsed() ) else if( this->m_hyphen_follow_list.is_parsed() )
skipping to change at line 4995 skipping to change at line 4995
}; };
template<typename E> template<typename E>
class nonmatching_list class nonmatching_list
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
basic_terminal<E, '^'> m_circumflex; basic_terminal<E, '^'> m_circumflex;
basic_choice<E, bracket_list<E> > m_bracket_list; basic_choice<E, bracket_list<E> > m_bracket_list;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
// not recognized // not recognized
if( this->m_bracket_list->recognize(buf,buf_length) == 0 ) if( this->m_bracket_list->recognize(buf,buf_length) == 0 )
{ {
return 1; // TODO - if collating element size is mor e then 1? return 1; // TODO - if collating element size is mor e then 1?
} }
return 0; return 0;
} }
skipping to change at line 5033 skipping to change at line 5033
} }
}; };
template<typename E> template<typename E>
class matching_list class matching_list
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
basic_choice<E,bracket_list<E> > m_bracket_list; basic_choice<E,bracket_list<E> > m_bracket_list;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
return this->m_bracket_list->recognize(buf,buf_length); return this->m_bracket_list->recognize(buf,buf_length);
} }
matching_list() matching_list()
{ {
} }
virtual ~matching_list() virtual ~matching_list()
{ {
skipping to change at line 5068 skipping to change at line 5068
template<typename E> template<typename E>
class bracket_expr class bracket_expr
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
class left_bracket_nonmatching_list_right_bracket{ class left_bracket_nonmatching_list_right_bracket{
basic_terminal<E,'['> m_left_bracket; basic_terminal<E,'['> m_left_bracket;
basic_non_terminal<E,nonmatching_list<E> > m_nonmatching_lis t; basic_non_terminal<E,nonmatching_list<E> > m_nonmatching_lis t;
basic_terminal<E,']'> m_right_bracket; basic_terminal<E,']'> m_right_bracket;
public: public:
unsigned long recognize( const E* buf, const unsigned long b uf_length ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
return this->m_nonmatching_list->recognize(buf,buf_l ength); return this->m_nonmatching_list->recognize(buf,buf_l ength);
} }
left_bracket_nonmatching_list_right_bracket() : left_bracket_nonmatching_list_right_bracket() :
m_nonmatching_list() m_nonmatching_list()
{ {
} }
virtual ~left_bracket_nonmatching_list_right_bracket() virtual ~left_bracket_nonmatching_list_right_bracket()
skipping to change at line 5101 skipping to change at line 5101
return "[nonmatching_list]"; return "[nonmatching_list]";
} }
}; };
class left_bracket_matching_list_rigth_bracket class left_bracket_matching_list_rigth_bracket
{ {
basic_terminal<E,'['> m_le ft_bracket; basic_terminal<E,'['> m_le ft_bracket;
basic_non_terminal<E,matching_list<E> > m_matching_list; basic_non_terminal<E,matching_list<E> > m_matching_list;
basic_terminal<E,']'> m_ri ght_bracket; basic_terminal<E,']'> m_ri ght_bracket;
public: public:
unsigned long recognize( const E* buf, const unsigned long b uf_length ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
return this->m_matching_list->recognize(buf,buf_leng th); return this->m_matching_list->recognize(buf,buf_leng th);
} }
public: public:
left_bracket_matching_list_rigth_bracket() : left_bracket_matching_list_rigth_bracket() :
m_matching_list() m_matching_list()
{ {
} }
virtual ~left_bracket_matching_list_rigth_bracket() virtual ~left_bracket_matching_list_rigth_bracket()
skipping to change at line 5133 skipping to change at line 5133
{ {
return "[matching_list]"; return "[matching_list]";
} }
}; };
basic_non_terminal<E,left_bracket_matching_list_rigth_bracket > m_ma tching; basic_non_terminal<E,left_bracket_matching_list_rigth_bracket > m_ma tching;
basic_non_terminal<E,left_bracket_nonmatching_list_right_bracket > m _nonmatching; basic_non_terminal<E,left_bracket_nonmatching_list_right_bracket > m _nonmatching;
public: public:
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
if( this->m_matching.is_parsed() ) if( this->m_matching.is_parsed() )
{ {
return this->m_matching->recognize(buf,buf_length); return this->m_matching->recognize(buf,buf_length);
} }
else else
{ {
return this->m_nonmatching->recognize(buf,buf_length ); return this->m_nonmatching->recognize(buf,buf_length );
} }
} }
skipping to change at line 5220 skipping to change at line 5220
l.push_back(&this->m_vertical_line); l.push_back(&this->m_vertical_line);
l.push_back(&this->m_circumflex); l.push_back(&this->m_circumflex);
l.push_back(&this->m_dollar); l.push_back(&this->m_dollar);
} }
const char * get_name() const const char * get_name() const
{ {
return "special_chars"; return "special_chars";
} }
unsigned long recognize( const E* buf, const unsigned long buf_lengt h ) uint64_t recognize( const E* buf, const uint64_t buf_length )
{ {
E c=0; E c=0;
if( this->m_period.is_parsed() ) c = this->m_period.get_vali d(); if( this->m_period.is_parsed() ) c = this->m_period.get_vali d();
else if( this->m_left_bracket.is_parsed() ) c = this->m_left _bracket.get_valid(); else if( this->m_left_bracket.is_parsed() ) c = this->m_left _bracket.get_valid();
else if( this->m_backslash.is_parsed() ) c = this->m_backsla sh.get_valid(); else if( this->m_backslash.is_parsed() ) c = this->m_backsla sh.get_valid();
else if( this->m_left_parenthesis.is_parsed() ) c = this->m_ left_parenthesis.get_valid(); else if( this->m_left_parenthesis.is_parsed() ) c = this->m_ left_parenthesis.get_valid();
else if( this->m_right_parenthesis.is_parsed() ) c = this->m _right_parenthesis.get_valid(); else if( this->m_right_parenthesis.is_parsed() ) c = this->m _right_parenthesis.get_valid();
else if( this->m_asterix.is_parsed() ) c = this->m_asterix.g et_valid(); else if( this->m_asterix.is_parsed() ) c = this->m_asterix.g et_valid();
else if( this->m_plus.is_parsed() ) c = this->m_plus.get_val id(); else if( this->m_plus.is_parsed() ) c = this->m_plus.get_val id();
else if( this->m_question_mark.is_parsed() ) c = this->m_que stion_mark.get_valid(); else if( this->m_question_mark.is_parsed() ) c = this->m_que stion_mark.get_valid();
skipping to change at line 5289 skipping to change at line 5289
{ {
} }
void push_parsers( parser_list &l ) void push_parsers( parser_list &l )
{ {
l.push_back(&this->m_backslash); l.push_back(&this->m_backslash);
l.push_back(&this->m_spec_chars); l.push_back(&this->m_spec_chars);
} }
const char* get_name() const { return "\\special_chars"; } const char* get_name() const { return "\\special_chars"; }
unsigned long recognize( const E* buf, uint64_t recognize( const E* buf,
const unsigned long buf_length ) const uint64_t buf_length )
{ {
return this->m_spec_chars->recognize(buf,buf_length) ; return this->m_spec_chars->recognize(buf,buf_length) ;
} }
}; };
basic_except_terminal<E,special_chars<E> > basic_except_terminal<E,special_chars<E> >
m_ord_char; m_ord_char;
basic_non_terminal<E,quoted_char> m_quoted_char; basic_non_terminal<E,quoted_char> m_quoted_char;
basic_terminal<E,'.'> m_dot; basic_terminal<E,'.'> m_dot;
basic_choice<E, bracket_expr_type > m_bracket_expr; basic_choice<E, bracket_expr_type > m_bracket_expr;
public: public:
skipping to change at line 5322 skipping to change at line 5322
l.push_back(&this->m_quoted_char); l.push_back(&this->m_quoted_char);
l.push_back(&this->m_dot); l.push_back(&this->m_dot);
l.push_back(&this->m_bracket_expr); l.push_back(&this->m_bracket_expr);
} }
const char* get_name() const const char* get_name() const
{ {
return "one_char|collating_element"; return "one_char|collating_element";
} }
unsigned long recognize( const E* buf, const unsigned long buf_lengt h, const unsigned long buf_offset ) uint64_t recognize( const E* buf, const uint64_t buf_length, const u int64_t buf_offset )
{ {
if( this->m_ord_char.is_parsed() ) if( this->m_ord_char.is_parsed() )
{ {
if( this->m_ord_char.get_valid() == buf[buf_offset] ) if( this->m_ord_char.get_valid() == buf[buf_offset] )
{ {
return collating_symbol_type::get_symbol_len (buf+buf_offset, buf_length-buf_offset); return collating_symbol_type::get_symbol_len (buf+buf_offset, buf_length-buf_offset);
} }
else else
{ {
return 0; return 0;
skipping to change at line 5386 skipping to change at line 5386
basic_terminal<E,')'> m_right_pare n; basic_terminal<E,')'> m_right_pare n;
public: public:
subexpression() : ere_base<E>() subexpression() : ere_base<E>()
{ {
} }
virtual ~subexpression() virtual ~subexpression()
{ {
} }
unsigned long recognize( const E* buf, const unsigned long b uint64_t recognize( const E* buf, const uint64_t buf_length,
uf_length, const unsigned long buf_offset, bool try_positions = true ); const uint64_t buf_offset, bool try_positions = true );
void assign_matches( matches::match_key key, unsigned long& void assign_matches( matches::match_key key, uint64_t& branc
branch_pos, matches& m ); h_pos, matches& m );
void push_parsers( parser_list& l ); void push_parsers( parser_list& l );
const char* get_name() const const char* get_name() const
{ {
return "(subexpression)"; return "(subexpression)";
} }
}; };
class ere_expression_no_dup : public ere_expression<E> class ere_expression_no_dup : public ere_expression<E>
skipping to change at line 5417 skipping to change at line 5417
} }
const char* get_name() const { return "one_char_or_c oll_elem_ere | '^' | '$' | (subexpression)"; } const char* get_name() const { return "one_char_or_c oll_elem_ere | '^' | '$' | (subexpression)"; }
}; };
class ere_expression_and_dupl : public ere_base<E> class ere_expression_and_dupl : public ere_base<E>
{ {
basic_choice<E,ere_expression_no_dup > m_ere; basic_choice<E,ere_expression_no_dup > m_ere;
basic_choice<E, ere_dups<E> > m_dup; basic_choice<E, ere_dups<E> > m_dup;
matches m_matches; matches m_matches;
unsigned long divide_and_recognize( const E* buf, const unsi gned long buf_length, const unsigned long buf_offset, unsigned long rep, bo ol assign_matches ); uint64_t divide_and_recognize( const E* buf, const uint64_t buf_length, const uint64_t buf_offset, uint64_t rep, bool assign_matches );
public: public:
ere_expression_and_dupl() : ere_base<E>() ere_expression_and_dupl() : ere_base<E>()
{ {
} }
virtual ~ere_expression_and_dupl() virtual ~ere_expression_and_dupl()
{ {
} }
unsigned long recognize( const E* buf, const unsigned long b uint64_t recognize( const E* buf, const uint64_t buf_length,
uf_length, const unsigned long buf_offset, bool try_positions = true ); const uint64_t buf_offset, bool try_positions = true );
void assign_matches( matches::match_key key, unsigned long& void assign_matches( matches::match_key key, uint64_t& branc
branch_pos, matches& m ); h_pos, matches& m );
void push_parsers( parser_list& l ); void push_parsers( parser_list& l );
const char* get_name() const const char* get_name() const
{ {
return "ere_expression,dupl"; return "ere_expression,dupl";
} }
bool is_lazy() bool is_lazy()
{ {
return this->m_dup.is_parsed() && this->m_dup->is_la zy(); return this->m_dup.is_parsed() && this->m_dup->is_la zy();
} }
skipping to change at line 5480 skipping to change at line 5480
bool is_subexpression() bool is_subexpression()
{ {
return this->m_subexpression.is_parsed(); return this->m_subexpression.is_parsed();
} }
bool is_lazy() bool is_lazy()
{ {
return this->m_ere_expr_and_dup.is_parsed() && this->m_ere_e xpr_and_dup->is_lazy(); return this->m_ere_expr_and_dup.is_parsed() && this->m_ere_e xpr_and_dup->is_lazy();
} }
unsigned long recognize( const E* buf, const unsigned long buf_lengt uint64_t recognize( const E* buf, const uint64_t buf_length, const u
h, const unsigned long buf_offset, bool try_positions = true ); int64_t buf_offset, bool try_positions = true );
void assign_matches( matches::match_key key, unsigned long& branch_p void assign_matches( matches::match_key key, uint64_t& branch_pos, m
os, matches& m ); atches& m );
void push_parsers( parser_list& l ); void push_parsers( parser_list& l );
const char* get_name() const const char* get_name() const
{ {
return "ere_expression"; return "ere_expression";
} }
}; };
template< typename E > class ere_expression; template< typename E > class ere_expression;
skipping to change at line 5524 skipping to change at line 5524
parser_list; parser_list;
class ere_expression_ere_branch : public ere_base<E> class ere_expression_ere_branch : public ere_base<E>
{ {
basic_choice<E, ere_expression<E> > m_ere_expression; basic_choice<E, ere_expression<E> > m_ere_expression;
basic_choice<E, ere_branch<E> > m_ere_branch; basic_choice<E, ere_branch<E> > m_ere_branch;
public: public:
ere_expression_ere_branch() : ere_base<E>() {}; ere_expression_ere_branch() : ere_base<E>() {};
~ere_expression_ere_branch() {}; ~ere_expression_ere_branch() {};
unsigned long recognize( const E* buf, uint64_t recognize( const E* buf,
const unsigned long buf_length, const uint64_t buf_length,
const unsigned long buf_offset, const uint64_t buf_offset,
bool try_positions = true ); bool try_positions = true );
void push_parsers( parser_list& l ); void push_parsers( parser_list& l );
const char* get_name() const { return "ere_expression,ere_br anch"; } const char* get_name() const { return "ere_expression,ere_br anch"; }
void assign_matches( matches::match_key parent_address, void assign_matches( matches::match_key parent_address,
unsigned long& branch_pos, uint64_t& branch_pos,
matches& m ); matches& m );
}; };
basic_choice<E, ere_expression<E> > m_ere; basic_choice<E, ere_expression<E> > m_ere;
basic_non_terminal<E,ere_expression_ere_branch> m_ere_expression_ere _branch; basic_non_terminal<E,ere_expression_ere_branch> m_ere_expression_ere _branch;
public: public:
ere_branch() : ere_branch() :
ere_base<E>(), ere_base<E>(),
m_ere_expression_ere_branch() m_ere_expression_ere_branch()
{ {
} }
virtual ~ere_branch() virtual ~ere_branch()
{ {
} }
unsigned long recognize( const E* buf, const unsigned long buf_lengt h, const unsigned long buf_offset, bool try_positions = true ); uint64_t recognize( const E* buf, const uint64_t buf_length, const u int64_t buf_offset, bool try_positions = true );
void assign_matches( matches::match_key parent_address, unsigned lon g& branch_pos, matches& m ); void assign_matches( matches::match_key parent_address, uint64_t& br anch_pos, matches& m );
bool is_right_anchor() bool is_right_anchor()
{ {
return this->m_ere.is_parsed() && this->m_ere->is_right_anch or(); return this->m_ere.is_parsed() && this->m_ere->is_right_anch or();
} }
void push_parsers( parser_list& l ); void push_parsers( parser_list& l );
const char* get_name() const const char* get_name() const
{ {
return "ere_branch"; return "ere_branch";
} }
}; };
/* /*
unsigned long collating_symbol<char>::get_symbol_len( const char* buf, c onst unsigned long buf_length ) uint64_t collating_symbol<char>::get_symbol_len( const char* buf, const uint64_t buf_length )
{ {
// TODO - don't know how to test this - when mbrlen returns value > 1? // TODO - don't know how to test this - when mbrlen returns value > 1?
// I tested with setting the diferent locales and sending digraph values (l ike ch for // I tested with setting the diferent locales and sending digraph values (l ike ch for
// czech locale, but never get value > 1 // czech locale, but never get value > 1
//std::mbstate_t state; //std::mbstate_t state;
//std::memset( &state,'\0',sizeof(state) ); //std::memset( &state,'\0',sizeof(state) );
return 1; return 1;
int len = mblen( buf, buf_length ); int len = mblen( buf, buf_length );
if( len < 0 ) if( len < 0 )
{ {
len = 0; len = 0;
} }
return (unsigned long)len; return (uint64_t)len;
} }
unsigned long collating_symbol<wchar_t>::get_symbol_len( const wchar_t* buf uint64_t collating_symbol<wchar_t>::get_symbol_len( const wchar_t* buf,
, const uint64_t buf_length )
const unsigned long buf_length )
{ {
// TODO - check, if this is OK // TODO - check, if this is OK
if( buf_length > 0 ) if( buf_length > 0 )
return 1; return 1;
else else
return 0; return 0;
} }
*/ */
/*! /*!
skipping to change at line 5632 skipping to change at line 5632
basic_choice<E, extended_reg_exp<E> > m_ext_regexp; basic_choice<E, extended_reg_exp<E> > m_ext_regexp;
public: public:
ere_branch_or_extended_reg_exp() : ere_base<E>() ere_branch_or_extended_reg_exp() : ere_base<E>()
{ {
} }
~ere_branch_or_extended_reg_exp() ~ere_branch_or_extended_reg_exp()
{ {
} }
unsigned long recognize( const E* buf, const unsigned long b uint64_t recognize( const E* buf, const uint64_t buf_length,
uf_length, const unsigned long buf_offset, bool try_positions = true ); const uint64_t buf_offset, bool try_positions = true );
void assign_matches( matches::match_key parent_address, unsi void assign_matches( matches::match_key parent_address, uint
gned long& branch_pos, matches& m ); 64_t& branch_pos, matches& m );
void push_parsers( parser_list& l ); void push_parsers( parser_list& l );
const char* get_name() const const char* get_name() const
{ {
return "ere_branch|ere"; return "ere_branch|ere";
} }
}; };
basic_choice<E, ere_branch<E> > m_branch; basic_choice<E, ere_branch<E> > m_branch;
basic_non_terminal<E, ere_branch_or_extended_reg_exp > m_branch_or_e xt_regexp; basic_non_terminal<E, ere_branch_or_extended_reg_exp > m_branch_or_e xt_regexp;
skipping to change at line 5657 skipping to change at line 5657
extended_reg_exp() : extended_reg_exp() :
ere_base<E>(), ere_base<E>(),
m_branch_or_ext_regexp() m_branch_or_ext_regexp()
{ {
} }
virtual ~extended_reg_exp() virtual ~extended_reg_exp()
{ {
} }
unsigned long recognize( const E* buf, const unsigned long buf_lengt uint64_t recognize( const E* buf, const uint64_t buf_length, const u
h, const unsigned long buf_offset, bool try_positions = true ); int64_t buf_offset, bool try_positions = true );
void assign_matches( matches::match_key parent_address, unsigned lon void assign_matches( matches::match_key parent_address, uint64_t& br
g& branch_pos, matches& m ); anch_pos, matches& m );
void push_parsers( parser_list& l ); void push_parsers( parser_list& l );
const char* get_name() const const char* get_name() const
{ {
return "ere"; return "ere";
} }
}; };
template< typename E > template< typename E >
unsigned long ere_expression<E>::subexpression::recognize( const E* buf, co nst unsigned long buf_length, const unsigned long buf_offset, bool try_posi tions ) uint64_t ere_expression<E>::subexpression::recognize( const E* buf, const u int64_t buf_length, const uint64_t buf_offset, bool try_positions )
{ {
this->m_extened_regexp->recognize( buf, buf_length, buf_offset ); this->m_extened_regexp->recognize( buf, buf_length, buf_offset );
this->m_is_rec = this->m_extened_regexp->is_recognized(); this->m_is_rec = this->m_extened_regexp->is_recognized();
if( this->m_is_rec ) if( this->m_is_rec )
{ {
this->m_rec_size = this->m_extened_regexp->recognize( buf, b uf_length, buf_offset ); this->m_rec_size = this->m_extened_regexp->recognize( buf, b uf_length, buf_offset );
this->m_rec_pos = this->m_extened_regexp->recognized_positio n(); this->m_rec_pos = this->m_extened_regexp->recognized_positio n();
} }
return this->m_rec_size; return this->m_rec_size;
} }
template< typename E > template< typename E >
void ere_expression<E>::subexpression::assign_matches( matches::match_key k ey, unsigned long& branch_pos, matches& m ) void ere_expression<E>::subexpression::assign_matches( matches::match_key k ey, uint64_t& branch_pos, matches& m )
{ {
key += '.'; key += '.';
key += this->to_str(branch_pos); key += this->to_str(branch_pos);
this->m_extened_regexp->assign_matches( key, branch_pos, m ); this->m_extened_regexp->assign_matches( key, branch_pos, m );
} }
template< typename E > template< typename E >
void ere_expression<E>::subexpression::push_parsers( parser_list& l ) void ere_expression<E>::subexpression::push_parsers( parser_list& l )
{ {
l.push_back( &this->m_left_paren ); l.push_back( &this->m_left_paren );
l.push_back( &this->m_extened_regexp ); l.push_back( &this->m_extened_regexp );
l.push_back( &this->m_right_paren ); l.push_back( &this->m_right_paren );
} }
template< typename E > template< typename E >
unsigned long ere_expression<E>::ere_expression_and_dupl::divide_and_recogn ize( const E* buf, const unsigned long buf_length, const unsigned lo ng buf_offset, unsigned long rep, bool assign_matches ) uint64_t ere_expression<E>::ere_expression_and_dupl::divide_and_recognize( const E* buf, const uint64_t buf_length, const uint64_t buf_offset, uin t64_t rep, bool assign_matches )
{ {
this->m_is_rec = true; this->m_is_rec = true;
if( rep == this->m_dup->get_max() ) if( rep == this->m_dup->get_max() )
{ {
this->m_dup->set_recognized_dup(rep); this->m_dup->set_recognized_dup(rep);
return 0; return 0;
} }
unsigned long best_left_side_buf_len = 0; uint64_t best_left_side_buf_len = 0;
unsigned long best_rec_size = 0; uint64_t best_rec_size = 0;
unsigned long left_side_buf_len = buf_length; uint64_t left_side_buf_len = buf_length;
unsigned long left_rec_size = 0; uint64_t left_rec_size = 0;
while( this->m_is_rec ) while( this->m_is_rec )
{ {
this->m_ere->recognize( buf, left_side_buf_len, buf_offset, true ); this->m_ere->recognize( buf, left_side_buf_len, buf_offset, true );
if( this->m_ere->is_recognized() ) if( this->m_ere->is_recognized() )
{ {
left_rec_size = this->m_ere->recognized_size(); left_rec_size = this->m_ere->recognized_size();
// m_ere->recognized_position() is always same as bu f_offset // m_ere->recognized_position() is always same as bu f_offset
this->m_rec_size = divide_and_recognize( this->m_rec_size = divide_and_recognize(
buf, buf,
buf_length, buf_length,
skipping to change at line 5746 skipping to change at line 5746
{ {
this->m_is_rec = false; this->m_is_rec = false;
} }
} }
if( best_rec_size > 0 ) if( best_rec_size > 0 )
{ {
if( assign_matches ) if( assign_matches )
{ {
this->m_ere->recognize( buf, best_left_side_buf_len, buf_offset, true ); this->m_ere->recognize( buf, best_left_side_buf_len, buf_offset, true );
unsigned long branch_pos = rep; uint64_t branch_pos = rep;
this->m_ere->assign_matches( "", branch_pos, this->m _matches ); this->m_ere->assign_matches( "", branch_pos, this->m _matches );
this->m_rec_size = 0; this->m_rec_size = 0;
left_rec_size = this->m_ere->recognized_size(); left_rec_size = this->m_ere->recognized_size();
divide_and_recognize( divide_and_recognize(
buf, buf,
buf_length, buf_length,
buf_offset + left_rec_size, buf_offset + left_rec_size,
rep+1, rep+1,
true ); true );
skipping to change at line 5778 skipping to change at line 5778
this->m_is_rec = true; this->m_is_rec = true;
} }
else else
{ {
this->m_is_rec = false; this->m_is_rec = false;
} }
return this->m_rec_size; return this->m_rec_size;
} }
template< typename E > template< typename E >
unsigned long ere_expression<E>::ere_expression_and_dupl::recognize( const E* buf, const unsigned long buf_length, const unsigned long buf_offset, boo l try_positions ) uint64_t ere_expression<E>::ere_expression_and_dupl::recognize( const E* bu f, const uint64_t buf_length, const uint64_t buf_offset, bool try_positions )
{ {
unsigned long rep = 1; uint64_t rep = 1;
if( this->m_ere->is_subexpression() ) if( this->m_ere->is_subexpression() )
{ {
this->m_matches.clear(); this->m_matches.clear();
// different handling for subexpressions - need to try diffe rent // different handling for subexpressions - need to try diffe rent
// splits on buffer, so expressions like ((ab){1,3}){5} matc h the // splits on buffer, so expressions like ((ab){1,3}){5} matc h the
// input like "ababababab" // input like "ababababab"
// --- recursive calls // --- recursive calls
divide_and_recognize( buf, divide_and_recognize( buf,
buf_length, buf_length,
skipping to change at line 5806 skipping to change at line 5806
} }
// else the ere is not subexpression - can be made faster then // else the ere is not subexpression - can be made faster then
this->m_ere->recognize( buf, buf_length, buf_offset, try_positions ) ; this->m_ere->recognize( buf, buf_length, buf_offset, try_positions ) ;
this->m_is_rec = this->m_ere->is_recognized(); this->m_is_rec = this->m_ere->is_recognized();
this->m_rec_pos = this->m_ere->recognized_position(); this->m_rec_pos = this->m_ere->recognized_position();
this->m_rec_size = this->m_ere->recognized_size(); this->m_rec_size = this->m_ere->recognized_size();
if( this->m_ere->is_recognized() && this->m_ere->is_subexpression() ) if( this->m_ere->is_recognized() && this->m_ere->is_subexpression() )
{ {
unsigned long branch_pos = 0; uint64_t branch_pos = 0;
this->m_ere->assign_matches( "", branch_pos, this->m_matches ); this->m_ere->assign_matches( "", branch_pos, this->m_matches );
} }
while( this->m_is_rec && rep < this->m_dup->get_max() ) while( this->m_is_rec && rep < this->m_dup->get_max() )
{ {
this->m_ere->recognize( buf, this->m_ere->recognize( buf,
buf_length, buf_length,
this->m_rec_pos+this->m_rec_size, this->m_rec_pos+this->m_rec_size,
false ); // don't try next positions false ); // don't try next positions
if( this->m_ere->is_recognized() ) if( this->m_ere->is_recognized() )
skipping to change at line 5838 skipping to change at line 5838
else else
{ {
break; // positive return break; // positive return
} }
} }
this->m_dup->set_recognized_dup( rep ); this->m_dup->set_recognized_dup( rep );
return this->m_rec_size; return this->m_rec_size;
} }
template< typename E > template< typename E >
void ere_expression<E>::ere_expression_and_dupl::assign_matches( matches::m atch_key key, unsigned long& branch_pos, matches& m ) void ere_expression<E>::ere_expression_and_dupl::assign_matches( matches::m atch_key key, uint64_t& branch_pos, matches& m )
{ {
if( this->m_ere->is_subexpression() ) if( this->m_ere->is_subexpression() )
{ {
// in this case matches are in private collection, don't nee d // in this case matches are in private collection, don't nee d
// to assign in loop // to assign in loop
m.extend( key, this->m_matches ); m.extend( key, this->m_matches );
} }
else else
{ {
for( int i = 0; i < (int)this->m_dup->get_recognized_dup(); i++ ) for( int i = 0; i < (int)this->m_dup->get_recognized_dup(); i++ )
skipping to change at line 5863 skipping to change at line 5863
} }
template< typename E > template< typename E >
void ere_expression<E>::ere_expression_and_dupl::push_parsers( parser_list& l ) void ere_expression<E>::ere_expression_and_dupl::push_parsers( parser_list& l )
{ {
l.push_back( &this->m_ere ); l.push_back( &this->m_ere );
l.push_back( &this->m_dup ); l.push_back( &this->m_dup );
} }
template<typename E> template<typename E>
unsigned long ere_expression<E>::recognize(const E* buf, const unsigned lon g buf_length, const unsigned long buf_offset, bool try_positions) uint64_t ere_expression<E>::recognize(const E* buf, const uint64_t buf_leng th, const uint64_t buf_offset, bool try_positions)
{ {
this->m_is_rec = false; this->m_is_rec = false;
this->m_rec_pos = buf_offset; this->m_rec_pos = buf_offset;
this->m_rec_size = 0; this->m_rec_size = 0;
if( this->m_one_elem.is_parsed() ) if( this->m_one_elem.is_parsed() )
{ {
while( !this->m_is_rec && this->m_rec_pos < buf_length ) while( !this->m_is_rec && this->m_rec_pos < buf_length )
{ {
this->m_rec_size = this->m_one_elem->recognize( buf, buf_length, this->m_rec_pos ); this->m_rec_size = this->m_one_elem->recognize( buf, buf_length, this->m_rec_pos );
skipping to change at line 5908 skipping to change at line 5908
{ {
this->m_rec_pos = this->m_ere_expr_and_dup->recogniz ed_position(); this->m_rec_pos = this->m_ere_expr_and_dup->recogniz ed_position();
this->m_rec_size = this->m_ere_expr_and_dup->recogni zed_size(); this->m_rec_size = this->m_ere_expr_and_dup->recogni zed_size();
} }
} }
else else
{ {
this->m_subexpression->recognize( buf, buf_length, buf_offse t ); this->m_subexpression->recognize( buf, buf_length, buf_offse t );
this->m_is_rec = this->m_subexpression->is_recognized(); this->m_is_rec = this->m_subexpression->is_recognized();
// Dont check in // Dont check in
unsigned long off = buf_offset; uint64_t off = buf_offset;
while( !this->m_is_rec && off < buf_length ) while( !this->m_is_rec && off < buf_length )
{ {
off++; off++;
this->m_subexpression->recognize( buf, buf_length, o ff ); this->m_subexpression->recognize( buf, buf_length, o ff );
this->m_is_rec = this->m_subexpression->is_recognize d(); this->m_is_rec = this->m_subexpression->is_recognize d();
} }
this->m_rec_size = this->m_subexpression->recognized_size() + this->m_rec_size = this->m_subexpression->recognized_size() +
this->m_subexpression->recognized_position() - this->m_subexpression->recognized_position() -
off; off;
this->m_rec_pos = off; this->m_rec_pos = off;
} }
return this->m_rec_size; return this->m_rec_size;
} }
template<typename E> template<typename E>
void ere_expression<E>::assign_matches( matches::match_key key, unsigned lo ng& branch_pos, matches& m ) void ere_expression<E>::assign_matches( matches::match_key key, uint64_t& b ranch_pos, matches& m )
{ {
if( this->m_subexpression.is_parsed() ) if( this->m_subexpression.is_parsed() )
{ {
branch_pos++; branch_pos++;
this->m_subexpression->assign_matches( key, branch_pos, m ); this->m_subexpression->assign_matches( key, branch_pos, m );
} }
else if( this->m_ere_expr_and_dup.is_parsed() ) else if( this->m_ere_expr_and_dup.is_parsed() )
{ {
this->m_ere_expr_and_dup->assign_matches( key, branch_pos, m ); this->m_ere_expr_and_dup->assign_matches( key, branch_pos, m );
} }
skipping to change at line 5949 skipping to change at line 5949
void ere_expression<E>::push_parsers( parser_list& l ) void ere_expression<E>::push_parsers( parser_list& l )
{ {
l.push_back( &this->m_ere_expr_and_dup ); l.push_back( &this->m_ere_expr_and_dup );
l.push_back( &this->m_one_elem ); l.push_back( &this->m_one_elem );
l.push_back( &this->m_left_anchor ); l.push_back( &this->m_left_anchor );
l.push_back( &this->m_right_anchor ); l.push_back( &this->m_right_anchor );
l.push_back( &this->m_subexpression ); l.push_back( &this->m_subexpression );
} }
template<typename E> template<typename E>
unsigned long ere_branch<E>::ere_expression_ere_branch::recognize( const E* buf, const unsigned long buf_length, const unsigned long buf_offset, bool try_positions ) uint64_t ere_branch<E>::ere_expression_ere_branch::recognize( const E* buf, const uint64_t buf_length, const uint64_t buf_offset, bool try_positions )
{ {
this->m_is_rec = false; this->m_is_rec = false;
this->m_rec_pos = 0; this->m_rec_pos = 0;
this->m_rec_size = 0; this->m_rec_size = 0;
if( this->m_ere_branch->is_right_anchor() ) if( this->m_ere_branch->is_right_anchor() )
{ {
// different processing for this kind of expression - no spl itting retries // different processing for this kind of expression - no spl itting retries
this->m_ere_expression->recognize( buf, buf_length, buf_offs et ); this->m_ere_expression->recognize( buf, buf_length, buf_offs et );
if( this->m_ere_expression->is_recognized() ) if( this->m_ere_expression->is_recognized() )
{ {
skipping to change at line 5985 skipping to change at line 5985
this->m_is_rec = this->m_ere_branch->is_recognized() && this->m_is_rec = this->m_ere_branch->is_recognized() &&
(this->m_ere_branch->recognized_position() == buf_of fset); (this->m_ere_branch->recognized_position() == buf_of fset);
if( this->m_is_rec ) if( this->m_is_rec )
{ {
this->m_rec_pos = buf_offset; this->m_rec_pos = buf_offset;
this->m_rec_size = this->m_ere_branch->recognized_si ze(); this->m_rec_size = this->m_ere_branch->recognized_si ze();
} }
return this->m_rec_size; return this->m_rec_size;
} }
unsigned long buf_split = 0; uint64_t buf_split = 0;
unsigned long longest_recognized_size = 0; uint64_t longest_recognized_size = 0;
unsigned long buf_split_for_shortest_size = 0; uint64_t buf_split_for_shortest_size = 0;
unsigned long shortest_left_recognized_size = INT_MAX; uint64_t shortest_left_recognized_size = INT_MAX;
unsigned long buf_split_for_longest_size = buf_split; uint64_t buf_split_for_longest_size = buf_split;
bool left_side_recognized = true; bool left_side_recognized = true;
this->m_is_rec = true; this->m_is_rec = true;
// try all possible splits - this downsizes performance, but is nece ssary to // try all possible splits - this downsizes performance, but is nece ssary to
// recognize expressions like (wee|week)(knights|night) - for input // recognize expressions like (wee|week)(knights|night) - for input
// 'weeknights' must recognize all 10 characters // 'weeknights' must recognize all 10 characters
while( left_side_recognized && buf_split < buf_length - buf_offset ) while( left_side_recognized && buf_split < buf_length - buf_offset )
{ {
this->m_ere_expression->recognize( buf, buf_length-buf_split , buf_offset ); this->m_ere_expression->recognize( buf, buf_length-buf_split , buf_offset );
left_side_recognized = this->m_ere_expression->is_recognized (); left_side_recognized = this->m_ere_expression->is_recognized ();
skipping to change at line 6075 skipping to change at line 6075
} }
else else
{ {
this->m_is_rec = false; this->m_is_rec = false;
} }
return this->m_rec_size; return this->m_rec_size;
} }
template<typename E> template<typename E>
void ere_branch<E>::ere_expression_ere_branch::assign_matches( matches::mat ch_key parent_address, unsigned long& branch_pos, matches& m ) void ere_branch<E>::ere_expression_ere_branch::assign_matches( matches::mat ch_key parent_address, uint64_t& branch_pos, matches& m )
{ {
if( this->m_ere_branch.is_parsed() && this->m_ere_expression.is_pars ed() ) if( this->m_ere_branch.is_parsed() && this->m_ere_expression.is_pars ed() )
{ {
this->m_ere_expression->assign_matches( parent_address, bran ch_pos, m ); this->m_ere_expression->assign_matches( parent_address, bran ch_pos, m );
this->m_ere_branch->assign_matches( parent_address, branch_p os, m ); this->m_ere_branch->assign_matches( parent_address, branch_p os, m );
} }
} }
template<typename E> template<typename E>
void ere_branch<E>::ere_expression_ere_branch::push_parsers( parser_list& l ) void ere_branch<E>::ere_expression_ere_branch::push_parsers( parser_list& l )
{ {
l.push_back( &this->m_ere_expression ); l.push_back( &this->m_ere_expression );
l.push_back( &this->m_ere_branch ); l.push_back( &this->m_ere_branch );
} }
template<typename E> template<typename E>
unsigned long ere_branch<E>::recognize( const E* buf, const unsigned long b uf_length, const unsigned long buf_offset, bool try_positions ) uint64_t ere_branch<E>::recognize( const E* buf, const uint64_t buf_length, const uint64_t buf_offset, bool try_positions )
{ {
if( this->m_ere.is_parsed() ) if( this->m_ere.is_parsed() )
{ {
this->m_ere->recognize( buf, buf_length, buf_offset, try_pos itions ); this->m_ere->recognize( buf, buf_length, buf_offset, try_pos itions );
this->m_is_rec = this->m_ere->is_recognized(); this->m_is_rec = this->m_ere->is_recognized();
this->m_rec_pos = this->m_ere->recognized_position(); this->m_rec_pos = this->m_ere->recognized_position();
this->m_rec_size = this->m_ere->recognized_size(); this->m_rec_size = this->m_ere->recognized_size();
} }
else else
{ {
this->m_ere_expression_ere_branch->recognize( buf, buf_lengt h, buf_offset, try_positions ); this->m_ere_expression_ere_branch->recognize( buf, buf_lengt h, buf_offset, try_positions );
this->m_is_rec = this->m_ere_expression_ere_branch->is_recog nized(); this->m_is_rec = this->m_ere_expression_ere_branch->is_recog nized();
this->m_rec_pos = this->m_ere_expression_ere_branch->recogni zed_position(); this->m_rec_pos = this->m_ere_expression_ere_branch->recogni zed_position();
this->m_rec_size = this->m_ere_expression_ere_branch->recogn ized_size(); this->m_rec_size = this->m_ere_expression_ere_branch->recogn ized_size();
} }
return this->m_rec_size; return this->m_rec_size;
} }
template<typename E> template<typename E>
void ere_branch<E>::assign_matches( matches::match_key parent_address, unsi gned long& branch_pos, matches& m ) void ere_branch<E>::assign_matches( matches::match_key parent_address, uint 64_t& branch_pos, matches& m )
{ {
if( this->m_ere.is_parsed() ) if( this->m_ere.is_parsed() )
{ {
this->m_ere->assign_matches( parent_address, branch_pos, m ) ; this->m_ere->assign_matches( parent_address, branch_pos, m ) ;
} }
else else
{ {
this->m_ere_expression_ere_branch->assign_matches( parent_ad dress, branch_pos, m ); this->m_ere_expression_ere_branch->assign_matches( parent_ad dress, branch_pos, m );
} }
} }
template<typename E> template<typename E>
void ere_branch<E>::push_parsers( parser_list& l ) void ere_branch<E>::push_parsers( parser_list& l )
{ {
l.push_back( &this->m_ere_expression_ere_branch ); l.push_back( &this->m_ere_expression_ere_branch );
l.push_back( &this->m_ere ); l.push_back( &this->m_ere );
} }
template<typename E> template<typename E>
unsigned long extended_reg_exp<E>::ere_branch_or_extended_reg_exp::recogniz e( const E* buf, const unsigned long buf_length, const unsigned long buf _offset, bool try_positions ) uint64_t extended_reg_exp<E>::ere_branch_or_extended_reg_exp::recognize( co nst E* buf, const uint64_t buf_length, const uint64_t buf_offset, bool try_positions )
{ {
this->m_rec_size = 0; this->m_rec_size = 0;
this->m_rec_pos = 0; this->m_rec_pos = 0;
this->m_ext_regexp->recognize( buf, buf_length, buf_offset ); this->m_ext_regexp->recognize( buf, buf_length, buf_offset );
this->m_branch->recognize( buf, buf_length, buf_offset ); this->m_branch->recognize( buf, buf_length, buf_offset );
// check whichone is better match // check whichone is better match
if( this->m_ext_regexp->is_recognized() && this->m_branch->is_recogn ized() ) if( this->m_ext_regexp->is_recognized() && this->m_branch->is_recogn ized() )
{ {
if( this->m_branch->recognized_size() > this->m_ext_regexp-> recognized_size() ) if( this->m_branch->recognized_size() > this->m_ext_regexp-> recognized_size() )
{ {
skipping to change at line 6170 skipping to change at line 6170
this->m_rec_size = this->m_branch->recognized_size(); this->m_rec_size = this->m_branch->recognized_size();
} }
else else
{ {
this->m_is_rec = false; this->m_is_rec = false;
} }
return this->m_rec_size; return this->m_rec_size;
} }
template<typename E> template<typename E>
void extended_reg_exp<E>::ere_branch_or_extended_reg_exp::assign_matches( m atches::match_key parent_address, unsigned long& branch_pos, matches& m ) void extended_reg_exp<E>::ere_branch_or_extended_reg_exp::assign_matches( m atches::match_key parent_address, uint64_t& branch_pos, matches& m )
{ {
if( this->m_branch->is_recognized() ) if( this->m_branch->is_recognized() )
{ {
this->m_branch->assign_matches( parent_address, branch_pos, m ); this->m_branch->assign_matches( parent_address, branch_pos, m );
} }
else else
{ {
this->m_ext_regexp->assign_matches( parent_address, branch_p os, m ); this->m_ext_regexp->assign_matches( parent_address, branch_p os, m );
} }
} }
template<typename E> template<typename E>
void extended_reg_exp<E>::ere_branch_or_extended_reg_exp::push_parsers( par ser_list& l ) void extended_reg_exp<E>::ere_branch_or_extended_reg_exp::push_parsers( par ser_list& l )
{ {
l.push_back( &this->m_branch ); l.push_back( &this->m_branch );
l.push_back( &this->m_or ); l.push_back( &this->m_or );
l.push_back( &this->m_ext_regexp ); l.push_back( &this->m_ext_regexp );
} }
template<typename E> template<typename E>
unsigned long extended_reg_exp<E>::recognize( const E* buf, const unsigned long buf_length, const unsigned long buf_offset, bool try_positions ) uint64_t extended_reg_exp<E>::recognize( const E* buf, const uint64_t buf_l ength, const uint64_t buf_offset, bool try_positions )
{ {
this->m_rec_pos = 0; this->m_rec_pos = 0;
this->m_rec_size = 0; this->m_rec_size = 0;
if( this->m_branch.is_parsed() ) if( this->m_branch.is_parsed() )
{ {
this->m_branch->recognize( buf, buf_length, buf_offset ); this->m_branch->recognize( buf, buf_length, buf_offset );
this->m_is_rec = this->m_branch->is_recognized(); this->m_is_rec = this->m_branch->is_recognized();
if( this->m_is_rec ) if( this->m_is_rec )
{ {
this->m_rec_pos = this->m_branch->recognized_positio n(); this->m_rec_pos = this->m_branch->recognized_positio n();
skipping to change at line 6219 skipping to change at line 6219
if( this->m_is_rec ) if( this->m_is_rec )
{ {
this->m_rec_pos = this->m_branch_or_ext_regexp->reco gnized_position(); this->m_rec_pos = this->m_branch_or_ext_regexp->reco gnized_position();
this->m_rec_size = this->m_branch_or_ext_regexp->rec ognized_size(); this->m_rec_size = this->m_branch_or_ext_regexp->rec ognized_size();
} }
} }
return this->m_rec_size; return this->m_rec_size;
} }
template<typename E> template<typename E>
void extended_reg_exp<E>::assign_matches( matches::match_key key, unsigned long& branch_pos, matches& m ) void extended_reg_exp<E>::assign_matches( matches::match_key key, uint64_t& branch_pos, matches& m )
{ {
m.insert( key, match( this->m_rec_pos, this->m_rec_size ) ); m.insert( key, match( this->m_rec_pos, this->m_rec_size ) );
unsigned long new_branch_pos = 0; uint64_t new_branch_pos = 0;
if( this->m_branch.is_parsed() ) if( this->m_branch.is_parsed() )
{ {
this->m_branch->assign_matches( key, new_branch_pos, m ); this->m_branch->assign_matches( key, new_branch_pos, m );
} }
else else
{ {
this->m_branch_or_ext_regexp->assign_matches( key, new_branc h_pos, m ); this->m_branch_or_ext_regexp->assign_matches( key, new_branc h_pos, m );
} }
} }
skipping to change at line 6246 skipping to change at line 6246
l.push_back( &this->m_branch_or_ext_regexp ); l.push_back( &this->m_branch_or_ext_regexp );
l.push_back( &this->m_branch ); l.push_back( &this->m_branch );
} }
template< typename E > template< typename E >
class ere class ere
{ {
typedef typename basic_parser<E>::parser_list parser_list; typedef typename basic_parser<E>::parser_list parser_list;
basic_choice< E, extended_reg_exp<E> > m_ext_reg_exp; basic_choice< E, extended_reg_exp<E> > m_ext_reg_exp;
unsigned long m_rec_size; uint64_t m_rec_size;
unsigned long m_rec_pos; uint64_t m_rec_pos;
bool m_is_rec; bool m_is_rec;
public: public:
ere() : m_rec_size(0), m_rec_pos(0), m_is_rec(false) ere() : m_rec_size(0), m_rec_pos(0), m_is_rec(false)
{ {
} }
virtual ~ere() virtual ~ere()
{ {
} }
unsigned long recognize( const E* buf, const unsigned long buf_lengt h, bool try_positions = true ) uint64_t recognize( const E* buf, const uint64_t buf_length, bool tr y_positions = true )
{ {
this->m_ext_reg_exp->recognize( buf, buf_length, 0, try_posi tions ); this->m_ext_reg_exp->recognize( buf, buf_length, 0, try_posi tions );
this->m_is_rec = this->m_ext_reg_exp->is_recognized(); this->m_is_rec = this->m_ext_reg_exp->is_recognized();
this->m_rec_pos = this->m_ext_reg_exp->recognized_position() ; this->m_rec_pos = this->m_ext_reg_exp->recognized_position() ;
this->m_rec_size = this->m_ext_reg_exp->recognized_size(); this->m_rec_size = this->m_ext_reg_exp->recognized_size();
return this->m_rec_size; return this->m_rec_size;
} }
void assign_matches( matches& m ) void assign_matches( matches& m )
{ {
unsigned long branch_pos = 0; uint64_t branch_pos = 0;
matches::match_key key = "1"; matches::match_key key = "1";
if( this->m_ext_reg_exp.is_parsed() ) this->m_ext_reg_exp->a ssign_matches( key, branch_pos, m ); if( this->m_ext_reg_exp.is_parsed() ) this->m_ext_reg_exp->a ssign_matches( key, branch_pos, m );
} }
void push_parsers( parser_list& l ) void push_parsers( parser_list& l )
{ {
l.push_back( &this->m_ext_reg_exp ); l.push_back( &this->m_ext_reg_exp );
} }
const char* get_name() const const char* get_name() const
{ {
return "ere"; return "ere";
} }
bool is_recognized() bool is_recognized()
{ {
return this->m_is_rec; return this->m_is_rec;
} }
const unsigned long recognized_size() const const uint64_t recognized_size() const
{ {
return this->m_rec_size; return this->m_rec_size;
} }
const unsigned long recognized_position() const const uint64_t recognized_position() const
{ {
return this->m_rec_pos; return this->m_rec_pos;
} }
}; };
/* /*
template<typename E> template<typename E>
class end_range class end_range
{ {
choice<collating_choice> m_end_range; choice<collating_choice> m_end_range;
public: public:
bool is_greater_or_equals( const E* buf, const unsigned long buf_length ) bool is_greater_or_equals( const E* buf, const uint64_t buf_length )
{ {
return this->m_collating_choice->is_greater_ro_equals(buf,buf_length); return this->m_collating_choice->is_greater_ro_equals(buf,buf_length);
} }
unsigned long recognized_size() uint64_t recognized_size()
{ {
return this->m_collating_choice->recognized_size(); return this->m_collating_choice->recognized_size();
} }
end_range(); end_range();
virtual ~end_range(); virtual ~end_range();
}; };
*/ */
skipping to change at line 6890 skipping to change at line 6890
return this->m_regexp.is_parsed(); return this->m_regexp.is_parsed();
} }
//! Uses regexp pattern to find match in the input buffer //! Uses regexp pattern to find match in the input buffer
/*! /*!
The constructor parameter is used as regexp pattern during parsing The constructor parameter is used as regexp pattern during parsing
\param buf input buffer \param buf input buffer
\param buf_length input buffer length \param buf_length input buffer length
\return parsed size \return parsed size
*/ */
virtual unsigned long parse( const E *buf, const unsigned lo ng buf_length ) virtual uint64_t parse( const E *buf, const uint64_t buf_len gth )
{ {
this->prepare_for_parsing(); this->prepare_for_parsing();
if( this->is_valid() ) if( this->is_valid() )
{ {
this->m_parsed_size = this->m_regexp->recogn ize( buf, buf_length ); this->m_parsed_size = this->m_regexp->recogn ize( buf, buf_length );
} }
else else
{ {
return 0; return 0;
skipping to change at line 6927 skipping to change at line 6927
virtual std::basic_istream<E>& parse( std::basic_istream<E>& is ) virtual std::basic_istream<E>& parse( std::basic_istream<E>& is )
{ {
this->prepare_for_parsing(); this->prepare_for_parsing();
// TODO - implement to pass istream to regexp - now limited to input in one line // TODO - implement to pass istream to regexp - now limited to input in one line
std::basic_stringbuf<E> buf; std::basic_stringbuf<E> buf;
std::streampos pos = is.tellg(); std::streampos pos = is.tellg();
if( is.good() ) if( is.good() )
{ {
is.get( buf ); is.get( buf );
unsigned long length = buf.str().length(); uint64_t length = buf.str().length();
if( this->is_valid() ) if( this->is_valid() )
{ {
this->m_regexp->recognize( buf.str() .c_str(), length ); this->m_regexp->recognize( buf.str() .c_str(), length );
} }
else else
{ {
return is; return is;
} }
if( this->m_regexp->is_recognized() ) if( this->m_regexp->is_recognized() )
{ {
skipping to change at line 6956 skipping to change at line 6956
else else
{ {
is.clear(); is.clear();
is.seekg(pos); is.seekg(pos);
} }
} }
return is; return is;
} }
//! Returns the match position in the input //! Returns the match position in the input
unsigned long recognized_position() uint64_t recognized_position()
{ {
if( is_pattern_valid() && this->m_regexp->is_recogni zed() ) if( is_pattern_valid() && this->m_regexp->is_recogni zed() )
{ {
return this->m_regexp->recognized_position() ; return this->m_regexp->recognized_position() ;
} }
else else
{ {
return 0; return 0;
} }
} }
//! Returns the match size in the input //! Returns the match size in the input
unsigned long recognized_size() uint64_t recognized_size()
{ {
if( is_pattern_valid() && this->m_regexp->is_recogni zed() ) if( is_pattern_valid() && this->m_regexp->is_recogni zed() )
{ {
return this->m_regexp->recognized_size(); return this->m_regexp->recognized_size();
} }
else else
{ {
return 0; return 0;
} }
} }
 End of changes. 162 change blocks. 
217 lines changed or deleted 217 lines changed or added


 jrtpsocket.h   jrtpsocket.h 
skipping to change at line 38 skipping to change at line 38
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
#else #else
#include <netdb.h> #include <netdb.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h>
#include <stdint.h> #include <stdint.h>
namespace jsocket { namespace jsocket {
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// ------------------ md5 class ----------------------------------------- // ------------------ md5 class -----------------------------------------
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// TODO:: retirar isso // TODO:: retirar isso
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 jrunnable.h   jrunnable.h 
skipping to change at line 34 skipping to change at line 34
namespace jthread{ namespace jthread{
/** /**
* \brief Runnable. * \brief Runnable.
* *
* @author Jeff Ferr * @author Jeff Ferr
*/ */
class Runnable : public virtual jcommon::Object{ class Runnable : public virtual jcommon::Object{
private: private:
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
Runnable(); Runnable();
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~Runnable(); virtual ~Runnable();
/** /**
* \brief * \brief
* *
*/ */
virtual void Routine(); virtual void Run();
}; };
} }
#endif #endif
 End of changes. 4 change blocks. 
16 lines changed or deleted 16 lines changed or added


 jruntimeexception.h   jruntimeexception.h 
skipping to change at line 37 skipping to change at line 37
namespace jcommon { namespace jcommon {
/** /**
* \brief Exception. * \brief Exception.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class RuntimeException : public jcommon::Exception, public std::runtime_err or{ class RuntimeException : public jcommon::Exception, public std::runtime_err or{
private: private:
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
RuntimeException(std::string reason); RuntimeException(std::string reason);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~RuntimeException() throw(); virtual ~RuntimeException() throw();
/** /**
* \brief * \brief
* *
*/ */
virtual std::string what(); virtual std::string what();
}; };
} }
 End of changes. 3 change blocks. 
12 lines changed or deleted 12 lines changed or added


 jschedule.h   jschedule.h 
skipping to change at line 37 skipping to change at line 37
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sched.h> #include <sched.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jshared { namespace jshared {
/** /**
* \brief Prioridade do escalonamento * \brief Prioridade do escalonamento
* *
*/ */
enum jschedule_policy_t { enum jschedule_policy_t {
#ifdef _WIN32 SCHEDULE_FIFO,
#else SCHEDULE_ROUND_ROBIN,
SCHEDULE_FIFO = SCHED_FIFO, SCHEDULE_OTHER
SCHEDULE_ROUND_ROBIN = SCHED_RR,
SCHEDULE_OTHER = SCHED_OTHER
#endif
}; };
/** /**
* \brief Prioridade do escalonamento * \brief Prioridade do escalonamento
* *
*/ */
enum jschedule_type_t { enum jschedule_type_t {
#ifdef _WIN32 #ifdef _WIN32
PRIORITY_PROCESS = 0, PRIORITY_PROCESS = 0,
PRIORITY_GROUP = 0, PRIORITY_GROUP = 0,
skipping to change at line 104 skipping to change at line 100
#else #else
/** \brief */ /** \brief */
pid_t _pid; pid_t _pid;
#endif #endif
public: public:
/** /**
* \brief Constructor. * \brief Constructor.
* *
*/ */
#ifdef _WIN32
Schedule(HANDLE pid_ = 0);
#else
Schedule(pid_t pid_ = 0); Schedule(pid_t pid_ = 0);
#endif
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~Schedule(); virtual ~Schedule();
#ifdef _WIN32
#else
/** /**
* \brief * \brief
* *
*/ */
#ifdef _WIN32
HANDLE GetPID();
#else
pid_t GetPID(); pid_t GetPID();
#endif #endif
/** /**
* \brief * \brief
* *
*/ */
void SetPriority(int n); void SetPriority(int n);
/** /**
 End of changes. 6 change blocks. 
9 lines changed or deleted 10 lines changed or added


 jscrollbar.h   jscrollbar.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_SCROLLBAR_H #ifndef J_SCROLLBAR_H
#define J_SCROLLBAR_H #define J_SCROLLBAR_H
#include "jcomponent.h" #include "jcomponent.h"
#include "jadjustmentlistener.h" #include "jadjustmentlistener.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jscroll_orientation_t { enum jscroll_orientation_t {
LEFT_RIGHT_SCROLL, LEFT_RIGHT_SCROLL,
BOTTOM_UP_SCROLL BOTTOM_UP_SCROLL
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jscrollpane.h   jscrollpane.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SCROLLPANE_H #ifndef J_SCROLLPANE_H
#define J_SCROLLPANE_H #define J_SCROLLPANE_H
#include "jguilib.h"
#include "jcontainer.h" #include "jcontainer.h"
#include "jscrollbar.h" #include "jscrollbar.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jscrollpane_type_t { enum jscrollpane_type_t {
HORIZONTAL_SCROLL, HORIZONTAL_SCROLL,
VERTICAL_SCROLL, VERTICAL_SCROLL,
 End of changes. 2 change blocks. 
3 lines changed or deleted 0 lines changed or added


 jselectevent.h   jselectevent.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SELECTEVENT_H #ifndef J_SELECTEVENT_H
#define J_SELECTEVENT_H #define J_SELECTEVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include "jitemcomponent.h" #include "jitemcomponent.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jselect_type_t { enum jselect_type_t {
LEFT_ITEM, LEFT_ITEM,
RIGHT_ITEM, RIGHT_ITEM,
UP_ITEM, UP_ITEM,
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jselectlistener.h   jselectlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SELECTLISTENER_H #ifndef J_SELECTLISTENER_H
#define J_SELECTLISTENER_H #define J_SELECTLISTENER_H
#include "jselectevent.h" #include "jselectevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class SelectListener : public jcommon::Listener{ class SelectListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jsemaphore.h   jsemaphore.h 
skipping to change at line 51 skipping to change at line 51
/** /**
* \brief Semaphore. * \brief Semaphore.
* *
* @author Jeff Ferr * @author Jeff Ferr
*/ */
class Semaphore : public virtual jcommon::Object{ class Semaphore : public virtual jcommon::Object{
private: private:
#ifdef _WIN32 #ifdef _WIN32
/** \brief */ /** \brief */
long _count; HANDLE _semaphore;
/** \brief */ /** \brief */
long _max_count; LPSECURITY_ATTRIBUTES _sa;
/** \brief */
BOOL _inherit;
/** \brief */
std::string _semaphore_name;
/** \brief */
HANDLE _semaphore;
/** \brief */
LPSECURITY_ATTRIBUTES _sa;
#else #else
/** \brief Semaphore handler. */ /** \brief Semaphore handler. */
sem_t _semaphore; sem_t _semaphore;
/** \brief */
int _count;
#endif #endif
/** \brief */ /** \brief */
bool _is_open; Mutex mutex;
/** \brief */
Mutex mutex;
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
Semaphore(int = 0); Semaphore(int = 0);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~Semaphore(); virtual ~Semaphore();
/** /**
* \brief Lock the semaphore. * \brief Lock the semaphore.
* *
*/ */
void Wait(); void Wait();
/** /**
* \brief Lock semaphore. * \brief Lock semaphore.
* *
*/ */
void Wait(long long time_); void Wait(uint64_t time_);
/** /**
* \brief Notify the locked semaphore. * \brief Notify the locked semaphore.
* *
*/ */
void Notify(); void Notify();
/** /**
* \brief Notify all locked semaphores. * \brief Notify all locked semaphores.
* *
*/ */
void NotifyAll(); void NotifyAll();
/** /**
* \brief Try lock the semaphore. * \brief Try lock the semaphore.
* *
*/ */
bool TryWait(); bool TryWait();
/** /**
* \brief * \brief
* *
*/ */
int GetValue(); int GetValue();
/** /**
* \brief * \brief
* *
*/ */
void Release(); void Release();
}; };
} }
#endif #endif
 End of changes. 12 change blocks. 
66 lines changed or deleted 53 lines changed or added


 jserializable.h   jserializable.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SERIALIZABLE_H #ifndef J_SERIALIZABLE_H
#define J_SERIALIZABLE_H #define J_SERIALIZABLE_H
#include "jobject.h" #include "jobject.h"
namespace jcommon { namespace jio {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Serializable : public jcommon::Object{ class Serializable : public jcommon::Object{
private: private:
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 jsharedfifo.h   jsharedfifo.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SHAREDFIFO_H #ifndef J_SHAREDFIFO_H
#define J_SHAREDFIFO_H #define J_SHAREDFIFO_H
#include "jobject.h" #include "jobject.h"
#include <iostream> #include <iostream>
#ifdef _WIN32
#include <windows.h>
#include <winsock.h>
#else
#include <sys/socket.h>
#include <sys/ipc.h>
#endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jshared { namespace jshared {
struct jshmhandle_t { struct jshmhandle_t {
int sid; int sid;
void *mem; void *mem;
int privsz; // size of single priv structure of upper pr ogram int privsz; // size of single priv structure of upper pr ogram
int semid; // semaphore id int semid; // semaphore id
int sz; // size of shared mem in bytes int sz; // size of shared mem in bytes
skipping to change at line 182 skipping to change at line 173
* *
*/ */
bool IsEmpty(); bool IsEmpty();
/** /**
* \brief Close. * \brief Close.
* *
*/ */
void Close(); void Close();
/**
* \brief
*
*/
std::string what();
}; };
}; };
#endif #endif
 End of changes. 2 change blocks. 
15 lines changed or deleted 0 lines changed or added


 jsharedlib.h   jsharedlib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SHAREDLIB_H #ifndef J_SHAREDLIB_H
#define J_SHAREDLIB_H #define J_SHAREDLIB_H
#include "jfifoexception.h"
#include "jmemoryexception.h"
#include "jmemorymap.h"
#include "jmessageexception.h"
#include "jmessagequeue.h"
#include "jpipe.h"
#include "jprivateprocess.h"
#include "jprocessexception.h"
#include "jschedule.h"
#include "jsharedfifo.h"
#include "jsharedmemory.h"
#include "jsharedmutex.h"
#include "jsharedsemaphore.h"
#include "jwrapperprocess.h"
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 15 lines changed or added


 jsharedmutex.h   jsharedmutex.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_SHAREDMUTEX_H #ifndef J_SHAREDMUTEX_H
#define J_SHAREDMUTEX_H #define J_SHAREDMUTEX_H
#include "jobject.h" #include "jobject.h"
#include <iostream> #include <iostream>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <unistd.h> #include <unistd.h>
#include <stdint.h> #include <stdint.h>
#endif #endif
namespace jshared { namespace jshared {
// MCL_CURRENT,
// MCL_FUTURE
enum jmutex_flags_t { enum jmutex_flags_t {
#ifdef _WIN32 MUTEX_CURRENT = 1,
MUTEX_CURRENT = 0, MUTEX_FUTURE = 2
MUTEX_FUTURE = 0
#else
MUTEX_CURRENT = MCL_CURRENT,
MUTEX_FUTURE = MCL_FUTURE
#endif
}; };
/** /**
* \brief SharedMutex. * \brief SharedMutex.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class SharedMutex : public virtual jcommon::Object{ class SharedMutex : public virtual jcommon::Object{
private: private:
/** \brief Socket handler. */ /** \brief Socket handler. */
#ifdef _WIN32 #ifdef _WIN32
int _id; int _id;
#else #else
key_t _id; key_t _id;
#endif #endif
/** \brief */ /** \brief */
char *_shmp; int64_t _size;
/** \brief */ /** \brief */
int _memsize; char *_shmp;
/** \brief */ /** \brief */
bool _is_open; bool _is_open;
/** \brief */ /** \brief */
jmutex_flags_t _flags; jmutex_flags_t _flags;
public: public:
/** /**
* \brief Constructor. * \brief Constructor.
* *
*/ */
SharedMutex(jmutex_flags_t flags_ = MUTEX_CURRENT | MUTEX_FUTURE); SharedMutex(jmutex_flags_t flags_ = jmutex_flags_t(M
UTEX_CURRENT | MUTEX_FUTURE));
/** /**
* \brief Constructor. * \brief Constructor.
* *
*/ */
SharedMutex(void *data_, long long size_); SharedMutex(void *data_, int64_t size_);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~SharedMutex(); virtual ~SharedMutex();
/** /**
* \brief * \brief
* *
*/ */
void Lock(); void Lock();
/** /**
* \brief * \brief
* *
*/ */
void Unlock(); void Unlock();
/** /**
* \brief * \brief
* *
*/ */
void LockAll(); void LockAll();
/** /**
* \brief * \brief
* *
*/ */
void UnlockAll(); void UnlockAll();
/** /**
* \brief * \brief
* *
*/ */
void Release(); void Release();
}; };
} }
#endif #endif
 End of changes. 16 change blocks. 
61 lines changed or deleted 57 lines changed or added


 jslider.h   jslider.h 
skipping to change at line 30 skipping to change at line 30
#ifndef J_SLIDER_H #ifndef J_SLIDER_H
#define J_SLIDER_H #define J_SLIDER_H
#include "jcomponent.h" #include "jcomponent.h"
#include "jscrollbar.h" #include "jscrollbar.h"
#include "jadjustmentlistener.h" #include "jadjustmentlistener.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Slider : public jgui::Component{ class Slider : public jgui::Component{
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jsocket.h   jsocket.h 
skipping to change at line 41 skipping to change at line 41
#include <iostream> #include <iostream>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jsocket { namespace jsocket {
class ServerSocket; class ServerSocket;
/** /**
* \brief Socket. * \brief Socket.
* *
* \author Jeff Ferr * \author Jeff Ferr
skipping to change at line 104 skipping to change at line 103
/** /**
* \brief Connect the socket. * \brief Connect the socket.
* *
*/ */
void ConnectSocket(InetAddress *, int); void ConnectSocket(InetAddress *, int);
/** /**
* \brief * \brief
* *
*/ */
void InitStreams(int rbuf_, int wbuf_); void InitStreams(int64_t rbuf_, int64_t wbuf_);
public: public:
/** /**
* \brief Constructor. * \brief Constructor.
* *
*/ */
Socket(int handler_, sockaddr_in server_, int timeout_ = 0, int rbu f_ = 65535, int wbuf_ = 4096); Socket(int handler_, sockaddr_in server_, int timeout_ = 0, int rbu f_ = 65535, int wbuf_ = 4096);
/** /**
* \brief Constructor. * \brief Constructor.
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 jsocketinputstream.h   jsocketinputstream.h 
skipping to change at line 33 skipping to change at line 33
#include "jobject.h" #include "jobject.h"
#include "jinputstream.h" #include "jinputstream.h"
#include "jconnection.h" #include "jconnection.h"
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <cstring> #include <cstring>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
namespace jsocket { namespace jsocket {
/** /**
* \brief SocketInputStream. * \brief SocketInputStream.
* *
skipping to change at line 57 skipping to change at line 56
private: private:
#ifdef _WIN32 #ifdef _WIN32
/** \brief */ /** \brief */
SOCKET _fd; SOCKET _fd;
#else #else
/** \brief */ /** \brief */
int _fd; int _fd;
#endif #endif
/** \brief */ /** \brief */
Connection *_connection;
/** \brief */
char *_buffer; char *_buffer;
/** \brief */ /** \brief */
int _buffer_length; int64_t _buffer_length;
/** \brief */ /** \brief */
int _current_index; int64_t _current_index;
/** \brief */ /** \brief */
int _end_index; int64_t _end_index;
/** \brief */ /** \brief */
int64_t _receive_bytes; int64_t _receive_bytes;
/** \brief */ /** \brief */
bool _stream;
/** \brief */
sockaddr_in _server_sock; sockaddr_in _server_sock;
/** \brief */ /** \brief */
bool *_is_closed; bool *_is_closed;
/** \brief */ /** \brief */
Connection *_connection; bool _stream;
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
SocketInputStream(Connection *conn_, bool *is_closed _, int size_ = 65535); SocketInputStream(Connection *conn_, bool *is_closed _, int64_t size_ = 65535LL);
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
SocketInputStream(Connection *conn_, bool *is_closed _, sockaddr_in server_sock_, int size_ = 65535); SocketInputStream(Connection *conn_, bool *is_closed _, sockaddr_in server_sock_, int64_t size_ = 65535LL);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~SocketInputStream(); virtual ~SocketInputStream();
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
skipping to change at line 144 skipping to change at line 143
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
* \return the number of bytes received, or 0 if the peer has shutdown. * \return the number of bytes received, or 0 if the peer has shutdown.
* *
* \exception SocketException an error occurred. * \exception SocketException an error occurred.
* *
*/ */
virtual int Read(); virtual int64_t Read();
/** /**
* \brief * \brief
* *
* \return the number of bytes received, or 0 if the peer has shutdown. * \return the number of bytes received, or 0 if the peer has shutdown.
* *
* \exception SocketException an error occurred. * \exception SocketException an error occurred.
* *
*/ */
virtual int64_t Read(char *data_, int64_t data_lengt h_); virtual int64_t Read(char *data_, int64_t data_lengt h_);
/** /**
* \brief * \brief
* *
*/ */
int64_t GetReceiveBytes(); virtual int64_t GetReceiveBytes();
}; };
} }
#endif #endif
 End of changes. 11 change blocks. 
11 lines changed or deleted 10 lines changed or added


 jsocketlib.h   jsocketlib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SOCKLIB_H #ifndef J_SOCKLIB_H
#define J_SOCKLIB_H #define J_SOCKLIB_H
#include "jconnection.h"
#include "jconnectionpipe.h"
#include "jdatagramsocket.h"
#include "jhttprequester.h"
#include "jinetaddress.h"
#include "jmulticastsocket.h"
// #include "jrtpsocket.h"
#include "jserversocket.h"
#include "jsocket.h"
#include "jsocketexception.h"
#include "jsocketinputstream.h"
#include "jsocketoption.h"
#include "jsocketoptionexception.h"
#include "jsocketoutputstream.h"
#include "jsocketstreamexception.h"
#include "jsockettimeoutexception.h"
#include "junknownhostexception.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #else
#include <winsock.h> #include "jrawsocket.h"
#include "jsslserversocket.h"
#include "jsslsocket.h"
#include "jsslsocketinputstream.h"
#include "jsslsocketoutputstream.h"
#endif #endif
void InitWindowsSocket(); void InitWindowsSocket();
void ReleaseWindowsSocket(); void ReleaseWindowsSocket();
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 24 lines changed or added


 jsocketoption.h   jsocketoption.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SOCKET_OPTION_H #ifndef J_SOCKET_OPTION_H
#define J_SOCKET_OPTION_H #define J_SOCKET_OPTION_H
#include "jobject.h"
#include "jconnection.h" #include "jconnection.h"
#include <string> #include <string>
#include <stdint.h>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
namespace jsocket { namespace jsocket {
class Socket; class Socket;
class SSLSocket; class SSLSocket;
class DatagramSocket; class DatagramSocket;
 End of changes. 3 change blocks. 
4 lines changed or deleted 0 lines changed or added


 jsocketoutputstream.h   jsocketoutputstream.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SOCKET_OUTPUT_STREAM_H #ifndef J_SOCKET_OUTPUT_STREAM_H
#define J_SOCKET_OUTPUT_STREAM_H #define J_SOCKET_OUTPUT_STREAM_H
#include "jobject.h"
#include "joutputstream.h" #include "joutputstream.h"
#include "jconnection.h" #include "jconnection.h"
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <cstring> #include <cstring>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
skipping to change at line 50 skipping to change at line 49
/** /**
* \brief SocketOutputStream. * \brief SocketOutputStream.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class SocketOutputStream : public jio::OutputStream{ class SocketOutputStream : public jio::OutputStream{
private: private:
#ifdef _WIN32 #ifdef _WIN32
SOCKET _fd; SOCKET _fd;
#else #else
int _fd; int _fd;
#endif #endif
/** \brief */ /** \brief */
char *_buffer; char *_buffer;
/** \brief */ /** \brief */
int _buffer_length; int64_t _buffer_length;
/** \brief */ /** \brief */
int _current_index; int64_t _current_index;
/** \brief */ /** \brief */
int64_t _sent_bytes; int64_t _sent_bytes;
/** \brief */ /** \brief */
bool _stream; bool _stream;
/** \brief */ /** \brief */
sockaddr_in _server_sock; sockaddr_in _server_sock;
/** \brief */ /** \brief */
bool *_is_closed; bool *_is_closed;
/** \brief */ /** \brief */
Connection *_connection; Connection *_connection;
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
SocketOutputStream(Connection *conn_, bool *is_closed, int size_ = SocketOutputStream(Connection *conn_, bool *is_close
4096); d, int64_t size_ = 4096LL);
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
SocketOutputStream(Connection *conn_, bool *is_closed, sockaddr_in SocketOutputStream(Connection *conn_, bool *is_close
server_sock_, int size_ = 65535); d, sockaddr_in server_sock_, int64_t size_ = 65535LL);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~SocketOutputStream(); virtual ~SocketOutputStream();
/** /**
* \brief * \brief
* *
*/ */
virtual bool IsEmpty(); virtual bool IsEmpty();
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Available(); virtual int64_t Available();
/** /**
* \brief jio::OutputStream * \brief jio::OutputStream
* *
*/ */
virtual int64_t GetSize(); virtual int64_t GetSize();
/** /**
* \brief jio::OutputStream * \brief jio::OutputStream
* *
*/ */
virtual void Seek(int64_t index); virtual void Seek(int64_t index);
/** /**
* \brief jio::OutputStream * \brief jio::OutputStream
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(int c_); virtual int64_t Write(int64_t c_);
/** /**
* \brief * \brief
* *
*/ */
int64_t Write(const char *data_, int64_t data_length_); virtual int64_t Write(const char *data_, int64_t dat
a_length_);
/** /**
* \brief * \brief
* *
*/ */
virtual int GetAvailable(); virtual int64_t GetAvailable();
/** /**
* \brief * \brief
* *
*/ */
int64_t GetSentBytes(); virtual int64_t GetSentBytes();
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Flush(); virtual int64_t Flush();
}; };
} }
#endif #endif
 End of changes. 17 change blocks. 
87 lines changed or deleted 87 lines changed or added


 jspin.h   jspin.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SPIN_H #ifndef J_SPIN_H
#define J_SPIN_H #define J_SPIN_H
#include "jselectlistener.h" #include "jselectlistener.h"
#include "jitemcomponent.h" #include "jitemcomponent.h"
#include <iostream> #include <vector>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jspin_type_t { enum jspin_type_t {
HORIZONTAL_SPIN, HORIZONTAL_SPIN,
VERTICAL_SPIN VERTICAL_SPIN
 End of changes. 1 change blocks. 
10 lines changed or deleted 1 lines changed or added


 jsslserversocket.h   jsslserversocket.h 
skipping to change at line 20 skipping to change at line 20
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SERVER_SOCKET_H #ifndef J_SSL_SERVER_SOCKET_H
#define J_SERVER_SOCKET_H #define J_SSL_SERVER_SOCKET_H
#include "jsslsocket.h" #include "jsslsocket.h"
#include "jinetaddress.h" #include "jinetaddress.h"
#include "jobject.h" #include "jobject.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 jsslsocket.h   jsslsocket.h 
skipping to change at line 20 skipping to change at line 20
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_SOCKET_H #ifndef J_SSLSOCKET_H
#define J_SOCKET_H #define J_SSLSOCKET_H
#include "jinetaddress.h" #include "jinetaddress.h"
#include "jserversocket.h" #include "jserversocket.h"
#include "jsocketoption.h" #include "jsocketoption.h"
#include "jsslsocketinputstream.h" #include "jsslsocketinputstream.h"
#include "jsslsocketoutputstream.h" #include "jsslsocketoutputstream.h"
#include "jconnection.h" #include "jconnection.h"
#include "jobject.h"
#include <iostream>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/rsa.h> #include <openssl/rsa.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
/** /**
* It's VERY important that these types really have the right sizes! * It's VERY important that these types really have the right sizes!
* *
*/ */
#define COMPILE_TIME_ASSERT(name, x) typedef int _dummy_ ## name[(x) * 2 - 1] #define COMPILE_TIME_ASSERT(name, x) typedef int _dummy_ ## name[(x) * 2 - 1]
COMPILE_TIME_ASSERT(uint8, sizeof(uint8_t) == 1); COMPILE_TIME_ASSERT(uint8, sizeof(uint8_t) == 1);
COMPILE_TIME_ASSERT(sint8, sizeof(int8_t) == 1); COMPILE_TIME_ASSERT(sint8, sizeof(int8_t) == 1);
COMPILE_TIME_ASSERT(uint16, sizeof(uint16_t) == 2); COMPILE_TIME_ASSERT(uint16, sizeof(uint16_t) == 2);
 End of changes. 4 change blocks. 
8 lines changed or deleted 2 lines changed or added


 jsslsocketinputstream.h   jsslsocketinputstream.h 
skipping to change at line 54 skipping to change at line 54
/** /**
* \brief SSLSocketInputStream. * \brief SSLSocketInputStream.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class SSLSocketInputStream : public jio::InputStream{ class SSLSocketInputStream : public jio::InputStream{
private: private:
#ifdef _WIN32 #ifdef _WIN32
SOCKET _fd; /** \brief */
SOCKET _fd;
#else #else
int _fd; /** \brief */
SSL *_ssl;
/** \brief */
int _fd;
#endif #endif
/** \brief */ /** \brief */
char *_buffer; Connection *_connection;
/** \brief */ /** \brief */
int _buffer_length; char *_buffer;
/** \brief */ /** \brief */
int _current_index; int64_t _buffer_length;
/** \brief */ /** \brief */
int _end_index; int64_t _current_index;
/** \brief */ /** \brief */
int64_t _receive_bytes; int64_t _end_index;
/** \brief */ /** \brief */
bool _stream; int64_t _receive_bytes;
/** \brief */ /** \brief */
bool *_is_closed; bool _stream;
/** \brief */ /** \brief */
Connection *_connection; bool *_is_closed;
/** \brief */
SSL *_ssl;
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
SSLSocketInputStream(Connection *conn_, bool *is_closed_, SSL *ssl, SSLSocketInputStream(Connection *conn_, bool *is_clo
int size_ = 65535); sed_, SSL *ssl, int64_t size_ = 65535LL);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~SSLSocketInputStream(); virtual ~SSLSocketInputStream();
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
*/ */
virtual bool IsEmpty(); virtual bool IsEmpty();
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
*/ */
virtual int64_t Available(); virtual int64_t Available();
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
*/ */
virtual int64_t GetSize(); virtual int64_t GetSize();
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
*/ */
virtual int64_t GetPosition(); virtual int64_t GetPosition();
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
*/ */
virtual void Skip(int64_t skip); virtual void Skip(int64_t skip);
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
*/ */
virtual void Reset(); virtual void Reset();
/** /**
* \brief jio::InputStream * \brief jio::InputStream
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
* \return the number of bytes received, or 0 if the peer ha * \return the number of bytes received, or 0 if the
s shutdown. peer has shutdown.
* *
* \exception SocketException an error occurred. * \exception SocketException an error occurred.
* *
*/ */
virtual int Read(); virtual int64_t Read();
/** /**
* \brief * \brief
* *
* \return the number of bytes received, or 0 if the peer ha * \return the number of bytes received, or 0 if the
s shutdown. peer has shutdown.
* *
* \exception SocketException an error occurred. * \exception SocketException an error occurred.
* *
*/ */
virtual int64_t Read(char *data_, int64_t data_length_); virtual int64_t Read(char *data_, int64_t data_lengt
h_);
/** /**
* \brief * \brief
* *
*/ */
int64_t GetReceiveBytes(); virtual int64_t GetReceiveBytes();
}; };
} }
#endif #endif
 End of changes. 15 change blocks. 
92 lines changed or deleted 95 lines changed or added


 jsslsocketoutputstream.h   jsslsocketoutputstream.h 
skipping to change at line 54 skipping to change at line 54
/** /**
* \brief SSLSocketOutputStream. * \brief SSLSocketOutputStream.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class SSLSocketOutputStream : public jio::OutputStream{ class SSLSocketOutputStream : public jio::OutputStream{
private: private:
#ifdef _WIN32 #ifdef _WIN32
SOCKET _fd; SOCKET _fd;
#else #else
int _fd; int _fd;
#endif #endif
/** \brief */ /** \brief */
char *_buffer; Connection *_connection;
/** \brief */ /** \brief */
int _buffer_length; char *_buffer;
/** \brief */ /** \brief */
int _current_index; int64_t _buffer_length;
/** \brief */ /** \brief */
int64_t _sent_bytes; int64_t _current_index;
/** \brief */ /** \brief */
bool _stream; int64_t _sent_bytes;
/** \brief */ /** \brief */
bool *_is_closed; bool _stream;
/** \brief */ /** \brief */
Connection *_connection; bool *_is_closed;
/** \brief */ /** \brief */
SSL *_ssl; SSL *_ssl;
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
SSLSocketOutputStream(Connection *conn_, bool *is_closed, SSL *ssl, SSLSocketOutputStream(Connection *conn_, bool *is_cl
int size_ = 4096); osed, SSL *ssl, int64_t size_ = 4096LL);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~SSLSocketOutputStream(); virtual ~SSLSocketOutputStream();
/** /**
* \brief * \brief
* *
*/ */
virtual bool IsEmpty(); virtual bool IsEmpty();
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Available(); virtual int64_t Available();
/** /**
* \brief jio::OutputStream * \brief jio::OutputStream
* *
*/ */
virtual int64_t GetSize(); virtual int64_t GetSize();
/** /**
* \brief jio::OutputStream * \brief jio::OutputStream
* *
*/ */
virtual void Seek(int64_t index); virtual void Seek(int64_t index);
/** /**
* \brief jio::OutputStream * \brief jio::OutputStream
* *
*/ */
virtual void Close(); virtual void Close();
/** /**
* \brief * \brief
* *
*/ */
virtual int Write(int c_); virtual int64_t Write(int64_t c_);
/** /**
* \brief * \brief
* *
*/ */
int64_t Write(const char *data_, int64_t data_length_); virtual int64_t Write(const char *data_, int64_t dat
a_length_);
/** /**
* \brief * \brief
* *
*/ */
virtual int GetAvailable(); virtual int64_t GetAvailable();
/** /**
* \brief * \brief
* *
*/ */
int64_t GetSentBytes(); virtual int64_t GetSentBytes();
/** /**
* \brief * \brief
* *
*/ */
virtual int64_t Flush(); virtual int64_t Flush();
}; };
} }
#endif #endif
 End of changes. 15 change blocks. 
80 lines changed or deleted 81 lines changed or added


 jsystem.h   jsystem.h 
skipping to change at line 143 skipping to change at line 143
*/ */
static int KbHit(void); static int KbHit(void);
/** /**
* \brief * \brief
* *
*/ */
static int Getch(void); static int Getch(void);
/** /**
* \brief Expand a pathname getting rid of special shell cha * \brief
racters like ~.$, etc.
* For Unix/Win32 compatibility use $(XXX) instead of $XXX w
hen using
* environment variables in a pathname. If compatibility is
not an issue
* you can use on Unix directly $XXX. This is a protected fu
nction called
* from the OS specific system classes, like TUnixSystem and
TWinNTSystem.
* *
*/ */
static std::string ExpandFileName(std::string fname); void ChangeWorkingDirectory(std::string dir);
/**
* \brief
*
*/
std::string GetProcessName();
/**
* \brief
*
*/
std::string GetUserName();
/**
* \brief
*
*/
std::string GetHostName();
/**
* \brief
*
*/
std::string GetHostArchitecture();
/**
* \brief
*
*/
std::string GetOSName();
/**
* \brief
*
*/
std::string GetOSVersion();
/**
* \brief
*
*/
std::string GetTempDirectory();
/**
* \brief
*
*/
uint64_t GetDiskFreeSpace();
/**
* \brief
*
*/
int GetProcessorCount();
/** /**
* \brief Reset the system. * \brief Reset the system.
* *
*/ */
static int ResetSystem(); static int ResetSystem();
/** /**
* \brief * \brief
* *
 End of changes. 2 change blocks. 
11 lines changed or deleted 56 lines changed or added


 jtable.h   jtable.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_TABLE_H #ifndef J_TABLE_H
#define J_TABLE_H #define J_TABLE_H
#include "jcomponent.h" #include "jcomponent.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class Table; class Table;
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Cell : public virtual jcommon::Object{ class Cell : public virtual jcommon::Object{
friend class Table;
private: private:
Table *_table; Table *_table;
std::string _value; std::string _value;
int _bgcell_red, int _bgcell_red,
_bgcell_green, _bgcell_green,
_bgcell_blue, _bgcell_blue,
_bgcell_alpha; _bgcell_alpha;
int _fgcell_red, int _fgcell_red,
_fgcell_green, _fgcell_green,
_fgcell_blue, _fgcell_blue,
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 jtextarea.h   jtextarea.h 
skipping to change at line 30 skipping to change at line 30
#ifndef J_TEXTAREA_H #ifndef J_TEXTAREA_H
#define J_TEXTAREA_H #define J_TEXTAREA_H
#include "jtextcomponent.h" #include "jtextcomponent.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <map> #include <map>
#include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h> #include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class TextArea : public jgui::TextComponent{ class TextArea : public jgui::TextComponent{
 End of changes. 3 change blocks. 
3 lines changed or deleted 0 lines changed or added


 jtextcomponent.h   jtextcomponent.h 
skipping to change at line 30 skipping to change at line 30
#ifndef J_TEXTCOMPONENT_H #ifndef J_TEXTCOMPONENT_H
#define J_TEXTCOMPONENT_H #define J_TEXTCOMPONENT_H
#include "jcomponent.h" #include "jcomponent.h"
#include "jtextlistener.h" #include "jtextlistener.h"
#include "jgraphics.h" #include "jgraphics.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jcursor_type_t { enum jcursor_type_t {
NONE_CURSOR, NONE_CURSOR,
UNDERSCORE_CURSOR, UNDERSCORE_CURSOR,
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jtextdialogbox.h   jtextdialogbox.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_TEXTDIALOGBOX_H #ifndef J_TEXTDIALOGBOX_H
#define J_TEXTDIALOGBOX_H #define J_TEXTDIALOGBOX_H
#include "jbutton.h" #include "jbutton.h"
#include "jbuttonlistener.h" #include "jbuttonlistener.h"
#include "jlabel.h" #include "jlabel.h"
#include "jframe.h" #include "jframe.h"
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jdate.h" #include "jdate.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class TextDialogBox : public jgui::Frame{ class TextDialogBox : public jgui::Frame{
private: private:
Label *_label; Label *_label;
public: public:
/** /**
 End of changes. 2 change blocks. 
3 lines changed or deleted 0 lines changed or added


 jtextevent.h   jtextevent.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_TEXTEVENT_H #ifndef J_TEXTEVENT_H
#define J_TEXTEVENT_H #define J_TEXTEVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class TextEvent : public jcommon::EventObject{ class TextEvent : public jcommon::EventObject{
private: private:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jtextfield.h   jtextfield.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_TEXTFIELD_H #ifndef J_TEXTFIELD_H
#define J_TEXTFIELD_H #define J_TEXTFIELD_H
#include "jtextcomponent.h" #include "jtextcomponent.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h> #include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class TextField : public jgui::TextComponent{ class TextField : public jgui::TextComponent{
 End of changes. 3 change blocks. 
3 lines changed or deleted 0 lines changed or added


 jtextlistener.h   jtextlistener.h 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_TEXTLISTENER_H #ifndef J_TEXTLISTENER_H
#define J_TEXTLISTENER_H #define J_TEXTLISTENER_H
#include "jtextevent.h" #include "jtextevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class TextListener : public jcommon::Listener{ class TextListener : public jcommon::Listener{
protected: protected:
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jtheme.h   jtheme.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_THEME_H #ifndef J_THEME_H
#define J_THEME_H #define J_THEME_H
#include "jgraphics.h" #include "jgraphics.h"
#include "jcomponent.h" #include "jcomponent.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class Component; class Component;
class Window; class Window;
class ItemComponent; class ItemComponent;
/** /**
* \brief * \brief
* *
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jthememanager.h   jthememanager.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_THEMEMANAGER_H #ifndef J_THEMEMANAGER_H
#define J_THEMEMANAGER_H #define J_THEMEMANAGER_H
#include "jtheme.h" #include "jtheme.h"
#include "jthemelistener.h" #include "jthemelistener.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class ThemeManager : public jcommon::Object{ class ThemeManager : public jcommon::Object{
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jthread.h   jthread.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_THREAD_H #ifndef J_THREAD_H
#define J_THREAD_H #define J_THREAD_H
#include "jmutex.h" #include "jmutex.h"
#include "jcondition.h" #include "jcondition.h"
#include "jthreadexception.h" #include "jthreadexception.h"
#include "jobject.h" #include "jobject.h"
#include "jrunnable.h"
#include <map> #include <map>
#include <cstdlib> #include <cstdlib>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#else #else
#endif #endif
namespace jthread{ namespace jthread{
struct jthread_map_t {
#ifdef _WIN32
HANDLE thread;
#else
pthread_t thread;
#endif
bool alive;
};
enum jthread_type_t { enum jthread_type_t {
DETACH_THREAD, DETACH_THREAD,
JOINABLE_THREAD JOINABLE_THREAD
}; };
enum jthread_priority_t {
LOW_PRIORITY,
NORMAL_PRIORITY,
HIGH_PRIORITY
};
enum jthread_policy_t { enum jthread_policy_t {
POLICY_OTHER, // Normal thread
POLICY_FIFO, // Real-time thread fifo
POLICY_ROUND_ROBIN // Round robin thread round robin
};
struct jthread_map_t {
#ifdef _WIN32 #ifdef _WIN32
POLICY_OTHER = 1, // Normal thread HANDLE thread;
POLICY_FIFO = 2, // Real-time thread fifo
POLICY_ROUND_ROBIN = 3 // Round robin thread round
robin
#else #else
POLICY_OTHER = SCHED_OTHER, // Normal thread pthread_t thread;
POLICY_FIFO = SCHED_FIFO, // Real-time thread
fifo
POLICY_ROUND_ROBIN = SCHED_RR // Round robin threa
d round robin
#endif #endif
bool alive;
}; };
enum jthread_priority_t { class ThreadGroup;
LOW_PRIORITY = 0,
NORMAL_PRIORITY = 5,
HIGH_PRIORITY = 10
};
/** /**
* \brief Thread. * \brief Thread.
* *
* @author Jeff Ferr * @author Jeff Ferr
*/ */
class Thread : public virtual jcommon::Object{ class Thread : public virtual jcommon::Object{
private: private:
#ifdef _WIN32 #ifdef _WIN32
skipping to change at line 102 skipping to change at line 99
LPSECURITY_ATTRIBUTES _sa; LPSECURITY_ATTRIBUTES _sa;
/** \brief */ /** \brief */
DWORD _exitCode; DWORD _exitCode;
#else #else
/** \brief */ /** \brief */
pthread_t _thread; pthread_t _thread;
/** \brief */ /** \brief */
Condition _condition; Condition _condition;
#endif #endif
/** \brief */ /** \brief */
std::map<int, jthread_map_t *> _threads;
/** \brief */
Mutex jthread_mutex; Mutex jthread_mutex;
/** \brief */ /** \brief */
Runnable *_runnable;
/** \brief */
ThreadGroup *_group;
/** \brief */
jthread_type_t _type; jthread_type_t _type;
/** \brief */ /** \brief */
int _key; int _key;
/** \brief */ /** \brief */
bool _is_running; bool _is_running;
/** \brief */
std::map<int, jthread_map_t *> _threads;
/** /**
* \brief * \brief
* *
*/ */
#ifdef _WIN32 #ifdef _WIN32
static DWORD WINAPI ThreadMain(void *owner_); static DWORD WINAPI ThreadMain(void *owner_);
#else #else
static void * ThreadMain(void *owner_); static void * ThreadMain(void *owner_);
static void CleanUpMain(void *owner_);
#endif #endif
/** /**
* \brief Notify the end of thread. * \brief Notify the end of thread.
* *
*/ */
void SignalThreadDead();
/**
* \brief Notify the end of thread.
*
*/
jthread_map_t * GetMap(int key); jthread_map_t * GetMap(int key);
protected: protected:
/** /**
* \brief * \brief
* *
*/ */
virtual int SetUp(); virtual int SetUp();
/** /**
skipping to change at line 159 skipping to change at line 153
* \brief * \brief
* *
*/ */
virtual int CleanUp(); virtual int CleanUp();
public: public:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
Thread(jthread_type_t type = JOINABLE_THREAD); Thread(jthread_type_t type = JOINABLE_THREAD, ThreadGroup *g
roup = NULL);
/**
* \brief Construtor.
*
*/
Thread(Runnable *runnable, jthread_type_t type = JOINABLE_TH
READ, ThreadGroup *group = NULL);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~Thread(); virtual ~Thread();
/** /**
* \brief * \brief
* *
*/ */
static void Sleep(long long time_); ThreadGroup * GetThreadGroup();
/** /**
* \brief * \brief
* *
*/ */
static void USleep(long long time_); static void Sleep(uint64_t time_);
/**
* \brief
*
*/
static void MSleep(uint64_t time_);
/**
* \brief
*
*/
static void USleep(uint64_t time_);
/** /**
* \brief Get thread identifier * \brief Get thread identifier
* *
*/ */
int GetID(); int GetKey();
/** /**
* \brief * \brief
* *
*/ */
void KillAllThreads(); void KillAllThreads();
/** /**
* \brief Init the thread. * \brief Init the thread.
* *
skipping to change at line 225 skipping to change at line 237
/** /**
* \brief Return true if thread is started, false if not. * \brief Return true if thread is started, false if not.
* *
*/ */
bool IsRunning(int key = 0); bool IsRunning(int key = 0);
/** /**
* \bried * \bried
* *
*/ */
void Yield();
/**
* \bried
*
*/
void SetPolicy(jthread_policy_t policy, jthread_priority_t p riority); void SetPolicy(jthread_policy_t policy, jthread_priority_t p riority);
/** /**
* \bried * \bried
* *
*/ */
void GetPolicy(jthread_policy_t *policy, jthread_priority_t *priority); void GetPolicy(jthread_policy_t *policy, jthread_priority_t *priority);
/** /**
* \brief Wait for end of thread. * \brief Wait for end of thread.
* *
*/ */
void WaitThread(int key = 0); void WaitThread(int key = 0);
/**
* \brief Wait for end of thread.
*
*/
void Release();
}; };
} }
#endif #endif
 End of changes. 19 change blocks. 
36 lines changed or deleted 59 lines changed or added


 jthreadgroup.h   jthreadgroup.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_THREADGROUP_H #ifndef J_THREADGROUP_H
#define J_THREADGROUP_H #define J_THREADGROUP_H
#include "jrunnable.h"
#include "jthread.h" #include "jthread.h"
#include "jsemaphore.h" #include "jsemaphore.h"
#include "jobject.h" #include "jobject.h"
#include <map> #include <vector>
#include <queue> #include <string>
#ifdef _WIN32
#include <windows.h>
#else
#endif
namespace jthread{ namespace jthread{
enum jthread_group_priority_t {
THREAD_GROUP_LOW,
THREAD_GROUP_MEDIUM,
THREAD_GROUP_HIGH
};
class ThreadGroup;
class WorkerThread : public jthread::Thread{
private:
/** \brief */
ThreadGroup *_group;
/** \brief */
Runnable *_runnable;
/** \brief */
Semaphore _sem;
/** \brief */
Mutex _mutex;
/** \brief */
bool _is_locked;
public:
/**
* \brief
*
*/
WorkerThread(ThreadGroup *group);
/**
* \brief
*
*/
virtual ~WorkerThread();
/**
* \brief
*
*/
bool IsRunning();
/**
* \brief
*
*/
void WaitThread();
/**
* \brief
*
*/
void AttachThread(Runnable *r);
/**
* \brief
*
*/
void DetachThread(Runnable *r);
/**
* \brief
*
*/
virtual void Run();
};
/** /**
* \brief ThreadGroup. * \brief ThreadGroup.
* *
* @author Jeff Ferr * @author Jeff Ferr
*/ */
class ThreadGroup : public virtual jcommon::Object{ class ThreadGroup : public virtual jcommon::Object{
private: friend class Thread;
/** \brief */
std::vector<WorkerThread *> _threads; private:
/** \brief */
std::queue<Runnable *> _low_threads;
/** \brief */
std::queue<Runnable *> _medium_threads;
/** \brief */ /** \brief */
std::queue<Runnable *> _high_threads; std::vector<Thread *> _threads;
/** \brief */ /** \brief */
Mutex _mutex; Mutex _mutex;
/** \brief */ /** \brief */
Semaphore _sem; std::string _name;
/** \brief */
int _max_threads;
public: private:
/** /**
* \brief Construtor. * \brief Construtor.
* *
*/ */
ThreadGroup(int max_threads); void RegisterThread(Thread *thread);
/** /**
* \brief Destrutor virtual. * \brief Construtor.
* *
*/ */
virtual ~ThreadGroup(); void UnregisterThread(Thread *thread);
public:
/** /**
* \brief * \brief Construtor.
* *
*/ */
bool AttachThread(Runnable *r, jthread_group_priority_t t = THREAD_GROUP_MEDIUM); ThreadGroup(std::string name);
/** /**
* \brief * \brief Destrutor virtual.
* *
*/ */
bool DetachThread(Runnable *r); virtual ~ThreadGroup();
/** /**
* \brief * \brief
* *
*/ */
void Interrupt(); void InterruptAll();
/** /**
* \brief * \brief
* *
*/ */
void WaitForAll(); void WaitForAll();
/**
* \brief Return true if thread is started, false if not.
*
*/
int CountActiveThreads();
/**
* \brief
*
*/
void ReleaseWorkerThread(WorkerThread *t);
}; };
} }
#endif #endif
 End of changes. 17 change blocks. 
107 lines changed or deleted 17 lines changed or added


 jthreadlib.h   jthreadlib.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_THREADLIB_H #ifndef J_THREADLIB_H
#define J_THREADLIB_H #define J_THREADLIB_H
#include "jautolock.h"
#include "jbufferexception.h"
#include "jcondition.h"
#include "jevent.h"
#include "jillegalstateexception.h"
#include "jindexedbuffer.h"
#include "jmonitor.h"
#include "jmutex.h"
#include "jmutexexception.h"
#include "jrunnable.h"
#include "jrwlock.h"
#include "jsemaphore.h"
#include "jsemaphoreexception.h"
#include "jsemaphoretimeoutexception.h"
#include "jspinlock.h"
#include "jthread.h"
#include "jthreadexception.h"
#include "jthreadgroup.h"
#include "jthreadpool.h"
#include "jtimer.h"
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 21 lines changed or added


 jtooglebutton.h   jtooglebutton.h 
skipping to change at line 29 skipping to change at line 29
************************************************************************** */ ************************************************************************** */
#ifndef J_TOOGLEBUTTON_H #ifndef J_TOOGLEBUTTON_H
#define J_TOOGLEBUTTON_H #define J_TOOGLEBUTTON_H
#include "jcomponent.h" #include "jcomponent.h"
#include "jimagebutton.h" #include "jimagebutton.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
class ButtonListener; class ButtonListener;
class ButtonEvent; class ButtonEvent;
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jtree.h   jtree.h 
skipping to change at line 31 skipping to change at line 31
#define J_TREE_H #define J_TREE_H
#include "jmenu.h" #include "jmenu.h"
#include "jitemcomponent.h" #include "jitemcomponent.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Tree : public jgui::ItemComponent{ class Tree : public jgui::ItemComponent{
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jtypes.h   jtypes.h 
skipping to change at line 28 skipping to change at line 28
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
a************************************************************************* **/ a************************************************************************* **/
#ifndef J_TYPES_H #ifndef J_TYPES_H
#define J_TYPES_H #define J_TYPES_H
#include "jobject.h" #include "jobject.h"
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
#include <cstdlib>
namespace jcommon { namespace jcommon {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class Types : public virtual jcommon::Object{ class Types : public virtual jcommon::Object{
skipping to change at line 69 skipping to change at line 68
/** /**
* \brief * \brief
* *
*/ */
static std::string IntegerToString(int i, int radix = 10); static std::string IntegerToString(int i, int radix = 10);
/** /**
* \brief * \brief
* *
*/ */
static long long StringToLong(std::string s, int radix = 10) ; static int64_t StringToLong(std::string s, int radix = 10);
/** /**
* \brief * \brief
* *
*/ */
static std::string LongToString(long long i, int radix = 10) ; static std::string LongToString(int64_t i, int radix = 10);
/** /**
* \brief * \brief
* *
*/ */
static float StringToFloat(std::string s); static float StringToFloat(std::string s);
/** /**
* \brief * \brief
* *
skipping to change at line 105 skipping to change at line 104
/** /**
* \brief * \brief
* *
*/ */
static std::string DoubleToString(double i, int radix = 10); static std::string DoubleToString(double i, int radix = 10);
/** /**
* \brief * \brief
* *
*/ */
static std::string LongToRadix(long long i, int radix); static std::string LongToRadix(int64_t i, int radix);
}; };
} }
#endif #endif
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added


 jurl.h   jurl.h 
skipping to change at line 74 skipping to change at line 74
*/ */
virtual ~URL(); virtual ~URL();
/** /**
* \brief * \brief
* *
*/ */
static std::string Encode(std::string); static std::string Encode(std::string);
/** /**
* \brief
*
*/
static std::string Decode(std::string);
/**
* \brief * \brief
* *
*/ */
static std::string Encode(std::string, std::string); static std::string Encode(std::string, std::string);
/** /**
* \brief * \brief
* *
*/ */
static std::string Decode(std::string, std::string); static std::string Decode(std::string, std::string);
 End of changes. 1 change blocks. 
0 lines changed or deleted 6 lines changed or added


 jwatch.h   jwatch.h 
skipping to change at line 32 skipping to change at line 32
#include "jcomponent.h" #include "jcomponent.h"
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jautolock.h" #include "jautolock.h"
#include <string> #include <string>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jwatch_type_t { enum jwatch_type_t {
ANALOGIC_WATCH, ANALOGIC_WATCH,
CRONOMETERUP_WATCH, CRONOMETERUP_WATCH,
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 jwindow.h   jwindow.h 
skipping to change at line 147 skipping to change at line 147
/** /**
* \brief * \brief
* *
*/ */
virtual void SetMaximumSize(int w, int h); virtual void SetMaximumSize(int w, int h);
/** /**
* \brief * \brief
* *
*/ */
virtual void SetBounds(int x1, int y1, int w1, int h1); virtual void SetBounds(int x, int y, int w, int h);
/** /**
* \brief * \brief
* *
*/ */
virtual void SetLocation(int x1, int y1); virtual void SetLocation(int x, int y);
/** /**
* \brief * \brief
* *
*/ */
virtual void SetSize(int w, int h); virtual void SetSize(int width, int height);
/** /**
* \brief * \brief
* *
*/ */
virtual void Move(int x1, int y1); virtual void Move(int x, int y);
/** /**
* \brief * \brief
* *
*/ */
virtual void Flip(); virtual void Flip();
/** /**
* \brief * \brief
* *
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 jwindowevent.h   jwindowevent.h 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_WINDOWEVENT_H #ifndef J_WINDOWEVENT_H
#define J_WINDOWEVENT_H #define J_WINDOWEVENT_H
#include "jeventobject.h" #include "jeventobject.h"
#include <iostream>
#include <cstdlib>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
*/ */
enum jwindow_event_t { enum jwindow_event_t {
WINDOW_CLOSING_EVENT, WINDOW_CLOSING_EVENT,
WINDOW_CLOSED_EVENT, WINDOW_CLOSED_EVENT,
WINDOW_OPENED_EVENT, WINDOW_OPENED_EVENT,
 End of changes. 1 change blocks. 
11 lines changed or deleted 0 lines changed or added


 jwindowlistener.h   jwindowlistener.h 
skipping to change at line 30 skipping to change at line 30
#ifndef J_WINDOWLISTENER_H #ifndef J_WINDOWLISTENER_H
#define J_WINDOWLISTENER_H #define J_WINDOWLISTENER_H
#include "jwindowevent.h" #include "jwindowevent.h"
#include "jlistener.h" #include "jlistener.h"
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
namespace jgui { namespace jgui {
/** /**
* \brief * \brief
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class WindowListener : public jcommon::Listener{ class WindowListener : public jcommon::Listener{
 End of changes. 2 change blocks. 
5 lines changed or deleted 0 lines changed or added


 jwrapperprocess.h   jwrapperprocess.h 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_WRAPPERPROCESS_H #ifndef J_WRAPPERPROCESS_H
#define J_WRAPPERPROCESS_H #define J_WRAPPERPROCESS_H
#include "jobject.h" #include "jprivateprocess.h"
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock.h>
#else #else
#include <sys/socket.h>
#endif #endif
#include <unistd.h>
#include <stdint.h> #include <stdint.h>
namespace jshared { namespace jshared {
enum jwprocess_mode_t { enum jwprocess_mode_t {
FLUSH_WRITE_BUFFER, FLUSH_WRITE_BUFFER,
WAIT_ANY_INPUT, WAIT_ANY_INPUT,
WAIT_ALL_INPUT, WAIT_ALL_INPUT,
TRY_ONCE TRY_ONCE
}; };
enum jwprocess_flag_t { enum jwprocess_flag_t {
PROCESS_CREAT, /** \brief Create a new process */ PROCESS_CREAT, /** \brief Create a new process */
PROCESS_LOCK /** \brief Create a new process and block parent */ PROCESS_LOCK /** \brief Create a new process and block parent */
}; };
enum jwprocess_type_t {
PROCESS_CHILD,
PROCESS_PARENT
};
/** /**
* \brief Socket. * \brief Socket.
* *
* \author Jeff Ferr * \author Jeff Ferr
*/ */
class WrapperProcess : public virtual jcommon::Object{ class WrapperProcess : public virtual jcommon::Object{
private: private:
#ifdef _WIN32 #ifdef _WIN32
/** \brief Socket handler. */ /** \brief */
HANDLE _pid; HANDLE _pid;
#else #else
/** \brief Socket handler. */ /** \brief */
pid_t _pid; pid_t _pid;
/** \brief */
pid_t chldpid;
#endif #endif
/** \brief */ /** \brief */
int _pchild[2]; int _pchild[2];
/** \brief */ /** \brief */
int _pparent[2]; int _pparent[2];
/** \brief */ /** \brief */
pid_t chldpid; bool _is_running;
/** \brief */
bool _is_running;
/** /**
* \brief * \brief
* *
*/ */
int ReadIns(char *b, int size); int ReadIns(char *b, int size);
/** /**
* \brief * \brief
* *
*/ */
void ReadWrite(jwprocess_mode_t m); void ReadWrite(jwprocess_mode_t m);
/** /**
* \brief * \brief
* *
*/ */
void MakeHandleGreaterThan2(int fd); void MakeHandleGreaterThan2(int fd);
/** /**
* \brief * \brief
* *
*/ */
void ForkChild(const char *prog, char **args); void ForkChild(const char *prog, char **args);
protected: protected:
/** /**
* \brief InputStream parameters * \brief InputStream parameters
* *
*/ */
/** \brief */ /** \brief */
char *_rbuffer; char *_rbuffer;
/** \brief */ /** \brief */
int _rbuffer_length; int _rbuffer_length;
/** \brief */ /** \brief */
int _rcurrent_index; int _rcurrent_index;
/** \brief */ /** \brief */
int _rend_index; int _rend_index;
/** /**
* \brief * \brief
* *
*/ */
int ReadBuffer(char *data_, int data_length_); int ReadBuffer(char *data_, int data_length_);
/** /**
* \brief * \brief
* *
*/ */
bool IsReadBufferEmpty(); bool IsReadBufferEmpty();
/** /**
* \brief * \brief
* *
*/ */
int GetReadBufferAvailable(); int GetReadBufferAvailable();
/** /**
* \brief * \brief
* *
*/ */
void ResetReadBuffer(); void ResetReadBuffer();
/** /**
* \brief OutputStream parameters * \brief OutputStream parameters
* *
*/ */
/** \brief */ /** \brief */
char *_wbuffer; char *_wbuffer;
/** \brief */ /** \brief */
int _wbuffer_length; int _wbuffer_length;
/** \brief */ /** \brief */
int _wcurrent_index; int _wcurrent_index;
/** /**
* \brief * \brief
* *
*/ */
int WriteBuffer(const char *data_, int data_length_); int WriteBuffer(const char *data_, int data_length_)
;
/** /**
* \brief * \brief
* *
*/ */
bool IsWriteBufferEmpty(); bool IsWriteBufferEmpty();
/** /**
* \brief * \brief
* *
*/ */
int GetWriteBufferAvailable(); int GetWriteBufferAvailable();
/** /**
* \brief * \brief
* *
*/ */
int FlushWriteBuffer(); int FlushWriteBuffer();
public: public:
/** /**
* \brief Constructor. * \brief Constructor.
* *
* \param args_ Contem um array de parametros, com o ultimo * \param args_ Contem um array de parametros, com o
parametro igual a NULL ultimo parametro igual a NULL
* *
*/ */
WrapperProcess(std::string prog_, char **args_); WrapperProcess(std::string prog_, char **args_);
/** /**
* \brief Constructor. * \brief Constructor.
* *
*/ */
WrapperProcess(std::string prog_); WrapperProcess(std::string prog_);
/** /**
* \brief Destrutor virtual. * \brief Destrutor virtual.
* *
*/ */
virtual ~WrapperProcess(); virtual ~WrapperProcess();
/** /**
* \brief * \brief
* *
*/ */
void Flush(); void Flush();
/** /**
* \brief * \brief
* *
*/ */
int Read(char *buf, int size); int Read(char *buf, int size);
/** /**
* \brief * \brief
* *
*/ */
int Write(const char *buf, int size); int Write(const char *buf, int size);
/** /**
* \brief * \brief
* *
*/ */
void Write(std::string s); void Write(std::string s);
/** /**
* \brief * \brief
* *
*/ */
void WaitAnyData(); void WaitAnyData();
/** /**
* \brief * \brief
* *
*/ */
void WaitAllData(); void WaitAllData();
/** /**
* \brief * \brief
* *
*/ */
jwprocess_type_t CreateProcess(); jprocess_type_t CreateProcess();
/** /**
* \brief * \brief
* *
*/ */
void WaitProcess(); void WaitProcess();
/** /**
* \brief * \brief
* *
*/ */
void Interrupt(); void Interrupt();
/** /**
* \brief * \brief
* *
*/ */
void Release(); void Release();
}; };
} }
#endif #endif
 End of changes. 38 change blocks. 
173 lines changed or deleted 166 lines changed or added


 jyesnodialogbox.h   jyesnodialogbox.h 
skipping to change at line 27 skipping to change at line 27
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
************************************************************************** */ ************************************************************************** */
#ifndef J_YESNODIALOGBOX_H #ifndef J_YESNODIALOGBOX_H
#define J_YESNODIALOGBOX_H #define J_YESNODIALOGBOX_H
#include "jbutton.h" #include "jbutton.h"
#include "jbuttonlistener.h" #include "jbuttonlistener.h"
#include "jlabel.h" #include "jlabel.h"
#include "jframe.h" #include "jframe.h"
#include "jthread.h" #include "jthread.h"
#include "jmutex.h" #include "jmutex.h"
#include "jdate.h" #include "jdate.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
namespace jgui { namespace jgui {
enum jyesno_response_t { enum jyesno_response_t {
YES_RESPONSE, YES_RESPONSE,
NO_RESPONSE NO_RESPONSE
}; };
/** /**
* \brief * \brief
 End of changes. 2 change blocks. 
3 lines changed or deleted 0 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/