genericopenlibs/openenvcore/backend/inc/sysif.h
branchRCL_3
changeset 64 c44f36bb61a3
parent 57 2efc27d87e1c
child 75 254b651f304e
equal deleted inserted replaced
60:82ca0c6a68ed 64:c44f36bb61a3
    34 #include <commdb.h>
    34 #include <commdb.h>
    35 #include <commdbconnpref.h>
    35 #include <commdbconnpref.h>
    36 #include <rpipe.h>
    36 #include <rpipe.h>
    37 
    37 
    38 #include<tz.h>
    38 #include<tz.h>
       
    39 #include <e32atomics.h>
    39 
    40 
    40 #ifdef SYMBIAN_OE_POSIX_SIGNALS
    41 #ifdef SYMBIAN_OE_POSIX_SIGNALS
    41 #include "signalclient.h"
    42 #include "signalclient.h"
    42 #include "tsignalmessage.h"
    43 #include "tsignalmessage.h"
    43 
    44 
   112 /*
   113 /*
   113 @internalComponent
   114 @internalComponent
   114 */
   115 */
   115 	{
   116 	{
   116 public:
   117 public:
   117 	void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock,RFastLock* aDefConnLock,RFastLock* aAESelectLock)
   118 	void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock,RFastLock* aDefConnLock,RFastLock* aAESelectLock,RFastLock* aTzServerLock)
   118 		{
   119 		{
   119 		iHeap = aHeap;
   120 		iHeap = aHeap;
   120 		iFs = aFs;
   121 		iFs = aFs;
   121 		iSs = aSs;
   122 		iSs = aSs;
   122 		iCs = aCs;
   123 		iCs = aCs;
   123 		iSsLock = aSsLock;
   124 		iSsLock = aSsLock;
   124 		iCsLock = aCsLock;
   125 		iCsLock = aCsLock;
   125 		iDefConnLock = aDefConnLock;
   126 		iDefConnLock = aDefConnLock;
   126 		iAESelectLock = aAESelectLock;
   127 		iAESelectLock = aAESelectLock;
       
   128 		iTzServerLock = aTzServerLock;
   127 		}
   129 		}
   128 
   130 
   129 	~TCLSICleanup()
   131 	~TCLSICleanup()
   130 		{
   132 		{
   131 		iFs->Close();
   133 		iFs->Close();
   134 		iCs->Close();
   136 		iCs->Close();
   135 		iCsLock->Close();
   137 		iCsLock->Close();
   136 		iHeap->Close();
   138 		iHeap->Close();
   137 		iDefConnLock->Close();
   139 		iDefConnLock->Close();
   138 		iAESelectLock->Close();
   140 		iAESelectLock->Close();
       
   141 		iTzServerLock->Close();
   139 		}
   142 		}
   140 private:
   143 private:
   141 	RHeap* iHeap;
   144 	RHeap* iHeap;
   142 	RFs* iFs;
   145 	RFs* iFs;
   143 	RSocketServ* iSs;
   146 	RSocketServ* iSs;
   144 	RCommServ* iCs;
   147 	RCommServ* iCs;
   145 	RFastLock* iSsLock;
   148 	RFastLock* iSsLock;
   146 	RFastLock* iCsLock;
   149 	RFastLock* iCsLock;
   147 	RFastLock* iDefConnLock;
   150 	RFastLock* iDefConnLock;
   148 	RFastLock* iAESelectLock;	
   151 	RFastLock* iAESelectLock;
       
   152 	RFastLock* iTzServerLock;
   149 	};
   153 	};
   150 
   154 
   151 
   155 
   152 class TFileTableCleanup
   156 class TFileTableCleanup
   153 {
   157 {
   451 	int utime (const wchar_t* name, const struct utimbuf* filetimes, int& anErrno);
   455 	int utime (const wchar_t* name, const struct utimbuf* filetimes, int& anErrno);
   452 
   456 
   453 	int popen (const wchar_t* file, const wchar_t* cmd, const char* mode, int& anErrno);
   457 	int popen (const wchar_t* file, const wchar_t* cmd, const char* mode, int& anErrno);
   454 	int pclose (int aFid, int& anErrno);
   458 	int pclose (int aFid, int& anErrno);
   455 	IMPORT_C void CheckOrigins (wchar_t**& wenvp, int& aCount);
   459 	IMPORT_C void CheckOrigins (wchar_t**& wenvp, int& aCount);
       
   460     IMPORT_C void freednssuffixes(if_dns_suffixes * suffixes);
       
   461     
   456 #ifdef SYMBIAN_OE_POSIX_SIGNALS
   462 #ifdef SYMBIAN_OE_POSIX_SIGNALS
   457 	TInt SignalHandler();
   463 	TInt SignalHandler();
   458 	IMPORT_C void InitSignalHandler();
   464 	IMPORT_C void InitSignalHandler();
   459 	void RegisterExitNotification(TProcessId aPid);
   465 	void RegisterExitNotification(TProcessId aPid);
   460 
   466 
   589 	TInt GetSessionPath(TDes& aPath);
   595 	TInt GetSessionPath(TDes& aPath);
   590 	
   596 	
   591 	//Save the file server session path
   597 	//Save the file server session path
   592 	TInt SaveSessionPath(const TDesC& aPath);
   598 	TInt SaveSessionPath(const TDesC& aPath);
   593 	
   599 	
       
   600 	static void WaitForNRequest(TRequestStatus **aStatusArray, TInt aNum);
       
   601 	
   594 	static void WaitForNRequest(TRequestStatus aStatusArray[], TInt aNum);
   602 	static void WaitForNRequest(TRequestStatus aStatusArray[], TInt aNum);
   595 
   603 
   596 private:
   604 private:
   597 	//Helper function to read a record from the IAP table
   605 	//Helper function to read a record from the IAP table
   598 	void ReadRecordFromIapTableL(CCommsDbTableView* aView, TAccessPointRecord &aRecord);
   606 	void ReadRecordFromIapTableL(CCommsDbTableView* aView, TAccessPointRecord &aRecord);
   611 	
   619 	
   612 	// Helper function for the setdefaultif() API to restart the 
   620 	// Helper function for the setdefaultif() API to restart the 
   613 	// default RConnection with the new settings.
   621 	// default RConnection with the new settings.
   614 	TInt StartDefConnection();
   622 	TInt StartDefConnection();
   615 	
   623 	
       
   624 	// Helper function for doing an on-demand connection to RTz server
       
   625 	TInt OnDemandTZServerConnection();
   616 private:
   626 private:
   617 	// NOTE: iCleanup should be the first member of CLSI, since iPrivateHeap
   627 	// NOTE: iCleanup should be the first member of CLSI, since iPrivateHeap
   618 	// will be destroyed from within iCleanup destructor.
   628 	// will be destroyed from within iCleanup destructor.
   619 	TCLSICleanup	iCleanup;
   629 	TCLSICleanup	iCleanup;
   620 
   630 
   687 	RArray<TASelectRequest> iASelectRequest;
   697 	RArray<TASelectRequest> iASelectRequest;
   688 	
   698 	
   689 	// Default connection settings, set/cleared using setdefaultif
   699 	// Default connection settings, set/cleared using setdefaultif
   690 	TConnPref* iDefConnPref;
   700 	TConnPref* iDefConnPref;
   691     RTz     iTzServer;	
   701     RTz     iTzServer;	
       
   702 	RFastLock iTzServerLock;
       
   703 	TBool	iIsRTzConnected;
   692     RPointerArray<CSocketDesc> iSocketArray;
   704     RPointerArray<CSocketDesc> iSocketArray;
   693 #ifdef SYMBIAN_OE_POSIX_SIGNALS
   705 #ifdef SYMBIAN_OE_POSIX_SIGNALS
   694 	// Signal handler thread
   706 	// Signal handler thread
   695 	RThread 				iSignalHandlerThread;
   707 	RThread 				iSignalHandlerThread;
   696 	RPipe					iSignalReadPipe;
   708 	RPipe					iSignalReadPipe;
   840 #endif // SYMBIAN_OE_LIBRT		
   852 #endif // SYMBIAN_OE_LIBRT		
   841 	
   853 	
   842 #endif // SYMBIAN_OE_POSIX_SIGNALS
   854 #endif // SYMBIAN_OE_POSIX_SIGNALS
   843 public:
   855 public:
   844 
   856 
   845    inline RTz & TZServer()
   857 	IMPORT_C RTz & TZServer(TInt& aStatus);
   846         {
   858 	
   847         return iTzServer;
       
   848         } 
       
   849 //ipc server session
   859 //ipc server session
   850 RIpcSession iIpcS;
   860 RIpcSession iIpcS;
   851 friend class RFileDesTransferSession;
   861 friend class RFileDesTransferSession;
   852 	};
   862 	};
   853 
   863 
   954 	{
   964 	{
   955 public:
   965 public:
   956 	TUSockAddr() : TSockAddr(), iError(0) {}
   966 	TUSockAddr() : TSockAddr(), iError(0) {}
   957 
   967 
   958 	TUSockAddr(TAny* addr);			// constructor form of Prepare
   968 	TUSockAddr(TAny* addr);			// constructor form of Prepare
       
   969 	TUSockAddr(const TSockAddr& aSockAddr):TSockAddr(aSockAddr),iError(0){};
   959 	IMPORT_C TUSockAddr(const TAny* addr, TUint len);	// constructor form of Set
   970 	IMPORT_C TUSockAddr(const TAny* addr, TUint len);	// constructor form of Set
   960 private:
   971 private:
   961 	void Prepare(TAny* addr);
   972 	void Prepare(TAny* addr);
   962 	void Set(const TAny* addr, TUint len);
   973 	void Set(const TAny* addr, TUint len);
   963 public:
   974 public: