firstworks Rudiments Guide

Rudiments Guide
Downloading Rudiments:

You can download the most current source distribution of rudiments from http://www.firstworks.com/downloads/rudiments.

Unpacking Rudiments:

To unpack the distribution, copy the file to a location on your machine that you have access to and execute the following commands:

- gunzip rudiments-X.XX.tar.gz
- tar xf rudiments-X.XX.tar

This will create a rudiments-X.XX directory. Change directories into that directory.

Compiling Rudiments:

To compile Rudiments, read the INSTALL file, then execute the following commands:

- configure
- make

Rudiments should compile and function on unix-based systems using the GNU development system. Other compilers may work too but have not been tested on the current version.

The -pedantic flag must be used with newer GNU compilers. This flag is turned on by default, don't disable it.

Upon sucessfull compilation, the lib directory should contain both librudiments.a and librudiments.so.

Installing Rudiments:

To install Rudiments, become root and execute:

- make install

By default, everything is installed under /usr/local/firstworks.

To uninstall Rudiments, become root and execute:

- make uninstall

Classes:

The rudiments class library consists of several classes. Some are utility classes, others are designed to be base classes for software.

- Base Classes:
  - daemonprocess - base class for daemons
  - serversocket - base class for tcp stream servers
  - serversocketpool - base class for pools of tcp stream server sockets
  - clientsocket - base class for tcp stream clients
- Utility Classes:
  - commandline - command line processing class
  - datetime - date/time processing class
  - permissions - class for generating file access permissions
  - randomnumber - class for generating random numbers
  - regularexpression - class for dealing with regular expressions
  - semaphoreset - semaphore class
  - sharedmemory - shared memory class
  - signalclasses - classes with methods for dealing with signals
  - text - text processing and evaluation class

As a rule of thumb, the base classes should be inherited from and the utility classes should be instantiated as needed. Some of the utility classes have static methods which can be called directly without instantiating an instance of the class.

Refer to base classes and utility classes programming examples for more more information.