home *** CD-ROM | disk | FTP | other *** search
- DCDLIB10.ZIP Command/filename/text decoding routines
- ============
-
- Version: 1.0
- Author: Graham Klyne
- Released: 25-Oct-1991
-
- This archive contains a collection of procedures written in C for
- analysing text strings and decoding data values from their textual
- representations. I use these routines extensively in my own
- programming to analyse command lines and to parse filenames.
-
- Documentation is contained in the C source code, so look there
- for detailed information. Files which may be of particular
- interest are DCDTEM.C and DCDPTH.C.
-
- The source files here consist of:
-
- DCDDEF.H contains type definitions and function prototypes for
- routines defined by this library.
-
- DCDANS.C decode YES/NO value from string.
-
- DCDCMD.C assembles the command line used to run a C program.
-
- DCDDEF.C routines for applying defaults to filename
- specification strings.
-
- DCDFLT.C decode floating point values from a string.
-
- DCDNAM.C decode name values from a string
-
- DCDNUM.C decode integer numbers (any radix) from a string
-
- DCDPAR.C routines for reading and parsing a standard command
- line. (This was originally written to support a style
- of command-line interface which was more common in the
- early 80's, so is probably not of such interest to
- 'modern' programmers.)
-
- DCDPTH.C routines for parsing filename specifications from a
- string.
-
- DCDSPC.C routines for scanning whitespace in a string.
-
- DCDSTR.C routines for scanning substring values (possible quoted)
- from a string.
-
- DCDTOK.C routine for scanning a 'token' from a string.
-
- DCDTEM.C collection of routines for parsing and decoding values
- from a string based upon a supplied template. This
- module provides a facility a bit like 'sscanf', but
- it is MUCH MORE flexible. There are provisions for
- optional, alternate, repeated and abbreviated values
- in the string, and others.
-
- DCDTST.C this is a test harness for the template-based test decoding
- DCDTST.LNK routines. It also tests the individual value-decoding
- routines (which are called by the template-based decoder).
-
- DEFTST.C this is a test harness for the routine which applies
- DEFTST.LNK default values to a filename.
-
- PARTST.C test harness for command line parsing routines.
- PARTST.LNK
-
- DCDLIB MAKE file for all the above (primitive Microsoft style)
- Builds all modules into 4 libraries -- DCDLIBS, DCDLIBM,
- and DCDLIBL for small, medium and large model versions
- of the code.
-
- The programs have all been compiled and tested using
- Microsoft C version 5.1. Apart from a few library calls,
- the programs use features defined for ANSI C, so should
- compile with most compilers.
-
- The copyright in these programs is owned by Graham Klyne,
- but permission is granted for anyone to distribute and make
- free use of them in any way they see fit, provided that no
- fee is charged for their distribution.
-
- If you have any questions or comments, I routinely poll the
- programmer's areas of the following UK public-access bulletin
- boards:
- Golly! 0734 320812
- Hawk's Castle 0344 411621
- Mission Impossible 0602 654329 or 0602 654680
-
- Alternatively, you can fax me on 0235 847520 (Outside UK: +44 235 847520).
-
- Graham Klyne
- ~~~~~~~~~~~~
-