www.LabF.com  
   Products   DownloadPrice & OrderSupportCompanyTutorialsSitemap
           










  back | index | next

Porting X Window Applications to WinaXe Plus

When porting any application to WinaXe Plus, the first step is to ensure that the build environment is fully set up on WinaXe Plus.

Quite often, code for X applications are generated using specific tools. If your code is created using a code generator and the code generator is not available on WinaXe Plus, you must take the code that was generated using the code generator to WinaXe Plus and port it.

The next step is to compile the source code and resolve issues as they appear. Typical issues are related to path differences, potentially non-existent device files, environment differences, etc. You might need to modify the paths for including the X11 and/or Motif include files and libraries.

There could be differences in the header files and in specific APIs, or there may be missing header files and APIs. The differences can be resolved by writing WinaXe Plus implementations for the APIs and header files.

If your applications include scripts, such as Perl scripts, these will have to be modified to account for the platform differences.

If you are porting a GUI application client receiving input via STDIN, use an alternate method of receiving input, such as a Windows dialog box.


Memory Management

Xlib contains its own memory management routines, including Xfree, Xmalloc, and Xcalloc. In order to maintain compatibility with future versions of the WinaXe Plus XDK, use these routines instead of Microsoft WIN32 memory management routines.

Memory allocated by these Xlib routines should be freed using Xlib routines. Similarly, memory that is freed using Xlib routines should be allocated by Xlib routines.


The gethostname Function

Xlib.dll exports the gethostname function. A function by this name is also exported by the Windows Sockets DLL.

We do not recommend that you use the Xlib.dll version of this function; it is provided by Xlib only for backwards compatibility. In order to ensure that you are using the Windows Sockets version of this function, and not the Xlib.dll version, your link statement must include WSOCK32.lib before Xlib.lib.


Setting the Locale for an X Client

The default value for the run-time control variable XLOCALEDIR is home\x11\locale. The locale.dir file is in the home\x11\locale directory.

Locale aliases are supported. You can specify your locale alias in the locale.alias file in the home\x11\locale directory.


Accepting Localized Input

X11R6 XIM support is included on the X server side. This support lets local X clients accept localized input when displaying to an X server that supports X11R6 XIM (such as XServer in WinaXe Plus).


Restrictions on Developing X Applications with XDK

There are some restrictions on developing an X application code with the WinaXe Plus XDK:

  • You cannot directly use WinSock API

  • As sockets interface, the BSD sockets interface is implemented in XDK

  • There are no equivalent substitutes for some UNIX system calls/requests (e.g., fork, signal, pipe, etc.)

  • The source errno.h file for an X application may require some changes in the application source code; in some cases, you can also use the xeerrno.h file in the home\XDK\Include\Sys directory of the WinaXe Plus package

  • Some other restrictions.
   

WinaXe Plus
X-server and ssh-client
> Download now!

> Info
   > PC With
   > All in one
   > Easy to
> Specs
   > Package
   > Specifications
   > Requirements
   > Network variants
   > New features
> Price & order
   > Price list
   > Payment methods
> Support
   > Technical questions
   > Sales questions
   > FAQ
   
> Tutorials
   > Manual

  
           
           
    © LabF. All rights reserved.     Privacy policy     e-mail us at: sales@labf.com