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