RetroShare/libretroshare/src/pqi
leander-256 b30056e17f This patch allows Windows users to share files and folders with "exotic" characters.
The problem was that libretroshare handles files in UTF-8 but Windows's ANSI/POSIX C functions automatically assume that the char* parameters are encoded with the system's code page. There is no way to set that code page as UTF-8. So now under Windows the code translates the file name to UTF-16 before feeding it to one of the Unicode functions (they are usually prefixed or suffixed by 'w'). Please note that it is not very efficient.

Furthermore, Windows does not provide a Unicode version of opendir/readdir/closedir, so it was necessary to use FindFirstFileW/FindNextFileW/FindClose which has a different behaviour as well as different structures. The FolderIterator class was created in order to mimic the Unix way of traversing folders contents. Hence the algorithm is unchanged and the systems differences masked.

As it was necessary to use some functions from the Windows API, <windows.h> had to be included in a few files were it didn't appear before, creating macros and #define conflicts. In order to solve them, util/rswin.h must be included first in a file (if necessary). Otherwise the preprocessor will fail on purpose to avoid the code being compiled with different _WIN32_WINNT values.

As another side-effect, rstlvutil.h and rstlvutil.cc have been removed from libretroshare.pro file. They are only used by testing units and include util/utest.h which defines a macro FAILED that already exists in <windows.h>. I don't know if unit tests are still in use and I don't plan on coding often on Windows, so I'll leave that as an exercise (hot potato?) to a motivated fellow Windows programmer.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2924 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2010-05-16 23:26:45 +00:00
..
authgpg.cc Minor fixes 2010-05-14 18:50:20 +00:00
authgpg.h Portable version for Windows. 2010-04-30 14:34:48 +00:00
authssl.cc included patch for openssl-1.0.0 compatibility 2010-04-21 08:52:04 +00:00
authssl.h implementation of an SSL binary encryption 2010-02-25 22:42:42 +00:00
cleanupxpgp.cc add the clean cert routine for gpg certs 2010-01-19 21:44:59 +00:00
cleanupxpgp.h update, during the GUI for invitation changes 2009-03-18 19:33:30 +00:00
conn_test.cc Changes required to get Retroshare V0.4 working under windows. 2008-03-03 14:41:15 +00:00
dht_test.cc * Modified p3ConnectMgr to enable Standalone testing of components. 2008-08-16 15:02:24 +00:00
gpgme_tst.c Major change to the way certificates are stored now defaults to ~/.retroshare/SSLID/ 2009-07-30 21:27:47 +00:00
Makefile * Major tweak to the serialiser: shifted size to 32bits to handle bigger packets. This will break compatibility. 2009-09-08 20:18:43 +00:00
net_test.cc Changes required to get Retroshare V0.4 working under windows. 2008-03-03 14:41:15 +00:00
net_test1.cc moved isLocalNet() etc to util/rsnet.cc 2008-06-07 11:21:00 +00:00
netiface_test.cc * Major tweak to the serialiser: shifted size to 32bits to handle bigger packets. This will break compatibility. 2009-09-08 20:18:43 +00:00
p3cfgmgr.cc documentation - p3configmgr.h 2010-04-15 11:26:44 +00:00
p3cfgmgr.h documentation - p3configmgr.h 2010-04-15 11:26:44 +00:00
p3connmgr.cc New methods for calculating the count of peers and messages. It should be faster than getting all data in std::list. 2010-05-13 19:20:40 +00:00
p3connmgr.h New methods for calculating the count of peers and messages. It should be faster than getting all data in std::list. 2010-05-13 19:20:40 +00:00
p3dhtmgr.cc final code, working on local machine 2009-11-11 16:49:11 +00:00
p3dhtmgr.h * Modified p3ConnectMgr to enable Standalone testing of components. 2008-08-16 15:02:24 +00:00
p3notify.cc Merge branch 'gcc44' 2009-05-27 20:59:48 +00:00
p3notify.h Merge branch 'badPacketMessage' 2009-05-05 13:35:36 +00:00
p3upnpmgr.h * Modified p3ConnectMgr to enable Standalone testing of components. 2008-08-16 15:02:24 +00:00
pqi.h Major changes to the networking core of retroshare to introduce the new serialiser. 2007-12-12 01:29:14 +00:00
pqi_base.cc Major changes to the networking core of retroshare to introduce the new serialiser. 2007-12-12 01:29:14 +00:00
pqi_base.h documenting: pqi_base.h 2010-04-15 11:39:54 +00:00
pqiarchive.cc still further log cleanings 2010-02-08 16:42:26 +00:00
pqiarchive.h Commit of the new UDP Connection methods and 2008-01-25 06:36:40 +00:00
pqiassist.h Missed a file. 2008-08-16 15:06:03 +00:00
pqibin.cc * Fixed up various memory leaks (mainly serialiser cleanup). 2008-04-02 13:55:45 +00:00
pqibin.h documentation: pqibin 2010-04-15 10:54:54 +00:00
pqihandler.cc Revert "Ad a friend right upon connection when necessary. Removed two core mutex to do that, it might be dangerous, we will see" 2010-01-14 22:50:27 +00:00
pqihandler.h new computing for download and upload rate. No more indiv rate settings 2009-06-08 17:09:00 +00:00
pqihash.h warning suppression 2010-02-23 21:55:29 +00:00
pqiindic.h Lots of little changes to libretroshare. Improvements mainly focused 2008-02-07 16:18:34 +00:00
pqilistener.h Commit of the new UDP Connection methods and 2008-01-25 06:36:40 +00:00
pqiloopback.cc * Enabled saving of data rate limits. 2008-04-04 12:19:50 +00:00
pqiloopback.h Commit of the new UDP Connection methods and 2008-01-25 06:36:40 +00:00
pqimonitor.cc final code, working on local machine 2009-11-11 16:49:11 +00:00
pqimonitor.h final code, working on local machine 2009-11-11 16:49:11 +00:00
pqinetwork.cc Memory leak: 2010-05-09 21:58:28 +00:00
pqinetwork.h This patch allows Windows users to share files and folders with "exotic" characters. 2010-05-16 23:26:45 +00:00
pqinotify.h Merge branch 'badPacketMessage' 2009-05-05 13:35:36 +00:00
pqiperson.cc reimplemented the tunnel handshake 2010-02-25 22:44:04 +00:00
pqiperson.h change hearbeat period to 6 secons. Disconnect when no beat is received after 18 sec 2010-01-04 13:05:28 +00:00
pqipersongrp.cc remove a maximum of debug outputs for the release 2010-02-07 21:28:40 +00:00
pqipersongrp.h add ext address detector when connectiong to peers 2009-12-14 18:11:19 +00:00
pqisecurity.cc * Added partially completed authssl.cc, as we move towards openpgp authentication. 2009-04-22 23:29:16 +00:00
pqisecurity.h Major changes to the networking core of retroshare to introduce the new serialiser. 2007-12-12 01:29:14 +00:00
pqiservice.cc Add the tunneling connection. Warning, encryption is not implemented yet for tunnel connection, use only for testing. 2009-12-13 21:59:26 +00:00
pqiservice.h Added Mutex protection to the core comms (pqihandler + pqipersongrp). 2008-11-22 13:15:07 +00:00
pqissl.cc Memory leaks: 2010-05-12 20:10:22 +00:00
pqissl.h clean the qmake files 2010-02-14 14:18:53 +00:00
pqissllistener.cc small update of connct mgr and ssl connection 2010-03-05 21:27:42 +00:00
pqissllistener.h make it run 2010-01-13 21:01:06 +00:00
pqisslpersongrp.cc get rid of p3authmgr 2010-01-13 20:56:55 +00:00
pqisslpersongrp.h Commit of the new UDP Connection methods and 2008-01-25 06:36:40 +00:00
pqissltunnel.cc reimplemented the tunnel handshake 2010-02-25 22:44:04 +00:00
pqissltunnel.h reimplemented the tunnel handshake 2010-02-25 22:44:04 +00:00
pqissludp.cc get rid of p3authmgr 2010-01-13 20:56:55 +00:00
pqissludp.h get rid of p3authmgr 2010-01-13 20:56:55 +00:00
pqistore.cc added security check against malformed packets 2010-04-23 12:57:59 +00:00
pqistore.h Modified (all I hope) remaining pqistream -> pqistore for cache file save/loads. 2009-05-12 21:55:50 +00:00
pqistreamer.cc remove a maximum of debug outputs for the release 2010-02-07 21:28:40 +00:00
pqistreamer.h Added a Mutex around out_pkt and out_data in pqistreamer.cc, as a thread race between queue_outpqi and handleoutgoing is most probably responsible for random packet corruption. 2009-03-11 20:36:51 +00:00
sslcert.cc Created V0.3.x branch and moved the head into the trunk directory. 2007-11-15 03:18:48 +00:00
sslcert.h Created V0.3.x branch and moved the head into the trunk directory. 2007-11-15 03:18:48 +00:00
xpgp_id.cc Addition of several utility functions: 2008-03-21 02:02:58 +00:00
xpgpcert.cc Commit of the new UDP Connection methods and 2008-01-25 06:36:40 +00:00
xpgpcert.h Commit of the new UDP Connection methods and 2008-01-25 06:36:40 +00:00