.\" $Id: getudprefix.3,v 1.1 2000/08/07 23:15:03 emmerson Exp $ .TH GETUDPREFIX 3 "$Date: 2000/08/07 23:15:03 $" "Printed: \n(yr.\n(mo.\n(dy" "UNIDATA LIBRARY FUNCTIONS" .SH NAME getudprefix \- return installation prefix of Unidata software .SH SYNOPSIS .nf .ft B .sp const char *getudprefix(void); .ft .fi .SH DESCRIPTION .LP This function returns the pathname of the directory off of which most Unidata-supported software is installed. Thus, it may be used during program execution to help form needed pathnames. For example: .sp .RS +4 .nf .ta 4m \w'extern const char 'u #include extern const char *getudprefix(void); char pathbuf[256]; \&... (void)strcat(strcpy(pathbuf, getudprefix()), "/etc/udunits.dat"); .fi .RE .LP The function returns the value of the environment variable \fBUDPREFIX\fP, if it exists; otherwise, the value of the environment variable \fBUDHOME\fP is returned, if it exists; otherwise, the home directory of the user database entry returned by `\fBgetuduser()' is used, if it exists; otherwise, the empty string (\fB""\fP) is returned. .nr in \w'UDPREFIX ' .SH ENVIRONMENT .IP UDPREFIX \n(inu Contains the pathname of the root of the installed, Unidata software. .IP UDHOME Contains the pathname of the home directory of the Unidata user. .SH "SEE ALSO" .LP .BR getuduser (3).