[ Download ] [ Theory ] [ Bugs ] [ License ] [ Examples ] [ Home ]

 

The sos home page

Switching on strings in standard C

 

Download and use

 

 

Download sos - links

Manual installation

Installation via "make"

There is one variable you should modify to configure the Makefile:


      #INSTALL_DIR=/usr/local/sos
      INSTALL_DIR=$(HOME)

The first value is the "official location", the other is recommended if you don't have access to the system directories.

You can use "make" to build, check, install, compile and link a sample program, clean and uninstall sos. Type "make" or "make help" for a list of all the supported arguments:


   make               - display usage info
   make help          - display usage info
   make all           - create all buildable files
   make test          - test sos/nsos with canned output
   make examples      - compile example programs
   make install       - create and install all buildable files
   make installtest   - test installed sos/nsos with canned output
   make libtest       - compile examples using the library
   make clean         - remove all built files in current dir
   make uninstall     - remove all installed files
   make dist          - create a distribution file
   make check         - make sure all files are present
   make note          - author's personal note
   make nop           - do nothing

Using sos

Note that the development version of sos (nsos) can generate code useful to processing attribute value pairs. For example, this input will generate the following output.

Running sos:

  Usage:    sos  [-p|-s|-f]  [identifier-list]  > output-file

            -p  generate C preprocessor code   (default)
            -s  generate switch skeleton code  (safe)
            -f  like "-s" but full char range  (safe)

The input list may be provided on the command line, interactively or redirected from a one identifier per line file. If the output is not redirected to a file an ugly stdout/stderr mixture will result on the screen.

For the "-f" option: You can use C escape sequences but hexadecimal escapes must be 2 digits long and octal escapes 3 digits long. Zero pad if necessary. To enter a string that contains a space char from the command line enclose it with ''.