X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..d5d484b0fbe924d3663b177965538d517ee412c1:/icuSources/tools/toolutil/toolutil.c diff --git a/icuSources/tools/toolutil/toolutil.c b/icuSources/tools/toolutil/toolutil.c index 8703445c..3ee34e98 100644 --- a/icuSources/tools/toolutil/toolutil.c +++ b/icuSources/tools/toolutil/toolutil.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1999-2004, International Business Machines +* Copyright (C) 1999-2005, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -16,7 +16,14 @@ * This file contains utility functions for ICU tools like genccode. */ -#ifdef WIN32 +#include +#include "unicode/utypes.h" +#include "unicode/putil.h" +#include "cmemory.h" +#include "cstring.h" +#include "toolutil.h" + +#ifdef U_WINDOWS # define VC_EXTRALEAN # define WIN32_LEAN_AND_MEAN # define NOUSER @@ -24,17 +31,16 @@ # define NOIME # define NOMCX # include +# include +#else +# include +# include #endif -#include -#include "unicode/utypes.h" -#include "unicode/putil.h" -#include "cmemory.h" -#include "cstring.h" -#include "toolutil.h" +#include U_CAPI const char * U_EXPORT2 getLongPathname(const char *pathname) { -#ifdef WIN32 +#ifdef U_WINDOWS /* anticipate problems with "short" pathnames */ static WIN32_FIND_DATA info; HANDLE file=FindFirstFile(pathname, &info); @@ -75,6 +81,19 @@ findBasename(const char *filename) { } } +U_CAPI void U_EXPORT2 +uprv_mkdir(const char *pathname, UErrorCode *status) { + int retVal = 0; +#if defined(U_WINDOWS) + retVal = _mkdir(pathname); +#else + retVal = mkdir(pathname, S_IRWXU | (S_IROTH | S_IXOTH) | (S_IROTH | S_IXOTH)); +#endif + if (retVal && errno != EEXIST) { + *status = U_FILE_ACCESS_ERROR; + } +} + /* tool memory helper ------------------------------------------------------- */ struct UToolMemory {