|
From: <jon...@us...> - 2003-02-25 02:49:46
|
Update of /cvsroot/libaim/libaim
In directory sc8-pr-cvs1:/tmp/cvs-serv20381
Modified Files:
Makefile aimsession.cpp defaultaimlistener.cpp flap.cpp
htmlparser.cpp jaim.cpp server.cpp
Log Message:
Code cleanup. Getting rid of that silly bool.h file. Compiles with -Wall now. Doesn't use deprecated iostream.h stuff
anymore
Index: Makefile
===================================================================
RCS file: /cvsroot/libaim/libaim/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Makefile 17 May 2000 20:52:38 -0000 1.5
--- Makefile 25 Feb 2003 02:49:40 -0000 1.6
***************
*** 4,8 ****
CC = g++
! CPPFLAGS = -c -g -I./include
OBJS = \
--- 4,8 ----
CC = g++
! CPPFLAGS = -c -g -I./include -Wall
OBJS = \
Index: aimsession.cpp
===================================================================
RCS file: /cvsroot/libaim/libaim/aimsession.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** aimsession.cpp 25 Jan 2003 01:22:07 -0000 1.18
--- aimsession.cpp 25 Feb 2003 02:49:41 -0000 1.19
***************
*** 15,20 ****
--- 15,23 ----
#include <netdb.h>
+ #include <iostream>
#include <string>
+ using namespace std;
+
void AIMSession::handleSNACFamilyMessaging ( const FLAP::SNAC& snac, FLAP& flap ) {
const int INCOMING_IM = 0x07;
***************
*** 139,143 ****
flap.read8LV ( screenName );
! word type, tlvCount, warningLevel, userClass;
flap.readWord ( warningLevel );
--- 142,146 ----
flap.read8LV ( screenName );
! word tlvCount, warningLevel;
flap.readWord ( warningLevel );
***************
*** 264,268 ****
0xC5, 0xFA, 0x6B, 0x63, 0x69, 0x6C, 0xC3, 0x9F };
! for (int i=0; i<value.length(); i++)
password[i] = value[i] ^ mask[i % 16];
--- 267,271 ----
0xC5, 0xFA, 0x6B, 0x63, 0x69, 0x6C, 0xC3, 0x9F };
! for (string::size_type i=0; i<value.length(); i++)
password[i] = value[i] ^ mask[i % 16];
***************
*** 303,307 ****
FLAP flap;
! flap.setFileDescriptor (s, TRUE);
--- 306,310 ----
FLAP flap;
! flap.setFileDescriptor (s, true);
***************
*** 325,329 ****
*/
int passwordLen;
! const unsigned char *passowrd = getPassword( passwordLen );
flap.resetData();
flap.writeData (connectionAck, 4);
--- 328,332 ----
*/
int passwordLen;
! const unsigned char *password = getPassword( passwordLen );
flap.resetData();
flap.writeData (connectionAck, 4);
***************
*** 381,385 ****
*/
! int colonPos = newBOSServer.find (':');
if (colonPos != string::npos) {
--- 384,388 ----
*/
! string::size_type colonPos = newBOSServer.find (':');
if (colonPos != string::npos) {
***************
*** 410,414 ****
if ( ::connect (s, (struct sockaddr *)&sin, sizeof (struct sockaddr)) != 0 ) return 0;
! flap.setFileDescriptor (s, TRUE);
/*
--- 413,417 ----
if ( ::connect (s, (struct sockaddr *)&sin, sizeof (struct sockaddr)) != 0 ) return 0;
! flap.setFileDescriptor (s, true);
/*
***************
*** 447,451 ****
delete defaultAIMListener;
! if (password) delete password;
}
--- 450,454 ----
delete defaultAIMListener;
! delete password;
}
Index: defaultaimlistener.cpp
===================================================================
RCS file: /cvsroot/libaim/libaim/defaultaimlistener.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** defaultaimlistener.cpp 3 Jun 2000 14:09:10 -0000 1.3
--- defaultaimlistener.cpp 25 Feb 2003 02:49:41 -0000 1.4
***************
*** 2,5 ****
--- 2,8 ----
#include <buddyevent.h>
#include <aimsession.h>
+ #include <iostream>
+
+ using namespace std;
void DefaultAIMListener::simpleEventHandler ( AIMSession& session, int event, const string& message ) {
Index: flap.cpp
===================================================================
RCS file: /cvsroot/libaim/libaim/flap.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** flap.cpp 20 Nov 2000 16:03:44 -0000 1.10
--- flap.cpp 25 Feb 2003 02:49:41 -0000 1.11
***************
*** 2,7 ****
#include <tlv.h>
! #include <iostream.h>
! #include <iomanip.h>
#include <unistd.h>
--- 2,7 ----
#include <tlv.h>
! #include <iostream>
! #include <iomanip>
#include <unistd.h>
***************
*** 16,20 ****
return *this;
}
! FLAP& FLAP::setSeek ( int value, int whence = 0 ) {
int newValue;
--- 16,20 ----
return *this;
}
! FLAP& FLAP::setSeek ( int value, int whence ) {
int newValue;
***************
*** 55,59 ****
}
! FLAP::FLAP () : nextOutSequenceNumber(0), bufferCapacity(2046), closeFileDescOnDestroy ( false ) {
dataBuffer = new unsigned char[ bufferCapacity ];
resetData();
--- 55,63 ----
}
! FLAP::FLAP () :
! closeFileDescOnDestroy ( false ),
! bufferCapacity(2046),
! nextOutSequenceNumber(0)
! {
dataBuffer = new unsigned char[ bufferCapacity ];
resetData();
Index: htmlparser.cpp
===================================================================
RCS file: /cvsroot/libaim/libaim/htmlparser.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** htmlparser.cpp 29 May 2000 04:08:01 -0000 1.3
--- htmlparser.cpp 25 Feb 2003 02:49:41 -0000 1.4
***************
*** 1,9 ****
#include <htmlparser.h>
!
! #include <iostream.h>
! #include <iomanip.h>
!
! #include <unistd.h>
! #include <ctype.h>
/*
--- 1,4 ----
#include <htmlparser.h>
! #include <string>
/*
***************
*** 11,15 ****
*/
! string HTMLParser::parse(const string& text) {
return text; // tempory fix till bryan fixes this
--- 6,10 ----
*/
! std::string HTMLParser::parse(const std::string& text) {
return text; // tempory fix till bryan fixes this
Index: jaim.cpp
===================================================================
RCS file: /cvsroot/libaim/libaim/jaim.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** jaim.cpp 20 Nov 2000 16:03:44 -0000 1.11
--- jaim.cpp 25 Feb 2003 02:49:41 -0000 1.12
***************
*** 4,8 ****
#include <string>
! #include <iostream.h>
#include <unistd.h>
#include <pwd.h>
--- 4,8 ----
#include <string>
! #include <iostream>
#include <unistd.h>
#include <pwd.h>
***************
*** 13,17 ****
public:
! static const char id[] = "$Id$";
void buddyEventHandler (AIMSession& session, const BuddyEvent& event) {
--- 13,17 ----
public:
! static const char* id;
void buddyEventHandler (AIMSession& session, const BuddyEvent& event) {
***************
*** 76,96 ****
};
! int main (int argc, char **argv) {
! /*
! * For some reason a switch statement won't work here.
! * aww, shucks. that's ok.
! */
try {
!
! if (argc == 1) {
Jaim jaim;
! } else if (argc == 2) {
Jaim jaim(argv[1]);
! } else if (argc == 3) {
Jaim jaim(argv[1], argv[2]);
}
! } catch (out_of_range e) {
cout << e.what() << endl;
}
--- 76,101 ----
};
! const char* Jaim::id = "$Id$";
! int main (int argc, char **argv) {
try {
! switch( argc )
! {
! case 1:
! {
Jaim jaim;
! }
! case 2:
! {
Jaim jaim(argv[1]);
! }
! case 3:
! {
Jaim jaim(argv[1], argv[2]);
+ }
}
!
! } catch (const exception& e) {
cout << e.what() << endl;
}
Index: server.cpp
===================================================================
RCS file: /cvsroot/libaim/libaim/server.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** server.cpp 18 May 2000 17:22:45 -0000 1.2
--- server.cpp 25 Feb 2003 02:49:41 -0000 1.3
***************
*** 1,3 ****
! #include <iostream.h>
#include <flap.h>
--- 1,3 ----
! #include <iostream>
#include <flap.h>
|