From 1fd5e000ace55b323124c7e556a7a864b972a5c4 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 17 Feb 2000 19:38:33 +0000 Subject: import winsup-2000-02-17 snapshot --- winsup/cygwin/path.sgml | 205 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 winsup/cygwin/path.sgml (limited to 'winsup/cygwin/path.sgml') diff --git a/winsup/cygwin/path.sgml b/winsup/cygwin/path.sgml new file mode 100644 index 000000000..6030c8f78 --- /dev/null +++ b/winsup/cygwin/path.sgml @@ -0,0 +1,205 @@ + +cygwin_posix_to_win32_path_list + + +extern "C" void +cygwin_posix_to_win32_path_list +const char *posix +char *win32 + + +Given a POSIX path-style string (i.e. /foo:/bar) convert it to +the equivalent Win32 path-style string (i.e. d:\;e:\bar). +win32 must point to a sufficiently large +buffer. + + +Example use of cygwin_posix_to_win32_path_list + +char *_epath; +char *_win32epath; +_epath = _win32epath = getenv (NAME); +/* If we have a POSIX path list, convert to win32 path list */ +if (_epath != NULL && *_epath != 0 + && cygwin_posix_path_list_p (_epath)) + { + _win32epath = (char *) xmalloc + (cygwin_posix_to_win32_path_list_buf_size (_epath)); + cygwin_posix_to_win32_path_list (_epath, _win32epath); + } + + + +See also +cygwin_posix_to_win32_path_list_buf_size + + + + +cygwin_win32_to_posix_path_list + + +extern "C" void +cygwin_win32_to_posix_path_list +const char *win32 +char *posix + + +Given a Win32 path-style string (i.e. d:\;e:\bar) convert it to +the equivalent POSIX path-style string (i.e. /foo:/bar). +posix must point to a sufficiently large +buffer. See also +cygwin_win32_to_posix_path_list_buf_size + + + + +cygwin_posix_to_win32_path_list_buf_size + + +extern "C" int +cygwin_posix_to_win32_path_list_buf_size +const char *path_list + + +Returns the number of bytes needed to hold the result of calling + +cygwin_posix_to_win32_path_list. + + + + +cygwin_win32_to_posix_path_list_buf_size + + +extern "C" int +cygwin_win32_to_posix_path_list_buf_size +const char *path_list + + +Tells you how many bytes are needed for the results of +cygwin_win32_to_posix_path_list. + + + + +cygwin_conv_to_posix_path + + +extern "C" void +cygwin_conv_to_posix_path +const char *path +char *posix_path + + +Converts a Win32 path to a POSIX path. If +path is already a POSIX path, leaves it alone. +If path is relative, then +posix_path will also be relative. Note that +posix_path must point to a buffer of sufficient +size; use MAX_PATH if needed. + + + + +cygwin_conv_to_win32_path + + +extern "C" void +cygwin_conv_to_win32_path +const char *path +char *win32_path + + +Converts a POSIX path to a Win32 path. If +path is already a Win32 path, leaves it alone. +If path is relative, then +win32_path will also be relative. Note that +win32_path must point to a buffer of sufficient +size; use MAX_PATH if needed. + + + +cygwin_conv_to_full_posix_path + + +extern "C" void +cygwin_conv_to_full_posix_path +const char *path +char *posix_path + + +Converts a Win32 path to a POSIX path. If +path is already a POSIX path, leaves it alone. +If path is relative, then +posix_path will be converted to an absolute +path. Note that posix_path must point to a +buffer of sufficient size; use MAX_PATH if needed. + + + + +cygwin_conv_to_full_win32_path + + +extern "C" void +cygwin_conv_to_full_win32_path +const char *path +char *win32_path + + +Converts a POSIX path to a Win32 path. If +path is already a Win32 path, leaves it alone. +If path is relative, then +win32_path will be converted to an absolute +path. Note that win32_path must point to a +buffer of sufficient size; use MAX_PATH if needed. + + + + +cygwin_posix_path_list_p + + +extern "C" int +posix_path_list_p +const char *path + + +This function tells you if the supplied +path is a POSIX-style path (i.e. posix names, +forward slashes, colon delimiters) or a Win32-style path (drive +letters, reverse slashes, semicolon delimiters. The return value is +true if the path is a POSIX path. Note that "_p" means "predicate", a +lisp term meaning that the function tells you something about the +parameter. + + + + +cygwin_split_path + + +extern "C" void +cygwin_split_path + +const char * path +char * dir +char * file + + +Split a path into the directory and the file portions. Both +dir and file are +expected to point to buffers of sufficient size. + + +Example use of cygwin_split_path + +char dir[200], file[100]; +cygwin_split_path("c:/foo/bar.c", dir, file); +printf("dir=%s, file=%s\n", dir, file); + + + -- cgit v1.2.3