home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib / misc / util.man < prev   
Encoding:
Text File  |  1991-05-04  |  2.2 KB  |  55 lines

  1. '\" Copyright 1991 Regents of the University of California
  2. '\" Permission to use, copy, modify, and distribute this
  3. '\" documentation for any purpose and without fee is hereby
  4. '\" granted, provided that this notice appears in all copies.
  5. '\" The University of California makes no representations about
  6. '\" the suitability of this material for any purpose.  It is
  7. '\" provided "as is" without express or implied warranty.
  8. '\" 
  9. '\" $Header: /sprite/lib/forms/RCS/lib.man,v 1.3 91/01/07 17:55:52 mottsmth Exp $ SPRITE (Berkeley)
  10. '/" 
  11. .so \*(]ltmac.sprite
  12. .HS util lib
  13. .BS
  14. '\" Note:  do not modify the .SH NAME line immediately below!
  15. .SH NAME
  16. Util_CanonicalDir \- Canonicalize a directory name to a full path.
  17. .SH SYNOPSIS
  18. .nf
  19. \fB#include <util.h>\fR
  20. .sp
  21. char *
  22. \fBUtil_CanonicalDir\fR(\fInewDir, currentDir, buffer\fP)
  23. .SH ARGUMENTS
  24. .AS biggestType biggestName
  25. .AP char *newDir in
  26. The new directory name to canonicalize.
  27. .AP char *currentDir in
  28. The current directory (or other name) to which \fInewDir is
  29. relative - may be NULL.
  30. .AP char *buffer in/out
  31. Pre-allocated space in which to put new canonicalized name - may be NULL.
  32. .BE
  33.  
  34. .SH DESCRIPTION
  35. .PP
  36. The procedure takes a directory name, \fInewDir\fR, and turns it into
  37. a full path relative to a directory \fIcurrentDir\fR.  The parameter
  38. \fIcurrentDir\fR can actually be any full pathname to a directory but is
  39. usually the current directory.  If \fIcurrentDir\fR is NULL, the procedure
  40. calls \fIgetwd()\fR to find the full path name to the current directory.
  41. If the parameter \fIbuffer\fR is NULL, then the procedure allocates space
  42. for the new canonicalized directory name and returns a pointer to that new
  43. string.  If \fIbuffer\fR is not NULL, then it must be an area of at least
  44. MAXPATHLEN characters in which the procedure will copy the computed
  45. canonicalized name.  A pointer to \fIbuffer\fR is then returned.  It is okay
  46. for \fIbuffer\fR and \fInewDir\fR to be the same physical string, since
  47. \fInewDir\fR is only overwritten at the end of the computation.
  48. .PP
  49. The procedure returns a pointer to a new full pathname if successful.  If
  50. there is a failure, it returns NULL, with an error string in \fIbuffer\fR if
  51. that parameter was non-NULL.
  52.  
  53. .SH KEYWORDS
  54. directory, path, pathname, full
  55.