1 /* $XConsortium: README /main/2 1996/07/15 14:14:37 drk $ */
2 The advanced software technology department has been collecting useful C
3 routines in a single library called libast. libast is used by nmake, the
4 nmake cpp (which is mainly based on another library (libpp)), CIA
5 (C information abstractor from Robin Chen), and a collection of other
6 /bin and /usr/bin commands that benefit from concentrating functionality
9 More detail is available in the man pages. libast contains:
11 (1) routines to support a generic environment for
12 a variety of UNIX operating system variants
14 (2) routines that update standard libc routines
16 (3) routines shared between several commands
18 If you already have nmake 2.0 or newer installed then use
19 `nmake install' from this directory, otherwise use
20 ship/shipin from the root of the distribution directory tree.
22 Some of the routines not found in section 3:
24 hash: generic, scoped hash table support
26 hashalloc create a hash table or push new scope
27 hashdump debug dump of one or all hash tables
28 hashfree free a hashalloc()'d table
29 hashlook low level name lookup
30 hashscan entry generator for scoped table scan
31 hashsize explicitly change table size (usually automatic)
32 hashwalk apply function to each table entry
33 memhash return hash code for n-char chunk of memory
34 strhash return hash code for null terminated string
36 include/ast: libast support headers
38 align.h compile time type alignmnent support
39 dirent.h POSIX directory(3) interface definitions
40 error.h error() interface definitions
41 ftw.h ftwalk() interface definitions
42 hash.h hash*() interface definitions
43 ls.h strls() interface definitions
44 re.h re*() interface definitions
45 tar.h POSIX ustar format interface definitions
46 tm.h tm*() interface definitions
50 cmdargs apply a sequence of cmd line option parsers
51 cmdopen like popen() but stdin and stdout are specified
52 cvtatoe convert ASCII to EBCDIC
53 cvtetoa convert EBCDIC to ASCII
54 error output generic error and trace messages
55 ftwalk an ftw(3) that works -- used in new tw(1)
56 getcwd uses $PWD if ok, doesn't use /bin/pwd
57 getshell return full path of shell for cmdopen()
58 ooptget optget() for obsolete ar(1) and tar(1) options
59 optget YA getopt(3) but no argc or error message output
60 pathaccess find file with specific acces on list of dirs
61 pathcanon canonicalize path name in place
62 pathcmd return full path name of executable using $PATH
63 pathroot determine `related root' directory for command
64 perror uses strerror()
65 readargs append each line of file to argv[0]
67 re: egrep(1) and ed(1) style re's from V9
68 (not the good awk(1) algorithm)
70 recomp compile re pattern
71 reerror report re*() errors
72 reexec match string using compiled re
73 resub ed(1) style substitute using last reexec()
77 chresc return next char in string converting \ sequences
78 ctoi convert char constant string to int
79 strcopy like strcpy(3) but returns end of destination
80 strdup malloc(3) and strcpy(3) smashed together
81 strerror return error message string given errno
82 stresc convert \ sequences in string in place
83 streval evaluate C expression in string
84 strls ls -l format support
85 strmatch Korn shell file pattern match
86 strmode return ls -l style output given st.st_mode
87 strsignal return signal id string given SIG* number
88 strtape convert generic tape unit to /dev/* file
89 token generate space separated tokens in string
91 tm: time conversion support
93 tmdate convert date string to time_t
94 tmform format time_t to date string
95 tmmake return current time_t
96 tmtime convert struct tm to time_t