Back to TOC Features


A CUG Library Update

Victor R. Volkman

The 15-year old C/C++ Users Group Library of source code continues to grow. Victor Volkman describes ten new additions to the CUG CD-ROM.


Introduction

Since 1981, the mission of the C/C++ Users Group (CUG) has been committed to low-cost distribution of shareware and freeware C/C++ source code. The CUG is an independent organization sponsored by C/C++ Users Journal. CUG remains impartial to compiler vendors or platforms. Though many past volumes featured MS-DOS, CUG focuses heavily on cross-platform compatibility with UNIX, MS-Windows, and other platforms.

This article is a semi-annual update on what's happening with the CUG. And what's happening turns out to be quite a lot. Not only does the CD-ROM keep growing -- with ten new volumes this time around -- but the website keeps getting better and more interesting as well. If you're looking for new C/C++ tools or libraries (and who isn't?) check out the volumes described below.

The CUG Website

The CUG website (http:// www.HAL9K.com/cug/) has been expanding both forward and backward in time. Specifically, we have an ongoing project underway to both re-catalog past CUG releases and at the same time encompass the best of what's new in C/C++ sources. The catalog includes plenty of valuable and interesting releases from past years, which you may have missed. These are definitely worth a look. For instance, I dipped into the CUG library myself to retrieve volume 381, JPEG (catalogued in 1993). Using this volume I successfully incorporated the JPEG library by The Independent JPEG Group into a recent commercial product. This saved us at least four man-weeks of development time in the project.

The re-cataloging process consists of gathering and reprinting the vital information about each volume: capsule summary, title, author, platform/OS support, languages used, and subject keywords. All this information is entered into a database and then used to generate HTML index pages for the CUG website. Incidentally, the HTML files, database (CDROM.MDB), and MS Access code to generate the HTML files are all included on the CD-ROM. Thus, you can browse the pages online or offline using your favorite browser or the special I-VIEW offline reader that CUG has licensed for CD-ROM distribution. Currently, the re-cataloging project includes all CUG volumes back to #380. Stop by the website and see what you've been missing!

New on the CD-ROM

This edition represents the single biggest installment in the CUG Library in its 15-year history. There is a greater emphasis on C++ and cross-platform compatibility than ever before. Here's a brief summary of the new titles:

CUG #446 Partial Differential Equation solver
CUG #447 Tools to design and coordinate overload protection
CUG #448 Signature analysis for automatic computer troubleshooting
CUG #449 Offline Winsock DLL
CUG #450 C++ image processing class library
CUG #451 Polygon clipping with set operators
CUG #452 Windows program manager replacement
CUG #453 Persistent storage of structured C++ objects
CUG #454 Player for .MOD digital audio files
CUG #455 Advanced I/O C++ class library

You can order your updated copy of the CUG Library CD-ROM for $49.95 directly from Miller Freeman Inc. by calling 800-444-1884 or +1-913-841-1631 or via the WWW from Walnut Creek CD-ROM (http://www.cdrom.com).

CUG #446 Diffpack solves PDEs

The Are Magnus Bruasat of the SINTEF group at the University of Oslo (Norway) submits Diffpack: a fully object-oriented framework in C++ for solution of Partial Differential Equations (PDEs). PDEs often arise in the mathematical modeling of physical processes involving, for example, fluid mechanics or waves. Some typical uses of Diffpack include solving standard model PDEs, 3-D linear wave equations, incompressible Navier-Stokes formulas, and stochastic ODEs. Diffpack can interface with gnuPlot and plotmtv. You can even construct MPEG movies from multiple visualization frames.

Diffpack has been certified to run on any of the following environments: Hewlett Packard HP-UX 9.05 and C++ 3.50, Silicon Graphics IRIX 5.2 and C++ 3.2.1, Sun Sparc Solaris 2.3/SunOS 5.3 and C++ 4.0. Diffpack v1.4 is available on the CUG CD-ROM as volume #446.

CUG #447 Overload Protection

Michael F. Watson and Dean Lance Smith contribute RELAY: an interactive overload protection design tool for electrical engineers. RELAY plots the time-current characteristics of overcurrent protection devices and coordinates the overcurrent protection devices at an electric distribution substation. The source code is entirely in C and includes makefiles for the Microsoft C compiler. The RELAY.EXE executable requires MS-DOS and VGA display.

The traditional approach to staging overcurrent protection devices has been to plot the time-current curves for various relay settings using paper and pencil, compare the curves of the various relays and fuses, and then adjust the settings of the relays until a solution is reached. RELAY reduces the time required to complete the task and provides greater accuracy. Relay v1.0 is now available on the CUG CD-ROM as volume #447.

CUG #448 Signature Analysis

Surojit Chatterjee and Dean Lance Smith submit a tool for detecting digital circuit problems via signature analysis. Signature analysis is a technique used in servicing microprocessor-based systems. With this technique, an instrument called a signature analyzer checks a digital circuit by detecting the bit streams at various nodes of the circuit. The analyzer displays the bit streams as hexadecimal signatures, and compares the actual signature of a node with its predetermined correct signature. You can use the results of the comparison to trace faults in the system down to the component level. This distribution includes complete source in C and MS-DOS executables. The source supports Borland Turbo C but could possibly be ported to other environments. Signature analysis v1.0 is now available on the CUG CD-ROM as volume #448

CUG #449 NULLSOCK for Offline Winsock Apps

Nullsock, by Jean-Michel Mercier (Paris, France), is a Winsock simulator that allows you to run Winsock applications offline. This is most useful for forcing a web browser to read offline copies of HTML files that you have downloaded. You might appreciate this offline access if you're "on the road" with a portable computer but without an immediate Internet connection. Or perhaps you want to avoid paying online charges to view material you've already downloaded several times. Nullsock works by loading a dummy WINSOCK.DLL with its entry points replaced by stubs. You can either run Nullsock directly or use Nullsock to spawn the desired application. Nullsock was designed to work with Windows 3.11 and has been tested with Netscape and AIR Mosaic. It will work with Windows 95, but only when running 16-bit Winsock applications.

Nullsock includes complete C source and compiles with Borland C. Nullsock version 1.0 is available on the CUG CD-ROM as volume #449.

CUG #450 C++ Image Processing Lib

Klamer Schutte of the TNO Physics and Electronics Laboratory (The Hague, Netherlands) contributes the CppIma image processing class library. The CppIma library provides an interface to common operations on images for C++ applications. The operations include file I/O, image creation, iterators for traversing images, and histogram creation. The library enables easy construction of image processing programs. Secondarily, Schutte hopes to achieve reasonable performance and create an image-library-independent API. CppIma achieves the latter by its support for three popular base libraries:


  • ima(3): an image library from the University of Twente. A simple version of the ima(3) library is included with CppIma.

  • Khoros: this is a tool for information processing and visualization with an extensive image processing library.

  • Scil-Image: this is a large collection of linear filters, morphologic filters, segmentation algorithms, measurement functions, and arithmetic operations for both 2-D and 3-D binary, gray, floating point, complex valued, and color images.

    CppIma works with the GNU C++ compiler (g++) and most Cfront based compilers. It requires 32-bit integers, and 64-bit doubles. CppIma is distributed under the terms of the GNU Public License, Version 2. It is available on the CUG CD-ROM as volume #450

    CUG #451 Polygon Clipping

    Schutte has also contributed ClipPoly, an extended C++ polygon clipping library with set operators. Classical clipping algorithms will tell you whether a point x is withing a given polygon A. ClipPoly handles the more general case of two polygons A and B for which you want to know the areas of intersection of A and B, A minus B, and B minus A. Although the Weiler-Atherton algorithm already solves this case, Schutte presents a simpler but just as effective algorithm. The ClipPoly algorithm requires only that all polygons are non-self-intersecting (i.e. there are no "holes").

    ClipPoly requires a C++ compiler with template support, such as GNU C++ 2.6.3 or later. The algorithm is primarily supported on SUN and SGI UNIX platforms, though other platforms may also work. ClipPoly is distributed under terms of the GNU Public License, Version 2. It is available on the CUG CD-ROM as volume #451.

    CUG #452 Freedock Windows App Manager

    Sean Gordon (Fife, Scotland) submits Freedock, a Windows "dock" program that includes the full source code in C. A dock is kind of a miniature version of Program Manager that holds icons for the small number of applications that you use most often. Freedock also remembers your preferred window geometry for each application that you register with it. This saves you from the burden of re-arranging your windows each time you startup an application. A "previewer" allows you to check or change the window geometry without actually launching the applications. The entire dock can be scaled in a way similar to the MS Office Manager dock.

    Freedock includes compiled versions of a Win16 executable for Windows 3.1 (FREEDK16.EXE) and a Win32 executable for Windows 95 and NT (FREEDK32.EXE). The Freedock archive includes source code written in C for use with Borland C/C++ or Microsoft Visual C/C++ v1.5 (16-bit) and v2.0 (32-bit). In the Win32 version, you can choose to start applications in separate memory. Freedock is freeware and any programs derived from its source must remain freeware. Freedock version 2.5 is immediately available on the CUG CD-ROM as volume #452.

    CUG #453 Persistent Object Storage

    Jean-Claude Wippler (Houten, Netherlands) contributes his MetaKit, a compact class library for data storage and easy manipulation of structured objects and collections in C++. MetaKit works with any C++ compiler that supports Microsoft Foundation Classes, including VC++, Borland C++, and Symantec C++. MetaKit allows your data to be loaded on demand, which allows you access to any size files. It uses traditional database metaphors of begin work/commit work/rollback work with automatic file storage allocation and reclamation. MetaKit allows data to be "flattened" for efficient streaming over sockets and pipes. It encapsulates data in terms of view, row, and property classes. Data can be conveniently accessed via [] and () by operator overloading. Applications can statically link MetaKit or load it as a DLL.

    MetaKit is distributed as shareware. If you use it beyond the 30-day evaluation period then you must register it. Personal-use registration is $25 and commercial-use registration is $65 (includes full source code). The evaluation copy of MetaKit v1.2 is available on the CUG CD-ROM as volume #453.

    CUG #454 Sound Wizards Module Player

    Beat Rigazzi (Oberonz, Switzerland) submits the Sound Wizards Module Player (SWMP), a driver for playing .MOD sound files through any digital audio card (SoundBlaster compatible). The .MOD file is a multichannel sampled audio file that supports four, six, or eight simultaneous channels. The .MOD file has fewer limitations than the .WAV file and for that reason has become widely used by electronic music and game producers. SWMP includes several example .MOD tracks for you to experiment with and a stand-alone MS-DOS player program (SWMP.EXE). SWMP provides an API and calling interfaces for Borland C/C++, Assembler, and Pascal. You can integrate the library simply by including the header file and linking in MOD_DRV.OBJ (source not provided).

    The driver has a small API but you can start your first MOD file playing with as few as three function calls. SWMP includes powerful hardware detection, which identifies configurations of SoundBlaster, SoundBlaster Pro, and Gravis UltraSound digital audio adapters. This lets users forget about obscure DMA and I/O port settings. SWMP is freeware and can be incorporated into other freeware programs. If you want to use SWMP in a commercial product, you must contact the author first. SWMP version 1.41 is available on the CUG CD-ROM as volume #454.

    Oleg Kiselyov (Denton, TX) offers his Advanced I/O C++ Class Library which enhances the capabilities of stream I/O with encoding and compression. Some of these features include:


  • Filenames with pipes embedded

  • Explicit Endian I/O of short/long integers (guarantees portability)

  • Stream sharing of different I/O types

  • Simple variable-length coding of short integers

  • Arithmetic compression of a stream of integers

    The Advanced I/O class library has been designed with portability in mind: it compiles on UNIX (GNU C++), Macintosh, and MS-DOS platforms (including Borland C++). Kiselyov has placed this library in the public domain. Advanced I/O library v2.23 is available on the CUG CD-ROM as volume #455.

    CUG Call for Submissions

    The deadline for submissions for the next edition of the CUG Library CD-ROM is coming soon. If you have an innovative C or C++ application or library that you'd like to share with the world, please contact me by e-mail <SYSOP@HAL9K.COM> or visit the CUG website (http://www.HAL9K.com/cug). As a small token of our appreciation, you will receive a complimentary copy of the CUG CD-ROM if your submission is accepted. o

    Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to the C/C++ Users Journal since 1987. He is the author of the book Windows Programming with Shareware Tools. He can be reached at the HAL 9000 BBS (313)663-4173, URL http://www.HAL9K.com, or email to sysop@hal9k.com.