Ignore:
Timestamp:
Oct 23, 2014, 10:26:55 PM (11 years ago)
Author:
bird
Message:

0.6: Safer and more generic _path and _searchenv functions, making the spawn code use for locating executables in a more flexible manner. Unix style search PATH separators are now honored. Fixes #180 and #308.

Location:
branches/libc-0.6/src/emx/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/include/stdlib.h

    r3809 r3903  
    462462    const char *, const char *);
    463463int _path (char *, const char *);
     464int _path2(const char *pszName, const char *pszSuffixes, char *pszDst, size_t cbDst);
    464465int _read_kbd (int, int, int);
    465466void _remext (char *);
     
    468469void _scrsize (int *);
    469470void _searchenv (const char *, const char *, char *);
     471int _searchenv2(const char *pszEnvVar, const char *pszName, unsigned fFlags, const char *pszSuffixes,
     472                char *pszDst, size_t cbDst);
     473int _searchenv2_value(const char *pszSearchPath, const char *pszName, unsigned fFlags, const char *pszSuffixes,
     474                      char *pszDst, size_t cbDst);
     475int _searchenv2_has_suffix(const char *pszName, size_t cchName, const char *pszSuffixes);
     476int _searchenv2_one_file(char *pszDst, size_t cbDst, size_t cchName, unsigned fFlags, const char *pszSuffixes);
     477/** @name _SEARCHENV2_F_XXX - Flags for _searchenv2(), _searchenv2_value()
     478 *                            and _searchenv2_one_file().
     479 * @{ */
     480/** Indicates that we're searching for an executable file. */
     481#define _SEARCHENV2_F_EXEC_FILE     1
     482/** Indicates that we shouldn't explicitly check the current directory before
     483 * searching the search path. */
     484#define _SEARCHENV2_F_SKIP_CURDIR   2
     485/** @} */
     486
    470487void _sfnlwr (const char *);
    471488unsigned _sleep2 (unsigned);
  • branches/libc-0.6/src/emx/include/sys/cdefs.h

    r3738 r3903  
    627627#include <sys/gnu/cdefs.h>
    628628
     629/* bird: kLIBC specifics - start */
     630/** @def __KLIBC_PATH_SLASH
     631 * The default slash character (path component separator). */
     632/** @def __KLIBC_PATH_SLASH_ALT
     633 * Alternative slash character (path component separator). Optional. */
     634/** @def __KLIBC_PATH_HAVE_DRIVE_LETTERS
     635 * Defined if we have driver letters on this platform. */
     636/** @def __KLIBC_PATH_HAVE_DRIVES
     637 * Defined if we have UNC paths on this platform. */
     638#if defined(__OS2__) || defined(_WIN32) || defined(_WIN64) || defined(__NT__)
     639# define __KLIBC_PATH_SLASH         '\\'
     640# define __KLIBC_PATH_SLASH_ALT     '/'
     641# define __KLIBC_PATH_HAVE_DRIVE_LETTERS   1
     642# define __KLIBC_PATH_HAVE_UNC      1
     643#else
     644# define __KLIBC_PATH_SLASH         '/'
     645# undef  __KLIBC_PATH_SLASH_ALT
     646# undef  __KLIBC_PATH_HAVE_DRIVE_LETTERS
     647# undef  __KLIBC_PATH_HAVE_UNC
     648#endif
     649/** @def __KLIBC_PATH_IS_SLASH
     650 * Checks if @a a_ch is a slash character.
     651 * @param a_ch      The character. */
     652#ifdef __KLIBC_PATH_SLASH_ALT
     653# define __KLIBC_PATH_IS_SLASH(a_ch)    ((a_ch) == __KLIBC_PATH_SLASH || (a_ch) == __KLIBC_PATH_SLASH_ALT)
     654#else
     655# define __KLIBC_PATH_IS_SLASH(a_ch)    ((a_ch) == __KLIBC_PATH_SLASH)
     656#endif
     657/* bird: kLIBC specifics - end */
     658
    629659#endif /* !_SYS_CDEFS_H_ */
Note: See TracChangeset for help on using the changeset viewer.