Applications written for Unix often rely on functions that are incomplete or
unimplemented in the Microsoft C runtime library.
The Cygwin project emulates a more or less complete Unix environment to run Unix based applications under Windows.
However, this emulation isn't fast and doesn't provide the Windows "Look and Feel".
PlibC (re)implements typical C functions as defined in the POSIX standard and the Single Unix Specification to extend the MS C runtime library without loosing the integration into Windows.
This project was started in 2003 by Nils Durner as part of GNUnet. It moved to Sourceforge as an independent project in 2005.
The source code documentation is available here.
The printf() and scanf() implementation was taken from Felix von
Leitner's diet libc.
Wez Furlong from the PHP project has donated the select() implementation.
PlibC is known to be used by the following projects:
The stable releases are available from the file area.
svn co https://plibc.svn.sourceforge.net/svnroot/plibc/trunk/plibc
# Check system type case "$host_os" in linux*) AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system]) ;; *mingw*) AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system]) LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32 -lplibc" ;; *) AC_MSG_RESULT(Unrecognised OS $host_os) AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) ;; esac
long long bignum; FILE *f = FOPEN("test.dat", "a"); FPRINTF(f, "Bignum: %llu\n", bignum); fclose(fp);Your application will then use PlibC's functions under Windows and the usual functions under Unix.
C:\Program Files\Your Application\ +- bin\ +- etc\ +- lib\Only the "bin" directory is required. From there, "..\" is the root directory "/" in Unix terms. This is required to access paths like "/etc/myconf.conf". Files outside this hierarchy can be accessed in the usual way: c:\some\path\file.txt.
HKEY_LOCAL_MACHINE +- SOFTWARE +- My Company +- My Application InstallDir REG_SZ C:\Program Files\My Application