Dec 132017
 
Given C source and .LIB file, creates .LIB file with smaller component .OBJ files -- result = smaller executables that link with the .LIB.
File LIBSPLIT.ZIP from The Programmer’s Corner in
Category C++ Source Code
Given C source and .LIB file, creates .LIB file with smaller component .OBJ files — result = smaller executables that link with the .LIB.
File Name File Size Zip Size Zip Type
PARSE.BAT 215 130 deflated
PARSE.DOC 4782 2170 deflated
PARSER.EXE 46912 26540 deflated

Download File LIBSPLIT.ZIP Here

Contents of the PARSE.DOC file


There is a feature that is desired, but does not exist in any
of the borland C or C++ compilers. Yet it does exist in their
Pascal compilers. It's called "smart linking". If you have a
.c file that compiles down to one .OBJ file which has a hundred
functions in it and you want only one, you still link in the
WHOLE thing! AND, you link in all of the stuff that all of
those other functions need to do their thing. A .EXE file that
could be 5k with smart linking ends up being 500k! One
solution is to break up your source files so that every tiny
little function has it's own file. The problem with that is
that it is then harder to understand, add to or change such
files.

This program will open a .c source file and write out many .c
source files. It will then use the .PRJ file to call BCC to
compile all the little .c files. Next, it takes the orginal
big .OBJ out of the .LIB file and puts all of the tiny .OBJ
files in. Then it deletes all of the little .c and .obj files.

To make this program work as is, you must be using the IDE with
"C++ always" toggled on. Your file names should always end in
.c whether you are using C++ or not. Your .PRJ must be the
same name as your .LIB (so your project calls the librarian
instead of the linker when done). You must copy PARSE.BAT and
PARSER.EXE into a subdirectory that is in your path.

You also need to tell the parser where to parse. In your .c
file, put "//.parse" on a line by itself (on the very left
edge) where ever you want your source to be parsed. The first
parse will be for all header information that will be copied to
all of the little .c files. Your new .c file might look like
this:

-----------------------
#include

//.parse

void Foo()
{
puts("Have another day! They're free!");
}

//.parse

void Bar()
{
puts("Time is Mother Nature's way of keeping everything");
puts("from happening at once!");
}

//.parse

void FooBar()
{
puts("Two all beef patties, special sauce, lettuce, cheese,");
puts("pickles, onions on a sesamie seed bun");
}

-----------------------

Go to the directory where you keep your .PRJ, .LIB and .C files
for the library and type

parse

without the filename extensions.

So, if you had a C filename called WSTR.C and a library name
called WLIB.LIB, you would type

parse wstr wlib



If you use this product, you must register it for $25.
Registration will give you

source code
non-programming support

$50 registration will give you

source code
support (including programming support)

This includes support for the Wheaton Libraries (WLIB.ZIP)
which comes with the source.

copyright (c) 1992, 1993 by Paul Wheaton
1916 Brooks #205, Missoula, MT 59801

voice phone: (406)543-7543
modem phone: (406)543-1144 (2400N81)
CompuServe: 72707,207
Internet: [email protected]

Visa and MC accepted

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The Wheaton Libraries is a class library for C++

Some of the objects are

String (dynamic string type with full type checking)
String40, String120 (static (stack) based strings)
Form (Pass in a value and get a string back like "1,234,555.22")
LinkedList (doubly linked list class)
CreateLinkedListClass (Make your own typed linked list)
Queue, Stack (variations on LinkedList)
File, TextFile, RecFile (Makes file manipulation much easier)
TokenFile (Store thousands of files or different objects in
one file - kinda like a heap on disk)
File utilities (a variety of functions for copying files,
taking CRC, etc)
ByteVector (a dynamic array of bytes)
CreateVectorClass (make vectors of any object you want)
BitVector (dynamic arrays of thousands of booleans that take up
one bit of memory for each boolean)
CreateBitSetClass (make static bitsets that work like the
BitSets in Turbo Pascal or Modula 2)
Date, JulianDate (objects for working with dates)
dBase (a C++ class interface for the CodeBase libraries)
BtrieveFile (a C++ class interface for the Btrieve libraries)
much, much more!

These libraries are designed for optimal use in the cold, cruel world of
practical programming. It is my belief that the molding of C++ into a
SmallTalk environment kills the beauty of C++. I write object oriented
extensions to C++ that compiles very tight and fast while maintaining high
portability. If you want a SmallTalk-like environment, use SmallTalk! I
hope that this code allows all C++ programmers to develop smaller and
faster programs in less time.

Look for the file WLIB.ZIP. It includes full source code.



 December 13, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)