Index Click this button to go to the index for this section.


libpw(3)

NAME

libpw, libPW, Programmers_Workbench_Library - Provides functions for compatibility with existing programs

LIBRARY

Programmers Workbench Library (libPW.a)

DESCRIPTION

The libpw functions are provided for compatibility with existing programs. Their use in new programs is not recommended. any (character, string) Determines whether string contains character. anystr (string1, string2) Determines the offset in string1 of the first character that also occurs in string2. balbrk (string, open, close, end) Determines the offset in string of the first character in the string end that occurs outside of a balanced string as defined by open and close. cat (destination, source1, . . . , 0) Concatenates the source strings and copies them to destination. clean_up ( ) Defaults the cleanup routine. curdir (string) Puts the full pathname of the current directory in string. dname (p) Determines which directory contains the file p. fatal (message) General purpose error handler. fdfopen (fd, mode) Same as the stdio fdopen() function. giveup (dump) Forces a core dump. imatch (pref, string) Determines if the string pref is an initial substring of string. index (string1, string2) Determines the offset of the first occurrence in string1 of string2. lockit (lockfile, count, pid) Creates a lock file. logname ( ) Returns caller's login name. move (string1, string2, n) Copies the first n characters of string1 to string2. patoi (string) Converts string to integer. patol (string) Converts string to long. repeat (destination, string, n) Sets destination to string repeated n times. repl (string, old, new) Replaces each occurrence of the character old in string with the character new. satoi (string, ip) Converts string to integer and saves it in *ip. setsig ( ) Causes signals to be caught by the setsig1() function. setsig1 (signal) General purpose signal handling routine. sname (s) Gets a pointer to the simple name of full pathname s. strend (string) Finds the end of string. substr (s, destination, origin, length) Places a substring of string s in destination using the offset origin and length. trnslat (s, old, new, destination) Copies string s into destination and replaces any character in old with the corresponding characters in new. unlockit (lockfile, pid) Deletes the lock file. userdir (uid) Gets the user's login directory. userexit (code) Defaults user exit routine. username (uid) Gets the user's login name. verify (string1, string2) Determines the offset in string1 of the first character that is not also in string2. xalloc (asize) Allocates memory. xcreat (name, mode) Creates a file. xfree (aptr) Frees memory. xfreeall ( ) Frees all memory. xlink (f1, f2) Links files. xmsg (file, func) Calls the fatal() function with an appropriate error message. xopen (name, mode) Opens a file. xpipe (t) Creates a pipe. xunlink (f) Removes a directory entry. xwrite (fd, buffer, n) Writes n bytes to the file associated with fd from buffer. zero (p, n) Zeros n bytes starting at address p. zeropad (s) Replaces the initial blanks with the character '0' in string s.