1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/lib/libast
Martijn Dekker 77ab60a149 iffe: revert <stdio.h> removal, add different fix (re: 308696ec)
Commit 308696ec caused the build to fail on macOS Catalina.

src/cmd/INIT/iffe.sh:
- Fix a blatantly unportable practice of passing multiple
  "|"-separated 'case' patterns through a variable. This was a way
  of grepping for some headers including stdio.h, but it only works
  this way on ksh93 and possibly the original Bourne shell, and not
  on *any* other shell (not even pdksh or mksh) -- and the fact
  that it works on ksh93 is arguably a bug. Fix by eliminating the
  "noext" variable (which is init'ed once and never changes) and
  using the pattern in the relevant 'case' statement directly.

src/cmd/builtin/features/pty:
- No matter what I try, including <stdio.h> causes the build to
  fail on Gentoo Linux (i386) with mysterious "invalid identifier:
  off64_t" errors -- this is probably some AST preprocessor hackery
  gone awry, but I've no idea where to even begin with that. This
  works around the problem by using AST sfio instead, which is
  built and functional by the time this feature test is run.
- Remove explicit extern declaration for ptsname(2) that was never
  used because it depended on an npt_ptsname feature test that
  doesn't exist (or no longer exists).
- Add missing <fcntl.h>, <stdlib.h>, and <unistd.h> for open(2),
  ptsname(2) and close(2), respectively.

src/lib/libast/features/float,
src/lib/libast/features/sfio,
src/lib/libast/features/stdio:
- Re-include <stdio.h>.

Fixes: https://github.com/ksh93/ksh/issues/164 (I hope)
2021-01-27 15:30:16 +00:00
..
aso Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
astsa Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
cdt Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
comp conf.sh: correct embarrassing typo (re: a75d0dfa) 2021-01-20 22:05:22 +00:00
dir Remove vestigial 3DFS support code (re: f88f302c) 2020-07-17 05:04:03 +01:00
disc fix 24 more typos found with the help of codespell 2020-06-12 01:45:15 +02:00
features iffe: revert <stdio.h> removal, add different fix (re: 308696ec) 2021-01-27 15:30:16 +00:00
hash Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
include Build system tweaks; fix use of brk(2)/sbrk(2) feature test 2021-01-26 09:59:11 +00:00
man Fix leak and crash upon defining functions in subshells 2020-08-14 00:25:31 +01:00
misc libast: optget: improve usage messages, adding help info line 2021-01-21 08:55:12 +00:00
obsolete Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
path libast: update /usr/tmp fallback to /var/tmp 2020-09-12 19:14:27 +02:00
port libast/port/mnt.c: rm cachefs support (Solaris patch 135-CR6729252) 2021-01-08 11:50:57 +00:00
preroot Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
regex Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
sfio Apply patches to build on DragonFly BSD and (older) FreeBSD 2021-01-18 09:08:48 +00:00
std Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
stdio Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
string Apply patches to build on DragonFly BSD and (older) FreeBSD 2021-01-18 09:08:48 +00:00
tm Fix build on systems without O_CLOEXEC (re: 9f43f8d1) 2021-01-23 00:40:00 +00:00
uwin Fix some formatting errors, typos and other problems (#78) 2020-07-16 22:27:00 +01:00
vec Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
vmalloc Build system tweaks; fix use of brk(2)/sbrk(2) feature test 2021-01-26 09:59:11 +00:00
Mamfile **/Mamfile: iffe: rm irrelevant flags (re: 580ff616, 6cc2f6a0) 2021-01-27 14:54:53 +00:00
README Fix a large number of typos and other problems (#110) 2020-08-07 00:50:11 +01:00
RELEASE Fix a large number of typos and other problems (#110) 2020-08-07 00:50:11 +01:00

The advanced software technology department has been collecting useful C
routines in a single library called libast.  libast is used by nmake, the
nmake cpp (which is mainly based on another library (libpp)), CIA
(C information abstractor from Robin Chen), and a collection of other
/bin and /usr/bin commands that benefit from concentrating functionality
in libast.

More detail is available in the man pages.  libast contains:

  (1)	routines to support a generic environment for
	a variety of UNIX operating system variants

  (2)	routines that update standard libc routines

  (3)	routines shared between several commands

If you already have nmake 2.0 or newer installed then use
`nmake install' from this directory, otherwise use
ship/shipin from the root of the distribution directory tree.

Some of the routines not found in section 3:

hash:			generic, scoped hash table support

	hashalloc	create a hash table or push new scope
	hashdump	debug dump of one or all hash tables
	hashfree	free a hashalloc()'d table
	hashlook	low level name lookup
	hashscan	entry generator for scoped table scan
	hashsize	explicitly change table size (usually automatic)
	hashwalk	apply function to each table entry
	memhash		return hash code for n-char chunk of memory
	strhash		return hash code for null terminated string

include/ast:		libast support headers

	align.h		compile time type alignment support
	dirent.h	POSIX directory(3) interface definitions
	error.h		error() interface definitions
	ftw.h		ftwalk() interface definitions
	hash.h		hash*() interface definitions
	ls.h		strls() interface definitions
	re.h		re*() interface definitions
	tar.h		POSIX ustar format interface definitions
	tm.h		tm*() interface definitions

misc:

	cmdargs		apply a sequence of cmd line option parsers
	cmdopen		like popen() but stdin and stdout are specified
	cvtatoe		convert ASCII to EBCDIC
	cvtetoa		convert EBCDIC to ASCII
	error		output generic error and trace messages
	ftwalk		an ftw(3) that works -- used in new tw(1)
	getcwd		uses $PWD if ok, doesn't use /bin/pwd
	getshell	return full path of shell for cmdopen()
	ooptget		optget() for obsolete ar(1) and tar(1) options
	optget		YA getopt(3) but no argc or error message output
	pathaccess	find file with specific access on list of dirs
	pathcanon	canonicalize path name in place
	pathcmd		return full path name of executable using $PATH
	pathroot	determine `related root' directory for command
	perror		uses strerror()
	readargs	append each line of file to argv[0]

re:			egrep(1) and ed(1) style re's from V9
			(not the good awk(1) algorithm)

	recomp		compile re pattern
	reerror		report re*() errors
	reexec		match string using compiled re
	resub		ed(1) style substitute using last reexec()

string:

	chresc		return next char in string converting \ sequences
	ctoi		convert char constant string to int
	strcopy		like strcpy(3) but returns end of destination
	strdup		malloc(3) and strcpy(3) smashed together
	strerror	return error message string given errno
	stresc		convert \ sequences in string in place
	streval		evaluate C expression in string
	strls		ls -l format support
	strmatch	Korn shell file pattern match
	strmode		return ls -l style output given st.st_mode
	strsignal	return signal id string given SIG* number
	strtape		convert generic tape unit to /dev/* file
	token		generate space separated tokens in string

tm:			time conversion support

	tmdate		convert date string to time_t
	tmform		format time_t to date string
	tmmake		return current time_t
	tmtime		convert struct tm to time_t