Message-ID: <39967008.19B9688E@softhome.net> Date: Sun, 13 Aug 2000 11:53:12 +0200 From: Laurynas Biveinis X-Mailer: Mozilla 4.74 [en] (Win98; U) X-Accept-Language: lt,en MIME-Version: 1.0 To: DJGPP Workers Subject: Updated symlink patch Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Here are documentation changes from both previous patches, based on Eli's feedback. If they are OK, I check in everything. Laurynas Index: symlink.txh =================================================================== RCS file: symlink.txh diff -N symlink.txh --- /dev/null Tue May 5 16:32:27 1998 +++ symlink.txh Sun Aug 13 05:51:42 2000 @@ -0,0 +1,32 @@ +@node symlink, io +@subheading Syntax + +@example +#include + +int symlink(const char *exists, const char *new); +@end example + +@subheading Description +DOS does not support symbolic links. However, DJGPP emulates them---this +function creates a file with special size and format, so other DJGPP +library functions transparently work with file which is pointed to +by the symlink. Of course, it does not work outside DJGPP programs. +Those library functions which are simple wrappers about DOS calls do not +use symlinks neither. + +@subheading Return Value + +Zero in case of success, -1 in case of failure (and @code{errno} set to +the appropriate error code). + +@subheading Portability + +@portability !ansi, !posix + +@subheading Example + +@example +symlink ("c:/djgpp/bin/grep", "c:/djgpp/bin/fgrep"); +@end example + Index: xsymlink.txh =================================================================== RCS file: xsymlink.txh diff -N xsymlink.txh --- /dev/null Tue May 5 16:32:27 1998 +++ xsymlink.txh Sun Aug 13 05:52:10 2000 @@ -0,0 +1,37 @@ +@node __solve_symlinks, io +@subheading Syntax + +@example +#include + +int __solve_symlinks(const char *symlink_path, char *real_path); +@end example + +@subheading Description +This function fully resolves given symlink in @var{symlink_path}---all +path components and all symlink levels are resolved. The +returned path in @var{real_path} is guaranteed to be symlink-clean +and understandable by DOS. If @var{symlink_path} does not contain +symlinks at all, it is simply copied to @var{real_path}. +@subheading Return Value + +Zero in case of error (and @code{errno} set to the appropriate +error code), non-zero in case of success. + +@subheading Portability + +@portability !ansi, !posix + +@subheading Example + +@example + + #include + #include + + __solve_symlinks(fn, file_name); + printf("File %s is really %s\n", fn, file_name); + + +@end example +