ph_.lib -- create small windows .dll/.exe
[page last modified 2019-10-25]
For latest version go to paulhoule.com/ph_
ph_.lib is a tiny C stdlib replacement to produce smaller .exe files.
It is intended to support only a little-endian architecture (eg. X86) and
the Microsoft Visual C compiler. 32 and 64 bit versions are provided.
Only a small subset of the C stdlib is implemented. What is
implemented is compatible with MSVC, so a build-time switch to select
either ph_ or MSVC stdlib is possible -- a design goal for testing.
fwrite() supports "text" mode output, converting 0xa to 0xd, 0xa.
Text mode input is not supported; files must be read in binary mode.
Ver 1.x are pretty much "proof of concept." No __chkstk is
supplied; for programs making large stack allocations the caller must
add the compiler's chkstk.obj to their link list.
The target use of ph_.lib is a Windows program, windowed or console.
The program must be recompiled using ph_.h and linked against ph_.lib
(ph_.lib uses non-standard structs, #defines and calling conventions).
A typical scenario is to develop using the MSVC stdlib, then
recomplile/link against ph_.h/ph_.lib for release. A small .exe will
typically be a twentieth of the MSVC stdlib size using ph_.lib.
Any version of MSVC 6.0 or later should work, 32 or 64 bit.
The following files are included:
ph_.h C Header file
ph_.c C source
ph_.asm 32/64-bit X86 asm (rewrite of some ph_.c funcs)
ph_.txt This file
lib\ph_.lib 32-bit library
lib\x64\ph_.lib 64-bit library
Ver 1.4: Add support for building a dll, and command line args (argc/argv).
10/25/19 Args are parsed using shell32.dll function CommandLineToArgvW().
Ver 1.3: Removed ph_ prefix from all names; ph_.h/ph_.lib may no longer be
10/6/19 compiled and linked along with stdlib .h files and stdlib.lib.
Added a few dozen funtions. Still no support for argc/argv.
Ver 1.2: Added memmove,wmemmove, strcpy, wstrcpy
9/24/19 removed ?memcpy code; ?memcpy now equated to ?memmove
Ver 1.1 Added minimal wide char support; another proof-of-concept release.
9/13/19 New: wchar_t, wint_t, wmemcpy, wmemset, wcschr, scslen, _wfopen
Ver 1.0: Initial release. Only a handful of functions implemented.
9/1/19 Not really useful; basically a proof-of-concept.
Click here to download ph_14.zip
Click here to download ph_13.zip
Click here to download ph_12.zip
Click here to download ph_11.zip
Click here to download ph_10.zip
You are visitor 647 Go to Home Page