libCh 0.2

Handy objects for BeOS programmers

Here are a few handy little objects to ease your programming tasks on BeOS.

Shareware notice

libCh is shareware. You may examine it, try it out, and decide how useful it is. If you keep it and use it in your BeOS projects, you must register it. Registering libCh lets me continue programming BeOS (and we all want that, right?) and will encourage me to continue adding to and improving libCh.

But, you've heard all that before, right?

If you register libCh, you'll get the full source code. You'll also receive all updates until version 2.0 is released (buy you'd have to buy the 2.0 update; which would still be cheaper than just getting 2.0), which will ensure that you're getting your money's worth. If you think you're not getting your money's worth, please let me know and I'll try my best to make sure you're happy with libCh.

Getting the source code ensures that you'll be able to track down (and fix!) any problems with the code, even if I vanish or stop developing BeOS software. It will also reassure you that I'm not hiding any malicious code in the library. There's no risk in using libCh in your applications!

Use the Register application to use the Kagi online registration service to register your copy of libCh. If you'd rather trade your creations for a registered copy of libCh, please contact me and we'll work something out (this is an excellent way for poor developers, such as students or hobbyists, to register shareware; I'd really like to see more shareware authors supporting each other in this way).

Parts

In addition to the classes described below, the constants and enumerated types defined by libCh's ChDefs.h header are also documented. [New in 0.2!]

Class Version Description
ChAssert 1.4 [New in 0.2!] A somewhat nicer assert(); pops up an alert and lets you keep going or quit.
ChBenaphore 1.6 A smart-and-fast semaphore object. I use this in DOOM, my screen savers, etc.
ChColorMap 1.4 An approximate inverse color-mapping object. I used this in DOOM for a while.
ChPulsar 1.5 [New in 0.2!] Send a periodic message; a somewhat more reliable version of the Pulse() method in BView, etc.
ChSigApplication 1.4 [New in 0.2!] BApplication that can deal gracefully with POSIX signals.
ChSnoozer 1.5 Put your thread to sleep, but let it wake up early. I use this in my screen saver modules.
ChVolume 1.8 A BVolume with methods to make manipulating indexes easier. I'm using this in StartUp.

Using libCh

To use libCh in your projects:

If you're ... ... then you must:
using the CodeWarrior IDE Add /boot/home/config/include and /boot/home/config/lib to your project's Access Paths settings.
using mwcc from a Terminal window Add -I/boot/home/config/include to your Makefile's compiler flags, and -L/boot/home/config/lib -lCh to your linker flags.

or

Add these lines to your /boot/home/config/boot/UserSetupEnvironment file:

export BEINCLUDES=/boot/home/config/include:$BEINCLUDES
export BELIBRARIES=/boot/home/config/lib:$BELIBRARIES

Unfortunately, if you edit your UserSetupEnvironment file like this, the changes won't take effect until after you've restarted the BeOS.

To include a libCh class in your application, you would:

#include "Ch/Chclassname"

in your source code.


Coming Soon

An x86 port of the libCh library is in the works.

This preliminary version of libCh is being released due to the many (well, one) requests I've had for it. Just so you've got an idea of what else I'm working on for libCh, here's a list of coming attractions:

Class Description
C API Benaphore For those of you who don't like C++, a complete Benaphore type and API that you can use from C.
(I've started work on this.)
ChApplication A BApplication sub-class that automatically sets up access to your application's resources, preferences (via the libprefs library), and the application binary's file attributes.
(I've started work on this.)
ChAsyncIO A set of classes for implementing asynchronous I/O services. Then you can tell your I/O object to go do a lengthy I/O operation, and notify you when it's done.
(This is just in the planning stages.)
ChBufferedFile A BFile sub-class that performs buffered I/O on its data and attributes (the current BFile implemention does no buffering).
(This is just in the planning stages.)
ChException A set of C++ exception objects that mirror the Python exception interface. (Yes this is trivial, but the MSL C++ library is so cutting-edge, it hurts sometimes.)
(This is just in the planning stages; it may never appear unless someone asks for it.)
ChNamedPipe An object for handling named pipes for communicating with POSIX applications that don't understand the BeOS IPC systems.
(This is just in the planning stages.)
ChSWApplication A ChApplication sub-class for time-expiring shareware applications. ChSWApplication will track the age of the application, nag the user based on your settings, and then leave them alone once they've registered.
(I've started work on this.)
ChThreadPool A thread pool object, to easily let you spawn a self-limiting number of worker threads. The idea here is to make it easier to let the user tell the application how many threads to use for a task, such as backing up data; the user (or even the application itself) can tune the application for their specific system.
(This is just in the planning stages.)
ChVersionedFile A BFile sub-class that handles "safe save" and file versioning transparently.
(This is just in the planning stages.)

This will grow as I develop more of my own applications; anything I find useful in one or more places is likely to help someone else out, so it'll end up here.


Contacting the author

You can reach me via email at chrish@kagi.com or on the 'web at http://www.qnx.com/~chrish/.

My BeOS-related web pages are also available.

I also frequent the bedevtalk mailing list, and the various comp.sys.be.* newsgroups.


License

The code in the libCh library is provided "as is", with no guarentee of its usability or fitness for any purpose. You use it at your own risk, and you are the only one responsible for your use or misuse of the code.

This code (headers and library) is freely usable by anyone for any purpose, as long as the author (Chris Herborth, Arcane Dragon Software) is given credit (in an application/library/other software product's documentation and in the "About box" credits). libCh is shareware; if you use it in your applications you must register it; people who register will receive the full source code for libCh as well as technical support and updates.

This documentation must accompany libCh, but you don't have to include the documentation or the code with any software product that uses libCh internally.

If you don't like these license "restrictions", contact me, and maybe we can work something out. Once I'm done laughing at your lawyer.


Last modified: $Date: 1998/04/14 10:33:23 $