#include "wx/os2/private.h"
-#if defined(__VISAGECPP__) && __IBMCPP__ < 400
-#include <machine\endian.h>
-#include <ioctl.h>
-#include <select.h>
-#include <unistd.h>
-#else
+#ifdef __EMX__
+
#include <sys\ioctl.h>
#include <sys\select.h>
+
+#else
+
+#include <ioctl.h>
+#include <select.h>
+
+#endif // ndef for __EMX__
+
#ifndef __EMX__
+
#define select(a,b,c,d,e) bsdselect(a,b,c,d,e)
int _System bsdselect(int,
struct fd_set *,
struct fd_set *,
struct fd_set *,
struct timeval *);
-#endif
+
#endif
#if wxUSE_THREADS
#define wxSockReadMask 0x01
#define wxSockWriteMask 0x02
+#ifdef __EMX__
extern "C"
int wxAppAddSocketHandler(int handle, int mask,
- void (*callback)(void*), void * gsock)
+ void (*callback)(void*), void * gsock)
{
return wxTheApp->AddSocketHandler(handle, mask, callback, gsock);
}
-
extern "C"
void wxAppRemoveSocketHandler(int handle)
{
wxTheApp->RemoveSocketHandler(handle);
}
+#else
+// Linkage mode problems using callbacks with extern C in a .cpp module
+int wxAppAddSocketHandler(int handle, int mask,
+ void (*callback)(void*), void * gsock)
+{
+ return wxTheApp->AddSocketHandler(handle, mask, callback, gsock);
+}
+void wxAppRemoveSocketHandler(int handle)
+{
+ wxTheApp->RemoveSocketHandler(handle);
+}
+#endif
void wxApp::HandleSockets()
{
- bool pendingEvent = false;
+ bool pendingEvent = FALSE;
// Check whether it's time for Gsocket operation
if (m_maxSocketHandles > 0 && m_maxSocketNr > 0)
if (r < m_maxSocketHandles)
{
CallbackInfo[r].proc(CallbackInfo[r].gsock);
- pendingEvent = true;
+ pendingEvent = TRUE;
wxYield();
}
}
if (r < m_maxSocketHandles)
{
CallbackInfo[r].proc(CallbackInfo[r].gsock);
- pendingEvent = true;
+ pendingEvent = TRUE;
wxYield();
}
}
{
if (gs_inYield)
return FALSE;
-
+
return wxYield();
}
void SetFileSpec(const wxString& rsFilespec) { m_sFilespec = rsFilespec; }
void SetFlags(int nFlags) { m_nFlags = nFlags; }
+ const wxString& GetName() const { return m_sDirname; }
void Close();
void Rewind();
bool Read(wxString* rsFilename);
return m_data != NULL;
} // end of wxDir::IsOpen
+wxString wxDir::GetName() const
+{
+ wxString name;
+ if ( m_data )
+ {
+ name = M_DIR->GetName();
+ if ( !name.empty() )
+ {
+ // bring to canonical Windows form
+ name.Replace(_T("/"), _T("\\"));
+
+ if ( name.Last() == _T('\\') )
+ {
+ // chop off the last (back)slash
+ name.Truncate(name.length() - 1);
+ }
+ }
+ }
+
+ return name;
+}
+
wxDir::~wxDir()
{
delete M_DIR;
#include <assert.h>
#include <sys\types.h>
+
#ifdef __EMX__
#include <sys/time.h>
#include <netinet/in.h>
#include <unistd.h>
#include <sys/un.h>
#define HAVE_INET_ADDR
+
#else
+
#include <utils.h>
#include <sys\time.h>
#include <types.h>
#include <in.h>
#include <netdb.h>
#include <nerrno.h>
+
#endif
+
#if defined(__VISAGECPP__) && __IBMCPP__ < 400
+
#include <machine\endian.h>
#include <socket.h>
#include <ioctl.h>
#include <select.h>
#include <unistd.h>
+
+#define EBADF SOCEBADF
+
#else
+
#include <sys\socket.h>
#include <sys\ioctl.h>
#include <sys\select.h>
+
#ifdef __EMX__
#define soclose(a) close(a)
#else
* Sets up this socket as a server. The local address must have been
* set with GSocket_SetLocal() before GSocket_SetServer() is called.
* Returns GSOCK_NOERROR on success, one of the following otherwise:
- *
+ *
* Error codes:
* GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_SetServer(GSocket *sck)
{
* GSOCK_TIMEDOUT - timeout, no incoming connections.
* GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking.
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocket *GSocket_WaitConnection(GSocket *socket)
{
* GSOCK_TIMEDOUT - timeout, the connection failed.
* GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only)
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
{
ret = _GSocket_Recv_Stream(socket, buffer, size);
else
ret = _GSocket_Recv_Dgram(socket, buffer, size);
-
+
if (ret == -1)
{
if (errno == EWOULDBLOCK)
else
socket->m_error = GSOCK_IOERR;
}
-
+
return ret;
}
int GSocket_Write(GSocket *socket, const char *buffer, int size)
-{
+{
int ret;
assert(socket != NULL);
-
+
GSocket_Debug(( "GSocket_Write #1, size %d\n", size ));
if (socket->m_fd == INVALID_SOCKET || socket->m_server)
ret = _GSocket_Send_Stream(socket, buffer, size);
else
ret = _GSocket_Send_Dgram(socket, buffer, size);
-
+
GSocket_Debug(( "GSocket_Write #4, size %d\n", size ));
if (ret == -1)
_GSocket_Enable(socket, GSOCK_OUTPUT);
return -1;
}
-
+
GSocket_Debug(( "GSocket_Write #5, size %d ret %d\n", size, ret ));
return ret;
return result;
-#else
+#else
assert(socket != NULL);
return flags & socket->m_detected;
* operation, there is still data available, the callback function will
* be called again.
* GSOCK_OUTPUT:
- * The socket is available for writing. That is, the next write call
+ * The socket is available for writing. That is, the next write call
* won't block. This event is generated only once, when the connection is
* first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should
{
int ret;
+#ifdef __EMX__
MASK_SIGNAL();
ret = send(socket->m_fd, buffer, size, 0);
UNMASK_SIGNAL();
-
+#else
+ ret = send(socket->m_fd, buffer, size, 0);
+#endif
return ret;
}
return -1;
}
+#ifdef __EMX__
MASK_SIGNAL();
ret = sendto(socket->m_fd, buffer, size, 0, addr, len);
UNMASK_SIGNAL();
+#else
+ ret = sendto(socket->m_fd, buffer, size, 0, addr, len);
+#endif
/* Frees memory allocated from _GAddress_translate_to */
free(addr);
if (inet_aton(hostname, addr) == 0)
{
#elif defined(HAVE_INET_ADDR)
- if ( (addr->s_addr = inet_addr(hostname)) == -1 )
+ addr->s_addr = inet_addr(hostname);
+ if ( (addr->s_addr == -1 )
{
#else
/* Use gethostbyname by default */
- if (1)
+ int val = 1; //VA doesn't like constants in conditional expressions at all
+ if (val)
{
#endif
struct in_addr *array_addr;
address->m_error = GSOCK_INVPORT;
return GSOCK_INVPORT;
}
-
+
se = getservbyname(port, protocol);
if (!se)
{
assert(address != NULL);
CHECK_ADDRESS(address, INET);
-
+
addr = (struct sockaddr_in *)address->m_addr;
addr->sin_port = htons(port);
char *addr_buf;
struct sockaddr_in *addr;
- assert(address != NULL);
+ assert(address != NULL);
CHECK_ADDRESS(address, INET);
addr = (struct sockaddr_in *)address->m_addr;
{
struct sockaddr_in *addr;
- assert(address != NULL);
- CHECK_ADDRESS_RETVAL(address, INET, 0);
+ assert(address != NULL);
+ CHECK_ADDRESS_RETVAL(address, INET, 0);
addr = (struct sockaddr_in *)address->m_addr;
{
struct sockaddr_in *addr;
- assert(address != NULL);
- CHECK_ADDRESS_RETVAL(address, INET, 0);
+ assert(address != NULL);
+ CHECK_ADDRESS_RETVAL(address, INET, 0);
addr = (struct sockaddr_in *)address->m_addr;
return ntohs(addr->sin_port);
{
struct sockaddr_un *addr;
- assert(address != NULL);
+ assert(address != NULL);
- CHECK_ADDRESS(address, UNIX);
+ CHECK_ADDRESS(address, UNIX);
addr = ((struct sockaddr_un *)address->m_addr);
memcpy(addr->sun_path, path, strlen(path));
..\common\$D\dbtable.obj \
!endif
..\common\$D\dcbase.obj \
+ ..\common\$D\dircmn.obj \
..\common\$D\dlgcmn.obj \
..\common\$D\dndcmn.obj \
..\common\$D\dobjcmn.obj \
db.obj \
dbtable.obj \
dcbase.obj \
+ dircmn.obj \
dndcmn.obj \
dlgcmn.obj \
dobjcmn.obj \
geometry.obj \
gifdecod.obj \
hash.obj \
- helpbase.obj \
- http.obj
+ helpbase.obj
COMLIBOBJS2 = \
+ http.obj \
imagall.obj \
imagbmp.obj \
image.obj \
sizer.obj \
socket.obj \
strconv.obj \
- stream.obj \
- string.obj
+ stream.obj
COMLIBOBJS3 = \
+ string.obj \
tbarbase.obj \
textcmn.obj \
textfile.obj \
..\os2\$D\gdiimage.obj \
..\os2\$D\gdiobj.obj \
..\os2\$D\gsocket.obj \
+ ..\os2\$D\gsockpm.obj \
..\os2\$D\helpwin.obj \
..\os2\$D\icon.obj \
..\os2\$D\iniconf.obj \
gdiimage.obj \
gdiobj.obj \
gsocket.obj \
+ gsockpm.obj \
helpwin.obj \
icon.obj \
iniconf.obj \
main.obj \
mdi.obj \
menu.obj \
- menuitem.obj \
- metafile.obj
+ menuitem.obj
OS2LIBOBJS2 = \
+ metafile.obj \
mimetype.obj \
minifram.obj \
msgdlg.obj \
copy ..\common\$D\dbtable.obj
copy ..\common\$D\dcbase.obj
copy ..\common\$D\dlgcmn.obj
+ copy ..\common\$D\dircmn.obj
copy ..\common\$D\dndcmn.obj
copy ..\common\$D\dobjcmn.obj
copy ..\common\$D\docmdi.obj
copy ..\common\$D\gifdecod.obj
copy ..\common\$D\hash.obj
copy ..\common\$D\helpbase.obj
- copy ..\common\$D\http.obj
$(COMLIBOBJS2):
+ copy ..\common\$D\http.obj
copy ..\common\$D\imagall.obj
copy ..\common\$D\imagbmp.obj
copy ..\common\$D\image.obj
copy ..\common\$D\socket.obj
copy ..\common\$D\strconv.obj
copy ..\common\$D\stream.obj
- copy ..\common\$D\string.obj
$(COMLIBOBJS3):
+ copy ..\common\$D\string.obj
copy ..\common\$D\tbarbase.obj
copy ..\common\$D\textcmn.obj
copy ..\common\$D\textfile.obj
copy ..\os2\$D\gdiimage.obj
copy ..\os2\$D\gdiobj.obj
copy ..\os2\$D\gsocket.obj
+ copy ..\os2\$D\gsockpm.obj
copy ..\os2\$D\helpwin.obj
copy ..\os2\$D\icon.obj
copy ..\os2\$D\iniconf.obj
copy ..\os2\$D\mdi.obj
copy ..\os2\$D\menu.obj
copy ..\os2\$D\menuitem.obj
- copy ..\os2\$D\metafile.obj
$(OS2LIBOBJS2):
+ copy ..\os2\$D\metafile.obj
copy ..\os2\$D\mimetype.obj
copy ..\os2\$D\minifram.obj
copy ..\os2\$D\msgdlg.obj
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+//
+// already defined via nerror.h in app.h so undef them
+//
+#ifdef EEXIST
+#undef EEXIST
+#endif
+#ifdef ENOENT
+#undef ENOENT
+#endif
+#ifdef EMFILE
+#undef EMFILE
+#endif
+#ifdef EINTR
+#undef EINTR
+#endif
+#ifdef EINVAL
+#undef EINVAL
+#endif
+#ifdef ENOMEM
+#undef ENOMEM
+#endif
+#ifdef EACCES
+#undef EACCES
+#endif
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+//
+// already defined via nerror.h in app.h so undef them
+//
+#ifdef EEXIST
+#undef EEXIST
+#endif
+#ifdef ENOENT
+#undef ENOENT
+#endif
+#ifdef EMFILE
+#undef EMFILE
+#endif
+#ifdef EINTR
+#undef EINTR
+#endif
+#ifdef EINVAL
+#undef EINVAL
+#endif
+#ifdef ENOMEM
+#undef ENOMEM
+#endif
+#ifdef EACCES
+#undef EACCES
+#endif
#include <errno.h>
#include <stdarg.h>
}
else
nTempy = pParent->GetSize().y - (vPos.y + rSize.y);
-#if 0
- if (nTempy < 0)
- {
- nTempy = pParent->GetSize().y + (vPos.y + rSize.y);
- pParent->SetSize(0, 0, pParent->GetSize().x, nTempy);
- nTempy = pParent->GetSize().y - (vPos.y + rSize.y);
- }
-#endif
vPos.y = nTempy;
if ( pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxScrolledWindow))
CODE LOADONCALL
EXPORTS
-;From library: F:\DEV\WX2\WXWINDOWS\LIB\WX.lib
+;From library: H:\Dev\Wx2\WxWindows\lib\wx.lib
;From object file: dummy.cpp
;PUBDEFs (Symbols available from object file):
wxDummyChar
wx_spline_push__FdN71
;wx_spline_pop(double*,double*,double*,double*,double*,double*,double*,double*)
wx_spline_pop__FPdN71
+ ;From object file: ..\common\dircmn.cpp
+ ;PUBDEFs (Symbols available from object file):
+ ;wxDir::GetAllFiles(const wxString&,wxArrayString*,const wxString&,int)
+ GetAllFiles__5wxDirFRC8wxStringP13wxArrayStringT1i
+ ;wxDir::Traverse(wxDirTraverser&,const wxString&,int) const
+ Traverse__5wxDirCFR14wxDirTraverserRC8wxStringi
;From object file: ..\common\dndcmn.cpp
;From object file: ..\common\dlgcmn.cpp
;PUBDEFs (Symbols available from object file):
wxConstructorForwxPaintEvent__Fv
;wxConstructorForwxNotifyEvent()
wxConstructorForwxNotifyEvent__Fv
+ ;wxConstructorForwxContextMenuEvent()
+ wxConstructorForwxContextMenuEvent__Fv
;wxConstructorForwxCloseEvent()
wxConstructorForwxCloseEvent__Fv
;wxEvtHandler::sm_classwxEvtHandler
sm_classwxIdleEvent__11wxIdleEvent
;wxDropFilesEvent::sm_classwxDropFilesEvent
sm_classwxDropFilesEvent__16wxDropFilesEvent
+ ;wxContextMenuEvent::sm_classwxContextMenuEvent
+ sm_classwxContextMenuEvent__18wxContextMenuEvent
;wxActivateEvent::sm_classwxActivateEvent
sm_classwxActivateEvent__15wxActivateEvent
__vft15wxUpdateUIEvent8wxObject
wxEVT_NC_LEFT_DCLICK
wxEVT_INIT_DIALOG
wxEVT_COMMAND_SET_FOCUS
- ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\extended.c
+ ;From object file: H:\DEV\WX2\WXWINDOWS\src\common\extended.c
;PUBDEFs (Symbols available from object file):
ConvertToIeeeExtended
ConvertFromIeeeExtended
GetImageCount__14wxImageHandlerFR13wxInputStream
;wxImage::ConvertToMono(unsigned char,unsigned char,unsigned char) const
ConvertToMono__7wxImageCFUcN21
- ;wxImage::ConvertToBitmap() const
- ConvertToBitmap__7wxImageCFv
+ ;wxImage::GetHeight() const
+ GetHeight__7wxImageCFv
;wxImage::SetData(unsigned char*,int,int)
SetData__7wxImageFPUciT2
;wxImage::GetMaskBlue() const
GetMaskBlue__7wxImageCFv
- ;wxImage::GetHeight() const
- GetHeight__7wxImageCFv
+ ;wxImage::ConvertToBitmap() const
+ ConvertToBitmap__7wxImageCFv
;wxImage::CleanUpHandlers()
CleanUpHandlers__7wxImageFv
;wxImageHandler::CanRead(const wxString&)
wxLogTrace__FUlPCce
;wxLogStatus(const char*,...)
wxLogStatus__FPCce
+ ;wxLog::ClearTraceMasks()
+ ClearTraceMasks__5wxLogFv
;wxLog::RemoveTraceMask(const wxString&)
RemoveTraceMask__5wxLogFRC8wxString
;wxSysErrorMsg(unsigned long)
wxLogTrace__FPCcT1e
;wxLogSysError(const char*,...)
wxLogSysError__FPCce
+ ;wxLog::DontCreateOnDemand()
+ DontCreateOnDemand__5wxLogFv
;Trap()
Trap__Fv
;wxLog::TimeStamp(wxString*)
Read32__17wxTextInputStreamFv
;wxTextInputStream::SkipIfEndOfLine(char)
SkipIfEndOfLine__17wxTextInputStreamFc
- ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
+ ;From object file: H:\DEV\WX2\WXWINDOWS\src\common\unzip.c
;PUBDEFs (Symbols available from object file):
unzReadCurrentFile
unzGetCurrentFileInfo
wxTheApp
;wxApp::sm_classwxApp
sm_classwxApp__5wxApp
- ;wxConstructorForwxApp()
- wxConstructorForwxApp__Fv
+ ;wxAppRemoveSocketHandler(int)
+ wxAppRemoveSocketHandler__Fi
+ ;wxAppAddSocketHandler(int,int,void(*)(void*),void*)
+ wxAppAddSocketHandler__FiT1PFPv_vPv
;wxWakeUpIdle()
wxWakeUpIdle__Fv
wxSTD_MDICHILDFRAME_ICON
+ ;wxConstructorForwxApp()
+ wxConstructorForwxApp__Fv
vHabmain
;wxApp::~wxApp()
__dt__5wxAppFv
Pending__5wxAppFv
;wxApp::DeletePendingObjects()
DeletePendingObjects__5wxAppFv
+ ;wxApp::AddSocketHandler(int,int,void(*)(void*),void*)
+ AddSocketHandler__5wxAppFiT1PFPv_vPv
CANTREGISTERCLASS
;wxApp::RegisterWindowClasses(unsigned long)
RegisterWindowClasses__5wxAppFUl
wxMDIFrameClassName
;wxMsgArray::Insert(const _QMSG&,unsigned int)
Insert__10wxMsgArrayFRC5_QMSGUi
- ;wxApp::wxApp()
- __ct__5wxAppFv
+ ;wxApp::HandleSockets()
+ HandleSockets__5wxAppFv
;wxYieldIfNeeded()
wxYieldIfNeeded__Fv
wxDEFAULT_MDIPARENTFRAME_ICON
+ ;wxApp::wxApp()
+ __ct__5wxAppFv
;wxApp::SendIdleEvents()
SendIdleEvents__5wxAppFv
;wxApp::ProcessMessage(void**)
DoCopy__10wxMsgArrayFRC10wxMsgArray
;wxMsgArray::operator=(const wxMsgArray&)
__as__10wxMsgArrayFRC10wxMsgArray
+ ;wxApp::RemoveSocketHandler(int)
+ RemoveSocketHandler__5wxAppFi
;wxYield()
wxYield__Fv
wxSTD_FRAME_ICON
__ct__9wxDirDataFRC8wxString
;wxDir::Open(const wxString&)
Open__5wxDirFRC8wxString
+ ;wxDir::GetName() const
+ GetName__5wxDirCFv
;From object file: ..\os2\dirdlg.cpp
;PUBDEFs (Symbols available from object file):
;wxDirDialog::sm_classwxDirDialog
GSocket_Shutdown
GSocket_GetPeer
GAddress_new
- ;_GAddress_Init_UNIX(_GAddress*)
- _GAddress_Init_UNIX__FP9_GAddress
GSocket_SetNonBlocking
GAddress_INET_SetAnyAddress
GAddress_INET_GetHostAddress
_GAddress_Init_INET
GSocket_Read
GSocket_Connect
- GAddress_UNIX_GetPath
GAddress_INET_GetPort
GSocket_destroy
_GAddress_translate_from
_GSocket_Output_Timeout
_GSocket_Detected_Read
GSocket_SetTimeout
- GAddress_UNIX_SetPath
GAddress_INET_SetPort
_GSocket_Recv_Stream
_GSocket_Detected_Write
GSocket_SetServer
GSocket_UnsetCallback
_GAddress_translate_to
+ ;From object file: ..\os2\gsockpm.c
+ ;PUBDEFs (Symbols available from object file):
+ _GSocket_GUI_Destroy
+ _GSocket_Install_Callback
+ _GSocket_Disable_Events
+ _GSocket_GUI_Init
+ _GSocket_Uninstall_Callback
+ _GSocket_Enable_Events
;From object file: ..\os2\helpwin.cpp
;PUBDEFs (Symbols available from object file):
;wxWinHelpController::Initialize(const wxString&)