Linux repositories inspector



Korn Shell development environment


ast - miscellaneous libast support


#include <ast.h>

char* astconf(const char*
name, const char* path, const char* value); Ast_confdisc_t astconfdisc(Ast_confdisc_t new_notify); void astconflist(Sfio_t* stream, const char* path, int flags); off_t astcopy(int rfd, int wfd, off_t n); int astquery(int fd, const char* format , ...);


astconfis a string interface to the confstr(2), pathconf(2), and sysconf(2) calls. If value is 0then the configuration parameter value for name is returned. Some name configuration parameters may consult the path argument. In this case if path is 0then "/" is used. Otherwise if path is not 0then it must exist. The string return value for name remains unchanged until the next astconfcall on name. If value is 0then a valid string is always returned; "" is returned if name has no configuration value. This simplifies the programming interface:
if (!strcmp(astconf("PATH_RESOLVE", NiL, NiL), "logical"))
          /* the logical way ... */

If value is not 0then the configuration parameter value for name is set to value. 0is returned if the value cannot be set. The paradigm is:
universe = astconf("UNIVERSE", 0, "att");
astconf("UNIVERSE", 0, universe);

The settable configuration names are:
FS_3D1if 3d(1) viewpathing is enabled, 0otherwise. This is an alternative to the fs3d(3) interface.
PATH_RESOLVElogicalif symbolic links are followed during file tree traversal, physicalif symbolic links are not followed during file tree traversal, and metaphysicalif symbolic links are followed at the top level during file tree traversal. These correspond to the generic -L -P and -Hcommand options.
UNIVERSEucbfor Berkeley style and attotherwise. This configuration parameter controls the universe setting on machines that support it (e.g., Pyramid). UNIVERSEalso controls the behavior of some commands like cat(1) and echo(1).
User defined name values may also be set and queried, but these should probably have some form of vendor prefix to avoid being stomped by future standards.
astconfdiscregisters a discipline function
int (*notify)(const char* name, const char* path, const char* value);
that is called just before the configuration parameter name is set to value relative to path. If notify returns 0then the configuration parameter value is not changed.
astconflistlists the current configuration names and values of stream. If path is 0then "/" is used where appropriate. If flags is 0or R_OK|W_OKthen all configuration parameters are listed. R_OKlists the readonly configuration parameters and W_OKlists the settable configuration parameters. X_OKlists the settable configuration parameters in a form that can be snarfed for input to the getconf(1) command.
astcopyefficiently copies up to n bytes from the file descriptor rfd to the file descriptor wfd. The actual number of bytes copied is returned; -1 is returned on error. If n is 0 then an optimal number of bytes (with respect to both rfd and wfd) is copied.
If possible mmap(2) is used to do the transfer. Some implementations may bypass user buffer copies usually required by the read(2)- write(2) paradigm.
astqueryoutputs an sfprintf(3) prompt specified by format, ... to the controlling terminal and reads a response from the controlling terminal. Offirmative response returns 0 EOFor quit response returns -1 otherwise 1is returned. If quit is greater than 0then exit(quit) is called on a quit response. The responses will eventually be locale specific.
astwinsizereturns the number of rows in *rows and the number of columns *col for the terminal file descriptor fd. If the number of rows or columns cannot be determined or if fd is not a terminal then *rows and *cols are set to 0 If ioctl(2) methods fail then the environment variable LINESis used to set *rows and the environment variable COLUMNSis used to set *cols.


getconf(1), confstr(2), mmap(2), pathconf(2), read(2), sysconf(2), write(2)
⇧ Top