Windows Compatability Functions

Name

Windows Compatability Functions -- functions to support portability to the Windows environment.

Synopsis


#include <glib.h>


#define     MAXPATHLEN
#define     NAME_MAX
#define     getcwd
#define     getpid
typedef     pid_t;
#define     access
#define     open
#define     read
#define     write
#define     lseek
#define     close
#define     pipe                            (phandles)
#define     popen
#define     pclose
#define     fdopen
#define     ftruncate                       (fd, size)
#define     opendir
#define     readdir
#define     rewinddir
#define     closedir

Description

These functions and macros are provided in the GLib library when compiled on the Windows platform.

Many of the macros simply rename available windows functions so that they use the same name as the standard Unix functions. This means that code written for the Unix platform will work without change under Windows.

A few additional constants, types, and functions are also provided, to provide a common base set of functions across both the Unix and Windows environments.

Details

MAXPATHLEN

#  define MAXPATHLEN 1024


NAME_MAX

#    define NAME_MAX 255


getcwd

#    define getcwd		_getcwd


getpid

#    define getpid		_getpid


pid_t

typedef int pid_t;


access

#    define access		_access


open

#    define open		_open


read

#    define read		_read


write

#    define write		_write


lseek

#    define lseek		_lseek


close

#    define close		_close


pipe()

#    define pipe(phandles)	_pipe (phandles, 4096, _O_BINARY)

phandles : 


popen

#    define popen		_popen


pclose

#    define pclose		_pclose


fdopen

#    define fdopen		_fdopen


ftruncate()

#    define ftruncate(fd, size)	gwin_ftruncate (fd, size)

fd : 
size : 


opendir

#    define opendir		gwin_opendir


readdir

#    define readdir		gwin_readdir


rewinddir

#    define rewinddir		gwin_rewinddir


closedir

#    define closedir		gwin_closedir