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