mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Merge pull request #10 from gnustep/master
Pull latest master branch changes into our fork.
This commit is contained in:
commit
79f738ceb1
150 changed files with 7342 additions and 3674 deletions
43
.gitignore
vendored
43
.gitignore
vendored
|
@ -25,3 +25,46 @@ Tests/base/coding/ulong-8.type
|
|||
# Editor byproducts
|
||||
*.orig
|
||||
*.swp
|
||||
|
||||
# MacOS Desktop Services Store
|
||||
.DS_Store
|
||||
|
||||
# Created by https://www.gitignore.io/api/xcode
|
||||
# Edit at https://www.gitignore.io/?templates=xcode
|
||||
|
||||
### Xcode ###
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## User settings
|
||||
xcuserdata/
|
||||
|
||||
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
|
||||
*.xcscmblueprint
|
||||
*.xccheckout
|
||||
|
||||
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
|
||||
build/
|
||||
DerivedData/
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
|
||||
## Xcode Patch
|
||||
*.xcodeproj/*
|
||||
!*.xcodeproj/project.pbxproj
|
||||
!*.xcodeproj/xcshareddata/
|
||||
!*.xcworkspace/contents.xcworkspacedata
|
||||
/*.gcno
|
||||
|
||||
### Xcode Patch ###
|
||||
**/xcshareddata/WorkspaceSettings.xcsettings
|
||||
|
||||
# End of https://www.gitignore.io/api/xcode
|
206
.travis.yml
206
.travis.yml
|
@ -1,72 +1,142 @@
|
|||
---
|
||||
language: cpp
|
||||
dist: xenial
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
env:
|
||||
- LIBRARY_COMBO=gnu-gnu-gnu
|
||||
- LIBRARY_COMBO=ng-gnu-gnu
|
||||
- LIBRARY_COMBO=ng-gnu-gnu BASE_ABI=--disable-mixedabi
|
||||
- LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-2.0
|
||||
- LIBRARY_COMBO=ng-gnu-gnu BASE_ABI=--disable-mixedabi RUNTIME_VERSION=gnustep-2.0
|
||||
matrix:
|
||||
exclude:
|
||||
- compiler: gcc
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu
|
||||
- compiler: gcc
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu BASE_ABI=--disable-mixedabi
|
||||
- compiler: gcc
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-2.0
|
||||
- compiler: gcc
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu BASE_ABI=--disable-mixedabi RUNTIME_VERSION=gnustep-2.0
|
||||
- compiler: clang
|
||||
jobs:
|
||||
include:
|
||||
- name: "Linux GCC"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env: LIBRARY_COMBO=gnu-gnu-gnu
|
||||
sudo: required
|
||||
before_install:
|
||||
- sudo apt-get -qq update
|
||||
- sudo apt-get install -y cmake pkg-config libgnutls28-dev libgmp-dev libffi-dev libicu-dev libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev
|
||||
- >
|
||||
if [ $LIBRARY_COMBO = 'gnu-gnu-gnu' ];
|
||||
then
|
||||
if [ $CC = 'gcc' ];
|
||||
then
|
||||
sudo apt-get install -y gobjc;
|
||||
fi;
|
||||
sudo apt-get install -y libobjc-4.8-dev libblocksruntime-dev;
|
||||
else
|
||||
curl -s -o - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -;
|
||||
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main" && sudo apt-get update -qq;
|
||||
sudo apt-get install -y clang-9 libkqueue-dev libpthread-workqueue-dev;
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10 \
|
||||
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-9;
|
||||
export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/clang-7.0.0\/bin//');
|
||||
if [ "$RUNTIME_VERSION" = "gnustep-2.0" ];
|
||||
then
|
||||
sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10;
|
||||
fi;
|
||||
fi;
|
||||
# libdispatch requires a fairly recent version of cmake
|
||||
- >
|
||||
if [ $LIBRARY_COMBO = 'ng-gnu-gnu' ];
|
||||
then
|
||||
curl -LO https://cmake.org/files/v3.15/cmake-3.15.5-Linux-x86_64.tar.gz;
|
||||
tar xf cmake-3.15.5-Linux-x86_64.tar.gz;
|
||||
mv cmake-3.15.5-Linux-x86_64 $HOME/cmake;
|
||||
export PATH=$HOME/cmake/:$HOME/cmake/bin:$PATH
|
||||
fi;
|
||||
- name: "Linux Clang gnustep-1.9"
|
||||
os: linux
|
||||
compiler: clang
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-1.9
|
||||
- name: "Linux Clang gnustep-1.9 disable-mixedabi"
|
||||
os: linux
|
||||
compiler: clang
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-1.9 BASE_ABI=--disable-mixedabi
|
||||
- name: "Linux Clang gnustep-2.0"
|
||||
os: linux
|
||||
compiler: clang
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-2.0
|
||||
- name: "Linux Clang gnustep-2.0 disable-mixedabi"
|
||||
os: linux
|
||||
compiler: clang
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-2.0 BASE_ABI=--disable-mixedabi
|
||||
- name: "Windows GCC MinGW-w64 i686"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env: LIBRARY_COMBO=gnu-gnu-gnu MSYSTEM=mingw32 ARCH=i686
|
||||
- name: "Windows GCC MinGW-w64 x86_64"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env: LIBRARY_COMBO=gnu-gnu-gnu MSYSTEM=mingw64 ARCH=x86_64
|
||||
# allow Windows builds to fail (remove once all tests are passing on Windows)
|
||||
allow_failures:
|
||||
- os: windows
|
||||
before_install: |
|
||||
case $TRAVIS_OS_NAME in
|
||||
linux)
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get install -y cmake pkg-config libgnutls28-dev libgmp-dev libffi-dev libicu-dev libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev
|
||||
case $LIBRARY_COMBO in
|
||||
gnu-gnu-gnu)
|
||||
if [ $CC = 'gcc' ]; then
|
||||
sudo apt-get install -y gobjc
|
||||
fi
|
||||
sudo apt-get install -y libobjc-4.8-dev libblocksruntime-dev
|
||||
;;
|
||||
ng-gnu-gnu)
|
||||
curl -s -o - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
|
||||
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main" && sudo apt-get update -qq
|
||||
sudo apt-get install -y clang-9 libkqueue-dev libpthread-workqueue-dev
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10 \
|
||||
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-9
|
||||
export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/clang-7.0.0\/bin//')
|
||||
if [ "$RUNTIME_VERSION" = "gnustep-2.0" ]; then
|
||||
sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10
|
||||
fi;
|
||||
## libdispatch requires a fairly recent version of cmake
|
||||
curl -LO https://cmake.org/files/v3.15/cmake-3.15.5-Linux-x86_64.tar.gz
|
||||
tar xf cmake-3.15.5-Linux-x86_64.tar.gz
|
||||
mv cmake-3.15.5-Linux-x86_64 $HOME/cmake
|
||||
export PATH=$HOME/cmake/:$HOME/cmake/bin:$PATH
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
windows)
|
||||
## from https://docs.travis-ci.com/user/reference/windows/#how-do-i-use-msys2
|
||||
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
|
||||
choco uninstall -y mingw
|
||||
choco upgrade --no-progress -y msys2
|
||||
export msys2='cmd //C RefreshEnv.cmd '
|
||||
export msys2+='& set MSYS=winsymlinks:nativestrict '
|
||||
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
|
||||
export mingw="$msys2 -$MSYSTEM -full-path -here -c "\"\$@"\" --"
|
||||
export msys2+=" -msys2 -c "\"\$@"\" --"
|
||||
## Install MSYS2 packages required by GNUstep
|
||||
$msys2 pacman --sync --noconfirm --needed \
|
||||
mingw-w64-$ARCH-gcc-objc \
|
||||
make \
|
||||
pkg-config \
|
||||
libxml2-devel \
|
||||
libxslt-devel \
|
||||
libffi-devel \
|
||||
libgnutls-devel \
|
||||
icu-devel \
|
||||
mingw-w64-$ARCH-pkg-config \
|
||||
mingw-w64-$ARCH-libxml2 \
|
||||
mingw-w64-$ARCH-libxslt \
|
||||
mingw-w64-$ARCH-libffi \
|
||||
mingw-w64-$ARCH-gnutls \
|
||||
mingw-w64-$ARCH-icu \
|
||||
##
|
||||
taskkill //IM gpg-agent.exe //F # https://travis-ci.community/t/4967
|
||||
export PATH=/C/tools/msys64/$MSYSTEM/bin:$PATH
|
||||
## disable conversion to native-form paths when configuring GNUstep Make in travis-deps.sh
|
||||
## https://www.msys2.org/wiki/Porting/#filesystem-namespaces
|
||||
export MSYS2_ARG_CONV_EXCL="--prefix="
|
||||
;;
|
||||
esac
|
||||
install: ./travis-deps.sh
|
||||
before_script: >
|
||||
export LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LIBRARY_PATH;
|
||||
export LD_LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LD_LIBRARY_PATH;
|
||||
if [ $LIBRARY_COMBO = 'ng-gnu-gnu' ];
|
||||
then
|
||||
export CPATH=$HOME/staging/include;
|
||||
else
|
||||
export CPATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/include;
|
||||
fi;
|
||||
export PATH=$HOME/staging/bin:$PATH;
|
||||
export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles;
|
||||
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh;
|
||||
script: >
|
||||
./configure $BASE_ABI || (cat config.log && false);
|
||||
make && make install && make check || (cat Tests/tests.log && false);
|
||||
before_script: |
|
||||
case $TRAVIS_OS_NAME in
|
||||
linux)
|
||||
DEP_ROOT=$HOME/staging
|
||||
export PATH=$DEP_ROOT/bin:$PATH
|
||||
;;
|
||||
windows)
|
||||
DEP_ROOT=/c/staging
|
||||
setx -m PATH "C:\staging;%PATH%"
|
||||
CONFIGURE_OPTS=--without-unwind
|
||||
;;
|
||||
esac
|
||||
export LIBRARY_PATH=$DEP_ROOT/lib:$DEP_ROOT/lib64:$LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$DEP_ROOT/lib:$DEP_ROOT/lib64:$LD_LIBRARY_PATH
|
||||
case $LIBRARY_COMBO in
|
||||
gnu-gnu-gnu)
|
||||
export CPATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/include
|
||||
;;
|
||||
ng-gnu-gnu)
|
||||
export CPATH=$DEP_ROOT/include
|
||||
;;
|
||||
esac
|
||||
export GNUSTEP_MAKEFILES=$DEP_ROOT/share/GNUstep/Makefiles
|
||||
. $GNUSTEP_MAKEFILES/GNUstep.sh
|
||||
script:
|
||||
# configure and make need to be executed via MinGW shell on Windows ($mingw is undefined on Linux)
|
||||
- $mingw ./configure $BASE_ABI $CONFIGURE_OPTS || (cat config.log && false)
|
||||
- $mingw make && $mingw make install && $mingw make check || (cat Tests/tests.log && false)
|
||||
|
||||
# set up packages cache (currently used on Windows only)
|
||||
before_cache: |
|
||||
case $TRAVIS_OS_NAME in
|
||||
windows)
|
||||
# https://unix.stackexchange.com/a/137322/107554
|
||||
$msys2 pacman --sync --clean --noconfirm
|
||||
;;
|
||||
esac
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/AppData/Local/Temp/chocolatey
|
||||
- /C/tools/msys64
|
||||
|
|
202
ANNOUNCE
202
ANNOUNCE
|
@ -1,7 +1,7 @@
|
|||
1 Announcement
|
||||
**************
|
||||
|
||||
The GNUstep Base Library, version 1.26.0, is now available.
|
||||
The GNUstep Base Library, version 1.27.0, is now available.
|
||||
|
||||
1.1 What is the GNUstep Base Library?
|
||||
=====================================
|
||||
|
@ -18,48 +18,180 @@ portion of the OpenStep standard (the Foundation library).
|
|||
There is more information available at the GNUstep homepage at
|
||||
'http://www.gnustep.org'.
|
||||
|
||||
1.2 Noteworthy changes in version '1.26.0'
|
||||
1.2 Noteworthy changes in version '1.27.0'
|
||||
==========================================
|
||||
|
||||
* Improve utf8 validity checks.
|
||||
* Make point and size subclasses for NSValue interchangable.
|
||||
* Add support for TLS SNI. Always request certificate from client and
|
||||
update certificates after 5 minutes.
|
||||
* Don't write deprecated fields to desktop link file.
|
||||
* Use NSLock instead of GSLazyLock and other improvements for
|
||||
multithreaded processes.
|
||||
* Clean up of NSString cluster.
|
||||
* Update NSAssert() and NSCAssert() to handle variable arguments (as
|
||||
OSX has done) and mark the numbered macros as obsolete.
|
||||
* Various improvements in tests.
|
||||
* Require ICU >= 50.
|
||||
* ICU is now detected using pkg-config.
|
||||
* Improve XML parsing.
|
||||
* Make NSXMLNode ivar a union representing different types, instead
|
||||
of assuming it will contain different underlying class types in
|
||||
different contexts. This is important for the new libobjc2 ABI.
|
||||
* OSX compatibility changes to NSURL.
|
||||
* NSFileManager call error handle on missing file.
|
||||
* Dummy spinlock implementation for platforms that don't support it.
|
||||
* Internationalization improvements: Japanese translation, Turkish
|
||||
translation, Polish translation.
|
||||
* Various improvements for new libobjc2 "v2 ABI", including things
|
||||
like a new NSConstantString implementation, making
|
||||
GS_REPLACE_CONSTANT_STRING a noop with the new ABI, etc.
|
||||
* Improvements for stack traces, exception handling and dead lock
|
||||
detection.
|
||||
* Other more minor bugfixes and cleanups. Many found by Coverity
|
||||
scan results.
|
||||
* As usual, this release also contains an update to include the most
|
||||
recent international timezone data.
|
||||
Aside from an assortment of bugfixes, this release includes a lot of
|
||||
improvements for Android support as well as numerous new classes and
|
||||
methods.
|
||||
|
||||
* Expose GNU TLS wrappers and add methods to get certificate expiry.
|
||||
* Improve thread safety when using zombies, particularly on
|
||||
statup/shutdown.
|
||||
* Improvements for Ukrainian localization.
|
||||
* Decreased ICU requirements to 49 to support Windows 2000.
|
||||
* Simplifications and fixes in GSPrivateSymbolPath().
|
||||
* GSMime improvements (word encoding specifier, utf-8 improvements
|
||||
encoding quoted words with multibyte characters)
|
||||
* NSJSONSerialization fixes for codepoints over 0x7f.
|
||||
* NSCharacterSet support for URL*AllowedCharacterSet and declarations
|
||||
for new character sets.
|
||||
* NSString implementations for new methods
|
||||
stringByRemovingPercentEncoding/
|
||||
stringByAddingPercentEncodingWithAllowedCharacterSet:.
|
||||
* Fixed a crash in gdomap when an invalid hostname is given for the
|
||||
-M option.
|
||||
* In NSString.m, removed functions urldecode() and ishex() which were
|
||||
mistakenly neither namespaced nor declared static and thus could
|
||||
have conflicted with non-library code.
|
||||
* Fixed libdispatch configuration switch so -enable-libdispatch works
|
||||
correctly; correctly checking for HAVE_LIBDISPATCH_RUNLOOP.
|
||||
* Updated libdispatch runloop integration so it is compatible with
|
||||
Swift's corelibs libdispatch release (from
|
||||
github.com/apple/swift-corelibs-libdispatch). The libdispatch must
|
||||
be compiled with INSTALL_PRIVATE_HEADERS=YES.
|
||||
* In NSThread, spinlocks implemented using builtins to be able to
|
||||
target platforms without pthread_spin_lock(), such as Android
|
||||
targeting API level < 24.
|
||||
* In NSLog on Android, send logs to syslog.
|
||||
* Implementation of NSOrderedSet.
|
||||
* When ./configuring, link against libandroid on Android.
|
||||
* In NSBundle, allow integrating with Android asset manager using
|
||||
+[NSBundle setJavaAssetManager:withJNIEnv:], enabling use of
|
||||
mainBundle's pathForResource:ofType:, -URLForResource:ofType: and
|
||||
similar; referencing Info.plist if it exists in Android assets; use
|
||||
of NSFileManager's fileExistsAtPath: et al and
|
||||
isReadableFileAtPath:; reading files using NSFileHandle APIs; use
|
||||
of NSDirectoryEnumerator to enumerate Android assets from the main
|
||||
bundle.
|
||||
* In NSBundle, localization support on Android.
|
||||
* In NSProcessInfo, automatic initialization on Android using a fake
|
||||
executable path (/data/data/<app identifier>/Resources).
|
||||
* In NSData, improvements in reading Android assets.
|
||||
* Various improvements in the mechanism to report memory usage of
|
||||
individual objects.
|
||||
* Skeletal implementation of NSUbiquitousKeyValueStore.
|
||||
* Implementation of NSByteCountFormatter.
|
||||
* Fixes to writing large HTTPS requests (GSSocketStream,
|
||||
NSURLProtocol).
|
||||
* In gdomap.c, fix detection of local networks.
|
||||
* In NSArray's -removeObjectsInArray:, prevent some crashes.
|
||||
* In GSTLS, avoid setting session priority twice.
|
||||
* In NSFileHandle, fix so that setting certificate information does
|
||||
not discard any other options already set.
|
||||
* In GSXML's -fatalErrorFunction, use the correct function to get the
|
||||
line number.
|
||||
* In NSOperation's _execute, ensure lock gets released on an error by
|
||||
surrounding with NS_DURING.
|
||||
* Generics support in NSHashTable.
|
||||
* Implementation of NSProgress.
|
||||
* Skeleton implementation of NSURLComponents.
|
||||
* In NSSortDescriptor, added
|
||||
-sortDescriptorWithKey:ascending:descending:.
|
||||
* In NSOperationQueue, added -addOperationWithBlock.
|
||||
* In NSFileManager, added
|
||||
-URLForDirectory:inDomain:appropriateForURL:create:error: and
|
||||
-enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:.
|
||||
Also added NSItemReplacementDirectory constant, and updated stub
|
||||
implementation for -URLForDirectory:shouldCreate:error:. Added
|
||||
-initWithDirectoryPath:... with additional parameters skipHidden
|
||||
and errorHandler.
|
||||
* In NSDictionary, fixed keysSortedByValueUsingComparator:.
|
||||
* Moved NSFileWrapper from -gui to -base.
|
||||
* Added NSFilePresenter, NSFileVersion and NSFileCoordinator.
|
||||
* Added NSPersonComponents and NSPersonNameComponentsFormatter.
|
||||
* Added units of measurement classes such as NSUnit, NSMeasurement,
|
||||
NSMeasurementFormatter, NSEnergyFormatter, NSLengthFormatter,
|
||||
NSMassFormatter.
|
||||
* In NSUnit, support for NSUnitArea, NSUnitConcentrationMass,
|
||||
NSUnitDispersion, NSUnitElectricCharge, NSUnitIlluminance,
|
||||
NSUnitElectricCurrent, NSUnitElectricPotentionDifference,
|
||||
NSElectricResistance, NSUnitMass, NSUnitEnergy, NSUnitFrequency,
|
||||
NSUnitPower, NSUnitSpeed, NSUnitFuelEfficiency, NSUnitPressure,
|
||||
NSUnitVolume, NSUnitLength.
|
||||
* Support for data directory on Android introduces
|
||||
GSInitializeProcessAndroid and makes use of the path returned by
|
||||
Context.getFilesDir() as the basis for storing data (e.g.
|
||||
NSUserDefaults) and when querying for directory paths
|
||||
(NSLibraryDirectory, NSApplicationSupportDirectory, etc.).
|
||||
* Placeholder NSScript* classes. Added NSUserActivity,
|
||||
NSObjectScripting, NSHFSFileTypes, NSAppleEventManager and
|
||||
NSAppleEventDescriptor.
|
||||
* Added NSDateInterval intersectionWithDateInterval:.
|
||||
* Added NSBackgroundActivityScheduler.
|
||||
* Added NSISO8601DateFormatter and NSMetadataAttributes.
|
||||
* Added NSOrtogrpahy and NSLinguisticTagger.
|
||||
* Added NSExtensionItem, NSExtensionContext,
|
||||
NSExtensionRequestHandling, and NSItemProvider and
|
||||
NSItemProviderReadingWriting.
|
||||
* Updated timezone info for NSTimeZones.
|
||||
* On Android, support for NSTemporaryDirectory to use
|
||||
Context.getCacheDir(), and cleaning it up in
|
||||
GSInitializeProcessAndroid() given there is no support for temp
|
||||
directory before Android API 26. Also used with NSCachesDirectory
|
||||
+ NSUserDomainMask.
|
||||
* NSXPCConnection fixes.
|
||||
* NSException symbolication support using libunwind (used when
|
||||
backtrace() is unavailable).
|
||||
* Travis build improvements to use new runloop integration and
|
||||
gnustep-2.0 runtime.
|
||||
* In NSKeyValueObserving, implement two missing methods for NSArray:
|
||||
-addObserver:options:context: and
|
||||
-removeObserver:fromObjectsAtIndexes:forKeyPath:.
|
||||
* Updated NSUUID to use instancetype.
|
||||
* Added support for NSDate constants in NSPredicate.
|
||||
* Fixed a NSTimer bug with blocks.
|
||||
* In GSTLS, do not put password in the hash key of the credentials,
|
||||
and to avoid logging it when debugging is on.
|
||||
* Improvements in NSConcreteHashTable and NSConcreteMapTable.
|
||||
* In various places, switch away from deprecated
|
||||
CREATE_AUTORELEASE_POOL() to use the ARC-compatible ENTER_POOL and
|
||||
LEAVE_POOL macros.
|
||||
* When building the list of hosts to be probed to see if they have
|
||||
gdomap servers, fix code to include those explicitly defined in the
|
||||
config file. Add -S option to list the addresses of the known
|
||||
gdomap servers.
|
||||
* Backward compatibility fix for ICU 65.
|
||||
* Update GSPrivateSymbolPath() so that, on the path where
|
||||
LINKER_GETSYMBOL is not available, we attempt to lookup classes
|
||||
using the prefix ._OBJC_CLASS_ for the 2.0 ABI (earlier ABIs use a
|
||||
prefix of __objc_class_name_ for the class definition.
|
||||
* Fix parsing of NSURLResponse content type header.
|
||||
* Fix for class lookup when using the 2.0 ABI.
|
||||
* Fixed NSURLComponents setURL: throwing exceptions when URL didn't
|
||||
have all expected parts caused by rangeOfString: throwing for nil
|
||||
values.
|
||||
* Added NSURLQueryItem implementation.
|
||||
|
||||
1.3 Where can you get it? How can you compile it?
|
||||
=================================================
|
||||
|
||||
The gnustep-base-1.26.0.tar.gz distribution file has been placed at
|
||||
The gnustep-base-1.27.0.tar.gz distribution file has been placed at
|
||||
<ftp://ftp.gnustep.org/pub/gnustep/core>.
|
||||
|
||||
Please log bug reports on the GNUstep project page
|
||||
It is accompanied by gnustep-base-1.27.0.tar.gz.sig, a PGP signature
|
||||
which you can validate by putting both files in the same directory and
|
||||
using:
|
||||
|
||||
gpg --verify gnustep-base-1.27.0.tar.gz.sig
|
||||
|
||||
Signature has been created using the key with the following
|
||||
fingerprint:
|
||||
|
||||
83AA E47C E829 A414 6EF8 3420 CA86 8D4C 9914 9679
|
||||
|
||||
Read the INSTALL file or the GNUstep-HOWTO for installation
|
||||
instructions.
|
||||
|
||||
1.4 Where do I send bug reports?
|
||||
================================
|
||||
|
||||
Please log bug reports on the GNUstep project page
|
||||
<http://savannah.gnu.org/bugs/?group=gnustep> or send bug reports to
|
||||
<bug-gnustep@gnu.org>.
|
||||
|
||||
1.5 Obtaining GNUstep Software
|
||||
==============================
|
||||
|
||||
Check out the GNUstep web site. (<http://www.gnustep.org/>) and the GNU
|
||||
web site. (<http://www.gnu.org/>)
|
||||
|
|
345
ChangeLog
345
ChangeLog
|
@ -1,3 +1,344 @@
|
|||
2020-08-30 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSDateComponentsFormatter.m: Fix use of wrong operator.
|
||||
|
||||
2020-08-02 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSNotification.h: Add NSNotificatioName typedef
|
||||
|
||||
2020-07-13 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSURLRequest.h:
|
||||
* Source/NSURLRequest.m:
|
||||
Update NSURLRequest header to use "instancetype".
|
||||
|
||||
2020-07-08 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSLog.m:
|
||||
Don't log current thread if its identical to private thread ID.
|
||||
This makes the log more succinct when GSLogThread is enabled and the
|
||||
system doesn't provide an OS-level thread ID (i.e. GSPrivateThreadID()
|
||||
returns GSCurrentThread()), which would previously cause the NSThread
|
||||
pointer to be logged twice.
|
||||
|
||||
2020-07-08 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSLog.m,
|
||||
* Source/NSProcessInfo.m: Improve NSLog output on Android.
|
||||
We now always set -GSLogSyslog, as stdout/stderr is not available on
|
||||
Android. Also fixes log output containing extraneous date/time.
|
||||
|
||||
2020-07-06 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSThread.m: Fix possible deadlock when becoming multi-
|
||||
threaded.
|
||||
|
||||
2020-06-14 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSKeyedArchiver.h
|
||||
* Source/NSKeyedArchiver.m
|
||||
* Source/NSKeyedUnarchiver.m: Add setter for requiresSecureCoding.
|
||||
|
||||
2020-06-11 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSValueTransformer.m:
|
||||
Fix recursive creation of value transformers.
|
||||
* Tests/base/NSValueTransformer/basic.m:
|
||||
Add tests for NSValueTransformer.
|
||||
|
||||
2020-06-06 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSBundle.m: Extend NSBundle resources support to handle
|
||||
directories in Android assets.
|
||||
* Source/NSFileManager.m: Fix NSFileManager -isReadableFileAtPath:
|
||||
to also support directories in Android assets.
|
||||
|
||||
2020-06-05 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Tests/base/NSMapTable/weakObjects.m,
|
||||
* Source/NSConcreteMapTable.m:
|
||||
Add test for and fix replacing an existing value in a weak objects map
|
||||
table.
|
||||
|
||||
2020-05-25 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSUserDefaults.m:
|
||||
Store NSNumber instead of NSString for NSUserDefaults -setBool:forKey:.
|
||||
|
||||
2020-05-23 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/GNUstepBase/GSConfig.h.in,
|
||||
* Source/GSNetwork.h,
|
||||
* Source/win32/GSFileHandle.m,
|
||||
* config/config.reuseaddr.c:
|
||||
Include winsock2.h before windows.h, as required by MSYS2/MinGW-w64.
|
||||
|
||||
2020-05-14 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSException.h:
|
||||
Fix BASE_NATIVE_OBJC_EXCEPTIONS check with OBJC_ZEROCOST_EXCEPTIONS.
|
||||
|
||||
2020-05-13 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/win32/GSFileHandle.m:
|
||||
* Source/win32/NSMessagePort.m:
|
||||
Fix building Win32 classes with nonfragile ABI.
|
||||
|
||||
2010-05-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Source/NSFileManager.m:
|
||||
In changeFileAttributes implement setting of creation date also for
|
||||
Unix, which needs to be done before setting the modification date.
|
||||
Also, implement reading the creation (birth time) date if a supported
|
||||
method was detected.
|
||||
|
||||
2010-05-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* configure
|
||||
* configure.ac
|
||||
* Headers/GNUstepBase/config.h.in
|
||||
Check for utimensat()
|
||||
|
||||
* Source/NSFileManager.m: (changeFileAttributes:)
|
||||
Use utimensat() to set file modification date, if available.
|
||||
|
||||
2020-05-05 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/unix/NSStream.m: Add NSInputStream support for reading
|
||||
Android assets from main bundle.
|
||||
|
||||
2020-05-10 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSISO8601DateFormatter.m,
|
||||
* Source/NSOrthography.m: Clean up some compiler warnings.
|
||||
|
||||
2020-05-09 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Tests/base/NSLocale/general.m: Mark more tests that depend on
|
||||
locale setting as hopes.
|
||||
* Tests/base/NSXMLParser/parse.m: Mark stream test as hopeful as
|
||||
this isn't implemented at the moment.
|
||||
* Tests/base/NSURL/basic.m: Use PASS_EQUAL in the downlaod test
|
||||
to get the actual http status reported.
|
||||
|
||||
2020-05-08 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSXMLParser.m: Fix small bug in last commit that broke
|
||||
all gui applications when there was a commented out section in the
|
||||
user default XML file.
|
||||
|
||||
2020-05-07 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSLocale.h:
|
||||
* Source/NSLocale.m:
|
||||
Use "instancetype" for instance-returning methods. Fix method
|
||||
signature of -displayNameForKey:value:.
|
||||
|
||||
2020-05-05 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSXMLParser.h:
|
||||
* Headers/GNUstepBase/GSXML.h:
|
||||
* Source/Additions/GSXML.m:
|
||||
* Source/NSXMLParser.m:
|
||||
* Tests/base/NSXMLParser/parse.m:
|
||||
Implement -[NSXMLParser initWithStream:].
|
||||
|
||||
2020-04-26 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSLocale.m: Respect NSLocaleCalendarIdentifier if
|
||||
NSLocaleCalendar isn't set.
|
||||
* Headers/Foundation/NSCalendar.h,
|
||||
* Source/NSCalendar.m: Add newer features for NSDateComponents and
|
||||
started to clean up NSCalendar implementation.
|
||||
* Tests/base/NSCalendar/features-10-7.m: Add test for different
|
||||
time zone.
|
||||
|
||||
2020-04-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSNotification.m:
|
||||
Override -hash and -isEqual: so that notifications with the name name,
|
||||
object, and userInfo are considered equal. This is the OSX behavior.
|
||||
|
||||
2020-04-14 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/GNUstepBase/GSConfig.h.in:
|
||||
* Headers/GNUstepBase/GSVersionMacros.h:
|
||||
* configure.ac:
|
||||
* configure:
|
||||
Remove last vestiges of MIXED ABI support (it didn't really work), and
|
||||
change code to assume that use of the apple runtime means we have the
|
||||
nonfragile ABI (true for modern apple systems we may be interested in
|
||||
using). Regenerate configure script.
|
||||
|
||||
2020-04-13 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
* Documentation/announce.texi:
|
||||
* ANNOUNCE:
|
||||
Normalize the accompanying text for the release announcement across
|
||||
core packages: standardize chapter name and GPG information.
|
||||
|
||||
2020-04-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSURLProtocol.h:
|
||||
* Source/NSURLProtocol.m:
|
||||
Fix [NSURLProtocol -initWithRequest:cachedResponse:client:] to retain
|
||||
the client (up until the last message is sent to it) as OSX does.
|
||||
|
||||
2020-04-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* CharSets/URLFragmentAllowedCharSet.h:
|
||||
* CharSets/URLHostAllowedCharSet.h:
|
||||
* CharSets/URLPasswordAllowedCharSet.h:
|
||||
* CharSets/URLPathAllowedCharSet.h:
|
||||
* CharSets/URLQueryAllowedCharSet.h:
|
||||
* CharSets/URLUserAllowedCharSet.h:
|
||||
Removed character set data headers from non-standard location.
|
||||
* NSCharacterSet.m:
|
||||
Fixed to load URL characterset data from standard file.
|
||||
Changed bitmap representation to use much less space for charsets
|
||||
residing wholly in the base plane (in particular the URL charsets
|
||||
which are purely ASCII characters).
|
||||
* NSCharacterSetData.h:
|
||||
Regenerated to contain the URL charactersets and to contain the
|
||||
latest Unicode data (3rd Oct 2019).
|
||||
|
||||
2020-04-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/GNUstepBase/GNUstep.h:
|
||||
Add ASSIGNMUTABLECOPY() macro for consistency with ASSIGNCOPY()
|
||||
Wolfgang pointed out that the lack of this macro was uninutitive.
|
||||
|
||||
2020-04-07 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSOperation.m: Fix completion block memory management.
|
||||
|
||||
2020-04-05 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
* ANNOUNCE:
|
||||
* NEWS:
|
||||
* Documentation/ReleaseNotes.gsdoc:
|
||||
* Documentation/news.texi:
|
||||
Update release notes for 1.27.0.
|
||||
|
||||
2020-03-29 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSThread.m: Use pthread_setname_np result instead of errno,
|
||||
which fixes setting thread name on platforms where errno is not set.
|
||||
|
||||
2020-03-29 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSURLResponse.m: Fix parsing of NSURLResponse content type
|
||||
header.
|
||||
|
||||
2020-03-29 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSString.m: Attempt to make calls to GSICUCollatorOpen()
|
||||
more consistent and correct for ICU 65.
|
||||
|
||||
2020-03-26 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSError.h:
|
||||
* Source/NSError.m: Added NSErrorDomain typedef.
|
||||
|
||||
2020-03-12 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSURL.m: Fix compiler warnings.
|
||||
* Headers/Foundation/NSLocale.h:
|
||||
* Source/NSLocale.m: Add a few convenience methods from MacOS 10.12.
|
||||
|
||||
2020-03-10 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSURL.m: fix –[NSURLComponents setURL:] throwing
|
||||
exception for URLs that don't have all parts.
|
||||
|
||||
2020-03-01 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Tests/base/NSBundle/TestInfo,
|
||||
* Tests/base/NSBundle/GNUmakefile.preamble,
|
||||
* Tests/base/NSBundle/resources2.m: Extend test to check for
|
||||
framework resource loading.
|
||||
|
||||
2020-03-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Resources/Languages/Locale.canonical:
|
||||
Backward compatibility fix for ICU 65 by Fred Kiefer
|
||||
* Resources/Languages/README: Fix trivial typo
|
||||
|
||||
2020-02-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/objc-load.m: update GSPrivateSymbolPath() so that, on the
|
||||
path where LINKER_GETSYMBOL is not available, we attempt to lookup
|
||||
classes using the prefix ._OBJC_CLASS_ for the 2.0 ABI (earlier
|
||||
ABIs use a prefix of __objc_class_name_ for the class definition.
|
||||
|
||||
2020-02-17 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/gdomap.c: When building the list of hosts to be probed to see
|
||||
if they have gdomap servers, fix code to include those explicitly
|
||||
defined in the config file. Add -S option to list the addresses of
|
||||
the known gdomap servers.
|
||||
* Tools/gdomap.8: Document the new command line option.
|
||||
|
||||
2020-02-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSXPCConnection.h: remove unistd.h since
|
||||
workaround broke blocks code. I guess we have to hope that
|
||||
sys/types.h has gid_t, pid_t, and uid_t on all systems we target.
|
||||
|
||||
2020-02-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Examples/dictionary.m:
|
||||
* Examples/nsconnection_client.m:
|
||||
* Headers/GNUstepBase/GNUstep.h:
|
||||
* Source/Additions/GSMime.m:
|
||||
* Source/NSConnection.m:
|
||||
* Source/NSDictionary.m:
|
||||
* Source/NSException.m:
|
||||
* Source/NSFileManager.m:
|
||||
* Source/NSFileWrapper.m:
|
||||
* Source/NSTask.m:
|
||||
* Source/NSUserDefaults.m:
|
||||
* Tools/AGSIndex.m:
|
||||
* Tools/AGSOutput.m:
|
||||
* Tools/cvtenc.m:
|
||||
Switch various places away from deprecated CREATE_AUTORELEASE_POOL()
|
||||
to use the ARC-compatible ENTER_POOL and LEAVE_POOL macros.
|
||||
|
||||
2020-02-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSXPCConnection.h: Workaround for clash between
|
||||
unistd.h and clang's reserved word __block
|
||||
|
||||
2020-02-05 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* configure.ac: Use pkg-config to check for libxml.
|
||||
* configure: regenerate
|
||||
|
||||
2020-01-23 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/Additions/NSURL+GNUstepBase.m: Handle case where scheme
|
||||
is missing from the URL.
|
||||
|
||||
2020-01-20 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSPredicate.m: Allow simple predicates on NSDate.
|
||||
|
||||
2020-01-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSTLS.m: remove certificate key password from hash key of
|
||||
credentials since it's unnecessary there and we don't want it to be
|
||||
logged when debug is on (for security, passwords shouldn't appear
|
||||
in logs).
|
||||
|
||||
2020-01-12 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSPredicate.m: Add support for NSDate constants.
|
||||
|
||||
2020-01-12 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSKeyValueObserving.m: Implement two missing KVO methods
|
||||
on NSArray.
|
||||
|
||||
2019-12-15 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Headers/GNUstepBase/GSIMap.h: Use GSI_MAP_NODE_IS_EMPTY macros
|
||||
|
@ -133,7 +474,7 @@
|
|||
|
||||
* Source/GSTLS.m: Re-order code to avoid setting session priority
|
||||
twice.
|
||||
* Source/NSFileHandle.m: Fux so that setting certificate information
|
||||
* Source/NSFileHandle.m: Fix so that setting certificate information
|
||||
does not discard any other options already set.
|
||||
|
||||
2019-09-16 Alan Jenkins <alan.christopher.jenkins@gmail.com>
|
||||
|
@ -333,7 +674,7 @@
|
|||
inverted) and ensures that both the handle and drain functions are
|
||||
available.
|
||||
|
||||
2019-02-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
2019-04-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSString.m: Removed public functions which could conflict
|
||||
with application code. Rewrote percent unescaping to avoid possible
|
||||
|
|
|
@ -18,7 +18,7 @@ notice and this notice are preserved.
|
|||
</author>
|
||||
<version>$Revision$</version>
|
||||
<date>$Date$</date>
|
||||
<copy>2005,2006 Free Software Foundation, Inc.</copy>
|
||||
<copy>2005-2020 Free Software Foundation, Inc.</copy>
|
||||
</head>
|
||||
<body>
|
||||
<chapter>
|
||||
|
@ -29,6 +29,140 @@ notice and this notice are preserved.
|
|||
migrate to using a newer version of the library.
|
||||
</p>
|
||||
|
||||
<section>
|
||||
<heading>Version 1.27.0</heading>
|
||||
<p>
|
||||
Aside from an assortment of bugfixes, this release includes a lot of
|
||||
improvements for Android support as well as numerous new classes and methods.
|
||||
</p>
|
||||
<p>
|
||||
Expose GNU TLS wrappers and add methods to get certificate expiry.<br />
|
||||
Improve thread safety when using zombies, particularly on statup/shutdown.<br />
|
||||
Improvements for Ukrainian localization.<br />
|
||||
Decreased ICU requirements to 49 to support Windows 2000.<br />
|
||||
Simplifications and fixes in GSPrivateSymbolPath().<br />
|
||||
GSMime improvements (word encoding specifier, utf-8 improvements encoding
|
||||
quoted words with multibyte characters)<br />
|
||||
NSJSONSerialization fixes for codepoints over 0x7f.<br />
|
||||
NSCharacterSet support for URL*AllowedCharacterSet and declarations for
|
||||
new character sets.<br />
|
||||
NSString implementations for new methods stringByRemovingPercentEncoding/
|
||||
stringByAddingPercentEncodingWithAllowedCharacterSet:.<br />
|
||||
Fixed a crash in gdomap when an invalid hostname is given for the -M
|
||||
option.<br />
|
||||
In NSString.m, removed functions urldecode() and ishex() which were
|
||||
mistakenly neither namespaced nor declared static and thus could have conflicted
|
||||
with non-library code.<br />
|
||||
Fixed libdispatch configuration switch so --enable-libdispatch works
|
||||
correctly; correctly checking for HAVE_LIBDISPATCH_RUNLOOP.<br />
|
||||
Updated libdispatch runloop integration so it is compatible with Swift's
|
||||
corelibs libdispatch release (from github.com/apple/swift-corelibs-libdispatch).
|
||||
The libdispatch must be compiled with INSTALL_PRIVATE_HEADERS=YES.<br />
|
||||
In NSThread, spinlocks implemented using builtins to be able to target
|
||||
platforms without pthread_spin_lock(), such as Android targeting API level < 24.<br />
|
||||
In NSLog on Android, send logs to syslog.<br />
|
||||
Implementation of NSOrderedSet.<br />
|
||||
When ./configuring, link against libandroid on Android.<br />
|
||||
In NSBundle, allow integrating with Android asset manager using +[NSBundle
|
||||
setJavaAssetManager:withJNIEnv:], enabling use of mainBundle's
|
||||
pathForResource:ofType:, -URLForResource:ofType: and similar; referencing
|
||||
Info.plist if it exists in Android assets; use of NSFileManager's
|
||||
fileExistsAtPath: et al and isReadableFileAtPath:; reading files using
|
||||
NSFileHandle APIs; use of NSDirectoryEnumerator to enumerate Android assets from
|
||||
the main bundle.<br />
|
||||
In NSBundle, localization support on Android.<br />
|
||||
In NSProcessInfo, automatic initialization on Android using a fake
|
||||
executable path (/data/data/<app identifier>/Resources).<br />
|
||||
In NSData, improvements in reading Android assets.<br />
|
||||
Various improvements in the mechanism to report memory usage of individual
|
||||
objects.<br />
|
||||
Skeletal implementation of NSUbiquitousKeyValueStore.<br />
|
||||
Implementation of NSByteCountFormatter.<br />
|
||||
Fixes to writing large HTTPS requests (GSSocketStream, NSURLProtocol).<br />
|
||||
In gdomap.c, fix detection of local networks.<br />
|
||||
In NSArray's -removeObjectsInArray:, prevent some crashes.<br />
|
||||
In GSTLS, avoid setting session priority twice.<br />
|
||||
In NSFileHandle, fix so that setting certificate information does not
|
||||
discard any other options already set.<br />
|
||||
In GSXML's -fatalErrorFunction, use the correct function to get the line
|
||||
number.<br />
|
||||
In NSOperation's _execute, ensure lock gets released on an error by
|
||||
surrounding with NS_DURING.<br />
|
||||
Generics support in NSHashTable.<br />
|
||||
Implementation of NSProgress.<br />
|
||||
Skeleton implementation of NSURLComponents.<br />
|
||||
In NSSortDescriptor, added -sortDescriptorWithKey:ascending:descending:.<br />
|
||||
In NSOperationQueue, added -addOperationWithBlock.<br />
|
||||
In NSFileManager, added
|
||||
-URLForDirectory:inDomain:appropriateForURL:create:error: and
|
||||
-enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:. Also added
|
||||
NSItemReplacementDirectory constant, and updated stub implementation for
|
||||
-URLForDirectory:shouldCreate:error:. Added -initWithDirectoryPath:... with
|
||||
additional parameters skipHidden and errorHandler.<br />
|
||||
In NSDictionary, fixed keysSortedByValueUsingComparator:.<br />
|
||||
Moved NSFileWrapper from -gui to -base.<br />
|
||||
Added NSFilePresenter, NSFileVersion and NSFileCoordinator.<br />
|
||||
Added NSPersonComponents and NSPersonNameComponentsFormatter.<br />
|
||||
Added units of measurement classes such as NSUnit, NSMeasurement,
|
||||
NSMeasurementFormatter, NSEnergyFormatter, NSLengthFormatter,
|
||||
NSMassFormatter.<br />
|
||||
In NSUnit, support for NSUnitArea, NSUnitConcentrationMass,
|
||||
NSUnitDispersion, NSUnitElectricCharge, NSUnitIlluminance,
|
||||
NSUnitElectricCurrent, NSUnitElectricPotentionDifference, NSElectricResistance,
|
||||
NSUnitMass, NSUnitEnergy, NSUnitFrequency, NSUnitPower, NSUnitSpeed,
|
||||
NSUnitFuelEfficiency, NSUnitPressure, NSUnitVolume, NSUnitLength.<br />
|
||||
Support for data directory on Android introduces
|
||||
GSInitializeProcessAndroid and makes use of the path returned by
|
||||
Context.getFilesDir() as the basis for storing data (e.g. NSUserDefaults) and
|
||||
when querying for directory paths (NSLibraryDirectory,
|
||||
NSApplicationSupportDirectory, etc.).<br />
|
||||
Placeholder NSScript* classes. Added NSUserActivity, NSObjectScripting,
|
||||
NSHFSFileTypes, NSAppleEventManager and NSAppleEventDescriptor.<br />
|
||||
Added NSDateInterval intersectionWithDateInterval:.<br />
|
||||
Added NSBackgroundActivityScheduler.<br />
|
||||
Added NSISO8601DateFormatter and NSMetadataAttributes.
|
||||
|
||||
<br />
|
||||
Added NSOrtogrpahy and NSLinguisticTagger.<br />
|
||||
Added NSExtensionItem, NSExtensionContext, NSExtensionRequestHandling, and
|
||||
NSItemProvider and NSItemProviderReadingWriting.<br />
|
||||
Updated timezone info for NSTimeZones.<br />
|
||||
On Android, support for NSTemporaryDirectory to use Context.getCacheDir(),
|
||||
and cleaning it up in GSInitializeProcessAndroid() given there is no support for
|
||||
temp directory before Android API 26. Also used with NSCachesDirectory +
|
||||
NSUserDomainMask.<br />
|
||||
NSXPCConnection fixes.<br />
|
||||
NSException symbolication support using libunwind (used when backtrace()
|
||||
is unavailable).<br />
|
||||
Travis build improvements to use new runloop integration and gnustep-2.0
|
||||
runtime.<br />
|
||||
In NSKeyValueObserving, implement two missing methods for NSArray:
|
||||
-addObserver:options:context: and
|
||||
-removeObserver:fromObjectsAtIndexes:forKeyPath:.<br />
|
||||
Updated NSUUID to use instancetype.<br />
|
||||
Added support for NSDate constants in NSPredicate.<br />
|
||||
Fixed a NSTimer bug with blocks.<br />
|
||||
In GSTLS, do not put password in the hash key of the credentials, and to
|
||||
avoid logging it when debugging is on.<br />
|
||||
Improvements in NSConcreteHashTable and NSConcreteMapTable.<br />
|
||||
In various places, switch away from deprecated CREATE_AUTORELEASE_POOL()
|
||||
to use the ARC-compatible ENTER_POOL and LEAVE_POOL macros.<br />
|
||||
When building the list of hosts to be probed to see if they have gdomap
|
||||
servers, fix code to include those explicitly defined in the config file.
|
||||
Add -S option to list the addresses of the known gdomap servers.<br />
|
||||
Backward compatibility fix for ICU 65.<br />
|
||||
Update GSPrivateSymbolPath() so that, on the path where LINKER_GETSYMBOL
|
||||
is not available, we attempt to lookup classes using the prefix ._OBJC_CLASS_
|
||||
for the 2.0 ABI (earlier ABIs use a prefix of __objc_class_name_ for the class
|
||||
definition.<br />
|
||||
Fix parsing of NSURLResponse content type header.<br />
|
||||
Fix for class lookup when using the 2.0 ABI.<br />
|
||||
Fixed NSURLComponents setURL: throwing exceptions when URL didn't have
|
||||
all expected parts caused by rangeOfString: throwing for nil values.<br />
|
||||
Added NSURLQueryItem implementation.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<heading>Version 1.26.0</heading>
|
||||
<p>A new stable release.<br />
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@c -*- texinfo -*-
|
||||
@chapter Announcement
|
||||
|
||||
@c set the vars GNUSTEP-BASE-VERSION and GNUSTEP-BASE-GCC-VERSION
|
||||
|
@ -31,9 +32,31 @@ at @samp{http://www.gnustep.org}.
|
|||
@ifset GNUSTEP-BASE-FTP-MACHINE
|
||||
The gnustep-base-@value{GNUSTEP-BASE-VERSION}.tar.gz distribution file has
|
||||
been placed at @url{ftp://@value{GNUSTEP-BASE-FTP-MACHINE}/@value{GNUSTEP-BASE-FTP-DIRECTORY}}.
|
||||
|
||||
It is accompanied by gnustep-base-@value{GNUSTEP-BASE-VERSION}.tar.gz.sig, a
|
||||
PGP signature which you can validate by putting both files in the same
|
||||
directory and using:
|
||||
|
||||
@example
|
||||
gpg --verify gnustep-base-@value{GNUSTEP-BASE-VERSION}.tar.gz.sig
|
||||
@end example
|
||||
|
||||
Signature has been created using the key with the following fingerprint:
|
||||
|
||||
@example
|
||||
83AA E47C E829 A414 6EF8 3420 CA86 8D4C 9914 9679
|
||||
@end example
|
||||
@end ifset
|
||||
|
||||
Read the INSTALL file or the GNUstep-HOWTO for installation instructions.
|
||||
|
||||
@section Where do I send bug reports?
|
||||
|
||||
Please log bug reports on the GNUstep project page
|
||||
@url{http://savannah.gnu.org/bugs/?group=gnustep} or send bug
|
||||
reports to @email{bug-gnustep@@gnu.org}.
|
||||
|
||||
@section Obtaining GNUstep Software
|
||||
|
||||
Check out the GNUstep web site. (@url{http://www.gnustep.org/}) and the
|
||||
GNU web site. (@url{http://www.gnu.org/})
|
||||
|
|
|
@ -11,6 +11,137 @@ The currently released version of the library is
|
|||
See the @url{ReleaseNotes.html} document for more information.
|
||||
@end ifclear
|
||||
|
||||
@section Noteworthy changes in version @samp{1.27.0}
|
||||
|
||||
Aside from an assortment of bugfixes, this release includes a lot of
|
||||
improvements for Android support as well as numerous new classes and methods.
|
||||
|
||||
@itemize @bullet
|
||||
@item Expose GNU TLS wrappers and add methods to get certificate expiry.
|
||||
@item Improve thread safety when using zombies, particularly on statup/shutdown.
|
||||
@item Improvements for Ukrainian localization.
|
||||
@item Decreased ICU requirements to 49 to support Windows 2000.
|
||||
@item Simplifications and fixes in GSPrivateSymbolPath().
|
||||
@item GSMime improvements (word encoding specifier, utf-8 improvements encoding
|
||||
quoted words with multibyte characters)
|
||||
@item NSJSONSerialization fixes for codepoints over 0x7f.
|
||||
@item NSCharacterSet support for URL*AllowedCharacterSet and declarations for
|
||||
new character sets.
|
||||
@item NSString implementations for new methods stringByRemovingPercentEncoding/
|
||||
stringByAddingPercentEncodingWithAllowedCharacterSet:.
|
||||
@item Fixed a crash in gdomap when an invalid hostname is given for the -M
|
||||
option.
|
||||
@item In NSString.m, removed functions urldecode() and ishex() which were
|
||||
mistakenly neither namespaced nor declared static and thus could have conflicted
|
||||
with non-library code.
|
||||
@item Fixed libdispatch configuration switch so --enable-libdispatch works
|
||||
correctly; correctly checking for HAVE_LIBDISPATCH_RUNLOOP.
|
||||
@item Updated libdispatch runloop integration so it is compatible with Swift's
|
||||
corelibs libdispatch release (from github.com/apple/swift-corelibs-libdispatch).
|
||||
The libdispatch must be compiled with INSTALL_PRIVATE_HEADERS=YES.
|
||||
@item In NSThread, spinlocks implemented using builtins to be able to target
|
||||
platforms without pthread_spin_lock(), such as Android targeting API level < 24.
|
||||
@item In NSLog on Android, send logs to syslog.
|
||||
@item Implementation of NSOrderedSet.
|
||||
@item When ./configuring, link against libandroid on Android.
|
||||
@item In NSBundle, allow integrating with Android asset manager using +[NSBundle
|
||||
setJavaAssetManager:withJNIEnv:], enabling use of mainBundle's
|
||||
pathForResource:ofType:, -URLForResource:ofType: and similar; referencing
|
||||
Info.plist if it exists in Android assets; use of NSFileManager's
|
||||
fileExistsAtPath: et al and isReadableFileAtPath:; reading files using
|
||||
NSFileHandle APIs; use of NSDirectoryEnumerator to enumerate Android assets from
|
||||
the main bundle.
|
||||
@item In NSBundle, localization support on Android.
|
||||
@item In NSProcessInfo, automatic initialization on Android using a fake
|
||||
executable path (/data/data/<app identifier>/Resources).
|
||||
@item In NSData, improvements in reading Android assets.
|
||||
@item Various improvements in the mechanism to report memory usage of individual
|
||||
objects.
|
||||
@item Skeletal implementation of NSUbiquitousKeyValueStore.
|
||||
@item Implementation of NSByteCountFormatter.
|
||||
@item Fixes to writing large HTTPS requests (GSSocketStream, NSURLProtocol).
|
||||
@item In gdomap.c, fix detection of local networks.
|
||||
@item In NSArray's -removeObjectsInArray:, prevent some crashes.
|
||||
@item In GSTLS, avoid setting session priority twice.
|
||||
@item In NSFileHandle, fix so that setting certificate information does not
|
||||
discard any other options already set.
|
||||
@item In GSXML's -fatalErrorFunction, use the correct function to get the line
|
||||
number.
|
||||
@item In NSOperation's _execute, ensure lock gets released on an error by
|
||||
surrounding with NS_DURING.
|
||||
@item Generics support in NSHashTable.
|
||||
@item Implementation of NSProgress.
|
||||
@item Skeleton implementation of NSURLComponents.
|
||||
@item In NSSortDescriptor, added -sortDescriptorWithKey:ascending:descending:.
|
||||
@item In NSOperationQueue, added -addOperationWithBlock.
|
||||
@item In NSFileManager, added
|
||||
-URLForDirectory:inDomain:appropriateForURL:create:error: and
|
||||
-enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:. Also added
|
||||
NSItemReplacementDirectory constant, and updated stub implementation for
|
||||
-URLForDirectory:shouldCreate:error:. Added -initWithDirectoryPath:... with
|
||||
additional parameters skipHidden and errorHandler.
|
||||
@item In NSDictionary, fixed keysSortedByValueUsingComparator:.
|
||||
@item Moved NSFileWrapper from -gui to -base.
|
||||
@item Added NSFilePresenter, NSFileVersion and NSFileCoordinator.
|
||||
@item Added NSPersonComponents and NSPersonNameComponentsFormatter.
|
||||
@item Added units of measurement classes such as NSUnit, NSMeasurement,
|
||||
NSMeasurementFormatter, NSEnergyFormatter, NSLengthFormatter,
|
||||
NSMassFormatter.
|
||||
@item In NSUnit, support for NSUnitArea, NSUnitConcentrationMass,
|
||||
NSUnitDispersion, NSUnitElectricCharge, NSUnitIlluminance,
|
||||
NSUnitElectricCurrent, NSUnitElectricPotentionDifference, NSElectricResistance,
|
||||
NSUnitMass, NSUnitEnergy, NSUnitFrequency, NSUnitPower, NSUnitSpeed,
|
||||
NSUnitFuelEfficiency, NSUnitPressure, NSUnitVolume, NSUnitLength.
|
||||
@item Support for data directory on Android introduces
|
||||
GSInitializeProcessAndroid and makes use of the path returned by
|
||||
Context.getFilesDir() as the basis for storing data (e.g. NSUserDefaults) and
|
||||
when querying for directory paths (NSLibraryDirectory,
|
||||
NSApplicationSupportDirectory, etc.).
|
||||
@item Placeholder NSScript* classes. Added NSUserActivity, NSObjectScripting,
|
||||
NSHFSFileTypes, NSAppleEventManager and NSAppleEventDescriptor.
|
||||
@item Added NSDateInterval intersectionWithDateInterval:.
|
||||
@item Added NSBackgroundActivityScheduler.
|
||||
@item Added NSISO8601DateFormatter and NSMetadataAttributes.
|
||||
@item Added NSOrtogrpahy and NSLinguisticTagger.
|
||||
@item Added NSExtensionItem, NSExtensionContext, NSExtensionRequestHandling, and
|
||||
NSItemProvider and NSItemProviderReadingWriting.
|
||||
@item Updated timezone info for NSTimeZones.
|
||||
@item On Android, support for NSTemporaryDirectory to use Context.getCacheDir(),
|
||||
and cleaning it up in GSInitializeProcessAndroid() given there is no support for
|
||||
temp directory before Android API 26. Also used with NSCachesDirectory +
|
||||
NSUserDomainMask.
|
||||
@item NSXPCConnection fixes.
|
||||
@item NSException symbolication support using libunwind (used when backtrace()
|
||||
is unavailable).
|
||||
@item Travis build improvements to use new runloop integration and gnustep-2.0
|
||||
runtime.
|
||||
@item In NSKeyValueObserving, implement two missing methods for NSArray:
|
||||
-addObserver:options:context: and
|
||||
-removeObserver:fromObjectsAtIndexes:forKeyPath:.
|
||||
@item Updated NSUUID to use instancetype.
|
||||
@item Added support for NSDate constants in NSPredicate.
|
||||
@item Fixed a NSTimer bug with blocks.
|
||||
@item In GSTLS, do not put password in the hash key of the credentials, and to
|
||||
avoid logging it when debugging is on.
|
||||
@item Improvements in NSConcreteHashTable and NSConcreteMapTable.
|
||||
@item In various places, switch away from deprecated CREATE_AUTORELEASE_POOL()
|
||||
to use the ARC-compatible ENTER_POOL and LEAVE_POOL macros.
|
||||
@item When building the list of hosts to be probed to see if they have gdomap
|
||||
servers, fix code to include those explicitly defined in the config file.
|
||||
Add -S option to list the addresses of the known gdomap servers.
|
||||
@item Backward compatibility fix for ICU 65.
|
||||
@item Update GSPrivateSymbolPath() so that, on the path where LINKER_GETSYMBOL
|
||||
is not available, we attempt to lookup classes using the prefix ._OBJC_CLASS_
|
||||
for the 2.0 ABI (earlier ABIs use a prefix of __objc_class_name_ for the class
|
||||
definition.
|
||||
@item Fix parsing of NSURLResponse content type header.
|
||||
@item Fix for class lookup when using the 2.0 ABI.
|
||||
@item Fixed NSURLComponents setURL: throwing exceptions when URL didn't have
|
||||
all expected parts caused by rangeOfString: throwing for nil values.
|
||||
@item Added NSURLQueryItem implementation.
|
||||
@end itemize
|
||||
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
@section Noteworthy changes in version @samp{1.26.0}
|
||||
@itemize @bullet
|
||||
@item Improve utf8 validity checks.
|
||||
|
@ -46,8 +177,6 @@ scan results.
|
|||
most recent international timezone data.
|
||||
@end itemize
|
||||
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
|
||||
@section Noteworthy changes in version @samp{1.25.1}
|
||||
@itemize @bullet
|
||||
@item Unicode fixes for characters outside the base plane
|
||||
|
|
|
@ -19,7 +19,8 @@ int
|
|||
main()
|
||||
{
|
||||
NSMutableDictionary *d;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
|
||||
ENTER_POOL
|
||||
|
||||
/* Create a Dictionary object. */
|
||||
d = [[NSMutableDictionary alloc] initWithCapacity: 32];
|
||||
|
@ -42,6 +43,6 @@ main()
|
|||
|
||||
NSLog(@"Now there are %u elements stored in the dictionary\n", [d count]);
|
||||
|
||||
DESTROY(pool);
|
||||
LEAVE_POOL
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -465,13 +465,13 @@ con_callback (id prx)
|
|||
k = 1000;
|
||||
for (j = 0; j < k; j++)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
ENTER_POOL
|
||||
[prx unregisterClient: localObj];
|
||||
[prx registerClient: localObj];
|
||||
[prx tryClientCallback];
|
||||
if (j < 10 || j %10 == 0)
|
||||
printf("repeated client registration and callback %d\n", j);
|
||||
RELEASE(arp);
|
||||
LEAVE_POOL
|
||||
}
|
||||
printf("repeated client registration and callback %d\n", j);
|
||||
RELEASE(localObj);
|
||||
|
|
|
@ -133,6 +133,8 @@ extern "C" {
|
|||
|
||||
@end //NSMutableAttributedString
|
||||
|
||||
typedef NSString* NSAttributedStringKey;
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
@ -129,7 +129,7 @@ enum
|
|||
NSCalendarUnitWeekOfMonth = (1UL << 12),
|
||||
NSCalendarUnitWeekOfYear = (1UL << 13),
|
||||
NSCalendarUnitYearForWeekOfYear = (1UL << 14),
|
||||
NSCalendarUnitNanosecond = (1 << 15), // FIXME: unimplemented
|
||||
NSCalendarUnitNanosecond = (1 << 15),
|
||||
NSCalendarUnitCalendar = (1 << 20), // FIXME: unimplemented
|
||||
NSCalendarUnitTimeZone = (1 << 21) // FIXME: unimplemented
|
||||
#endif
|
||||
|
@ -227,6 +227,7 @@ enum
|
|||
* yearForWeekOfYear is 2013, since it's already week 1 in 2013.
|
||||
*/
|
||||
- (NSInteger) yearForWeekOfYear;
|
||||
- (NSInteger) nanosecond;
|
||||
|
||||
/** Sets the number of the week in this month. */
|
||||
- (void) setWeekOfMonth: (NSInteger) v;
|
||||
|
@ -241,8 +242,22 @@ enum
|
|||
* See the explanation at <code>-yearForWeekOfYear</code>.
|
||||
*/
|
||||
- (void) setYearForWeekOfYear: (NSInteger) v;
|
||||
- (void) setNanosecond: (NSInteger) v;
|
||||
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST)
|
||||
- (BOOL) leapMonth;
|
||||
- (void) setLeapMonth: (BOOL) v;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
|
||||
- (BOOL) isValidDate;
|
||||
- (BOOL) isValidDateInCalendar: (NSCalendar *) calendar;
|
||||
- (NSInteger) valueForComponent: (NSCalendarUnit) unit;
|
||||
- (void) setValue: (NSInteger) value
|
||||
forComponent: (NSCalendarUnit) unit;
|
||||
#endif
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@ extern "C" {
|
|||
|
||||
@class NSArray, NSDictionary, NSString;
|
||||
|
||||
typedef NSString* NSErrorDomain;
|
||||
|
||||
/**
|
||||
* Key for user info dictionary component which describes the error in
|
||||
* a human readable format.
|
||||
|
@ -103,20 +105,20 @@ GS_EXPORT NSString* const NSURLErrorFailingURLStringErrorKey;
|
|||
/**
|
||||
* Domain for system errors (on MACH).
|
||||
*/
|
||||
GS_EXPORT NSString* const NSMACHErrorDomain;
|
||||
GS_EXPORT NSErrorDomain const NSMACHErrorDomain;
|
||||
/**
|
||||
* Domain for system errors.
|
||||
*/
|
||||
GS_EXPORT NSString* const NSOSStatusErrorDomain;
|
||||
GS_EXPORT NSErrorDomain const NSOSStatusErrorDomain;
|
||||
/**
|
||||
* Domain for system and system library errors.
|
||||
*/
|
||||
GS_EXPORT NSString* const NSPOSIXErrorDomain;
|
||||
GS_EXPORT NSErrorDomain const NSPOSIXErrorDomain;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST)
|
||||
/**
|
||||
* Domain for Foundation and AppKit (base and gui) errors.
|
||||
*/
|
||||
GS_EXPORT NSString* const NSCocoaErrorDomain;
|
||||
GS_EXPORT NSErrorDomain const NSCocoaErrorDomain;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -150,7 +152,7 @@ GS_EXPORT NSString* const NSCocoaErrorDomain;
|
|||
* Creates and returns an autoreleased NSError instance by calling
|
||||
* -initWithDomain:code:userInfo:
|
||||
*/
|
||||
+ (id) errorWithDomain: (NSString*)aDomain
|
||||
+ (id) errorWithDomain: (NSErrorDomain)aDomain
|
||||
code: (NSInteger)aCode
|
||||
userInfo: (NSDictionary*)aDictionary;
|
||||
|
||||
|
@ -163,13 +165,13 @@ GS_EXPORT NSString* const NSCocoaErrorDomain;
|
|||
/**
|
||||
* Return the domain for this instance.
|
||||
*/
|
||||
- (NSString*) domain;
|
||||
- (NSErrorDomain) domain;
|
||||
|
||||
/** <init />
|
||||
* Initialises the receiver using the supplied domain, code, and info.<br />
|
||||
* The domain must be non-nil.
|
||||
*/
|
||||
- (id) initWithDomain: (NSString*)aDomain
|
||||
- (id) initWithDomain: (NSErrorDomain)aDomain
|
||||
code: (NSInteger)aCode
|
||||
userInfo: (NSDictionary*)aDictionary;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
#if defined(_NATIVE_OBJC_EXCEPTIONS)
|
||||
# define USER_NATIVE_OBJC_EXCEPTIONS 1
|
||||
#elif defined(BASE_NATIVE_OBJC_EXCEPTIONS) && defined(OBJC_ZEROCOST_EXCEPTIONS)
|
||||
#elif BASE_NATIVE_OBJC_EXCEPTIONS && defined(OBJC_ZEROCOST_EXCEPTIONS)
|
||||
# define USER_NATIVE_OBJC_EXCEPTIONS 1
|
||||
# define _NATIVE_OBJC_EXCEPTIONS 1
|
||||
#endif
|
||||
|
@ -59,7 +59,9 @@
|
|||
* implementation of longjmp in mingw-w64 sometimes crashes in msvcrt.dll
|
||||
* but the builtin version provided by gcc seems to work.
|
||||
*/
|
||||
#undef setjmp
|
||||
#define setjmp(X) __builtin_setjmp(X)
|
||||
#undef longjmp
|
||||
#define longjmp(X,Y) __builtin_longjmp(X,Y)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -39,11 +39,16 @@ DEFINE_BLOCK_TYPE(GSFilePresentedItemChangesWithCompletionHandler, void, NSError
|
|||
|
||||
@protocol NSFilePresenter <NSObject>
|
||||
|
||||
// @required
|
||||
- (NSURL *) presentedItemURL;
|
||||
- (NSOperationQueue *) presentedItemOperationQueue;
|
||||
|
||||
// @optional
|
||||
#if GS_PROTOCOLS_HAVE_OPTIONAL
|
||||
@optional
|
||||
#else
|
||||
@end
|
||||
@interface NSObject (NSFilePresenter)
|
||||
#endif
|
||||
|
||||
- (NSURL *) primaryPresentedItemURL;
|
||||
- (NSString *) observedPresentedItemUbiquityAttributes;
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ extern "C" {
|
|||
NSMutableDictionary *_enc; /* Object being encoded. */
|
||||
NSMutableArray *_obj; /* Array of objects. */
|
||||
NSPropertyListFormat _format;
|
||||
BOOL _requiresSecureCoding;
|
||||
#endif
|
||||
#if GS_NONFRAGILE
|
||||
#else
|
||||
|
@ -87,6 +88,18 @@ extern "C" {
|
|||
*/
|
||||
+ (NSData*) archivedDataWithRootObject: (id)anObject;
|
||||
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_13,GS_API_LATEST)
|
||||
/**
|
||||
* Encodes anObject and returns the resulting data object. Allows
|
||||
* secure coding if specified. Returns an error if an object
|
||||
* violates secure coding rules.
|
||||
*/
|
||||
+ (NSData *) archivedDataWithRootObject: (id)anObject
|
||||
requiringSecureCoding: (BOOL)requiresSecureCoding
|
||||
error: (NSError **)error;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Encodes anObject and writes the resulting data ti aPath.
|
||||
*/
|
||||
|
@ -109,6 +122,18 @@ extern "C" {
|
|||
*/
|
||||
+ (void) setClassName: (NSString*)aString forClass: (Class)aClass;
|
||||
|
||||
/**
|
||||
* Returns whether the current instance of the archiver needs secure
|
||||
* coding.
|
||||
*/
|
||||
- (BOOL) requiresSecureCoding;
|
||||
|
||||
/**
|
||||
* Sets whether the current instance of the archiver needs secure
|
||||
* coding.
|
||||
*/
|
||||
- (void) setRequiresSecureCoding: (BOOL)flag;
|
||||
|
||||
/**
|
||||
* Returns any mapping for the name of aClass which was previously set
|
||||
* for the receiver using the -setClassName:forClass: method.<br />
|
||||
|
@ -245,6 +270,7 @@ extern "C" {
|
|||
#undef GSIArray
|
||||
#endif
|
||||
NSZone *_zone; /* Zone for allocating objs. */
|
||||
BOOL _requiresSecureCoding;
|
||||
#endif
|
||||
#if GS_NONFRAGILE
|
||||
#else
|
||||
|
@ -283,6 +309,18 @@ extern "C" {
|
|||
*/
|
||||
+ (id) unarchiveObjectWithFile: (NSString*)aPath;
|
||||
|
||||
/**
|
||||
* Returns whether the current instance of the archiver needs secure
|
||||
* coding.
|
||||
*/
|
||||
- (BOOL) requiresSecureCoding;
|
||||
|
||||
/**
|
||||
* Sets whether the current instance of the archiver needs secure
|
||||
* coding.
|
||||
*/
|
||||
- (void) setRequiresSecureCoding: (BOOL)flag;
|
||||
|
||||
/**
|
||||
* Returns class substituted for class name specified by aString when
|
||||
* encountered in the archive being decoded from, or nil if there is no
|
||||
|
@ -290,7 +328,7 @@ extern "C" {
|
|||
* translation map, which is searched on decoding if no match found here.
|
||||
*/
|
||||
- (Class) classForClassName: (NSString*)aString;
|
||||
|
||||
|
||||
/**
|
||||
* Sets class substituted for class name specified by aString when
|
||||
* encountered in the archive being decoded from, or nil if there is no
|
||||
|
|
|
@ -37,6 +37,7 @@ extern "C" {
|
|||
|
||||
@class NSMutableDictionary;
|
||||
@class NSString;
|
||||
@class NSCharacterSet;
|
||||
|
||||
typedef NSUInteger NSLocaleLanguageDirection;
|
||||
enum
|
||||
|
@ -155,7 +156,7 @@ GS_EXPORT NSString * const NSISO8601Calendar;
|
|||
|
||||
/** Returns the current locale information.
|
||||
*/
|
||||
+ (id) currentLocale;
|
||||
+ (instancetype) currentLocale;
|
||||
|
||||
/** Returns an array of NSString representing all known country codes.
|
||||
*/
|
||||
|
@ -189,7 +190,7 @@ GS_EXPORT NSString * const NSISO8601Calendar;
|
|||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
/** Returns a locale initialised with the given locale identifier.
|
||||
*/
|
||||
+ (id) localeWithLocaleIdentifier:(NSString *)string;
|
||||
+ (instancetype) localeWithLocaleIdentifier:(NSString *)string;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
|
@ -201,7 +202,7 @@ GS_EXPORT NSString * const NSISO8601Calendar;
|
|||
|
||||
/** Returns the the system locale.
|
||||
*/
|
||||
+ (id) systemLocale;
|
||||
+ (instancetype) systemLocale;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
/** Returns the windows locale code corresponding to the staqndard locale
|
||||
|
@ -215,12 +216,12 @@ GS_EXPORT NSString * const NSISO8601Calendar;
|
|||
* on the basis that it represents information whose type is specified by
|
||||
* the key.
|
||||
*/
|
||||
- (NSString *) displayNameForKey: (id)key value: (id)value;
|
||||
- (NSString *) displayNameForKey: (NSString *)key value: (id)value;
|
||||
|
||||
/** Initialises the receiver to be the locale specified by the identifier.
|
||||
* This may result in replacement of the receiver by an existing locale.
|
||||
*/
|
||||
- (id) initWithLocaleIdentifier: (NSString *)string;
|
||||
- (instancetype) initWithLocaleIdentifier: (NSString *)string;
|
||||
|
||||
/** Returns the canonical identifier for the receiver (which
|
||||
* may differ from the identifgier used to create the receiver
|
||||
|
@ -232,6 +233,16 @@ GS_EXPORT NSString * const NSISO8601Calendar;
|
|||
*/
|
||||
- (id) objectForKey: (id)key;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_12, GS_API_LATEST)
|
||||
- (NSString *) languageCode;
|
||||
- (NSString *) countryCode;
|
||||
- (NSString *) scriptCode;
|
||||
- (NSString *) variantCode;
|
||||
- (NSCharacterSet *) exemplarCharacterSet;
|
||||
- (NSString *) collationIdentifier;
|
||||
- (NSString *) collatorIdentifier;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
@ -43,6 +43,8 @@ extern "C" {
|
|||
@class NSLock;
|
||||
@class NSOperationQueue;
|
||||
|
||||
typedef NSString* NSNotificationName;
|
||||
|
||||
@interface NSNotification : NSObject <NSCopying, NSCoding>
|
||||
|
||||
/* Creating a Notification Object */
|
||||
|
|
|
@ -279,6 +279,11 @@ DEFINE_BLOCK_TYPE(NSComparator, NSComparisonResult, id, id);
|
|||
*/
|
||||
#define FOUNDATION_EXPORT GS_EXPORT
|
||||
|
||||
/**
|
||||
* Declare NSExceptionName
|
||||
*/
|
||||
typedef NSString* NSExceptionName;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -93,7 +93,7 @@ typedef NSInteger NSOperationQueuePriority;
|
|||
/** Returns all the dependencies of the receiver in the order in which they
|
||||
* were added.
|
||||
*/
|
||||
- (NSArray *)dependencies;
|
||||
- (NSArray *) dependencies;
|
||||
|
||||
/** This method should return YES if the -cancel method has been called.<br />
|
||||
* NB. a cancelled operation may still be executing.
|
||||
|
@ -208,8 +208,8 @@ typedef NSInteger NSOperationQueuePriority;
|
|||
}
|
||||
|
||||
// Managing the blocks in the Operation
|
||||
+ (instancetype)blockOperationWithBlock: (GSBlockOperationBlock)block;
|
||||
- (void)addExecutionBlock: (GSBlockOperationBlock)block;
|
||||
+ (instancetype) blockOperationWithBlock: (GSBlockOperationBlock)block;
|
||||
- (void) addExecutionBlock: (GSBlockOperationBlock)block;
|
||||
- (NSArray *) executionBlocks;
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/** Interface for NSPropertyList for GNUstep
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004-2020 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
||||
Date: January 2004
|
||||
|
@ -117,12 +117,16 @@ typedef NSUInteger NSPropertyListFormat;
|
|||
* </desc>
|
||||
* <term>[NSData]</term>
|
||||
* <desc>
|
||||
* An array is represented as a series of pairs of hexadecimal characters
|
||||
* (each pair representing a byte of data) enclosed in angle brackets.
|
||||
* Spaces are ignored).
|
||||
* A data object is represented as a series of pairs of hexadecimal
|
||||
* characters (each pair representing a byte of data) enclosed in angle
|
||||
* brackets. (Spaces are ignored).
|
||||
* <example>
|
||||
* < 54637374 696D67 >
|
||||
* </example>
|
||||
* Base64 can be used since Base 1.24.9:
|
||||
* <example>
|
||||
* <[VGNzdGltZw==]>
|
||||
* </example>
|
||||
* In XML format, a data object is an element whose name is
|
||||
* <code>data</code> and whose content is a stream of base64 encoded bytes.
|
||||
* </desc>
|
||||
|
@ -160,13 +164,13 @@ typedef NSUInteger NSPropertyListFormat;
|
|||
* }
|
||||
* </example>
|
||||
* In XML format, a dictionary is an element whose name is
|
||||
* <code>dictionary</code> and whose content consists of pairs of
|
||||
* strings and other <em>property list</em> objects.
|
||||
* <code>dict</code> and whose content consists of pairs of
|
||||
* string <code>key</code> and other <em>property list</em> objects.
|
||||
* <example>
|
||||
* <dictionary>
|
||||
* <string>key1</string>
|
||||
* <dict>
|
||||
* <key>key1</key>
|
||||
* <string>value1</string>
|
||||
* </dictionary>
|
||||
* </dict>
|
||||
* </example>
|
||||
* </desc>
|
||||
* <term>[NSNumber]</term>
|
||||
|
|
|
@ -85,16 +85,16 @@ enum
|
|||
* Calls -initFileURLWithPath: which escapes characters in the
|
||||
* path where necessary.
|
||||
*/
|
||||
+ (id) fileURLWithPath: (NSString*)aPath;
|
||||
+ (instancetype) fileURLWithPath: (NSString*)aPath;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST)
|
||||
/** Creates a file URL using a path built from components.
|
||||
*/
|
||||
+ (NSURL*) fileURLWithPathComponents: (NSArray*)components;
|
||||
+ (instancetype) fileURLWithPathComponents: (NSArray*)components;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
+ (id) fileURLWithPath: (NSString*)aPath isDirectory: (BOOL)isDir;
|
||||
+ (instancetype) fileURLWithPath: (NSString*)aPath isDirectory: (BOOL)isDir;
|
||||
#endif
|
||||
/**
|
||||
* Create and return a URL with the supplied string, which should
|
||||
|
@ -102,12 +102,12 @@ enum
|
|||
* conforming to the description (in RFC2396) of an absolute URL.<br />
|
||||
* Calls -initWithString:
|
||||
*/
|
||||
+ (id) URLWithString: (NSString*)aUrlString;
|
||||
+ (instancetype) URLWithString: (NSString*)aUrlString;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
|
||||
+ (id) URLByResolvingAliasFileAtURL: (NSURL*)url
|
||||
options: (NSURLBookmarkResolutionOptions)options
|
||||
error: (NSError**)error;
|
||||
+ (instancetype) URLByResolvingAliasFileAtURL: (NSURL*)url
|
||||
options: (NSURLBookmarkResolutionOptions)options
|
||||
error: (NSError**)error;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -116,8 +116,8 @@ enum
|
|||
* conforming to the description (in RFC2396) of a relative URL.<br />
|
||||
* Calls -initWithString:relativeToURL:
|
||||
*/
|
||||
+ (id) URLWithString: (NSString*)aUrlString
|
||||
relativeToURL: (NSURL*)aBaseUrl;
|
||||
+ (instancetype) URLWithString: (NSString*)aUrlString
|
||||
relativeToURL: (NSURL*)aBaseUrl;
|
||||
|
||||
/**
|
||||
* Initialise as a file URL with the specified path (which must
|
||||
|
@ -128,7 +128,7 @@ enum
|
|||
* specifies a directory.<br />
|
||||
* Calls -initWithScheme:host:path:
|
||||
*/
|
||||
- (id) initFileURLWithPath: (NSString*)aPath;
|
||||
- (instancetype) initFileURLWithPath: (NSString*)aPath;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST)
|
||||
/**
|
||||
|
@ -140,7 +140,8 @@ enum
|
|||
* specifies a directory.<br />
|
||||
* Calls -initWithScheme:host:path:
|
||||
*/
|
||||
- (id) initFileURLWithPath: (NSString*)aPath isDirectory: (BOOL)isDir;
|
||||
- (instancetype) initFileURLWithPath: (NSString*)aPath
|
||||
isDirectory: (BOOL)isDir;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -154,15 +155,15 @@ enum
|
|||
* Permits the 'aHost' part to contain 'username:password@host:port' or
|
||||
* 'host:port' in addition to a simple host name or address.
|
||||
*/
|
||||
- (id) initWithScheme: (NSString*)aScheme
|
||||
host: (NSString*)aHost
|
||||
path: (NSString*)aPath;
|
||||
- (instancetype) initWithScheme: (NSString*)aScheme
|
||||
host: (NSString*)aHost
|
||||
path: (NSString*)aPath;
|
||||
|
||||
/**
|
||||
* Initialise as an absolute URL.<br />
|
||||
* Calls -initWithString:relativeToURL:
|
||||
*/
|
||||
- (id) initWithString: (NSString*)aUrlString;
|
||||
- (instancetype) initWithString: (NSString*)aUrlString;
|
||||
|
||||
/** <init />
|
||||
* Initialised using aUrlString and aBaseUrl. The value of aBaseUrl
|
||||
|
@ -172,8 +173,8 @@ enum
|
|||
* Parses an empty string as an empty path.<br />
|
||||
* If the string cannot be parsed the method returns nil.
|
||||
*/
|
||||
- (id) initWithString: (NSString*)aUrlString
|
||||
relativeToURL: (NSURL*)aBaseUrl;
|
||||
- (instancetype) initWithString: (NSString*)aUrlString
|
||||
relativeToURL: (NSURL*)aBaseUrl;
|
||||
|
||||
#if GS_HAS_DECLARED_PROPERTIES
|
||||
@property (readonly, getter=isFileURL) BOOL fileURL;
|
||||
|
@ -699,8 +700,6 @@ GS_NSURLComponents_IVARS;
|
|||
- (NSArray *) percentEncodedQueryItems;
|
||||
- (void) setPercentEncodedQueryItems: (NSArray *)queryItems;
|
||||
#endif
|
||||
- (NSString *) percentEncodedScheme;
|
||||
- (void) setPercentEncodedScheme: (NSString *)scheme;
|
||||
- (NSString *) percentEncodedUser;
|
||||
- (void) setPercentEncodedUser: (NSString *)user;
|
||||
|
||||
|
|
|
@ -171,7 +171,8 @@ extern "C" {
|
|||
* The cachedResponse may be the result of a previous load of the
|
||||
* request (in which case the protocol may validate and use it).<br />
|
||||
* The client is the object which receives messages about the progress
|
||||
* of the load.
|
||||
* of the load. This is retained by the protocl instance and is released
|
||||
* once the last message has been sent to it.
|
||||
*/
|
||||
- (id) initWithRequest: (NSURLRequest *)request
|
||||
cachedResponse: (NSCachedURLResponse *)cachedResponse
|
||||
|
|
|
@ -99,15 +99,15 @@ typedef NSUInteger NSURLRequestCachePolicy;
|
|||
* and with the default cache policy (NSURLRequestUseProtocolCachePolicy)
|
||||
* and a sixty second timeout.
|
||||
*/
|
||||
+ (id) requestWithURL: (NSURL *)URL;
|
||||
+ (instancetype) requestWithURL: (NSURL *)URL;
|
||||
|
||||
/**
|
||||
* Returns an autoreleased instance initialised with the specified URL,
|
||||
* cachePolicy, and timeoutInterval.
|
||||
*/
|
||||
+ (id) requestWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval;
|
||||
+ (instancetype) requestWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval;
|
||||
|
||||
/**
|
||||
* Returns the cache policy associated with the receiver.
|
||||
|
@ -119,15 +119,15 @@ typedef NSUInteger NSURLRequestCachePolicy;
|
|||
* and with the default cache policy (NSURLRequestUseProtocolCachePolicy)
|
||||
* and a sixty second timeout.
|
||||
*/
|
||||
- (id) initWithURL: (NSURL *)URL;
|
||||
- (instancetype) initWithURL: (NSURL *)URL;
|
||||
|
||||
/**
|
||||
* Initialises the receiver with the specified URL,
|
||||
* cachePolicy, and timeoutInterval.
|
||||
*/
|
||||
- (id) initWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval;
|
||||
- (instancetype) initWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval;
|
||||
|
||||
/**
|
||||
* Returns the main document URL for the receiver.<br />
|
||||
|
|
|
@ -50,9 +50,9 @@ typedef uint8_t gsuuid_t[16];
|
|||
gsuuid_t uuid;
|
||||
}
|
||||
|
||||
+ (id)UUID;
|
||||
- (id)initWithUUIDString:(NSString *)string;
|
||||
- (id)initWithUUIDBytes:(gsuuid_t)bytes;
|
||||
+ (instancetype)UUID;
|
||||
- (instancetype)initWithUUIDString:(NSString *)string;
|
||||
- (instancetype)initWithUUIDBytes:(gsuuid_t)bytes;
|
||||
- (NSString *)UUIDString;
|
||||
- (void)getUUIDBytes:(gsuuid_t)bytes;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSData, NSDictionary, NSError, NSString, NSURL;
|
||||
@class NSData, NSDictionary, NSError, NSInputStream, NSString, NSURL;
|
||||
|
||||
/**
|
||||
* Domain for errors
|
||||
|
@ -100,12 +100,17 @@ GS_EXPORT NSString* const NSXMLParserErrorDomain;
|
|||
/**
|
||||
* Convenience method fetching data from anURL.<br />
|
||||
*/
|
||||
- (id) initWithContentsOfURL: (NSURL*)anURL;
|
||||
- (instancetype) initWithContentsOfURL: (NSURL*)anURL;
|
||||
|
||||
/** <init />
|
||||
* Initialises the parser with the specified xml data.
|
||||
*/
|
||||
- (id) initWithData: (NSData*)data;
|
||||
- (instancetype) initWithData: (NSData*)data;
|
||||
|
||||
/**
|
||||
* Initialises the parser with the specified input stream.
|
||||
*/
|
||||
- (instancetype) initWithStream: (NSInputStream*)stream;
|
||||
|
||||
/**
|
||||
* Parses the supplied data and returns YES on success, NO otherwise.
|
||||
|
|
|
@ -28,8 +28,15 @@
|
|||
#include <Foundation/NSObject.h>
|
||||
#include <Foundation/NSError.h>
|
||||
|
||||
#include <sys/types.h> // for gid_t and uid_t
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST)
|
||||
|
||||
#if defined (__MINGW__)
|
||||
typedef unsigned gid_t;
|
||||
typedef unsigned uid_t;
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -61,15 +68,13 @@ typedef NSUInteger NSXPCConnectionOptions;
|
|||
|
||||
@interface NSXPCConnection : NSObject <NSXPCProxyCreating>
|
||||
|
||||
- (instancetype)initWithServiceName:(NSString *)serviceName;
|
||||
|
||||
- (NSString *) serviceName;
|
||||
- (void) setServiceName: (NSString *)serviceName;
|
||||
|
||||
- (instancetype)initWithMachServiceName:(NSString *)name options:(NSXPCConnectionOptions)options;
|
||||
- (instancetype) initWithListenerEndpoint: (NSXPCListenerEndpoint *)endpoint;
|
||||
|
||||
- (instancetype)initWithListenerEndpoint:(NSXPCListenerEndpoint *)endpoint;
|
||||
- (instancetype) initWithMachServiceName: (NSString *)name
|
||||
options: (NSXPCConnectionOptions)options;
|
||||
|
||||
- (instancetype) initWithServiceName:(NSString *)serviceName;
|
||||
|
||||
- (NSXPCListenerEndpoint *) endpoint;
|
||||
- (void) setEndpoint: (NSXPCListenerEndpoint *) endpoint;
|
||||
|
||||
|
@ -85,7 +90,11 @@ typedef NSUInteger NSXPCConnectionOptions;
|
|||
|
||||
- (id) remoteObjectProxyWithErrorHandler:(GSXPCProxyErrorHandler)handler;
|
||||
|
||||
- (id) synchronousRemoteObjectProxyWithErrorHandler:(GSXPCProxyErrorHandler)handler;
|
||||
- (NSString *) serviceName;
|
||||
- (void) setServiceName: (NSString *)serviceName;
|
||||
|
||||
- (id) synchronousRemoteObjectProxyWithErrorHandler:
|
||||
(GSXPCProxyErrorHandler)handler;
|
||||
|
||||
- (GSXPCInterruptionHandler) interruptionHandler;
|
||||
- (void) setInterruptionHandler: (GSXPCInterruptionHandler)handler;
|
||||
|
@ -100,9 +109,9 @@ typedef NSUInteger NSXPCConnectionOptions;
|
|||
- (void) invalidate;
|
||||
|
||||
- (NSUInteger) auditSessionIdentifier;
|
||||
- (NSUInteger) processIdentifier;
|
||||
- (NSUInteger) effectiveUserIdentifier;
|
||||
- (NSUInteger) effectiveGroupIdentifier;
|
||||
- (pid_t) processIdentifier;
|
||||
- (uid_t) effectiveUserIdentifier;
|
||||
- (gid_t) effectiveGroupIdentifier;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -131,7 +140,8 @@ typedef NSUInteger NSXPCConnectionOptions;
|
|||
|
||||
@protocol NSXPCListenerDelegate <NSObject>
|
||||
|
||||
- (BOOL) listener: (NSXPCListener *)listener shouldAcceptNewConnection: (NSXPCConnection *)newConnection;
|
||||
- (BOOL) listener: (NSXPCListener *)listener
|
||||
shouldAcceptNewConnection: (NSXPCConnection *)newConnection;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -142,13 +152,23 @@ typedef NSUInteger NSXPCConnectionOptions;
|
|||
- (Protocol *) protocol;
|
||||
- (void) setProtocol: (Protocol *)protocol;
|
||||
|
||||
- (void) setClasses: (NSSet *)classes forSelector: (SEL)sel argumentIndex: (NSUInteger)arg ofReply: (BOOL)ofReply;
|
||||
- (void) setClasses: (NSSet *)classes
|
||||
forSelector: (SEL)sel
|
||||
argumentIndex: (NSUInteger)arg
|
||||
ofReply: (BOOL)ofReply;
|
||||
|
||||
- (NSSet *) classesForSelector: (SEL)sel argumentIndex: (NSUInteger)arg ofReply: (BOOL)ofReply;
|
||||
- (NSSet *) classesForSelector: (SEL)sel
|
||||
argumentIndex: (NSUInteger)arg
|
||||
ofReply: (BOOL)ofReply;
|
||||
|
||||
- (void) setInterface: (NSXPCInterface *)ifc forSelector: (SEL)sel argumentIndex: (NSUInteger)arg ofReply: (BOOL)ofReply;
|
||||
- (void) setInterface: (NSXPCInterface *)ifc
|
||||
forSelector: (SEL)sel
|
||||
argumentIndex: (NSUInteger)arg
|
||||
ofReply: (BOOL)ofReply;
|
||||
|
||||
- (NSXPCInterface *) interfaceForSelector: (SEL)sel argumentIndex: (NSUInteger)arg ofReply: (BOOL)ofReply;
|
||||
- (NSXPCInterface *) interfaceForSelector: (SEL)sel
|
||||
argumentIndex: (NSUInteger)arg
|
||||
ofReply: (BOOL)ofReply;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -80,6 +80,9 @@
|
|||
#ifndef ASSIGNCOPY
|
||||
#define ASSIGNCOPY(object,value) object = [(value) copy]
|
||||
#endif
|
||||
#ifndef ASSIGNMUTABLECOPY
|
||||
#define ASSIGNMUTABLECOPY(object,value) object = [(value) mutableCopy]
|
||||
#endif
|
||||
#ifndef DESTROY
|
||||
#define DESTROY(object) object = nil
|
||||
#endif
|
||||
|
@ -103,8 +106,7 @@
|
|||
#ifndef RETAIN
|
||||
/**
|
||||
* Basic retain operation ... calls [NSObject-retain]<br />
|
||||
* Deprecated ... pointless on modern processors.
|
||||
* Simply call the -retain method.
|
||||
* Does nothing when ARC is in use.
|
||||
*/
|
||||
#define RETAIN(object) [(object) retain]
|
||||
#endif
|
||||
|
@ -112,8 +114,7 @@
|
|||
#ifndef RELEASE
|
||||
/**
|
||||
* Basic release operation ... calls [NSObject-release]<br />
|
||||
* Deprecated ... pointless on modern processors.
|
||||
* Simply call the -release method.
|
||||
* Does nothing when ARC is in use.
|
||||
*/
|
||||
#define RELEASE(object) [(object) release]
|
||||
#endif
|
||||
|
@ -121,8 +122,7 @@
|
|||
#ifndef AUTORELEASE
|
||||
/**
|
||||
* Basic autorelease operation ... calls [NSObject-autorelease]<br />
|
||||
* Deprecated ... pointless on modern processors.
|
||||
* Simply call the -autorelease method.
|
||||
* Does nothing when ARC is in use.
|
||||
*/
|
||||
#define AUTORELEASE(object) [(object) autorelease]
|
||||
#endif
|
||||
|
@ -131,8 +131,7 @@
|
|||
/**
|
||||
* Tested retain - only invoke the
|
||||
* objective-c method if the receiver is not nil.<br />
|
||||
* Deprecated ... pointless on modern processors.
|
||||
* Simply call the -retain method.
|
||||
* Does nothing when ARC is in use.
|
||||
*/
|
||||
#define TEST_RETAIN(object) ({\
|
||||
id __object = (object); (__object != nil) ? [__object retain] : nil; })
|
||||
|
@ -142,8 +141,7 @@ id __object = (object); (__object != nil) ? [__object retain] : nil; })
|
|||
/**
|
||||
* Tested release - only invoke the
|
||||
* objective-c method if the receiver is not nil.<br />
|
||||
* Deprecated ... pointless on modern processors.
|
||||
* Simply call the -release method.
|
||||
* Does nothing when ARC is in use.
|
||||
*/
|
||||
#define TEST_RELEASE(object) ({\
|
||||
id __object = (object); if (__object != nil) [__object release]; })
|
||||
|
@ -153,8 +151,7 @@ id __object = (object); if (__object != nil) [__object release]; })
|
|||
/**
|
||||
* Tested autorelease - only invoke the
|
||||
* objective-c method if the receiver is not nil.<br />
|
||||
* Deprecated ... pointless on modern processors.
|
||||
* Simply call the -autorelease method.
|
||||
* Does nothing when ARC is in use.
|
||||
*/
|
||||
#define TEST_AUTORELEASE(object) ({\
|
||||
id __object = (object); (__object != nil) ? [__object autorelease] : nil; })
|
||||
|
@ -186,6 +183,19 @@ id __object = (object); (__object != nil) ? [__object autorelease] : nil; })
|
|||
})
|
||||
#endif
|
||||
|
||||
#ifndef ASSIGNMUTABLECOPY
|
||||
/**
|
||||
* ASSIGNMUTABLECOPY(object,value) assigns a mutable copy of the value
|
||||
* to the object with release of the original.<br />
|
||||
* Use this to avoid retain/release errors.
|
||||
*/
|
||||
#define ASSIGNMUTABLECOPY(object,value) ({\
|
||||
id __object = object; \
|
||||
object = [(value) mutableCopy];\
|
||||
[__object release]; \
|
||||
})
|
||||
#endif
|
||||
|
||||
#ifndef DESTROY
|
||||
/**
|
||||
* DESTROY() is a release operation which also sets the variable to be
|
||||
|
|
|
@ -262,7 +262,6 @@ typedef struct {
|
|||
#define OBJC2RUNTIME @OBJC2RUNTIME@
|
||||
#define BASE_NATIVE_OBJC_EXCEPTIONS @BASE_NATIVE_OBJC_EXCEPTIONS@
|
||||
#define GS_NONFRAGILE @GS_NONFRAGILE@
|
||||
#define GS_MIXEDABI @GS_MIXEDABI@
|
||||
#define GS_USE_LIBXML @HAVE_LIBXML@
|
||||
#define GS_USE_GNUTLS @HAVE_GNUTLS@
|
||||
#define GS_USE_AVAHI @HAVE_AVAHI@
|
||||
|
@ -307,12 +306,17 @@ typedef struct {
|
|||
#define WINVER Windows2000
|
||||
#endif
|
||||
|
||||
#if defined(__WIN64__)
|
||||
#include <winsock2.h>
|
||||
// Trick to distinguish between MSYS/MinGW and MSYS2/MinGW32, the latter defines
|
||||
// __MINGW32_MAJOR_VERSION and __MINGW32_MINOR_VERSION for compatibility
|
||||
// but to a lower version than older MSYS/MinGW, but not the compound version
|
||||
//
|
||||
#if defined(__MINGW32_VERSION)
|
||||
#define __USE_W32_SOCKETS
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#undef __OBJC_BOOL
|
||||
|
|
|
@ -543,8 +543,9 @@ GSIMapRemangleBuckets(GSIMapTable map,
|
|||
GSIMapBucket bkt;
|
||||
|
||||
GSIMapRemoveNodeFromBucket(old_buckets, node);
|
||||
bkt = GSIMapPickBucket(GSI_MAP_HASH(map, GSI_MAP_READ_KEY(map, &node->key)),
|
||||
new_buckets, new_bucketCount);
|
||||
bkt = GSIMapPickBucket(GSI_MAP_HASH(map,
|
||||
GSI_MAP_READ_KEY(map, &node->key)),
|
||||
new_buckets, new_bucketCount);
|
||||
GSIMapAddNodeToBucket(bkt, node);
|
||||
}
|
||||
}
|
||||
|
@ -561,8 +562,9 @@ GSIMapRemangleBuckets(GSIMapTable map,
|
|||
GSIMapBucket bkt;
|
||||
|
||||
GSIMapRemoveNodeFromBucket(old_buckets, node);
|
||||
bkt = GSIMapPickBucket(GSI_MAP_HASH(map, GSI_MAP_READ_KEY(map, &node->key)),
|
||||
new_buckets, new_bucketCount);
|
||||
bkt = GSIMapPickBucket(GSI_MAP_HASH(map,
|
||||
GSI_MAP_READ_KEY(map, &node->key)),
|
||||
new_buckets, new_bucketCount);
|
||||
GSIMapAddNodeToBucket(bkt, node);
|
||||
}
|
||||
old_buckets++;
|
||||
|
@ -987,9 +989,7 @@ GSIMapEnumeratorNextNode(GSIMapEnumerator enumerator)
|
|||
*/
|
||||
GS_STATIC_INLINE NSUInteger
|
||||
GSIMapCountByEnumeratingWithStateObjectsCount(GSIMapTable map,
|
||||
NSFastEnumerationState *state,
|
||||
id *stackbuf,
|
||||
NSUInteger len)
|
||||
NSFastEnumerationState *state, id *stackbuf, NSUInteger len)
|
||||
{
|
||||
NSInteger count;
|
||||
NSInteger i;
|
||||
|
@ -1011,7 +1011,7 @@ GSIMapCountByEnumeratingWithStateObjectsCount(GSIMapTable map,
|
|||
/* Construct the real enumerator */
|
||||
if (0 == state->state)
|
||||
{
|
||||
enumerator = GSIMapEnumeratorForMap(map);
|
||||
enumerator = GSIMapEnumeratorForMap(map);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -283,20 +283,15 @@
|
|||
* in the class source itsself
|
||||
*/
|
||||
|
||||
#if GS_MIXEDABI
|
||||
# undef GS_NONFRAGILE
|
||||
# define GS_NONFRAGILE 0 /* Mixed is treated as fragile */
|
||||
#if (__has_feature(objc_nonfragile_abi))
|
||||
# if !GS_NONFRAGILE
|
||||
# if defined(GNUSTEP_BASE_INTERNAL)
|
||||
# error "You are building gnustep-base using the objc-nonfragile-abi but your gnustep-base was not configured to use it."
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# if (__has_feature(objc_nonfragile_abi))
|
||||
# if !GS_NONFRAGILE
|
||||
# if defined(GNUSTEP_BASE_INTERNAL)
|
||||
# error "You are building gnustep-base using the objc-nonfragile-abi but your gnustep-base was not configured to use it."
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# if GS_NONFRAGILE
|
||||
# error "Your gnustep-base was configured for the objc-nonfragile-abi but you are not using it now."
|
||||
# endif
|
||||
# if GS_NONFRAGILE
|
||||
# error "Your gnustep-base was configured for the objc-nonfragile-abi but you are not using it now."
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSStream.h>
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
@ -222,6 +223,8 @@ extern "C" {
|
|||
withContentsOfURL: (NSURL*)url;
|
||||
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
||||
withData: (NSData*)data;
|
||||
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
||||
withInputStream: (NSInputStream*)stream;
|
||||
|
||||
- (BOOL) keepBlanks: (BOOL)yesno;
|
||||
- (NSInteger) lineNumber;
|
||||
|
|
|
@ -570,6 +570,18 @@
|
|||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if `st_birthtimespec' is a member of `struct stat64'. */
|
||||
#undef HAVE_STRUCT_STAT64_ST_BIRTHTIMESPEC
|
||||
|
||||
/* Define to 1 if `st_birthtim' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BIRTHTIM
|
||||
|
||||
/* Define to 1 if `st_birthtime' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BIRTHTIME
|
||||
|
||||
/* Define to 1 if `st_birthtimespec' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC
|
||||
|
||||
/* Define to 1 if you have the `symlink' function. */
|
||||
#undef HAVE_SYMLINK
|
||||
|
||||
|
@ -743,6 +755,9 @@
|
|||
/* Define to 1 if you have the `usleep' function. */
|
||||
#undef HAVE_USLEEP
|
||||
|
||||
/* Define to 1 if you have the `utimensat' function. */
|
||||
#undef HAVE_UTIMENSAT
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#undef HAVE_UTIME_H
|
||||
|
||||
|
@ -770,6 +785,9 @@
|
|||
/* Define to 1 if you have the <windows.h> header file. */
|
||||
#undef HAVE_WINDOWS_H
|
||||
|
||||
/* Define to 1 if you have the <ws2tcpip.h> header file. */
|
||||
#undef HAVE_WS2TCPIP_H
|
||||
|
||||
/* Define to 1 if you have the <zlib.h> header file. */
|
||||
#undef HAVE_ZLIB_H
|
||||
|
||||
|
@ -784,6 +802,9 @@
|
|||
*/
|
||||
#undef HAVE__DISPATCH_MAIN_QUEUE_CALLBACK_4CF
|
||||
|
||||
/* Define to 1 if you have the `_Unwind_GetIP' function. */
|
||||
#undef HAVE__UNWIND_GETIP
|
||||
|
||||
/* Define to 1 if you have the `__builtin_extract_return_address' function. */
|
||||
#undef HAVE___BUILTIN_EXTRACT_RETURN_ADDRESS
|
||||
|
||||
|
@ -893,6 +914,9 @@
|
|||
/* Define if vsprintf returns the length printed */
|
||||
#undef VSPRINTF_RETURNS_LENGTH
|
||||
|
||||
/* Have and use Unwind library */
|
||||
#undef WITH_UNWIND
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
|
|
|
@ -910,7 +910,6 @@ NSXMLNodeOptions:
|
|||
NSXMLParser:
|
||||
@class NSInputStream
|
||||
|
||||
- initWithStream:
|
||||
- parseError
|
||||
-------------------------------------------------------------
|
||||
NSZone:
|
311
NEWS
311
NEWS
|
@ -1,11 +1,156 @@
|
|||
1 News
|
||||
******
|
||||
|
||||
The currently released version of the library is '1.26.0'.
|
||||
The currently released version of the library is '1.27.0'.
|
||||
|
||||
See the <ReleaseNotes.html> document for more information.
|
||||
|
||||
1.1 Noteworthy changes in version '1.26.0'
|
||||
1.1 Noteworthy changes in version '1.27.0'
|
||||
==========================================
|
||||
|
||||
Aside from an assortment of bugfixes, this release includes a lot of
|
||||
improvements for Android support as well as numerous new classes and
|
||||
methods.
|
||||
|
||||
* Expose GNU TLS wrappers and add methods to get certificate expiry.
|
||||
* Improve thread safety when using zombies, particularly on
|
||||
statup/shutdown.
|
||||
* Improvements for Ukrainian localization.
|
||||
* Decreased ICU requirements to 49 to support Windows 2000.
|
||||
* Simplifications and fixes in GSPrivateSymbolPath().
|
||||
* GSMime improvements (word encoding specifier, utf-8 improvements
|
||||
encoding quoted words with multibyte characters)
|
||||
* NSJSONSerialization fixes for codepoints over 0x7f.
|
||||
* NSCharacterSet support for URL*AllowedCharacterSet and declarations
|
||||
for new character sets.
|
||||
* NSString implementations for new methods
|
||||
stringByRemovingPercentEncoding/
|
||||
stringByAddingPercentEncodingWithAllowedCharacterSet:.
|
||||
* Fixed a crash in gdomap when an invalid hostname is given for the
|
||||
-M option.
|
||||
* In NSString.m, removed functions urldecode() and ishex() which were
|
||||
mistakenly neither namespaced nor declared static and thus could
|
||||
have conflicted with non-library code.
|
||||
* Fixed libdispatch configuration switch so -enable-libdispatch works
|
||||
correctly; correctly checking for HAVE_LIBDISPATCH_RUNLOOP.
|
||||
* Updated libdispatch runloop integration so it is compatible with
|
||||
Swift's corelibs libdispatch release (from
|
||||
github.com/apple/swift-corelibs-libdispatch). The libdispatch must
|
||||
be compiled with INSTALL_PRIVATE_HEADERS=YES.
|
||||
* In NSThread, spinlocks implemented using builtins to be able to
|
||||
target platforms without pthread_spin_lock(), such as Android
|
||||
targeting API level < 24.
|
||||
* In NSLog on Android, send logs to syslog.
|
||||
* Implementation of NSOrderedSet.
|
||||
* When ./configuring, link against libandroid on Android.
|
||||
* In NSBundle, allow integrating with Android asset manager using
|
||||
+[NSBundle setJavaAssetManager:withJNIEnv:], enabling use of
|
||||
mainBundle's pathForResource:ofType:, -URLForResource:ofType: and
|
||||
similar; referencing Info.plist if it exists in Android assets; use
|
||||
of NSFileManager's fileExistsAtPath: et al and
|
||||
isReadableFileAtPath:; reading files using NSFileHandle APIs; use
|
||||
of NSDirectoryEnumerator to enumerate Android assets from the main
|
||||
bundle.
|
||||
* In NSBundle, localization support on Android.
|
||||
* In NSProcessInfo, automatic initialization on Android using a fake
|
||||
executable path (/data/data/<app identifier>/Resources).
|
||||
* In NSData, improvements in reading Android assets.
|
||||
* Various improvements in the mechanism to report memory usage of
|
||||
individual objects.
|
||||
* Skeletal implementation of NSUbiquitousKeyValueStore.
|
||||
* Implementation of NSByteCountFormatter.
|
||||
* Fixes to writing large HTTPS requests (GSSocketStream,
|
||||
NSURLProtocol).
|
||||
* In gdomap.c, fix detection of local networks.
|
||||
* In NSArray's -removeObjectsInArray:, prevent some crashes.
|
||||
* In GSTLS, avoid setting session priority twice.
|
||||
* In NSFileHandle, fix so that setting certificate information does
|
||||
not discard any other options already set.
|
||||
* In GSXML's -fatalErrorFunction, use the correct function to get the
|
||||
line number.
|
||||
* In NSOperation's _execute, ensure lock gets released on an error by
|
||||
surrounding with NS_DURING.
|
||||
* Generics support in NSHashTable.
|
||||
* Implementation of NSProgress.
|
||||
* Skeleton implementation of NSURLComponents.
|
||||
* In NSSortDescriptor, added
|
||||
-sortDescriptorWithKey:ascending:descending:.
|
||||
* In NSOperationQueue, added -addOperationWithBlock.
|
||||
* In NSFileManager, added
|
||||
-URLForDirectory:inDomain:appropriateForURL:create:error: and
|
||||
-enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:.
|
||||
Also added NSItemReplacementDirectory constant, and updated stub
|
||||
implementation for -URLForDirectory:shouldCreate:error:. Added
|
||||
-initWithDirectoryPath:... with additional parameters skipHidden
|
||||
and errorHandler.
|
||||
* In NSDictionary, fixed keysSortedByValueUsingComparator:.
|
||||
* Moved NSFileWrapper from -gui to -base.
|
||||
* Added NSFilePresenter, NSFileVersion and NSFileCoordinator.
|
||||
* Added NSPersonComponents and NSPersonNameComponentsFormatter.
|
||||
* Added units of measurement classes such as NSUnit, NSMeasurement,
|
||||
NSMeasurementFormatter, NSEnergyFormatter, NSLengthFormatter,
|
||||
NSMassFormatter.
|
||||
* In NSUnit, support for NSUnitArea, NSUnitConcentrationMass,
|
||||
NSUnitDispersion, NSUnitElectricCharge, NSUnitIlluminance,
|
||||
NSUnitElectricCurrent, NSUnitElectricPotentionDifference,
|
||||
NSElectricResistance, NSUnitMass, NSUnitEnergy, NSUnitFrequency,
|
||||
NSUnitPower, NSUnitSpeed, NSUnitFuelEfficiency, NSUnitPressure,
|
||||
NSUnitVolume, NSUnitLength.
|
||||
* Support for data directory on Android introduces
|
||||
GSInitializeProcessAndroid and makes use of the path returned by
|
||||
Context.getFilesDir() as the basis for storing data (e.g.
|
||||
NSUserDefaults) and when querying for directory paths
|
||||
(NSLibraryDirectory, NSApplicationSupportDirectory, etc.).
|
||||
* Placeholder NSScript* classes. Added NSUserActivity,
|
||||
NSObjectScripting, NSHFSFileTypes, NSAppleEventManager and
|
||||
NSAppleEventDescriptor.
|
||||
* Added NSDateInterval intersectionWithDateInterval:.
|
||||
* Added NSBackgroundActivityScheduler.
|
||||
* Added NSISO8601DateFormatter and NSMetadataAttributes.
|
||||
* Added NSOrtogrpahy and NSLinguisticTagger.
|
||||
* Added NSExtensionItem, NSExtensionContext,
|
||||
NSExtensionRequestHandling, and NSItemProvider and
|
||||
NSItemProviderReadingWriting.
|
||||
* Updated timezone info for NSTimeZones.
|
||||
* On Android, support for NSTemporaryDirectory to use
|
||||
Context.getCacheDir(), and cleaning it up in
|
||||
GSInitializeProcessAndroid() given there is no support for temp
|
||||
directory before Android API 26. Also used with NSCachesDirectory
|
||||
+ NSUserDomainMask.
|
||||
* NSXPCConnection fixes.
|
||||
* NSException symbolication support using libunwind (used when
|
||||
backtrace() is unavailable).
|
||||
* Travis build improvements to use new runloop integration and
|
||||
gnustep-2.0 runtime.
|
||||
* In NSKeyValueObserving, implement two missing methods for NSArray:
|
||||
-addObserver:options:context: and
|
||||
-removeObserver:fromObjectsAtIndexes:forKeyPath:.
|
||||
* Updated NSUUID to use instancetype.
|
||||
* Added support for NSDate constants in NSPredicate.
|
||||
* Fixed a NSTimer bug with blocks.
|
||||
* In GSTLS, do not put password in the hash key of the credentials,
|
||||
and to avoid logging it when debugging is on.
|
||||
* Improvements in NSConcreteHashTable and NSConcreteMapTable.
|
||||
* In various places, switch away from deprecated
|
||||
CREATE_AUTORELEASE_POOL() to use the ARC-compatible ENTER_POOL and
|
||||
LEAVE_POOL macros.
|
||||
* When building the list of hosts to be probed to see if they have
|
||||
gdomap servers, fix code to include those explicitly defined in the
|
||||
config file. Add -S option to list the addresses of the known
|
||||
gdomap servers.
|
||||
* Backward compatibility fix for ICU 65.
|
||||
* Update GSPrivateSymbolPath() so that, on the path where
|
||||
LINKER_GETSYMBOL is not available, we attempt to lookup classes
|
||||
using the prefix ._OBJC_CLASS_ for the 2.0 ABI (earlier ABIs use a
|
||||
prefix of __objc_class_name_ for the class definition.
|
||||
* Fix parsing of NSURLResponse content type header.
|
||||
* Fix for class lookup when using the 2.0 ABI.
|
||||
* Fixed NSURLComponents setURL: throwing exceptions when URL didn't
|
||||
have all expected parts caused by rangeOfString: throwing for nil
|
||||
values.
|
||||
* Added NSURLQueryItem implementation.
|
||||
|
||||
1.2 Noteworthy changes in version '1.26.0'
|
||||
==========================================
|
||||
|
||||
* Improve utf8 validity checks.
|
||||
|
@ -40,7 +185,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* As usual, this release also contains an update to include the most
|
||||
recent international timezone data.
|
||||
|
||||
1.2 Noteworthy changes in version '1.25.1'
|
||||
1.3 Noteworthy changes in version '1.25.1'
|
||||
==========================================
|
||||
|
||||
* Unicode fixes for characters outside the base plane
|
||||
|
@ -55,7 +200,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* As usual, this release also contains an update to include the most
|
||||
recent international timezone data.
|
||||
|
||||
1.3 Noteworthy changes in version '1.25.0'
|
||||
1.4 Noteworthy changes in version '1.25.0'
|
||||
==========================================
|
||||
|
||||
* Garbage collection support removed (NSGarbageCollector stub
|
||||
|
@ -70,7 +215,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* As usual, this release also contains an update to include the most
|
||||
recent international timezone data.
|
||||
|
||||
1.4 Noteworthy changes in version '1.24.9'
|
||||
1.5 Noteworthy changes in version '1.24.9'
|
||||
==========================================
|
||||
|
||||
* Niels added support for generics
|
||||
|
@ -80,7 +225,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* As usual, this release also contains an update to include the most
|
||||
recent international timezone data.
|
||||
|
||||
1.5 Noteworthy changes in version '1.24.8'
|
||||
1.6 Noteworthy changes in version '1.24.8'
|
||||
==========================================
|
||||
|
||||
* Performance optimisations (particularly in the use of tiny string
|
||||
|
@ -94,7 +239,7 @@ The currently released version of the library is '1.26.0'.
|
|||
recent international timezone data.
|
||||
* Various other bugfixes.
|
||||
|
||||
1.6 Noteworthy changes in version '1.24.7'
|
||||
1.7 Noteworthy changes in version '1.24.7'
|
||||
==========================================
|
||||
|
||||
* TLS and other security improvements (note, SSLv3.0 is disabled by
|
||||
|
@ -102,7 +247,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* Latest timezone data included.
|
||||
* Various other bugfixes.
|
||||
|
||||
1.7 Noteworthy changes in version '1.24.6'
|
||||
1.8 Noteworthy changes in version '1.24.6'
|
||||
==========================================
|
||||
|
||||
* NSUUID implemented
|
||||
|
@ -111,7 +256,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* Various new methods for OSX compatibility
|
||||
* Various other bugfixes
|
||||
|
||||
1.8 Noteworthy changes in version '1.24.5'
|
||||
1.9 Noteworthy changes in version '1.24.5'
|
||||
==========================================
|
||||
|
||||
* NSInvocationOperation
|
||||
|
@ -119,15 +264,15 @@ The currently released version of the library is '1.26.0'.
|
|||
* Static analyzer fixes (mostly printf format string issues)
|
||||
* Various other bugfixes
|
||||
|
||||
1.9 Noteworthy changes in version '1.24.4'
|
||||
==========================================
|
||||
1.10 Noteworthy changes in version '1.24.4'
|
||||
===========================================
|
||||
|
||||
* Updated time zone data
|
||||
* OSX 10.7 NSCalendar methods
|
||||
* Portability improvments and minor bugfixes
|
||||
* More testcases in the testsuite
|
||||
|
||||
1.10 Noteworthy changes in version '1.24.3'
|
||||
1.11 Noteworthy changes in version '1.24.3'
|
||||
===========================================
|
||||
|
||||
* Implementation of the NSXML DOM classes
|
||||
|
@ -135,7 +280,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* Implementation of new/selectable sorting algorithms
|
||||
* More explicit dependencies on external libraries.
|
||||
|
||||
1.11 Noteworthy changes in version '1.24.0'
|
||||
1.12 Noteworthy changes in version '1.24.0'
|
||||
===========================================
|
||||
|
||||
* There is binary incompatibility on 64bit systems in that the value
|
||||
|
@ -146,7 +291,7 @@ The currently released version of the library is '1.26.0'.
|
|||
* IPV6 support for NSHost and networking operations
|
||||
* Support for UTF-8 string literals in source (compiler permitting)
|
||||
|
||||
1.12 Noteworthy changes in version '1.23.0'
|
||||
1.13 Noteworthy changes in version '1.23.0'
|
||||
===========================================
|
||||
|
||||
* Support for automatic reference counting (ARC) when using clasng
|
||||
|
@ -155,31 +300,31 @@ The currently released version of the library is '1.26.0'.
|
|||
NSPointerArray when using clang and the GNUstep Objective-C 2.0
|
||||
runtime 1.5 or later.
|
||||
|
||||
1.13 Noteworthy changes in version '1.22.0'
|
||||
1.14 Noteworthy changes in version '1.22.0'
|
||||
===========================================
|
||||
|
||||
* Many updates and new classes
|
||||
* There is now a regression test framework included with the package
|
||||
* New support for Objective-C 2.0
|
||||
|
||||
1.14 Noteworthy changes in version '1.21.1'
|
||||
1.15 Noteworthy changes in version '1.21.1'
|
||||
===========================================
|
||||
|
||||
This is an (unstable) copy of the 1.20.1 release
|
||||
|
||||
1.15 Noteworthy changes in version '1.20.1'
|
||||
1.16 Noteworthy changes in version '1.20.1'
|
||||
===========================================
|
||||
|
||||
This is a stable bugfix release. There are no major changes or binary
|
||||
incompatibilities, but this release does include an update of timezone
|
||||
handling to include the latest zone information.
|
||||
|
||||
1.16 Noteworthy changes in version '1.21.0'
|
||||
1.17 Noteworthy changes in version '1.21.0'
|
||||
===========================================
|
||||
|
||||
This is an (unstable) copy of the 1.20.0 release
|
||||
|
||||
1.17 Noteworthy changes in version '1.20.0'
|
||||
1.18 Noteworthy changes in version '1.20.0'
|
||||
===========================================
|
||||
|
||||
This is a stable release. There have been major changes and
|
||||
|
@ -188,19 +333,19 @@ from clang. These changes, although they break binary compatibility
|
|||
with previous releases, should allow all future releases to maintain
|
||||
compatibility.
|
||||
|
||||
1.18 Noteworthy changes in version '1.19.3'
|
||||
1.19 Noteworthy changes in version '1.19.3'
|
||||
===========================================
|
||||
|
||||
* Bugfix to work around OSX behavior of [NSURL-path]
|
||||
|
||||
1.19 Noteworthy changes in version '1.19.2'
|
||||
1.20 Noteworthy changes in version '1.19.2'
|
||||
===========================================
|
||||
|
||||
* Various OSX compatibility improvements.
|
||||
* String handling performance improvements.
|
||||
* Several minor bugfixes.
|
||||
|
||||
1.20 Noteworthy changes in version '1.19.1'
|
||||
1.21 Noteworthy changes in version '1.19.1'
|
||||
===========================================
|
||||
|
||||
* New Mac OS X methods for writing data in NSData
|
||||
|
@ -209,7 +354,7 @@ compatibility.
|
|||
* Method return types and arguments have been changed for Mac OS X
|
||||
10.5
|
||||
|
||||
1.21 Noteworthy changes in version '1.19.0'
|
||||
1.22 Noteworthy changes in version '1.19.0'
|
||||
===========================================
|
||||
|
||||
* Support for native objective-c exceptions
|
||||
|
@ -218,7 +363,7 @@ compatibility.
|
|||
* Changes to build on 64bit ms-windows
|
||||
* Support for @synchronize
|
||||
|
||||
1.22 Noteworthy changes in version '1.15.3'
|
||||
1.23 Noteworthy changes in version '1.15.3'
|
||||
===========================================
|
||||
|
||||
* Extended NSUserDefaults so it recognizes ../ as a relative path.
|
||||
|
@ -227,13 +372,13 @@ compatibility.
|
|||
and added basic support for digest authentication.
|
||||
* Fixed various problems with and added new options to KVO.
|
||||
|
||||
1.23 Noteworthy changes in version '1.15.2'
|
||||
1.24 Noteworthy changes in version '1.15.2'
|
||||
===========================================
|
||||
|
||||
Bug fixes include improved thread safety (and a change to the NSThread
|
||||
class structure) and Key-Value observing.
|
||||
|
||||
1.24 Noteworthy changes in version '1.15.1'
|
||||
1.25 Noteworthy changes in version '1.15.1'
|
||||
===========================================
|
||||
|
||||
This is an unstable release. There may be API and ABI changes from
|
||||
|
@ -241,14 +386,14 @@ previous releases. The licesne hase changed to GPLv3 and LGPLv3.
|
|||
Mostly bug fixes, but a few improvements in NSPredicates and Key-Value
|
||||
coding have been added.
|
||||
|
||||
1.25 Noteworthy changes in version '1.15.0'
|
||||
1.26 Noteworthy changes in version '1.15.0'
|
||||
===========================================
|
||||
|
||||
This is an unstable release from 1.14.0. It is otherwise identical to
|
||||
the 1.14.0 release. Releases in the 1.15 series may not be forward
|
||||
compatible with previous 1.15 releases.
|
||||
|
||||
1.26 Noteworthy changes in version '1.14.0'
|
||||
1.27 Noteworthy changes in version '1.14.0'
|
||||
===========================================
|
||||
|
||||
Many portability (particularly for ms-windows) and MacOS-X compatibility
|
||||
|
@ -256,7 +401,7 @@ fixes. New MacOS-X classes and incorporation of NSAffineTransform and
|
|||
NSSpellServer which were formerly in the gui library. Improved
|
||||
performance of amssively multithreaded programs.
|
||||
|
||||
1.27 Noteworthy changes in version '1.13.1'
|
||||
1.28 Noteworthy changes in version '1.13.1'
|
||||
===========================================
|
||||
|
||||
Various minor bugs and MacOS-X incompatibilities fixed. One important
|
||||
|
@ -265,13 +410,13 @@ objects from strings. One fix for a serious (crash) bug when
|
|||
initialising the bundles system in an application which has a lot of
|
||||
frameworks linked to it. See the release notes for more details.
|
||||
|
||||
1.28 Noteworthy changes in version '1.13.0'
|
||||
1.29 Noteworthy changes in version '1.13.0'
|
||||
===========================================
|
||||
|
||||
Several sets of classes have been added for dealing with urls and
|
||||
predicates. A few minor api changes have occured as well.
|
||||
|
||||
1.29 Noteworthy changes in version '1.12.0'
|
||||
1.30 Noteworthy changes in version '1.12.0'
|
||||
===========================================
|
||||
|
||||
There have been a number of API changes and several methods have been
|
||||
|
@ -287,7 +432,7 @@ be set to not write to an external file at all, for developers who wish
|
|||
to use the library as a stand-alone library or in other situations where
|
||||
using external resources is not desired.
|
||||
|
||||
1.30 Noteworthy changes in version '1.11.2'
|
||||
1.31 Noteworthy changes in version '1.11.2'
|
||||
===========================================
|
||||
|
||||
* Support for GNUstep.conf and relocation of the filesystem is much
|
||||
|
@ -300,7 +445,7 @@ using external resources is not desired.
|
|||
* Some support for keeping user defaults in the Windows registry
|
||||
implemented.
|
||||
|
||||
1.31 Noteworthy changes in version '1.11.1'
|
||||
1.32 Noteworthy changes in version '1.11.1'
|
||||
===========================================
|
||||
|
||||
* New Cocoa class NSSortDescriptor
|
||||
|
@ -310,7 +455,7 @@ using external resources is not desired.
|
|||
* More support for debugging on mingw, including writing logs to
|
||||
debugger and event viewer.
|
||||
|
||||
1.32 Noteworthy changes in version '1.11.0'
|
||||
1.33 Noteworthy changes in version '1.11.0'
|
||||
===========================================
|
||||
|
||||
This release is binary incompatible with previous releases. The
|
||||
|
@ -326,12 +471,12 @@ new version.
|
|||
* NSRunLoop and related classes use natvie win32 event handling on
|
||||
Windows machines.
|
||||
|
||||
1.33 Noteworthy changes in version '1.10.3'
|
||||
1.34 Noteworthy changes in version '1.10.3'
|
||||
===========================================
|
||||
|
||||
This version includes a few minor bug fixes.
|
||||
|
||||
1.34 Noteworthy changes in version '1.10.2'
|
||||
1.35 Noteworthy changes in version '1.10.2'
|
||||
===========================================
|
||||
|
||||
This version mostly includes minor fixes and updates.
|
||||
|
@ -343,7 +488,7 @@ This version mostly includes minor fixes and updates.
|
|||
Windows).
|
||||
* Use a proper one-to-one abbreviation dictionary for NSTimeZone.
|
||||
|
||||
1.35 Noteworthy changes in version '1.10.1'
|
||||
1.36 Noteworthy changes in version '1.10.1'
|
||||
===========================================
|
||||
|
||||
This version mostly includes minor fixes and updates.
|
||||
|
@ -355,7 +500,7 @@ This version mostly includes minor fixes and updates.
|
|||
* Designated initializers for NSArray, NSDictionary, NSSet, and
|
||||
NSString have been changed for MacOS X compatibility.
|
||||
|
||||
1.36 Noteworthy changes in version '1.10.0'
|
||||
1.37 Noteworthy changes in version '1.10.0'
|
||||
===========================================
|
||||
|
||||
Note the interface version of the library has changed so that apps,
|
||||
|
@ -367,7 +512,7 @@ use it.
|
|||
* URL classes support persistant connections
|
||||
* Mac OSX XML compatibility fixes.
|
||||
|
||||
1.37 Noteworthy changes in version '1.9.2'
|
||||
1.38 Noteworthy changes in version '1.9.2'
|
||||
==========================================
|
||||
|
||||
* GSMime parsing ignores extraneous data
|
||||
|
@ -379,7 +524,7 @@ use it.
|
|||
* Binary incompatibility: NSUnarchiver, GSIMapTable have new ivars
|
||||
added
|
||||
|
||||
1.38 Noteworthy changes in version '1.9.1'
|
||||
1.39 Noteworthy changes in version '1.9.1'
|
||||
==========================================
|
||||
|
||||
* Default string encoding taken from system nl_langinfo if not set
|
||||
|
@ -388,7 +533,7 @@ use it.
|
|||
* NSPropertyLists class added, also decodes Mac OS X binary propery
|
||||
lists.
|
||||
|
||||
1.39 Noteworthy changes in version '1.9.0'
|
||||
1.40 Noteworthy changes in version '1.9.0'
|
||||
==========================================
|
||||
|
||||
* Lazy locking implemented (see GSLock documentation)
|
||||
|
@ -400,7 +545,7 @@ use it.
|
|||
* NSString subclass heirarchy reorganized to fix problems with
|
||||
copying and ownership of data.
|
||||
|
||||
1.40 Noteworthy changes in version '1.8.0'
|
||||
1.41 Noteworthy changes in version '1.8.0'
|
||||
==========================================
|
||||
|
||||
Read the NEWS file for a complete list of changes since the last stable
|
||||
|
@ -410,13 +555,13 @@ changes in gnustep-make, several components of gnustep-base are located
|
|||
in different locations. Generally this should not affect the
|
||||
compilation or running of applications and tools.
|
||||
|
||||
1.41 Noteworthy changes in version '1.7.4'
|
||||
1.42 Noteworthy changes in version '1.7.4'
|
||||
==========================================
|
||||
|
||||
* Added Korean encoding
|
||||
* Updated use of ObjCRuntime functions.
|
||||
|
||||
1.42 Noteworthy changes in version '1.7.3'
|
||||
1.43 Noteworthy changes in version '1.7.3'
|
||||
==========================================
|
||||
|
||||
Note in this version there have been large changes to the location of
|
||||
|
@ -427,7 +572,7 @@ specific headers may not compile because of this.
|
|||
* A number of Protocol and DO fixes.
|
||||
* New TraditionalChinese language.
|
||||
|
||||
1.43 Noteworthy changes in version '1.7.2'
|
||||
1.44 Noteworthy changes in version '1.7.2'
|
||||
==========================================
|
||||
|
||||
* NSUndoManager improvements
|
||||
|
@ -435,12 +580,12 @@ specific headers may not compile because of this.
|
|||
* Private GSTcpPort becomre NSSocketPort.
|
||||
* Improvements to handle selectors better over remote connections.
|
||||
|
||||
1.44 Noteworthy changes in version '1.7.1'
|
||||
1.45 Noteworthy changes in version '1.7.1'
|
||||
==========================================
|
||||
|
||||
Bug fixes.
|
||||
|
||||
1.45 Noteworthy changes in version '1.7.0'
|
||||
1.46 Noteworthy changes in version '1.7.0'
|
||||
==========================================
|
||||
|
||||
See gnustep-make for comments on the filesystem change. Some components
|
||||
|
@ -456,7 +601,7 @@ changes:
|
|||
NSSearchPathForDirectoriesInDomains.
|
||||
* Added man page for gdomap
|
||||
|
||||
1.46 Noteworthy changes in version '1.6.0'
|
||||
1.47 Noteworthy changes in version '1.6.0'
|
||||
==========================================
|
||||
|
||||
* More MinGW support
|
||||
|
@ -466,7 +611,7 @@ changes:
|
|||
* Built-in garbage collecting classes.
|
||||
* Any many many bug fixes and minor improvements.
|
||||
|
||||
1.47 Noteworthy changes in version '1.5.1'
|
||||
1.48 Noteworthy changes in version '1.5.1'
|
||||
==========================================
|
||||
|
||||
* Port NSThread to MingW
|
||||
|
@ -478,19 +623,19 @@ changes:
|
|||
* Warning logs selectable at runtime.
|
||||
* NSTimeZone code rewritten for speed.
|
||||
|
||||
1.48 Noteworthy changes in version '1.5.0'
|
||||
1.49 Noteworthy changes in version '1.5.0'
|
||||
==========================================
|
||||
|
||||
* New MacOSX methods implemented (NSString, NSArray, NSObject)
|
||||
* Fixed bug that occationally deleted user defaults.
|
||||
* Tcp connections use runloop in NSConnectionReplyMode.
|
||||
|
||||
1.49 Noteworthy changes in version '1.4.0'
|
||||
1.50 Noteworthy changes in version '1.4.0'
|
||||
==========================================
|
||||
|
||||
* gdomap - security bug fixes.
|
||||
|
||||
1.50 Noteworthy changes in version '1.3.4'
|
||||
1.51 Noteworthy changes in version '1.3.4'
|
||||
==========================================
|
||||
|
||||
This is a first pre-release version for 1.4.
|
||||
|
@ -501,7 +646,7 @@ users are urged to upgrade to this version as soon as possible.
|
|||
* gdomap - don't write pidfile until after setuid away from root
|
||||
* New combined Unix/Windows version of NSFileHandle
|
||||
|
||||
1.51 Noteworthy changes in version '1.3.3'
|
||||
1.52 Noteworthy changes in version '1.3.3'
|
||||
==========================================
|
||||
|
||||
Note there are interface and binary changes in this release that require
|
||||
|
@ -515,7 +660,7 @@ you to recompile all applications and tools that use gnustep-base.
|
|||
* GC improvements
|
||||
* Support for system-wide .GNUsteprc
|
||||
|
||||
1.52 Noteworthy changes in version '1.3.2'
|
||||
1.53 Noteworthy changes in version '1.3.2'
|
||||
==========================================
|
||||
|
||||
* Corrections for handling Windows file paths, etc
|
||||
|
@ -527,7 +672,7 @@ you to recompile all applications and tools that use gnustep-base.
|
|||
(cvtenc).
|
||||
* Unicode and UTF8 handling improvements.
|
||||
|
||||
1.53 Noteworthy changes in version '1.3.0'
|
||||
1.54 Noteworthy changes in version '1.3.0'
|
||||
==========================================
|
||||
|
||||
* Moved additional classes into subprojects and/or bundles to make it
|
||||
|
@ -538,7 +683,7 @@ you to recompile all applications and tools that use gnustep-base.
|
|||
* Better KeyValueCoding support (for EOF).
|
||||
* New, partially finished Objective-C/Foundation programming manual.
|
||||
|
||||
1.54 Noteworthy changes in version '1.1.0'
|
||||
1.55 Noteworthy changes in version '1.1.0'
|
||||
==========================================
|
||||
|
||||
* Removed use of distributed lock to sync defaults file.
|
||||
|
@ -552,7 +697,7 @@ you to recompile all applications and tools that use gnustep-base.
|
|||
* New localization files.
|
||||
* XML property lists
|
||||
|
||||
1.55 Noteworthy changes in version '1.0.2'
|
||||
1.56 Noteworthy changes in version '1.0.2'
|
||||
==========================================
|
||||
|
||||
Mostly a bug fix release to work with the new gcc 3.0.
|
||||
|
@ -560,7 +705,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* Added support for special gcc 3.0 options (constant string
|
||||
support).
|
||||
|
||||
1.56 Noteworthy changes in version '1.0.1'
|
||||
1.57 Noteworthy changes in version '1.0.1'
|
||||
==========================================
|
||||
|
||||
* Many fixes to work better with Darwin (still not there).
|
||||
|
@ -571,7 +716,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* Works better with gcc 3.x, newer kernels.
|
||||
* More memory debugging support.
|
||||
|
||||
1.57 Noteworthy changes in version '1.0.0'
|
||||
1.58 Noteworthy changes in version '1.0.0'
|
||||
==========================================
|
||||
|
||||
* Fix parsing of arguments for new linux kernels.
|
||||
|
@ -579,7 +724,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* Fix alignment issues on CPUs that require it.
|
||||
* Update unicode support and fixes
|
||||
|
||||
1.58 Noteworthy changes in version '0.9.1'
|
||||
1.59 Noteworthy changes in version '0.9.1'
|
||||
==========================================
|
||||
|
||||
* New MacOSX compatible files for NSCalendarDate, NSTimeZone
|
||||
|
@ -588,7 +733,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* NSCharacterSets updated to v3.0.1 of Unicode data.
|
||||
* Added some gettext compatible localization macros.
|
||||
|
||||
1.59 Noteworthy changes in version '0.9.1'
|
||||
1.60 Noteworthy changes in version '0.9.1'
|
||||
==========================================
|
||||
|
||||
* Fixes for building on FreeBSD
|
||||
|
@ -596,7 +741,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* NSDate pass dates over DO bycopy unless explicit byref.
|
||||
* Updated for Makefile package changes.
|
||||
|
||||
1.60 Noteworthy changes in version '0.9.0'
|
||||
1.61 Noteworthy changes in version '0.9.0'
|
||||
==========================================
|
||||
|
||||
* Workaround when no host IP set.
|
||||
|
@ -618,7 +763,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* Port to MinGW/Windows
|
||||
* Removed obsolete classes.
|
||||
|
||||
1.61 Noteworthy changes in version '0.6.6'
|
||||
1.62 Noteworthy changes in version '0.6.6'
|
||||
==========================================
|
||||
|
||||
* Lots of new documentation.
|
||||
|
@ -630,7 +775,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* New tools for handling property lists.
|
||||
* More optimization of classes.
|
||||
|
||||
1.62 Noteworthy changes in version '0.6.5'
|
||||
1.63 Noteworthy changes in version '0.6.5'
|
||||
==========================================
|
||||
|
||||
* Better debugging information.
|
||||
|
@ -640,7 +785,7 @@ Mostly a bug fix release to work with the new gcc 3.0.
|
|||
* Better garbage collection support.
|
||||
* Lots of optimizations and bug fixes.
|
||||
|
||||
1.63 Noteworthy changes in version '0.6.0'
|
||||
1.64 Noteworthy changes in version '0.6.0'
|
||||
==========================================
|
||||
|
||||
Most of the changes to the Base Library are bug fixes and updates to
|
||||
|
@ -655,7 +800,7 @@ and installations, and is considered to be fairly stable.
|
|||
|
||||
* Performance boosts in many classes.
|
||||
|
||||
1.64 Noteworthy changes in version '0.5.5'
|
||||
1.65 Noteworthy changes in version '0.5.5'
|
||||
==========================================
|
||||
|
||||
Too many changes to mention in detail, but here is a list of a few:
|
||||
|
@ -673,13 +818,13 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
* There are several new tools for handling services, defaults, and
|
||||
pasteboards.
|
||||
|
||||
1.65 Noteworthy changes in version '0.5.1'
|
||||
1.66 Noteworthy changes in version '0.5.1'
|
||||
==========================================
|
||||
|
||||
* Additional runtime functions for interaction with Guile and
|
||||
ObjC-Guile library.
|
||||
|
||||
1.66 Noteworthy changes in version '0.5.0'
|
||||
1.67 Noteworthy changes in version '0.5.0'
|
||||
==========================================
|
||||
|
||||
* Improvements to the NSInvocation class, from Masatake Yamato
|
||||
|
@ -692,7 +837,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
* gdomap now handles subnet addressing and machines with multiple IP
|
||||
addresses from Richard Frith-Macdonald <richard@brainstorm.co.uk>.
|
||||
|
||||
1.67 Noteworthy changes in version '0.4.0'
|
||||
1.68 Noteworthy changes in version '0.4.0'
|
||||
==========================================
|
||||
|
||||
* New tools for maintaining the defaults database.
|
||||
|
@ -726,7 +871,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
|
||||
* Many, many, many, many bug fixes and new classes.
|
||||
|
||||
1.68 Noteworthy changes since version '0.1.19'
|
||||
1.69 Noteworthy changes since version '0.1.19'
|
||||
==============================================
|
||||
|
||||
* The library has changed its name from 'libobjects' to
|
||||
|
@ -826,7 +971,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
|
||||
* ...and many bug fixes.
|
||||
|
||||
1.69 Noteworthy changes since version '0.1.14'
|
||||
1.70 Noteworthy changes since version '0.1.14'
|
||||
==============================================
|
||||
|
||||
* Can be made as a shared library by passing '--enabled-shared' to
|
||||
|
@ -860,7 +1005,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
* Bug fixes in NSString, NSDictionary, NSArray, NSGeometry and other
|
||||
places.
|
||||
|
||||
1.70 Noteworthy changes since version '0.1.13'
|
||||
1.71 Noteworthy changes since version '0.1.13'
|
||||
==============================================
|
||||
|
||||
* NSProcessInfo class, thanks to Georg Tuparev.
|
||||
|
@ -874,7 +1019,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
|
||||
* Many bug fixes.
|
||||
|
||||
1.71 Noteworthy changes since version '0.1.12'
|
||||
1.72 Noteworthy changes since version '0.1.12'
|
||||
==============================================
|
||||
|
||||
* Bug fixes: installation; NSArray and NSDictionary copying; NSArray,
|
||||
|
@ -882,7 +1027,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
configurability; NSString -getCharacter:range:. See the ChangeLog
|
||||
for more details.
|
||||
|
||||
1.72 Noteworthy changes since version '0.1.10'
|
||||
1.73 Noteworthy changes since version '0.1.10'
|
||||
==============================================
|
||||
|
||||
* Now using 'src', 'config' and 'doc' directories to un-clutter the
|
||||
|
@ -899,7 +1044,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
|
||||
* And several bug fixes. See the ChangeLog for details.
|
||||
|
||||
1.73 Noteworthy changes since version '0.1.9'
|
||||
1.74 Noteworthy changes since version '0.1.9'
|
||||
=============================================
|
||||
|
||||
* Renamed "foundation" include file directory to "Foundation", in
|
||||
|
@ -908,7 +1053,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
* Several bug fixes, including a problem with a missing file in
|
||||
0.1.9.
|
||||
|
||||
1.74 Noteworthy changes since version '0.1.8'
|
||||
1.75 Noteworthy changes since version '0.1.8'
|
||||
=============================================
|
||||
|
||||
* Many new GNUStep classes: NSEnumerator, NSArrayEnumerator, NSCoder,
|
||||
|
@ -944,7 +1089,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
in Collection.m; typo in BinaryTree.m; put -write: and -read:
|
||||
implementations back in Collection.m.
|
||||
|
||||
1.75 Noteworthy changes since version '0.1.7'
|
||||
1.76 Noteworthy changes since version '0.1.7'
|
||||
=============================================
|
||||
|
||||
* Thanks to Adam Fedor <fedor@boulder.colorado.edu>, classes
|
||||
|
@ -965,7 +1110,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
* Several bug fixes, including two serious ones in Collection
|
||||
deallocation and behavior adding. See the ChangeLog for details.
|
||||
|
||||
1.76 Noteworthy changes since version '0.1.5'
|
||||
1.77 Noteworthy changes since version '0.1.5'
|
||||
=============================================
|
||||
|
||||
* Better string handling. NSString is now fleshed out, and I've
|
||||
|
@ -992,7 +1137,7 @@ Too many changes to mention in detail, but here is a list of a few:
|
|||
* Several bug fixes. Thanks to those who reported them. Credits are
|
||||
in the ChangeLog.
|
||||
|
||||
1.77 Noteworthy changes since version '0.1.3'
|
||||
1.78 Noteworthy changes since version '0.1.3'
|
||||
=============================================
|
||||
|
||||
This release not well tested at all. We desperately need someone to
|
||||
|
@ -1018,7 +1163,7 @@ made on GNUSTEP.
|
|||
* Entire library converted to use 'retain', 'release', 'autorelease',
|
||||
'dealloc' instead of 'free'.
|
||||
|
||||
1.78 Noteworthy changes since version '0.1.0'
|
||||
1.79 Noteworthy changes since version '0.1.0'
|
||||
=============================================
|
||||
|
||||
* New category: ObjectRetaining. New classes: AutoreleasePool,
|
||||
|
@ -1027,7 +1172,7 @@ made on GNUSTEP.
|
|||
* Bug fixes: Install next-includes properly. New instructions in
|
||||
README.ULTRIX. Time.m patched for Solaris 2.4. test12.m free fix.
|
||||
|
||||
1.79 Noteworthy changes in version '0.1.0'
|
||||
1.80 Noteworthy changes in version '0.1.0'
|
||||
==========================================
|
||||
|
||||
* Renamed the library from 'libcoll' to 'libgnustep-base'. (See the
|
||||
|
@ -1059,7 +1204,7 @@ made on GNUSTEP.
|
|||
in List and HashTable. New files zone.[hc] containing dummy stubs
|
||||
for NeXT-compatible zone functions.
|
||||
|
||||
1.80 Noteworthy changes in version '940524'
|
||||
1.81 Noteworthy changes in version '940524'
|
||||
===========================================
|
||||
|
||||
* A NeXT-compatible NXStringTable object, thanks to Adam Fedor
|
||||
|
@ -1085,7 +1230,7 @@ made on GNUSTEP.
|
|||
'-freeEnumState:'. Several bug fixes in List and Storage; changes
|
||||
for better NeXT-compability. And more.
|
||||
|
||||
1.81 Noteworthy changes in version '931026'
|
||||
1.82 Noteworthy changes in version '931026'
|
||||
===========================================
|
||||
|
||||
* Installation using './configure' and 'autoconf'
|
||||
|
|
|
@ -9,7 +9,7 @@ any classes used by a new thread have already been used in the main thread
|
|||
before the new thread starts.
|
||||
|
||||
If you are worried, please build/run GNUstep with a runtime which supports
|
||||
the +initialize method. The GNUstep stable runtime (libobjc) and experimental
|
||||
the +initialize method. The GNUstep stable runtime (libobjc) and clang
|
||||
runtime (libobjc2), available from the GNUstep website and subversion
|
||||
repository, should both work.
|
||||
|
||||
|
|
|
@ -573,4 +573,27 @@
|
|||
zha = za;
|
||||
zho = zh;
|
||||
zul = zu;
|
||||
ca_ES_PREEURO = "ca_ES@currency=ESP";
|
||||
de_AT_PREEURO = "de_AT@currency=ATS";
|
||||
de_DE_PREEURO = "de_DE@currency=DEM";
|
||||
de_LU_PREEURO = "de_LU@currency=LUF";
|
||||
el_GR_PREEURO = "el_GR@currency=GRD";
|
||||
en_BE_PREEURO = "en_BE@currency=BEF";
|
||||
en_IE_PREEURO = "en_IE@currency=IEP";
|
||||
es_ES_PREEURO = "es_ES@currency=ESP";
|
||||
eu_ES_PREEURO = "eu_ES@currency=ESP";
|
||||
fi_FI_PREEURO = "fi_FI@currency=FIM";
|
||||
fr_BE_PREEURO = "fr_BE@currency=BEF";
|
||||
fr_FR_PREEURO = "fr_FR@currency=FRF";
|
||||
fr_LU_PREEURO = "fr_LU@currency=LUF";
|
||||
ga_IE_PREEURO = "ga_IE@currency=IEP";
|
||||
gl_ES_PREEURO = "gl_ES@currency=ESP";
|
||||
it_IT_PREEURO = "it_IT@currency=ITL";
|
||||
nl_BE_PREEURO = "nl_BE@currency=BEF";
|
||||
nl_NL_PREEURO = "nl_NL@currency=NLG";
|
||||
pt_PT_PREEURO = "pt_PT@currency=PTE";
|
||||
de__PHONEBOOK = "de@collation=phonebook";
|
||||
es__TRADITIONAL = "es@collation=traditional";
|
||||
hi__DIRECT = "hi@collation=direct";
|
||||
ja_JP_TRADITIONAL = "ja_JP@calendar=japanese";
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ The file Locale.aliases is used to map common language specifications to
|
|||
old-style long names.
|
||||
|
||||
The file Locale.canonical is used to map old style names and three letter
|
||||
ISO-639-2 names to the preferred tewo letter ISO-639-1 names.
|
||||
ISO-639-2 names to the preferred two letter ISO-639-1 names.
|
||||
|
||||
Language files which contain non-ascii characters should either be properly
|
||||
marked unicode files (UTF-8 with a leading Byte Order Mark or UTF-16 with a
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
{
|
||||
@public
|
||||
GSIMapTable_t map;
|
||||
NSUInteger _version;
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -115,7 +116,8 @@ static SEL objSel;
|
|||
{
|
||||
NSUInteger count = map.nodeCount;
|
||||
SEL sel = @selector(encodeObject:);
|
||||
IMP imp = [aCoder methodForSelector: sel];
|
||||
id (*imp)(id,SEL,id)
|
||||
= (id (*)(id,SEL,id))[aCoder methodForSelector: sel];
|
||||
GSIMapEnumerator_t enumerator = GSIMapEnumeratorForMap(&map);
|
||||
GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
|
||||
|
||||
|
@ -152,7 +154,8 @@ static SEL objSel;
|
|||
id key;
|
||||
id value;
|
||||
SEL sel = @selector(decodeValueOfObjCType:at:);
|
||||
IMP imp = [aCoder methodForSelector: sel];
|
||||
void (*imp)(id,SEL,const char*,void*)
|
||||
= (void (*)(id,SEL,const char*,void*))[aCoder methodForSelector: sel];
|
||||
const char *type = @encode(id);
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(NSUInteger)
|
||||
|
@ -220,8 +223,9 @@ static SEL objSel;
|
|||
if (c > 0)
|
||||
{
|
||||
NSEnumerator *e = [other keyEnumerator];
|
||||
IMP nxtObj = [e methodForSelector: nxtSel];
|
||||
IMP otherObj = [other methodForSelector: objSel];
|
||||
id (*nxtObj)(id, SEL) = (id (*)(id,SEL))[e methodForSelector: nxtSel];
|
||||
id (*otherObj)(id, SEL, id)
|
||||
= (id (*)(id,SEL,id))[other methodForSelector: objSel];
|
||||
BOOL isProxy = [other isProxy];
|
||||
NSUInteger i;
|
||||
|
||||
|
@ -293,7 +297,8 @@ static SEL objSel;
|
|||
{
|
||||
GSIMapEnumerator_t enumerator;
|
||||
GSIMapNode node;
|
||||
IMP otherObj = [other methodForSelector: objSel];
|
||||
id (*otherObj)(id, SEL, id)
|
||||
= (id (*)(id,SEL,id))[other methodForSelector: objSel];
|
||||
|
||||
enumerator = GSIMapEnumeratorForMap(&map);
|
||||
while ((node = GSIMapEnumeratorNextNode(&enumerator)) != 0)
|
||||
|
@ -345,6 +350,15 @@ static SEL objSel;
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState*)state
|
||||
objects: (__unsafe_unretained id[])stackbuf
|
||||
count: (NSUInteger)len
|
||||
{
|
||||
state->mutationsPtr = (unsigned long *)self;
|
||||
return GSIMapCountByEnumeratingWithStateObjectsCount
|
||||
(&map, state, stackbuf, len);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _GSMutableInsensitiveDictionary
|
||||
|
@ -392,6 +406,7 @@ static SEL objSel;
|
|||
{
|
||||
GSIMapNode node;
|
||||
|
||||
_version++;
|
||||
if (aKey == nil)
|
||||
{
|
||||
NSException *e;
|
||||
|
@ -421,11 +436,14 @@ static SEL objSel;
|
|||
{
|
||||
GSIMapAddPair(&map, (GSIMapKey)aKey, (GSIMapVal)anObject);
|
||||
}
|
||||
_version++;
|
||||
}
|
||||
|
||||
- (void) removeAllObjects
|
||||
{
|
||||
_version++;
|
||||
GSIMapCleanMap(&map);
|
||||
_version++;
|
||||
}
|
||||
|
||||
- (void) removeObjectForKey: (id)aKey
|
||||
|
@ -435,7 +453,18 @@ static SEL objSel;
|
|||
NSWarnMLog(@"attempt to remove nil key from dictionary %@", self);
|
||||
return;
|
||||
}
|
||||
_version++;
|
||||
GSIMapRemoveKey(&map, (GSIMapKey)aKey);
|
||||
_version++;
|
||||
}
|
||||
|
||||
- (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState*)state
|
||||
objects: (__unsafe_unretained id[])stackbuf
|
||||
count: (NSUInteger)len
|
||||
{
|
||||
state->mutationsPtr = (unsigned long *)&_version;
|
||||
return GSIMapCountByEnumeratingWithStateObjectsCount
|
||||
(&map, state, stackbuf, len);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -132,6 +132,7 @@ static NSString *CteContentType = @"content-type";
|
|||
static NSString *CteQuotedPrintable = @"quoted-printable";
|
||||
static NSString *CteXuuencode = @"x-uuencode";
|
||||
|
||||
typedef id (*oaiIMP)(id, SEL, NSUInteger);
|
||||
typedef BOOL (*boolIMP)(id, SEL, id);
|
||||
|
||||
static char *hex = "0123456789ABCDEF";
|
||||
|
@ -5723,14 +5724,20 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to fetch the content file name from the header.
|
||||
/** Convenience method to fetch the content file name from the content-type
|
||||
* or content-disposition header.
|
||||
*/
|
||||
- (NSString*) contentFile
|
||||
{
|
||||
GSMimeHeader *hdr = [self headerNamed: @"content-disposition"];
|
||||
GSMimeHeader *hdr = [self headerNamed: CteContentType];
|
||||
NSString *str = [hdr parameterForKey: @"name"];
|
||||
|
||||
return [hdr parameterForKey: @"filename"];
|
||||
if (nil == str)
|
||||
{
|
||||
hdr = [self headerNamed: @"content-disposition"];
|
||||
str = [hdr parameterForKey: @"filename"];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6184,12 +6191,12 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
|
||||
if (count > 0)
|
||||
{
|
||||
IMP imp1;
|
||||
oaiIMP imp1;
|
||||
boolIMP imp2;
|
||||
|
||||
name = [name lowercaseString];
|
||||
|
||||
imp1 = [headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp1 = (oaiIMP)[headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp2 = (boolIMP)[name methodForSelector: @selector(isEqualToString:)];
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -6268,14 +6275,14 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSMutableString *m;
|
||||
NSString *s;
|
||||
|
||||
m = [NSMutableString stringWithCapacity: 1000];
|
||||
ENTER_POOL
|
||||
NSMutableString *m = [NSMutableString stringWithCapacity: 1000];
|
||||
[self _descriptionTo: m level: 0];
|
||||
s = RETAIN(m);
|
||||
RELEASE(arp);
|
||||
LEAVE_POOL
|
||||
|
||||
return AUTORELEASE(s);
|
||||
}
|
||||
|
||||
|
@ -6330,11 +6337,11 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
if (count > 0)
|
||||
{
|
||||
NSUInteger index;
|
||||
IMP imp1;
|
||||
oaiIMP imp1;
|
||||
boolIMP imp2;
|
||||
|
||||
name = [headerClass makeToken: name preservingCase: NO];
|
||||
imp1 = [headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp1 = (oaiIMP)[headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp2 = (boolIMP)[name methodForSelector: @selector(isEqualToString:)];
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
|
@ -6364,10 +6371,10 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
{
|
||||
NSUInteger index;
|
||||
NSMutableArray *array;
|
||||
IMP imp1;
|
||||
oaiIMP imp1;
|
||||
boolIMP imp2;
|
||||
|
||||
imp1 = [headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp1 = (oaiIMP)[headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp2 = (boolIMP)[name methodForSelector: @selector(isEqualToString:)];
|
||||
array = [NSMutableArray array];
|
||||
|
||||
|
@ -7285,10 +7292,10 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
if (count > 0)
|
||||
{
|
||||
NSUInteger index;
|
||||
IMP imp1;
|
||||
oaiIMP imp1;
|
||||
boolIMP imp2;
|
||||
|
||||
imp1 = [headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp1 = (oaiIMP)[headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp2 = (boolIMP)[name methodForSelector: @selector(isEqualToString:)];
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
|
@ -7310,10 +7317,10 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
|
||||
if (count > 0)
|
||||
{
|
||||
IMP imp1;
|
||||
oaiIMP imp1;
|
||||
boolIMP imp2;
|
||||
|
||||
imp1 = [headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp1 = (oaiIMP)[headers methodForSelector: @selector(objectAtIndex:)];
|
||||
imp2 = (boolIMP)[name methodForSelector: @selector(isEqualToString:)];
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -7390,7 +7397,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
|
||||
- (void) encodePart: (GSMimeDocument*)document to: (NSMutableData*)md
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
ENTER_POOL
|
||||
NSData *d = nil;
|
||||
NSEnumerator *enumerator;
|
||||
NSString *subtype;
|
||||
|
@ -7813,7 +7820,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
[md appendData: d];
|
||||
}
|
||||
}
|
||||
RELEASE(arp);
|
||||
LEAVE_POOL
|
||||
}
|
||||
|
||||
- (NSUInteger) foldAt
|
||||
|
|
|
@ -1983,7 +1983,7 @@ GSAutoreleasedBuffer(unsigned size)
|
|||
static Class buffer_class = 0;
|
||||
static Class autorelease_class;
|
||||
static SEL autorelease_sel;
|
||||
static IMP autorelease_imp;
|
||||
static id (*autorelease_imp)(Class, SEL, id);
|
||||
static int instance_size;
|
||||
static int offset;
|
||||
NSObject *o;
|
||||
|
@ -1995,7 +1995,8 @@ GSAutoreleasedBuffer(unsigned size)
|
|||
offset = instance_size % ALIGN;
|
||||
autorelease_class = [NSAutoreleasePool class];
|
||||
autorelease_sel = @selector(addObject:);
|
||||
autorelease_imp = [autorelease_class methodForSelector: autorelease_sel];
|
||||
autorelease_imp = (id (*)(Class, SEL, id))
|
||||
[autorelease_class methodForSelector: autorelease_sel];
|
||||
}
|
||||
o = (NSObject*)NSAllocateObject(buffer_class,
|
||||
size + offset, NSDefaultMallocZone());
|
||||
|
@ -2065,7 +2066,9 @@ GSPrintf (FILE *fptr, NSString* format, ...)
|
|||
# define AADD(c, o)
|
||||
# define AREM(c, o)
|
||||
# endif
|
||||
|
||||
#else
|
||||
# define AADD(c, o)
|
||||
# define AREM(c, o)
|
||||
#endif /* defined(GNUSTEP_BASE_LIBRARY) */
|
||||
|
||||
void
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#ifdef HAVE_LIBXML
|
||||
|
||||
#import "GNUstepBase/GSObjCRuntime.h"
|
||||
#import "GNUstepBase/NSDebug+GNUstepBase.h"
|
||||
#import "GNUstepBase/NSObject+GNUstepBase.h"
|
||||
#import "GNUstepBase/GSMime.h"
|
||||
#import "GNUstepBase/GSXML.h"
|
||||
|
@ -104,7 +105,7 @@
|
|||
*/
|
||||
static Class NSString_class;
|
||||
static Class treeClass;
|
||||
static IMP usImp;
|
||||
static id (*usImp)(id, SEL, const unsigned char*);
|
||||
static SEL usSel;
|
||||
|
||||
static xmlExternalEntityLoader originalLoader = NULL;
|
||||
|
@ -166,11 +167,25 @@ setupCache()
|
|||
xmlDefaultSAXHandlerInit();
|
||||
NSString_class = [NSString class];
|
||||
usSel = @selector(stringWithUTF8String:);
|
||||
usImp = [NSString_class methodForSelector: usSel];
|
||||
usImp = (id (*)(id, SEL, const unsigned char*))
|
||||
[NSString_class methodForSelector: usSel];
|
||||
treeClass = [GSTreeSAXHandler class];
|
||||
}
|
||||
}
|
||||
|
||||
static int xmlNSInputStreamReadCallback(void *context, char *buffer, int len)
|
||||
{
|
||||
NSInputStream *stream = (NSInputStream *)context;
|
||||
return [stream read: (uint8_t *)buffer maxLength: len];
|
||||
}
|
||||
|
||||
static int xmlNSInputStreamCloseCallback (void *context)
|
||||
{
|
||||
NSInputStream *stream = (NSInputStream *)context;
|
||||
[stream close];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static xmlParserInputPtr
|
||||
loadEntityFunction(const unsigned char *url, const unsigned char *eid,
|
||||
void *ctx);
|
||||
|
@ -983,7 +998,10 @@ static NSMapTable *nodeNames = 0;
|
|||
1,
|
||||
1,
|
||||
"utf-8");
|
||||
xmlOutputBufferFlush(buf);
|
||||
if (xmlOutputBufferFlush(buf) < 0)
|
||||
{
|
||||
NSDebugMLog(@"Failed to flush XML description");
|
||||
}
|
||||
#if LIBXML_VERSION < 20900
|
||||
string = UTF8StrLen(buf->buffer->content, buf->buffer->use);
|
||||
#else
|
||||
|
@ -2101,6 +2119,31 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
return self;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Initialisation of a new Parser with SAX handler (if not nil)
|
||||
* by calling -initWithSAXHandler:
|
||||
* </p>
|
||||
* <p>
|
||||
* Sets the input source for the parser to be the specified input stream,
|
||||
* so parsing of the entire document will be performed rather than
|
||||
* incremental parsing.
|
||||
* </p>
|
||||
*/
|
||||
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
||||
withInputStream: (NSInputStream*)stream
|
||||
{
|
||||
if (stream == nil || [stream isKindOfClass: [NSInputStream class]] == NO)
|
||||
{
|
||||
NSLog(@"Bad NSInputStream passed to initialize GSXMLParser");
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
src = RETAIN(stream);
|
||||
self = [self initWithSAXHandler: handler];
|
||||
return self;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set and return the previous value for blank text nodes support.
|
||||
* ignorableWhitespace nodes are only generated when running
|
||||
|
@ -2166,7 +2209,8 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
return NO;
|
||||
}
|
||||
|
||||
if ([src isKindOfClass: [NSData class]])
|
||||
if ([src isKindOfClass: [NSData class]]
|
||||
|| [src isKindOfClass: [NSInputStream class]])
|
||||
{
|
||||
}
|
||||
else if ([src isKindOfClass: NSString_class])
|
||||
|
@ -2193,14 +2237,22 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"source for [-parse] must be NSString, NSData or NSURL type");
|
||||
NSLog(@"Source for [-parse] must be NSString, NSData, NSInputStream, or"
|
||||
@" NSURL type");
|
||||
return NO;
|
||||
}
|
||||
|
||||
tmp = RETAIN(src);
|
||||
ASSIGN(src, endMarker);
|
||||
[self _parseChunk: tmp];
|
||||
[self _parseChunk: nil];
|
||||
if ([tmp isKindOfClass: [NSInputStream class]])
|
||||
{
|
||||
xmlParseDocument(lib);
|
||||
}
|
||||
else
|
||||
{
|
||||
[self _parseChunk: tmp];
|
||||
[self _parseChunk: nil];
|
||||
}
|
||||
RELEASE(tmp);
|
||||
|
||||
if (((xmlParserCtxtPtr)lib)->wellFormed != 0
|
||||
|
@ -2381,7 +2433,19 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
{
|
||||
file = ".";
|
||||
}
|
||||
lib = (void*)xmlCreatePushParserCtxt([saxHandler lib], NULL, 0, 0, file);
|
||||
|
||||
if ([src isKindOfClass: [NSInputStream class]])
|
||||
{
|
||||
[(NSInputStream*)src open];
|
||||
lib = (void*)xmlCreateIOParserCtxt([saxHandler lib], NULL,
|
||||
xmlNSInputStreamReadCallback, xmlNSInputStreamCloseCallback,
|
||||
(void*)src, XML_CHAR_ENCODING_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
lib = (void*)xmlCreatePushParserCtxt([saxHandler lib], NULL, 0, 0, file);
|
||||
}
|
||||
|
||||
if (lib == NULL)
|
||||
{
|
||||
NSLog(@"Failed to create libxml parser context");
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
NSUInteger lower = 0;
|
||||
NSUInteger index;
|
||||
SEL oaiSel;
|
||||
IMP oai;
|
||||
id (*oai)(id,SEL,NSUInteger);
|
||||
|
||||
if (item == nil)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@
|
|||
}
|
||||
|
||||
oaiSel = @selector(objectAtIndex:);
|
||||
oai = [self methodForSelector: oaiSel];
|
||||
oai = (id(*)(id,SEL,NSUInteger))[self methodForSelector: oaiSel];
|
||||
/*
|
||||
* Binary search for an item equal to the one to be inserted.
|
||||
*/
|
||||
|
@ -95,7 +95,7 @@
|
|||
NSUInteger index;
|
||||
NSComparisonResult (*imp)(id, SEL, id);
|
||||
SEL oaiSel;
|
||||
IMP oai;
|
||||
id (*oai)(id,SEL,NSUInteger);
|
||||
|
||||
if (item == nil)
|
||||
{
|
||||
|
@ -115,7 +115,7 @@
|
|||
}
|
||||
|
||||
oaiSel = @selector(objectAtIndex:);
|
||||
oai = [self methodForSelector: oaiSel];
|
||||
oai = (id(*)(id,SEL,NSUInteger))[self methodForSelector: oaiSel];
|
||||
/*
|
||||
* Binary search for an item equal to the one to be inserted.
|
||||
*/
|
||||
|
|
|
@ -332,7 +332,7 @@ randombytes(uint8_t *buf, unsigned len)
|
|||
}
|
||||
stream.next_out = dst + stream.total_out;
|
||||
stream.avail_out = (unsigned)(capacity - stream.total_out);
|
||||
deflate(&stream, Z_FINISH);
|
||||
(void)deflate(&stream, Z_FINISH);
|
||||
}
|
||||
deflateEnd(&stream);
|
||||
result = [NSMutableData alloc];
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSHashTable.h"
|
||||
#import "Foundation/NSLock.h"
|
||||
#import "GNUstepBase/GSObjCRuntime.h"
|
||||
#import "GNUstepBase/NSObject+GNUstepBase.h"
|
||||
#import "GNUstepBase/NSDebug+GNUstepBase.h"
|
||||
#import "GNUstepBase/NSThread+GNUstepBase.h"
|
||||
|
@ -52,7 +53,7 @@
|
|||
format: @"method %@ not implemented in %@(class)",
|
||||
selector ? (id)NSStringFromSelector(selector) : (id)@"(null)",
|
||||
NSStringFromClass(self)];
|
||||
while (0) ; // Does not return
|
||||
while (1) ; // Does not return
|
||||
}
|
||||
|
||||
- (NSComparisonResult) compare: (id)anObject
|
||||
|
@ -116,7 +117,7 @@
|
|||
format: @"[%@%c%@] not implemented",
|
||||
NSStringFromClass([self class]), c,
|
||||
aSel ? (id)NSStringFromSelector(aSel) : (id)@"(null)"];
|
||||
while (0) ; // Does not return
|
||||
while (1) ; // Does not return
|
||||
}
|
||||
|
||||
- (id) shouldNotImplement: (SEL)aSel
|
||||
|
@ -128,7 +129,7 @@
|
|||
format: @"[%@%c%@] should not be implemented",
|
||||
NSStringFromClass([self class]), c,
|
||||
aSel ? (id)NSStringFromSelector(aSel) : (id)@"(null)"];
|
||||
while (0) ; // Does not return
|
||||
while (1) ; // Does not return
|
||||
}
|
||||
|
||||
- (id) subclassResponsibility: (SEL)aSel
|
||||
|
@ -139,7 +140,7 @@
|
|||
format: @"[%@%c%@] should be overridden by subclass",
|
||||
NSStringFromClass([self class]), c,
|
||||
aSel ? (id)NSStringFromSelector(aSel) : (id)@"(null)"];
|
||||
while (0) ; // Does not return
|
||||
while (1) ; // Does not return
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -412,7 +413,9 @@ handleExit()
|
|||
NSUInteger size;
|
||||
|
||||
#if GS_SIZEOF_VOIDP > 4
|
||||
if ((((NSUInteger)void*)self) & 0x07)
|
||||
NSUInteger xxx = (NSUInteger)(void*)self;
|
||||
|
||||
if (xxx & 0x07)
|
||||
{
|
||||
return 0; // Small object has no size
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ static BOOL debugTemporarilyDisabled = NO;
|
|||
|
||||
BOOL GSDebugSet(NSString *level)
|
||||
{
|
||||
static IMP debugImp = 0;
|
||||
static id (*debugImp)(id,SEL,id) = 0;
|
||||
static SEL debugSel;
|
||||
|
||||
if (debugTemporarilyDisabled == YES)
|
||||
|
@ -53,7 +53,7 @@ BOOL GSDebugSet(NSString *level)
|
|||
{
|
||||
[[NSProcessInfo processInfo] debugSet];
|
||||
}
|
||||
debugImp = [_debug_set methodForSelector: debugSel];
|
||||
debugImp = (id (*)(id,SEL,id))[_debug_set methodForSelector: debugSel];
|
||||
if (debugImp == 0)
|
||||
{
|
||||
fprintf(stderr, "Unable to set up with [NSProcessInfo-debugSet]\n");
|
||||
|
|
|
@ -415,7 +415,8 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
const char *iBaseString;
|
||||
const char *iSizeString;
|
||||
SEL objSel = @selector(objectForKey:);
|
||||
IMP myObj = [obj methodForSelector: objSel];
|
||||
id (*myObj)(id,SEL,id)
|
||||
= (id(*)(id,SEL,id))[obj methodForSelector: objSel];
|
||||
unsigned i;
|
||||
NSArray *keyArray = [obj allKeys];
|
||||
unsigned numKeys = [keyArray count];
|
||||
|
@ -642,7 +643,8 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
OAppend(aPropertyList, loc, 0, step > 3 ? 3 : step, dest);
|
||||
return dest;
|
||||
}
|
||||
return (*originalImp)(self, _cmd, aPropertyList, aFormat, anErrorString);
|
||||
return (*(id(*)(id,SEL,id,id,id))originalImp)
|
||||
(self, _cmd, aPropertyList, aFormat, anErrorString);
|
||||
}
|
||||
|
||||
+ (void) load
|
||||
|
|
|
@ -64,8 +64,15 @@
|
|||
NSMutableString *urlString;
|
||||
NSString *s;
|
||||
|
||||
urlString = [scheme mutableCopy];
|
||||
[urlString appendString: @"://"];
|
||||
if (scheme != nil)
|
||||
{
|
||||
urlString = [scheme mutableCopy];
|
||||
[urlString appendString: @"://"];
|
||||
}
|
||||
else
|
||||
{
|
||||
urlString = [[NSMutableString alloc] init];
|
||||
}
|
||||
if ([user length] > 0 || [password length] > 0)
|
||||
{
|
||||
if (nil == (s = user)) s = @"";
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -683,7 +683,8 @@ SANITY();
|
|||
unsigned tmpLength;
|
||||
unsigned arrayIndex = 0;
|
||||
unsigned arraySize;
|
||||
NSRange effectiveRange = NSMakeRange(0, NSNotFound);
|
||||
// Initial value unused; set by _attributesAtIndexEffectiveRange
|
||||
NSRange effectiveRange = NSMakeRange(NSNotFound, 0);
|
||||
unsigned afterRangeLoc, beginRangeLoc;
|
||||
NSDictionary *attrs;
|
||||
NSZone *z = [self zone];
|
||||
|
@ -795,7 +796,8 @@ SANITY();
|
|||
unsigned tmpLength;
|
||||
unsigned arrayIndex = 0;
|
||||
unsigned arraySize;
|
||||
NSRange effectiveRange = NSMakeRange(0, NSNotFound);
|
||||
// Initial value unused; set by _attributesAtIndexEffectiveRange
|
||||
NSRange effectiveRange = NSMakeRange(NSNotFound, 0);
|
||||
GSAttrInfo *info;
|
||||
int moveLocations;
|
||||
unsigned start;
|
||||
|
|
|
@ -426,7 +426,6 @@ static SEL objSel;
|
|||
{
|
||||
GSIMapNode node;
|
||||
|
||||
_version++;
|
||||
if (aKey == nil)
|
||||
{
|
||||
NSException *e;
|
||||
|
@ -448,6 +447,7 @@ static SEL objSel;
|
|||
userInfo: self];
|
||||
[e raise];
|
||||
}
|
||||
_version++;
|
||||
node = GSIMapNodeForKey(&map, (GSIMapKey)aKey);
|
||||
if (node)
|
||||
{
|
||||
|
|
|
@ -40,12 +40,8 @@
|
|||
|
||||
#if defined(_WIN32)
|
||||
|
||||
#if defined(__WIN64__)
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#include <io.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <wininet.h>
|
||||
#if !defined(EAFNOSUPPORT)
|
||||
|
|
|
@ -56,12 +56,21 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
extern const char *inet_ntop(int, const void *, char *, size_t);
|
||||
extern int inet_pton(int , const char *, void *);
|
||||
#define OPTLEN int
|
||||
#else
|
||||
#define OPTLEN socklen_t
|
||||
#endif
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
#endif // HAVE_WS2TCPIP_H
|
||||
|
||||
#if !defined(HAVE_INET_NTOP)
|
||||
extern const char* WSAAPI inet_ntop(int, const void *, char *, size_t);
|
||||
#endif
|
||||
#if !defined(HAVE_INET_NTOP)
|
||||
extern int WSAAPI inet_pton(int , const char *, void *);
|
||||
#endif
|
||||
|
||||
#define OPTLEN int
|
||||
#else // _WIN32
|
||||
#define OPTLEN socklen_t
|
||||
#endif // _WIN32
|
||||
|
||||
unsigned
|
||||
GSPrivateSockaddrLength(struct sockaddr *addr)
|
||||
|
|
|
@ -807,6 +807,10 @@ tinyEqualToString(uintptr_t s, NSString *aString)
|
|||
{
|
||||
return YES;
|
||||
}
|
||||
if (nil == aString)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
l = (s >> TINY_STRING_LENGTH_SHIFT) & TINY_STRING_LENGTH_MASK;
|
||||
if ([aString length] != l)
|
||||
|
|
|
@ -1117,7 +1117,8 @@ static NSMutableDictionary *credentialsCache = nil;
|
|||
NSMutableString *k;
|
||||
|
||||
/* Build a unique key for the credentials based on all the
|
||||
* information (file names and password) used to build them.
|
||||
* information used to build them (apart from password used
|
||||
* to load the key).
|
||||
*/
|
||||
k = [NSMutableString stringWithCapacity: 1024];
|
||||
ca = standardizedPath(ca);
|
||||
|
@ -1133,8 +1134,6 @@ static NSMutableDictionary *credentialsCache = nil;
|
|||
if (nil != cf) [k appendString: cf];
|
||||
[k appendString: @":"];
|
||||
if (nil != ck) [k appendString: ck];
|
||||
[k appendString: @":"];
|
||||
if (nil != cp) [k appendString: cp];
|
||||
|
||||
[credentialsLock lock];
|
||||
c = [credentialsCache objectForKey: k];
|
||||
|
|
|
@ -2228,6 +2228,24 @@ IF_NO_GC(
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
/* Android: check for directory resources by passing file path as subpath,
|
||||
* as AAssetDir and thereby NSDirectoryEnumerator doesn't list directories
|
||||
*/
|
||||
subPath = subPath ? [subPath stringByAppendingPathComponent: file] : file;
|
||||
pathlist = [[self _bundleResourcePathsWithRootPath: rootPath
|
||||
subPath: subPath localization: nil] objectEnumerator];
|
||||
while ((path = [pathlist nextObject]) != nil)
|
||||
{
|
||||
NSString *lastPathComponent = [path lastPathComponent];
|
||||
if ([lastPathComponent isEqualToString:file]
|
||||
&& [mgr isReadableFileAtPath: path])
|
||||
{
|
||||
return path;
|
||||
}
|
||||
}
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -49,12 +49,6 @@
|
|||
#undef GNUSTEP_INDEX_CHARSET
|
||||
|
||||
#import "NSCharacterSetData.h"
|
||||
#import "CharSets/URLFragmentAllowedCharSet.h"
|
||||
#import "CharSets/URLHostAllowedCharSet.h"
|
||||
#import "CharSets/URLPasswordAllowedCharSet.h"
|
||||
#import "CharSets/URLPathAllowedCharSet.h"
|
||||
#import "CharSets/URLQueryAllowedCharSet.h"
|
||||
#import "CharSets/URLUserAllowedCharSet.h"
|
||||
|
||||
#define GSUNICODE_MAX 1114112
|
||||
#define GSBITMAP_SIZE 8192
|
||||
|
@ -122,6 +116,20 @@
|
|||
i--;
|
||||
}
|
||||
i *= GSBITMAP_SIZE;
|
||||
if (GSBITMAP_SIZE == i)
|
||||
{
|
||||
/* In the base plane, find the number of used bytes, so we don't
|
||||
* produce a bitmap that is longer than necessary.
|
||||
*/
|
||||
if (_length < i)
|
||||
{
|
||||
i = _length;
|
||||
}
|
||||
while (i > 0 && 0 == _data[i - 1])
|
||||
{
|
||||
i--;
|
||||
}
|
||||
}
|
||||
if (i < _length)
|
||||
{
|
||||
return [NSData dataWithBytes: _data length: i];
|
||||
|
@ -206,7 +214,7 @@
|
|||
{
|
||||
unsigned length = [bitmap length];
|
||||
|
||||
if ((length % GSBITMAP_SIZE) != 0 || length > GSBITMAP_MAX)
|
||||
if (length > GSBITMAP_MAX)
|
||||
{
|
||||
NSLog(@"attempt to initialize character set with invalid bitmap");
|
||||
[self dealloc];
|
||||
|
@ -280,13 +288,22 @@
|
|||
}
|
||||
|
||||
/* Make space if needed.
|
||||
* Use exact size if we have nothing beyond the base plane,
|
||||
* otherwise round up to a plane boundary.
|
||||
*/
|
||||
b = (m - 1) / 8;
|
||||
if (b >= _length)
|
||||
{
|
||||
while (b >= _length)
|
||||
if (b < GSBITMAP_SIZE)
|
||||
{
|
||||
_length += GSBITMAP_SIZE;
|
||||
_length = b + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (b >= _length)
|
||||
{
|
||||
_length += GSBITMAP_SIZE;
|
||||
}
|
||||
}
|
||||
[_obj setLength: _length];
|
||||
_data = [_obj mutableBytes];
|
||||
|
@ -337,10 +354,14 @@
|
|||
if (length > 0)
|
||||
{
|
||||
NSUInteger i;
|
||||
unsigned max = _length;
|
||||
unichar (*get)(id, SEL, NSUInteger);
|
||||
|
||||
get = (unichar (*)(id, SEL, NSUInteger))
|
||||
[aString methodForSelector: @selector(characterAtIndex:)];
|
||||
|
||||
/* Determine size of bitmap needed.
|
||||
*/
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
unichar letter;
|
||||
|
@ -358,15 +379,49 @@
|
|||
+ (second - 0xdc00) + 0x0010000;
|
||||
}
|
||||
byte = letter/8;
|
||||
if (byte >= _length)
|
||||
if (byte >= max)
|
||||
{
|
||||
while (byte >= _length)
|
||||
max = byte;
|
||||
}
|
||||
}
|
||||
/* Make space if needed.
|
||||
* Use exact size if we have nothing beyond the base plane,
|
||||
* otherwise round up to a plane boundary.
|
||||
*/
|
||||
if (max >= _length)
|
||||
{
|
||||
if (max < GSBITMAP_SIZE)
|
||||
{
|
||||
_length = max + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (max >= _length)
|
||||
{
|
||||
_length += GSBITMAP_SIZE;
|
||||
}
|
||||
[_obj setLength: _length];
|
||||
_data = [_obj mutableBytes];
|
||||
}
|
||||
[_obj setLength: _length];
|
||||
_data = [_obj mutableBytes];
|
||||
}
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
unichar letter;
|
||||
unichar second;
|
||||
unsigned byte;
|
||||
|
||||
letter = (*get)(aString, @selector(characterAtIndex:), i);
|
||||
// Convert a surrogate pair if necessary
|
||||
if (letter >= 0xd800 && letter <= 0xdbff && i < length-1
|
||||
&& (second = (*get)(aString, @selector(characterAtIndex:), i+1))
|
||||
>= 0xdc00 && second <= 0xdfff)
|
||||
{
|
||||
i++;
|
||||
letter = ((letter - 0xd800) << 10)
|
||||
+ (second - 0xdc00) + 0x0010000;
|
||||
}
|
||||
byte = letter/8;
|
||||
GSSETBIT(_data[byte], letter % 8);
|
||||
}
|
||||
}
|
||||
|
@ -382,6 +437,20 @@
|
|||
i--;
|
||||
}
|
||||
i *= GSBITMAP_SIZE;
|
||||
if (GSBITMAP_SIZE == i)
|
||||
{
|
||||
/* In the base plane, find the number of used bytes, so we don't
|
||||
* produce a bitmap that is longer than necessary.
|
||||
*/
|
||||
if (_length < i)
|
||||
{
|
||||
i = _length;
|
||||
}
|
||||
while (i > 0 && 0 == _data[i - 1])
|
||||
{
|
||||
i--;
|
||||
}
|
||||
}
|
||||
return [NSData dataWithBytes: _data length: i];
|
||||
}
|
||||
|
||||
|
@ -430,7 +499,7 @@
|
|||
unsigned length = [bitmap length];
|
||||
id tmp;
|
||||
|
||||
if ((length % GSBITMAP_SIZE) != 0 || length > GSBITMAP_MAX)
|
||||
if (length > GSBITMAP_MAX)
|
||||
{
|
||||
NSLog(@"attempt to initialize character set with invalid bitmap");
|
||||
[self dealloc];
|
||||
|
@ -623,7 +692,8 @@ static Class concreteMutableClass = nil;
|
|||
|
||||
- (id) initWithBitmap: (NSData*)bitmap number: (int)number
|
||||
{
|
||||
if ((self = (_GSStaticCharSet*)[(NSBitmapCharSet*)self initWithBitmap: bitmap]) != nil)
|
||||
if ((self = (_GSStaticCharSet*)[(NSBitmapCharSet*)self
|
||||
initWithBitmap: bitmap]) != nil)
|
||||
{
|
||||
_index = number;
|
||||
}
|
||||
|
@ -841,56 +911,66 @@ static Class concreteMutableClass = nil;
|
|||
|
||||
+ (id) URLFragmentAllowedCharacterSet
|
||||
{
|
||||
return [self _staticSet: urlFragmentAllowedCharSet
|
||||
length: sizeof(urlFragmentAllowedCharSet)
|
||||
return [self _staticSet: URLFragmentAllowedCharSet
|
||||
length: sizeof(URLFragmentAllowedCharSet)
|
||||
number: 15];
|
||||
}
|
||||
|
||||
+ (id) URLPasswordAllowedCharacterSet
|
||||
{
|
||||
return [self _staticSet: urlPasswordAllowedCharSet
|
||||
length: sizeof(urlPasswordAllowedCharSet)
|
||||
return [self _staticSet: URLPasswordAllowedCharSet
|
||||
length: sizeof(URLPasswordAllowedCharSet)
|
||||
number: 16];
|
||||
}
|
||||
|
||||
+ (id) URLPathAllowedCharacterSet
|
||||
{
|
||||
return [self _staticSet: urlPathAllowedCharSet
|
||||
length: sizeof(urlPathAllowedCharSet)
|
||||
return [self _staticSet: URLPathAllowedCharSet
|
||||
length: sizeof(URLPathAllowedCharSet)
|
||||
number: 17];
|
||||
}
|
||||
|
||||
+ (id) URLQueryAllowedCharacterSet
|
||||
{
|
||||
return [self _staticSet: urlQueryAllowedCharSet
|
||||
length: sizeof(urlQueryAllowedCharSet)
|
||||
return [self _staticSet: URLQueryAllowedCharSet
|
||||
length: sizeof(URLQueryAllowedCharSet)
|
||||
number: 18];
|
||||
}
|
||||
|
||||
+ (id) URLUserAllowedCharacterSet
|
||||
{
|
||||
return [self _staticSet: urlUserAllowedCharSet
|
||||
length: sizeof(urlUserAllowedCharSet)
|
||||
return [self _staticSet: URLUserAllowedCharSet
|
||||
length: sizeof(URLUserAllowedCharSet)
|
||||
number: 19];
|
||||
}
|
||||
|
||||
+ (id) URLHostAllowedCharacterSet
|
||||
{
|
||||
return [self _staticSet: urlHostAllowedCharSet
|
||||
length: sizeof(urlHostAllowedCharSet)
|
||||
return [self _staticSet: URLHostAllowedCharSet
|
||||
length: sizeof(URLHostAllowedCharSet)
|
||||
number: 20];
|
||||
}
|
||||
|
||||
- (NSData*) bitmapRepresentation
|
||||
{
|
||||
BOOL (*imp)(id, SEL, unichar);
|
||||
NSMutableData *m = [NSMutableData dataWithLength: 8192];
|
||||
unsigned char *p = (unsigned char*)[m mutableBytes];
|
||||
NSMutableData *m;
|
||||
unsigned char *p;
|
||||
unsigned end;
|
||||
unsigned i;
|
||||
|
||||
imp = (BOOL (*)(id,SEL,unichar))
|
||||
[self methodForSelector: @selector(characterIsMember:)];
|
||||
for (i = 0; i <= 0xffff; i++)
|
||||
for (end = 0xffff; end > 0; end--)
|
||||
{
|
||||
if (imp(self, @selector(characterIsMember:), end) == YES)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
m = [NSMutableData dataWithLength: end / 8 + 1];
|
||||
p = (unsigned char*)[m mutableBytes];
|
||||
for (i = 0; i <= end; i++)
|
||||
{
|
||||
if (imp(self, @selector(characterIsMember:), i) == YES)
|
||||
{
|
||||
|
@ -970,25 +1050,21 @@ static Class concreteMutableClass = nil;
|
|||
|
||||
- (NSCharacterSet*) invertedSet
|
||||
{
|
||||
unsigned i;
|
||||
unsigned length;
|
||||
unsigned char *bytes;
|
||||
NSMutableData *bitmap;
|
||||
NSMutableCharacterSet *m = [self mutableCopy];
|
||||
NSCharacterSet *c;
|
||||
|
||||
bitmap = AUTORELEASE([[self bitmapRepresentation] mutableCopy]);
|
||||
length = [bitmap length];
|
||||
bytes = [bitmap mutableBytes];
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
bytes[i] = ~bytes[i];
|
||||
}
|
||||
return [[self class] characterSetWithBitmapRepresentation: bitmap];
|
||||
[m invert];
|
||||
c = [m copy];
|
||||
RELEASE(m);
|
||||
return AUTORELEASE(c);
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (id)anObject
|
||||
{
|
||||
if (anObject == self)
|
||||
return YES;
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
if ([anObject isKindOfClass: abstractClass])
|
||||
{
|
||||
unsigned i;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1392,7 +1392,7 @@ const NSMapTableValueCallBacks NSOwnedPointerMapValueCallBacks =
|
|||
if (GSI_MAP_READ_VALUE(self, &node->value).obj != anObject)
|
||||
{
|
||||
GSI_MAP_RELEASE_VAL(self, node->value);
|
||||
node->value.obj = anObject;
|
||||
GSI_MAP_WRITE_VAL(self, &node->value, (GSIMapVal)anObject);
|
||||
GSI_MAP_RETAIN_VAL(self, node->value);
|
||||
version++;
|
||||
}
|
||||
|
|
|
@ -335,7 +335,7 @@ GS_PRIVATE_INTERNAL(NSConnection)
|
|||
- (void) removeLocalObject: (NSDistantObject*)anObj;
|
||||
|
||||
- (void) _doneInReply: (NSPortCoder*)c;
|
||||
- (void) _doneInRmc: (NSPortCoder*)c;
|
||||
- (void) _doneInRmc: (NSPortCoder*) NS_CONSUMED c;
|
||||
- (void) _failInRmc: (NSPortCoder*)c;
|
||||
- (void) _failOutRmc: (NSPortCoder*)c;
|
||||
- (NSPortCoder*) _getReplyRmc: (int)sn for: (const char*)request;
|
||||
|
|
|
@ -1787,9 +1787,11 @@ failure:
|
|||
{
|
||||
/*
|
||||
* We have created a new file - so we attempt to make it's
|
||||
* attributes match that of the original.
|
||||
* attributes match that of the original (except for those
|
||||
* we can't reasonably set).
|
||||
*/
|
||||
[att removeObjectForKey: NSFileSize];
|
||||
[att removeObjectForKey: NSFileCreationDate];
|
||||
[att removeObjectForKey: NSFileModificationDate];
|
||||
[att removeObjectForKey: NSFileReferenceCount];
|
||||
[att removeObjectForKey: NSFileSystemNumber];
|
||||
|
@ -1798,10 +1800,21 @@ failure:
|
|||
[att removeObjectForKey: NSFileType];
|
||||
if ([mgr changeFileAttributes: att atPath: path] == NO)
|
||||
{
|
||||
NSWarnMLog(@"Unable to correctly set all attributes for '%@'",
|
||||
path);
|
||||
NSWarnMLog(@"Unable to correctly set attributes for '%@' to %@",
|
||||
path, att);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_GETEUID
|
||||
else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO)
|
||||
{
|
||||
att = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
NSFileOwnerAccountName, NSUserName(), nil];
|
||||
if ([mgr changeFileAttributes: att atPath: path] == NO)
|
||||
{
|
||||
NSWarnMLog(@"Unable to correctly set ownership for '%@'", path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* success: */
|
||||
|
@ -1961,6 +1974,7 @@ failure:
|
|||
* attributes match that of the original.
|
||||
*/
|
||||
[mAtt removeObjectForKey: NSFileSize];
|
||||
[mAtt removeObjectForKey: NSFileCreationDate];
|
||||
[mAtt removeObjectForKey: NSFileModificationDate];
|
||||
[mAtt removeObjectForKey: NSFileReferenceCount];
|
||||
[mAtt removeObjectForKey: NSFileSystemNumber];
|
||||
|
@ -1969,19 +1983,21 @@ failure:
|
|||
[mAtt removeObjectForKey: NSFileType];
|
||||
if ([mgr changeFileAttributes: mAtt atPath: path] == NO)
|
||||
{
|
||||
NSWarnMLog(@"Unable to correctly set all attributes for '%@'",
|
||||
path);
|
||||
NSWarnMLog(@"Unable to correctly set attributes for '%@' to %@",
|
||||
path, mAtt);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_GETEUID
|
||||
else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO)
|
||||
{
|
||||
att = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
NSFileOwnerAccountName, NSUserName(), nil];
|
||||
NSFileOwnerAccountName, NSUserName(), nil];
|
||||
if ([mgr changeFileAttributes: att atPath: path] == NO)
|
||||
{
|
||||
NSWarnMLog(@"Unable to correctly set ownership for '%@'", path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* success: */
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
- (instancetype) init
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
if (self != nil)
|
||||
{
|
||||
_calendar = nil;
|
||||
_referenceDate = nil;
|
||||
|
@ -43,13 +43,14 @@
|
|||
_includesApproximationPhrase = NO;
|
||||
_formattingContext = NSFormattingContextUnknown;
|
||||
_maximumUnitCount = 0;
|
||||
_zeroFormattingBehavior = NSDateComponentsFormatterZeroFormattingBehaviorDefault;
|
||||
_allowedUnits = NSCalendarUnitYear |
|
||||
NSCalendarUnitMonth |
|
||||
NSCalendarUnitDay |
|
||||
NSCalendarUnitHour |
|
||||
NSCalendarUnitMinute |
|
||||
NSCalendarUnitSecond;
|
||||
_zeroFormattingBehavior
|
||||
= NSDateComponentsFormatterZeroFormattingBehaviorDefault;
|
||||
_allowedUnits = NSCalendarUnitYear
|
||||
| NSCalendarUnitMonth
|
||||
| NSCalendarUnitDay
|
||||
| NSCalendarUnitHour
|
||||
| NSCalendarUnitMinute
|
||||
| NSCalendarUnitSecond;
|
||||
_unitsStyle = NSDateComponentsFormatterUnitsStylePositional;
|
||||
}
|
||||
return self;
|
||||
|
@ -58,7 +59,7 @@
|
|||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder: coder];
|
||||
if(self != nil)
|
||||
if (self != nil)
|
||||
{
|
||||
// TODO: Implement coding...
|
||||
}
|
||||
|
@ -82,11 +83,11 @@
|
|||
{
|
||||
NSString *result = nil;
|
||||
|
||||
if([obj isKindOfClass: [NSDateComponents class]])
|
||||
if ([obj isKindOfClass: [NSDateComponents class]])
|
||||
{
|
||||
result = [self stringFromDateComponents: obj];
|
||||
}
|
||||
else if([obj isKindOfClass: [NSNumber class]])
|
||||
else if ([obj isKindOfClass: [NSNumber class]])
|
||||
{
|
||||
NSTimeInterval ti = [obj longLongValue];
|
||||
result = [self stringFromTimeInterval: ti];
|
||||
|
@ -99,260 +100,296 @@
|
|||
{
|
||||
NSString *result = @"";
|
||||
|
||||
if(_allowedUnits | NSCalendarUnitYear)
|
||||
if (_allowedUnits & NSCalendarUnitYear)
|
||||
{
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
{
|
||||
NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
|
||||
NSNumber *num = [NSNumber numberWithInteger: [components year]];
|
||||
AUTORELEASE(fmt);
|
||||
[fmt setNumberStyle: NSNumberFormatterSpellOutStyle];
|
||||
result = [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result
|
||||
= [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result = [result stringByAppendingString: @" years"];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_zeroFormattingBehavior | NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
if (_zeroFormattingBehavior
|
||||
& NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
{
|
||||
NSString *s = [NSString stringWithFormat: @"%4ld", [components year]];
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"%4ld", [components year]];
|
||||
result = [result stringByAppendingString: s];
|
||||
}
|
||||
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
{
|
||||
result = [result stringByAppendingString: @" yr "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
else if (_unitsStyle
|
||||
== NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
{
|
||||
result = [result stringByAppendingString: @" yr "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
{
|
||||
result = [result stringByAppendingString: @" yr "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
{
|
||||
result = [result stringByAppendingString: @" years "];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_allowedUnits | NSCalendarUnitMonth)
|
||||
if (_allowedUnits & NSCalendarUnitMonth)
|
||||
{
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
{
|
||||
NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
|
||||
NSNumber *num = [NSNumber numberWithInteger: [components month]];
|
||||
AUTORELEASE(fmt);
|
||||
[fmt setNumberStyle: NSNumberFormatterSpellOutStyle];
|
||||
result = [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result
|
||||
= [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result = [result stringByAppendingString: @" months "];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_zeroFormattingBehavior | NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
if (_zeroFormattingBehavior
|
||||
& NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
{
|
||||
NSString *s = [NSString stringWithFormat: @"%2ld", [components month]];
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"%2ld", [components month]];
|
||||
result = [result stringByAppendingString: s];
|
||||
}
|
||||
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
{
|
||||
result = [result stringByAppendingString: @" "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
else if (_unitsStyle
|
||||
== NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
{
|
||||
result = [result stringByAppendingString: @" mn "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
{
|
||||
result = [result stringByAppendingString: @" mon "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
{
|
||||
result = [result stringByAppendingString: @" months "];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_allowedUnits | NSCalendarUnitDay)
|
||||
if (_allowedUnits & NSCalendarUnitDay)
|
||||
{
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
{
|
||||
NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
|
||||
NSNumber *num = [NSNumber numberWithInteger: [components day]];
|
||||
AUTORELEASE(fmt);
|
||||
[fmt setNumberStyle: NSNumberFormatterSpellOutStyle];
|
||||
result = [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result
|
||||
= [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result = [result stringByAppendingString: @" days "];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_zeroFormattingBehavior | NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
if (_zeroFormattingBehavior
|
||||
& NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
{
|
||||
NSString *s = [NSString stringWithFormat: @"%2ld", [components day]];
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"%2ld", [components day]];
|
||||
result = [result stringByAppendingString: s];
|
||||
}
|
||||
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
{
|
||||
result = [result stringByAppendingString: @" "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
else if (_unitsStyle
|
||||
== NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
{
|
||||
result = [result stringByAppendingString: @" d "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
{
|
||||
result = [result stringByAppendingString: @" day "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
{
|
||||
result = [result stringByAppendingString: @" days "];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_allowedUnits | NSCalendarUnitHour)
|
||||
if (_allowedUnits & NSCalendarUnitHour)
|
||||
{
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
{
|
||||
NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
|
||||
NSNumber *num = [NSNumber numberWithInteger: [components hour]];
|
||||
AUTORELEASE(fmt);
|
||||
[fmt setNumberStyle: NSNumberFormatterSpellOutStyle];
|
||||
result = [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result
|
||||
= [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result = [result stringByAppendingString: @" hours "];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_zeroFormattingBehavior | NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
if (_zeroFormattingBehavior
|
||||
& NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
{
|
||||
NSString *s = [NSString stringWithFormat: @"%2ld", [components hour]];
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"%2ld", [components hour]];
|
||||
result = [result stringByAppendingString: s];
|
||||
}
|
||||
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
{
|
||||
result = [result stringByAppendingString: @" "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
else if (_unitsStyle
|
||||
== NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
{
|
||||
result = [result stringByAppendingString: @" h "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
{
|
||||
result = [result stringByAppendingString: @" hrs "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
{
|
||||
result = [result stringByAppendingString: @" hours "];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_allowedUnits | NSCalendarUnitMinute)
|
||||
if (_allowedUnits & NSCalendarUnitMinute)
|
||||
{
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
{
|
||||
NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
|
||||
NSNumber *num = [NSNumber numberWithInteger: [components minute]];
|
||||
AUTORELEASE(fmt);
|
||||
[fmt setNumberStyle: NSNumberFormatterSpellOutStyle];
|
||||
result = [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result
|
||||
= [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result = [result stringByAppendingString: @" minutes "];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_zeroFormattingBehavior | NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
if (_zeroFormattingBehavior
|
||||
& NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
{
|
||||
NSString *s = [NSString stringWithFormat: @"%2ld", [components minute]];
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"%2ld", [components minute]];
|
||||
result = [result stringByAppendingString: s];
|
||||
}
|
||||
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
{
|
||||
result = [result stringByAppendingString: @" "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
else if (_unitsStyle
|
||||
== NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
{
|
||||
result = [result stringByAppendingString: @" min "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
{
|
||||
result = [result stringByAppendingString: @" mins "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
{
|
||||
result = [result stringByAppendingString: @" minutes "];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_allowedUnits | NSCalendarUnitSecond)
|
||||
if (_allowedUnits & NSCalendarUnitSecond)
|
||||
{
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
{
|
||||
NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
|
||||
NSNumber *num = [NSNumber numberWithInteger: [components second]];
|
||||
AUTORELEASE(fmt);
|
||||
[fmt setNumberStyle: NSNumberFormatterSpellOutStyle];
|
||||
result = [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result
|
||||
= [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result = [result stringByAppendingString: @" seconds "];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_zeroFormattingBehavior | NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
if (_zeroFormattingBehavior
|
||||
& NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
{
|
||||
NSString *s = [NSString stringWithFormat: @"%2ld", [components second]];
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"%2ld", [components second]];
|
||||
result = [result stringByAppendingString: s];
|
||||
}
|
||||
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
{
|
||||
result = [result stringByAppendingString: @" "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
else if (_unitsStyle
|
||||
== NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
{
|
||||
result = [result stringByAppendingString: @" s "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
{
|
||||
result = [result stringByAppendingString: @" secs "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
{
|
||||
result = [result stringByAppendingString: @" seconds "];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_allowedUnits | NSCalendarUnitWeekOfMonth)
|
||||
if (_allowedUnits & NSCalendarUnitWeekOfMonth)
|
||||
{
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStyleSpellOut)
|
||||
{
|
||||
NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
|
||||
NSNumber *num = [NSNumber numberWithInteger: [components weekOfMonth]];
|
||||
AUTORELEASE(fmt);
|
||||
NSNumberFormatter *fmt;
|
||||
NSNumber *num;
|
||||
|
||||
fmt = AUTORELEASE([[NSNumberFormatter alloc] init]);
|
||||
num = [NSNumber numberWithInteger: [components weekOfMonth]];
|
||||
[fmt setNumberStyle: NSNumberFormatterSpellOutStyle];
|
||||
result = [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result
|
||||
= [result stringByAppendingString: [fmt stringFromNumber: num]];
|
||||
result = [result stringByAppendingString: @" days "];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_zeroFormattingBehavior | NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
if (_zeroFormattingBehavior
|
||||
& NSDateComponentsFormatterZeroFormattingBehaviorDefault)
|
||||
{
|
||||
NSString *s = [NSString stringWithFormat: @"%2ld", [components weekOfMonth]];
|
||||
long wom = (long)[components weekOfMonth];
|
||||
NSString *s = [NSString stringWithFormat: @"%2ld", wom];
|
||||
result = [result stringByAppendingString: s];
|
||||
}
|
||||
|
||||
if(_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
if (_unitsStyle == NSDateComponentsFormatterUnitsStylePositional)
|
||||
{
|
||||
result = [result stringByAppendingString: @" "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
else if (_unitsStyle
|
||||
== NSDateComponentsFormatterUnitsStyleAbbreviated)
|
||||
{
|
||||
result = [result stringByAppendingString: @" wm "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleShort)
|
||||
{
|
||||
result = [result stringByAppendingString: @" wom "];
|
||||
}
|
||||
else if(_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
else if (_unitsStyle == NSDateComponentsFormatterUnitsStyleFull)
|
||||
{
|
||||
result = [result stringByAppendingString: @" week of month "];
|
||||
}
|
||||
|
@ -365,8 +402,10 @@
|
|||
- (NSString *) stringFromDate: (NSDate *)startDate
|
||||
toDate: (NSDate *)endDate
|
||||
{
|
||||
NSDateComponents *dc = nil;
|
||||
NSCalendar *calendar = ( _calendar != nil ) ? _calendar : [NSCalendar currentCalendar];
|
||||
NSDateComponents *dc;
|
||||
NSCalendar *calendar;
|
||||
|
||||
calendar = ( _calendar != nil ) ? _calendar : [NSCalendar currentCalendar];
|
||||
dc = [calendar components: _allowedUnits
|
||||
fromDate: startDate
|
||||
toDate: endDate
|
||||
|
@ -398,13 +437,13 @@
|
|||
|
||||
- (void) setAllowedUnits: (NSCalendarUnit)units
|
||||
{
|
||||
if(units | NSCalendarUnitYear &&
|
||||
units | NSCalendarUnitMonth &&
|
||||
units | NSCalendarUnitDay &&
|
||||
units | NSCalendarUnitHour &&
|
||||
units | NSCalendarUnitMinute &&
|
||||
units | NSCalendarUnitSecond &&
|
||||
units | NSCalendarUnitWeekOfMonth)
|
||||
if (units & NSCalendarUnitYear
|
||||
&& units & NSCalendarUnitMonth
|
||||
&& units & NSCalendarUnitDay
|
||||
&& units & NSCalendarUnitHour
|
||||
&& units & NSCalendarUnitMinute
|
||||
&& units & NSCalendarUnitSecond
|
||||
&& units & NSCalendarUnitWeekOfMonth)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Passed invalid unit into allowedUnits"];
|
||||
|
@ -492,7 +531,9 @@
|
|||
_formattingContext = formattingContext;
|
||||
}
|
||||
|
||||
- (BOOL) getObjectValue: (id*)obj forString: (NSString *)string errorDescription: (NSString **)error
|
||||
- (BOOL) getObjectValue: (id*)obj
|
||||
forString: (NSString *)string
|
||||
errorDescription: (NSString **)error
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
|
|
@ -960,11 +960,11 @@ compareIt(id o1, id o2, void* context)
|
|||
- (NSArray *) keysSortedByValueWithOptions: (NSSortOptions)opts
|
||||
usingComparator: (NSComparator)cmptr
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSArray *sortedValues;
|
||||
NSArray *noDuplicates;
|
||||
NSMutableArray *result;
|
||||
|
||||
ENTER_POOL
|
||||
sortedValues = [[self allValues] sortedArrayWithOptions: opts
|
||||
usingComparator: cmptr];
|
||||
noDuplicates = [[NSOrderedSet orderedSetWithArray: sortedValues] array];
|
||||
|
@ -972,7 +972,7 @@ compareIt(id o1, id o2, void* context)
|
|||
FOR_IN(NSObject*, value, noDuplicates)
|
||||
[result addObjectsFromArray: [self allKeysForObject: value]];
|
||||
END_FOR_IN(noDuplicates)
|
||||
RELEASE(arp);
|
||||
LEAVE_POOL
|
||||
return AUTORELEASE(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,14 +46,14 @@ NSString* const NSRecoveryAttempterErrorKey
|
|||
NSString* const NSURLErrorFailingURLErrorKey = @"NSErrorFailingURLKey";
|
||||
NSString* const NSURLErrorFailingURLStringErrorKey = @"NSErrorFailingURLStringKey";
|
||||
|
||||
NSString* const NSMACHErrorDomain = @"NSMACHErrorDomain";
|
||||
NSString* const NSOSStatusErrorDomain = @"NSOSStatusErrorDomain";
|
||||
NSString* const NSPOSIXErrorDomain = @"NSPOSIXErrorDomain";
|
||||
NSString* const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
|
||||
NSErrorDomain const NSMACHErrorDomain = @"NSMACHErrorDomain";
|
||||
NSErrorDomain const NSOSStatusErrorDomain = @"NSOSStatusErrorDomain";
|
||||
NSErrorDomain const NSPOSIXErrorDomain = @"NSPOSIXErrorDomain";
|
||||
NSErrorDomain const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
|
||||
|
||||
@implementation NSError
|
||||
|
||||
+ (id) errorWithDomain: (NSString*)aDomain
|
||||
+ (id) errorWithDomain: (NSErrorDomain)aDomain
|
||||
code: (NSInteger)aCode
|
||||
userInfo: (NSDictionary*)aDictionary
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ NSString* const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
|
|||
return [self localizedDescription];
|
||||
}
|
||||
|
||||
- (NSString*) domain
|
||||
- (NSErrorDomain) domain
|
||||
{
|
||||
return _domain;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ NSString* const NSCocoaErrorDomain = @"NSCocoaErrorDomain";
|
|||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithDomain: (NSString*)aDomain
|
||||
- (id) initWithDomain: (NSErrorDomain)aDomain
|
||||
code: (NSInteger)aCode
|
||||
userInfo: (NSDictionary*)aDictionary
|
||||
{
|
||||
|
|
|
@ -565,7 +565,7 @@ GSListModules()
|
|||
#endif /* USE_BFD */
|
||||
|
||||
|
||||
#if defined(HAVE_UNWIND_H) && !defined(HAVE_BACKTRACE)
|
||||
#if defined(WITH_UNWIND) && !defined(HAVE_BACKTRACE)
|
||||
|
||||
#include <unwind.h>
|
||||
#if !defined(_WIN32)
|
||||
|
@ -593,7 +593,7 @@ GSUnwindCallback(struct _Unwind_Context* context, void* arg)
|
|||
return 0; //_URC_OK/_URC_NO_REASON
|
||||
}
|
||||
|
||||
#endif /* HAVE_UNWIND_H && !HAVE_BACKTRACE */
|
||||
#endif /* WITH_UNWIND && !HAVE_BACKTRACE */
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(USE_BFD)
|
||||
|
@ -1101,7 +1101,7 @@ GSPrivateReturnAddresses(NSUInteger **returns)
|
|||
{
|
||||
if (nil == addresses && numReturns > FrameOffset)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
ENTER_POOL
|
||||
NSInteger count = numReturns - FrameOffset;
|
||||
NSValue *objects[count];
|
||||
NSUInteger index;
|
||||
|
@ -1112,7 +1112,7 @@ GSPrivateReturnAddresses(NSUInteger **returns)
|
|||
objects[index] = [NSValue valueWithPointer: ptrs[FrameOffset+index]];
|
||||
}
|
||||
addresses = [[NSArray alloc] initWithObjects: objects count: count];
|
||||
DESTROY(pool);
|
||||
LEAVE_POOL
|
||||
}
|
||||
return addresses;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
NSFileManager.m
|
||||
|
||||
Copyright (C) 1997-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2020 Free Software Foundation, Inc.
|
||||
|
||||
Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
|
||||
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
||||
|
@ -564,18 +564,84 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
}
|
||||
|
||||
date = [attributes fileCreationDate];
|
||||
if (date != nil && NO == [date isEqual: [old fileCreationDate]])
|
||||
{
|
||||
BOOL ok = NO;
|
||||
struct _STATB sb;
|
||||
#if defined(_WIN32)
|
||||
const _CHAR *lpath;
|
||||
#else
|
||||
const char *lpath;
|
||||
#endif
|
||||
|
||||
lpath = [self fileSystemRepresentationWithPath: path];
|
||||
if (_STAT(lpath, &sb) != 0)
|
||||
{
|
||||
ok = NO;
|
||||
}
|
||||
#if defined(_WIN32)
|
||||
else if (sb.st_mode & _S_IFDIR)
|
||||
{
|
||||
ok = YES; // Directories don't have creation times.
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
NSTimeInterval ti = [date timeIntervalSince1970];
|
||||
#if defined(_WIN32)
|
||||
FILETIME ctime;
|
||||
HANDLE fh;
|
||||
ULONGLONG nanosecs = ((ULONGLONG)([date timeIntervalSince1970]*10000000)+116444736000000000ULL);
|
||||
fh = CreateFileW(lpath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
|
||||
if (fh == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
ok = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctime.dwLowDateTime = (DWORD) (nanosecs & 0xFFFFFFFF );
|
||||
ctime.dwHighDateTime = (DWORD) (nanosecs >> 32 );
|
||||
ok = SetFileTime(fh, &ctime, NULL, NULL);
|
||||
CloseHandle(fh);
|
||||
}
|
||||
/* on Unix we try setting the creation date by setting the modification date earlier than the current one */
|
||||
#elif defined (HAVE_UTIMENSAT)
|
||||
struct timespec ub[2];
|
||||
ub[0].tv_sec = 0;
|
||||
ub[0].tv_nsec = UTIME_OMIT; // we don't touch access time
|
||||
ub[1].tv_sec = truncl(ti);
|
||||
ub[1].tv_nsec = (ti - (double)ub[1].tv_sec) * 1.0e6;
|
||||
|
||||
ok = (utimensat(AT_FDCWD, lpath, ub, 0) == 0);
|
||||
#elif defined(_POSIX_VERSION)
|
||||
struct _UTIMB ub;
|
||||
ub.actime = sb.st_atime;
|
||||
ub.modtime = ti;
|
||||
ok = (_UTIME(lpath, &ub) == 0);
|
||||
#else
|
||||
time_t ub[2];
|
||||
ub[0] = sb.st_atime;
|
||||
ub[1] = ti;
|
||||
ok = (_UTIME(lpath, ub) == 0);
|
||||
#endif
|
||||
}
|
||||
if (ok == NO)
|
||||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileCreationDate to '%@' - %@",
|
||||
date, [NSError _last]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
||||
date = [attributes fileModificationDate];
|
||||
if (date != nil && NO == [date isEqual: [old fileModificationDate]])
|
||||
{
|
||||
BOOL ok = NO;
|
||||
struct _STATB sb;
|
||||
|
||||
#if defined(_WIN32) || defined(_POSIX_VERSION)
|
||||
struct _UTIMB ub;
|
||||
#else
|
||||
time_t ub[2];
|
||||
#endif
|
||||
|
||||
if (_STAT(lpath, &sb) != 0)
|
||||
{
|
||||
ok = NO;
|
||||
|
@ -588,13 +654,24 @@ static NSStringEncoding defaultEncoding;
|
|||
#endif
|
||||
else
|
||||
{
|
||||
#if defined(_WIN32) || defined(_POSIX_VERSION)
|
||||
NSTimeInterval ti = [date timeIntervalSince1970];
|
||||
#if defined (HAVE_UTIMENSAT)
|
||||
struct timespec ub[2];
|
||||
ub[0].tv_sec = 0;
|
||||
ub[0].tv_nsec = UTIME_OMIT; // we don't touch access time
|
||||
ub[1].tv_sec = truncl(ti);
|
||||
ub[1].tv_nsec = (ti - (double)ub[1].tv_sec) * 1.0e6;
|
||||
|
||||
ok = (utimensat(AT_FDCWD, lpath, ub, 0) == 0);
|
||||
#elif defined(_WIN32) || defined(_POSIX_VERSION)
|
||||
struct _UTIMB ub;
|
||||
ub.actime = sb.st_atime;
|
||||
ub.modtime = [date timeIntervalSince1970];
|
||||
ub.modtime = ti;
|
||||
ok = (_UTIME(lpath, &ub) == 0);
|
||||
#else
|
||||
time_t ub[2];
|
||||
ub[0] = sb.st_atime;
|
||||
ub[1] = [date timeIntervalSince1970];
|
||||
ub[1] = ti;
|
||||
ok = (_UTIME(lpath, ub) == 0);
|
||||
#endif
|
||||
}
|
||||
|
@ -688,7 +765,7 @@ static NSStringEncoding defaultEncoding;
|
|||
NSString *n = [a1 objectAtIndex: index];
|
||||
NSString *p1;
|
||||
NSString *p2;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
ENTER_POOL
|
||||
|
||||
p1 = [path1 stringByAppendingPathComponent: n];
|
||||
p2 = [path2 stringByAppendingPathComponent: n];
|
||||
|
@ -704,7 +781,7 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
ok = [self contentsEqualAtPath: p1 andPath: p2];
|
||||
}
|
||||
RELEASE(pool);
|
||||
LEAVE_POOL
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
@ -1203,9 +1280,10 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
fileType = [attrs fileType];
|
||||
|
||||
/*
|
||||
* Don't attempt to retain ownership of copy ... we want the copy
|
||||
/* Don't attempt to retain ownership of copy ... we want the copy
|
||||
* to be owned by the current user.
|
||||
* However, the new copy should have the creation/modification date
|
||||
* of the original (unlike Posix semantics).
|
||||
*/
|
||||
attrs = AUTORELEASE([attrs mutableCopy]);
|
||||
[(NSMutableDictionary*)attrs removeObjectForKey: NSFileOwnerAccountID];
|
||||
|
@ -1218,7 +1296,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
|
||||
/* If destination directory is a descendant of source directory copying
|
||||
isn't possible. */
|
||||
* isn't possible.
|
||||
*/
|
||||
if ([[destination stringByAppendingString: @"/"]
|
||||
hasPrefix: [source stringByAppendingString: @"/"]])
|
||||
{
|
||||
|
@ -1609,12 +1688,12 @@ static NSStringEncoding defaultEncoding;
|
|||
NSString *item;
|
||||
NSString *next;
|
||||
BOOL result;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
ENTER_POOL
|
||||
|
||||
item = [contents objectAtIndex: i];
|
||||
next = [path stringByAppendingPathComponent: item];
|
||||
result = [self removeFileAtPath: next handler: handler];
|
||||
RELEASE(pool);
|
||||
LEAVE_POOL
|
||||
if (result == NO)
|
||||
{
|
||||
return NO;
|
||||
|
@ -1728,8 +1807,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
#ifdef __ANDROID__
|
||||
/* Android: try using asset manager if path is in
|
||||
* main bundle resources
|
||||
*/
|
||||
* main bundle resources
|
||||
*/
|
||||
AAsset *asset = [NSBundle assetForPath: path];
|
||||
if (asset)
|
||||
{
|
||||
|
@ -1799,13 +1878,22 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// Android: try using asset manager if path is in main bundle resources
|
||||
/* Android: try using asset manager if path is in
|
||||
* main bundle resources
|
||||
*/
|
||||
AAsset *asset = [NSBundle assetForPath: path];
|
||||
if (asset)
|
||||
{
|
||||
AAsset_close(asset);
|
||||
return YES;
|
||||
}
|
||||
|
||||
AAssetDir *assetDir = [NSBundle assetDirForPath: path];
|
||||
if (assetDir)
|
||||
{
|
||||
AAssetDir_close(assetDir);
|
||||
return YES;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NO;
|
||||
|
@ -2725,7 +2813,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
if (dirname)
|
||||
{
|
||||
// Skip it if it is hidden and flag is yes...
|
||||
if ([[dir.path lastPathComponent] hasPrefix: @"."] && _flags.skipHidden == YES)
|
||||
if ([[dir.path lastPathComponent] hasPrefix: @"."]
|
||||
&& _flags.skipHidden == YES)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -2755,14 +2844,14 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
stringWithFileSystemRepresentation: dirname
|
||||
length: strlen(dirname)];
|
||||
#endif
|
||||
/* if we have a null FileName something went wrong (charset?) and we skip it */
|
||||
/* if we have a null FileName something went wrong (charset?)
|
||||
* and we skip it */
|
||||
if (returnFileName == nil)
|
||||
continue;
|
||||
|
||||
returnFileName = RETAIN([dir.path stringByAppendingPathComponent:
|
||||
returnFileName]);
|
||||
|
||||
/* TODO - can this one can be removed ? */
|
||||
if (!_flags.justContents)
|
||||
_currentFilePath = RETAIN([_topPath stringByAppendingPathComponent:
|
||||
returnFileName]);
|
||||
|
@ -2816,13 +2905,16 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
else
|
||||
{
|
||||
BOOL flag = YES;
|
||||
|
||||
NSDebugLog(@"Failed to recurse into directory '%@' - %@",
|
||||
_currentFilePath, [NSError _last]);
|
||||
if(_errorHandler != NULL)
|
||||
if (_errorHandler != NULL)
|
||||
{
|
||||
flag = CALL_BLOCK(_errorHandler, [NSURL URLWithString: _currentFilePath], [NSError _last]);
|
||||
flag = CALL_BLOCK(_errorHandler,
|
||||
[NSURL URLWithString: _currentFilePath],
|
||||
[NSError _last]);
|
||||
}
|
||||
if(flag == NO)
|
||||
if (flag == NO)
|
||||
{
|
||||
return nil; // Stop enumeration...
|
||||
}
|
||||
|
@ -3187,7 +3279,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
{
|
||||
NSDirectoryEnumerator *enumerator;
|
||||
NSString *dirEntry;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
BOOL result = YES;
|
||||
ENTER_POOL
|
||||
|
||||
enumerator = [self enumeratorAtPath: source];
|
||||
while ((dirEntry = [enumerator nextObject]))
|
||||
|
@ -3227,8 +3320,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
fromPath: sourceFile
|
||||
toPath: destinationFile])
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* We may have managed to create the directory but not set
|
||||
|
@ -3246,8 +3339,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
toPath: destinationFile
|
||||
handler: handler])
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3257,8 +3350,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
toFile: destinationFile
|
||||
handler: handler])
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ([fileType isEqual: NSFileTypeSymbolicLink])
|
||||
|
@ -3275,8 +3368,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
fromPath: sourceFile
|
||||
toPath: destinationFile])
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3292,9 +3385,9 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
}
|
||||
[self changeFileAttributes: attributes atPath: destinationFile];
|
||||
}
|
||||
RELEASE(pool);
|
||||
LEAVE_POOL
|
||||
|
||||
return YES;
|
||||
return result;
|
||||
}
|
||||
|
||||
- (BOOL) _linkPath: (NSString*)source
|
||||
|
@ -3304,7 +3397,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
#ifdef HAVE_LINK
|
||||
NSDirectoryEnumerator *enumerator;
|
||||
NSString *dirEntry;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
BOOL result = YES;
|
||||
ENTER_POOL
|
||||
|
||||
enumerator = [self enumeratorAtPath: source];
|
||||
while ((dirEntry = [enumerator nextObject]))
|
||||
|
@ -3333,8 +3427,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
fromPath: sourceFile
|
||||
toPath: destinationFile] == NO)
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3344,8 +3438,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
toPath: destinationFile
|
||||
handler: handler] == NO)
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3363,8 +3457,8 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
fromPath: sourceFile
|
||||
toPath: destinationFile] == NO)
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3379,15 +3473,15 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
fromPath: sourceFile
|
||||
toPath: destinationFile] == NO)
|
||||
{
|
||||
RELEASE(pool);
|
||||
return NO;
|
||||
result = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
[self changeFileAttributes: attributes atPath: destinationFile];
|
||||
}
|
||||
RELEASE(pool);
|
||||
return YES;
|
||||
LEAVE_POOL
|
||||
return result;
|
||||
#else
|
||||
ASSIGN(_lastError, @"Links not supported on this platform");
|
||||
return NO;
|
||||
|
@ -3601,14 +3695,27 @@ static NSSet *fileKeys = nil;
|
|||
|
||||
- (NSDate*) fileCreationDate
|
||||
{
|
||||
/*
|
||||
* FIXME ... not sure there is any way to get a creation date :-(
|
||||
#if defined(_WIN32)
|
||||
return [NSDate dateWithTimeIntervalSince1970: statbuf.st_ctime];
|
||||
#elif defined (HAVE_STRUCT_STAT_ST_BIRTHTIM)
|
||||
NSTimeInterval ti;
|
||||
ti = statbuf.st_birthtim.tv_sec + (double)statbuf.st_birthtim.tv_nsec / 1.0e9;
|
||||
return [NSDate dateWithTimeIntervalSince1970: ti];
|
||||
#elif defined (HAVE_STRUCT_STAT_ST_BIRTHTIME)
|
||||
return [NSDate dateWithTimeIntervalSince1970: statbuf.st_birthtime];
|
||||
#elif defined (HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) || defined (HAVE_STRUCT_STAT64_ST_BIRTHTIMESPEC)
|
||||
NSTimeInterval ti;
|
||||
ti = statbuf.st_birthtimespec.tv_sec + (double)statbuf.st_birthtimespec.tv_nsec / 1.0e9;
|
||||
return [NSDate dateWithTimeIntervalSince1970: ti];
|
||||
#else
|
||||
/* We don't know a better way to get creation date, it is not defined in POSIX
|
||||
* Use the earlier of ctime or mtime
|
||||
*/
|
||||
if (statbuf.st_ctime < statbuf.st_mtime)
|
||||
return [NSDate dateWithTimeIntervalSince1970: statbuf.st_ctime];
|
||||
else
|
||||
return [NSDate dateWithTimeIntervalSince1970: statbuf.st_mtime];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL) fileExtensionHidden
|
||||
|
|
|
@ -114,10 +114,10 @@
|
|||
*/
|
||||
- (id) initWithPath: (NSString*)path
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
ENTER_POOL
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
NSDictionary *fileAttributes;
|
||||
NSString *fileType;
|
||||
NSDictionary *fileAttributes;
|
||||
NSString *fileType;
|
||||
|
||||
NSDebugLLog(@"NSFileWrapper", @"initWithPath: %@", path);
|
||||
|
||||
|
@ -158,7 +158,7 @@
|
|||
[self setPreferredFilename: [path lastPathComponent]];
|
||||
[self setFileAttributes: fileAttributes];
|
||||
|
||||
[arp drain];
|
||||
LEAVE_POOL
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
also contain commas, most notably in the Expires field (which is not quoted
|
||||
and can contain spaces as well). The last key/value does not have to have a
|
||||
semi-colon, so this can be tricky to parse if another cookie occurs
|
||||
after this (See GSRangeOfCookie).
|
||||
after this (See GSCookieStrings).
|
||||
*/
|
||||
|
||||
#import "common.h"
|
||||
|
@ -114,7 +114,7 @@ static const unsigned char whitespace[32] = {
|
|||
#define GS_IS_WHITESPACE(X) IS_BIT_SET(whitespace[(X)/8], (X) % 8)
|
||||
|
||||
static id GSPropertyListFromCookieFormat(NSString *string, int version);
|
||||
static NSRange GSRangeOfCookie(NSString *string);
|
||||
static NSMutableArray *GSCookieStrings(NSString *string);
|
||||
|
||||
@implementation NSHTTPCookie
|
||||
|
||||
|
@ -141,36 +141,42 @@ static NSRange GSRangeOfCookie(NSString *string);
|
|||
forHeader: (NSString *)header
|
||||
andURL: (NSURL *)url
|
||||
{
|
||||
int version;
|
||||
NSString *defaultPath, *defaultDomain;
|
||||
NSMutableArray *a;
|
||||
int version;
|
||||
NSString *defaultPath;
|
||||
NSString *defaultDomain;
|
||||
NSMutableArray *cookies;
|
||||
NSUInteger count;
|
||||
|
||||
if ([header isEqual: @"Set-Cookie"])
|
||||
version = 0;
|
||||
{
|
||||
version = 0;
|
||||
}
|
||||
else if ([header isEqual: @"Set-Cookie2"])
|
||||
version = 1;
|
||||
{
|
||||
version = 1;
|
||||
}
|
||||
else
|
||||
return nil;
|
||||
|
||||
a = [NSMutableArray array];
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
defaultDomain = [url host];
|
||||
defaultPath = [url path];
|
||||
if ([[url absoluteString] hasSuffix: @"/"] == NO)
|
||||
defaultPath = [defaultPath stringByDeletingLastPathComponent];
|
||||
{
|
||||
defaultPath = [defaultPath stringByDeletingLastPathComponent];
|
||||
}
|
||||
|
||||
cookies = GSCookieStrings(field);
|
||||
count = [cookies count];
|
||||
/* We could use an NSScanner here, but this string could contain all
|
||||
sorts of odd stuff. It's not quite a property list either - it has
|
||||
dates and also could have tokens without values. */
|
||||
while (1)
|
||||
while (count-- > 0)
|
||||
{
|
||||
NSHTTPCookie *cookie;
|
||||
NSMutableDictionary *dict;
|
||||
NSString *onecookie;
|
||||
NSRange range = GSRangeOfCookie(field);
|
||||
NSHTTPCookie *cookie;
|
||||
NSMutableDictionary *dict;
|
||||
NSString *onecookie = [cookies objectAtIndex: count];
|
||||
|
||||
if (range.location == NSNotFound)
|
||||
break;
|
||||
onecookie = [field substringWithRange: range];
|
||||
NS_DURING
|
||||
dict = GSPropertyListFromCookieFormat(onecookie, version);
|
||||
NS_HANDLER
|
||||
|
@ -179,18 +185,25 @@ static NSRange GSRangeOfCookie(NSString *string);
|
|||
if ([dict count])
|
||||
{
|
||||
if ([dict objectForKey: NSHTTPCookiePath] == nil)
|
||||
[dict setObject: defaultPath forKey: NSHTTPCookiePath];
|
||||
{
|
||||
[dict setObject: defaultPath forKey: NSHTTPCookiePath];
|
||||
}
|
||||
if ([dict objectForKey: NSHTTPCookieDomain] == nil)
|
||||
[dict setObject: defaultDomain forKey: NSHTTPCookieDomain];
|
||||
{
|
||||
[dict setObject: defaultDomain forKey: NSHTTPCookieDomain];
|
||||
}
|
||||
cookie = [NSHTTPCookie cookieWithProperties: dict];
|
||||
if (cookie)
|
||||
[a addObject: cookie];
|
||||
{
|
||||
[cookies replaceObjectAtIndex: count withObject: cookie];
|
||||
}
|
||||
else
|
||||
{
|
||||
[cookies removeObjectAtIndex: count];
|
||||
}
|
||||
}
|
||||
if ([field length] <= NSMaxRange(range))
|
||||
break;
|
||||
field = [field substringFromIndex: NSMaxRange(range)+1];
|
||||
}
|
||||
return a;
|
||||
return cookies;
|
||||
}
|
||||
|
||||
+ (NSArray *) cookiesWithResponseHeaderFields: (NSDictionary *)headerFields
|
||||
|
@ -833,72 +846,139 @@ GSPropertyListFromCookieFormat(NSString *string, int version)
|
|||
return AUTORELEASE(dict);
|
||||
}
|
||||
|
||||
/* Look for the comma that separates cookies. Commas can also occur in
|
||||
date strings, like "expires", but perhaps it can occur other places.
|
||||
For instance, the key/value pair key=value1,value2 is not really
|
||||
valid, but should we handle it anyway? Definitely we should handle the
|
||||
perfectly normal case of:
|
||||
|
||||
Set-Cookie: domain=test.com; expires=Thu, 12-Sep-2109 14:58:04 GMT;
|
||||
session=foo
|
||||
Set-Cookie: bar=baz
|
||||
|
||||
which gets concatenated into something like:
|
||||
|
||||
Set-Cookie: domain=test.com; expires=Thu, 12-Sep-2109 14:58:04 GMT;
|
||||
session=foo,bar=baz
|
||||
|
||||
*/
|
||||
static NSRange
|
||||
GSRangeOfCookie(NSString *string)
|
||||
/* Split a string containing comma seprated cookeie settings into an array
|
||||
* of individual cookie specifications.
|
||||
* Look for the comma that separates cookies. Commas can also occur in
|
||||
* date strings, like "expires", but perhaps it can occur other places.
|
||||
* For instance, the key/value pair key=value1,value2 is not really
|
||||
* valid, but should we handle it anyway? Definitely we should handle the
|
||||
* perfectly normal case of:
|
||||
*
|
||||
* Set-Cookie: domain=test.com; expires=Thu, 12-Sep-2109 14:58:04 GMT;
|
||||
* session=foo
|
||||
* Set-Cookie: bar=baz
|
||||
*
|
||||
* which gets concatenated into something like:
|
||||
*
|
||||
* Set-Cookie: domain=test.com; expires=Thu, 12-Sep-2109 14:58:04 GMT;
|
||||
* session=foo,bar=baz
|
||||
*/
|
||||
static NSMutableArray*
|
||||
GSCookieStrings(NSString *string)
|
||||
{
|
||||
pldata _pld;
|
||||
pldata *pld = &_pld;
|
||||
unsigned char *ptr;
|
||||
unsigned pos;
|
||||
unsigned end;
|
||||
NSData *d;
|
||||
NSRange range;
|
||||
NSMutableArray *cookies;
|
||||
unsigned start = 0;
|
||||
unsigned saved = 0;
|
||||
|
||||
/*
|
||||
* An empty string is a nil property list.
|
||||
*/
|
||||
range = NSMakeRange(NSNotFound, NSNotFound);
|
||||
if ([string length] == 0)
|
||||
{
|
||||
return range;
|
||||
return nil;
|
||||
}
|
||||
|
||||
d = [string dataUsingEncoding: NSUTF8StringEncoding];
|
||||
NSCAssert(d, @"Couldn't get utf8 data from string.");
|
||||
_pld.ptr = (unsigned char*)[d bytes];
|
||||
_pld.pos = 0;
|
||||
_pld.end = [d length];
|
||||
_pld.err = nil;
|
||||
_pld.lin = 0;
|
||||
_pld.opt = 0;
|
||||
_pld.key = NO;
|
||||
_pld.old = YES; // OpenStep style
|
||||
ptr = (unsigned char*)[d bytes];
|
||||
pos = 0;
|
||||
end = [d length];
|
||||
|
||||
while (skipSpace(pld) == YES)
|
||||
cookies = [NSMutableArray arrayWithCapacity: 4];
|
||||
while (pos < end)
|
||||
{
|
||||
if (pld->ptr[pld->pos] == ',')
|
||||
while (pos < end && isspace(ptr[pos]))
|
||||
{
|
||||
/* Look ahead for something that will tell us if this is a
|
||||
separate cookie or not */
|
||||
unsigned saved_pos = pld->pos;
|
||||
while (pld->ptr[pld->pos] != '=' && pld->ptr[pld->pos] != ';'
|
||||
&& pld->ptr[pld->pos] != ',' && pld->pos < pld->end )
|
||||
pld->pos++;
|
||||
if (pld->ptr[pld->pos] == '=')
|
||||
{
|
||||
/* Separate comment */
|
||||
range = NSMakeRange(0, saved_pos-1);
|
||||
break;
|
||||
}
|
||||
pld->pos = saved_pos;
|
||||
pos++;
|
||||
}
|
||||
pld->pos++;
|
||||
}
|
||||
if (range.location == NSNotFound)
|
||||
range = NSMakeRange(0, [string length]);
|
||||
start = pos;
|
||||
|
||||
return range;
|
||||
while (pos < end)
|
||||
{
|
||||
if (ptr[pos] == ',')
|
||||
{
|
||||
/* Look ahead for something that will tell us if this is a
|
||||
* separate cookie or not. We look for something of the form
|
||||
* ' token =' where a space represents any optional whitespace.
|
||||
*/
|
||||
saved = pos++;
|
||||
while (pos < end && isspace(ptr[pos]))
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
if (pos < end)
|
||||
{
|
||||
const char *bad = "()<>@,;:\\\"/[]?={}";
|
||||
int c = ptr[pos];
|
||||
|
||||
/* skip past token characters.
|
||||
*/
|
||||
while (c > 32 && c < 128 && strchr(bad, c) == 0)
|
||||
{
|
||||
pos++;
|
||||
if (pos < end)
|
||||
{
|
||||
c = ptr[pos];
|
||||
}
|
||||
}
|
||||
while (pos < end && isspace(ptr[pos]))
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
if (pos < end && '=' == ptr[pos])
|
||||
{
|
||||
pos = saved + 1;
|
||||
/* We found a comma separator: so make the text before
|
||||
* the comma a cooke string as long as it is not empty.
|
||||
*/
|
||||
while (saved > start
|
||||
&& isspace(ptr[saved - 1]))
|
||||
{
|
||||
saved--;
|
||||
}
|
||||
if (saved > start)
|
||||
{
|
||||
NSString *str = [NSString alloc];
|
||||
|
||||
str = [str initWithBytes: ptr + start
|
||||
length: saved - start
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[cookies addObject: str];
|
||||
RELEASE(str);
|
||||
}
|
||||
start = saved = pos;
|
||||
}
|
||||
}
|
||||
pos = saved;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if (pos > start)
|
||||
{
|
||||
/* There was data after the last comma; make it into a cookie string
|
||||
* as long as it's not empty after removing spaces
|
||||
*/
|
||||
saved = pos;
|
||||
while (saved > start
|
||||
&& isspace(ptr[saved - 1]))
|
||||
{
|
||||
saved--;
|
||||
}
|
||||
if (saved > start)
|
||||
{
|
||||
NSString *str = [NSString alloc];
|
||||
|
||||
/* There may not be room to add a nul terminator, so we use an
|
||||
* initialiser which doesn't need one.
|
||||
*/
|
||||
str = [str initWithBytes: ptr + start
|
||||
length: saved - start
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[cookies addObject: str];
|
||||
RELEASE(str);
|
||||
}
|
||||
}
|
||||
return cookies; // The individual cookies
|
||||
}
|
||||
|
|
|
@ -39,17 +39,22 @@
|
|||
#import "Foundation/NSCoder.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
extern const char *inet_ntop(int, const void *, char *, size_t);
|
||||
extern int inet_pton(int , const char *, void *);
|
||||
#else
|
||||
#endif // HAVE_WS2TCPIP_H
|
||||
#if !defined(HAVE_INET_NTOP)
|
||||
extern const char* WSAAPI inet_ntop(int, const void *, char *, size_t);
|
||||
#endif
|
||||
#if !defined(HAVE_INET_NTOP)
|
||||
extern int WSAAPI inet_pton(int , const char *, void *);
|
||||
#endif
|
||||
#else /* !_WIN32 */
|
||||
#include <netdb.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif /* !_WIN32*/
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE -1
|
||||
|
|
|
@ -22,17 +22,18 @@
|
|||
Boston, MA 02110 USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSISO8601DateFormatter.h>
|
||||
#include <Foundation/NSDateFormatter.h>
|
||||
#include <Foundation/NSTimeZone.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#import "Foundation/NSCoder.h"
|
||||
#import "Foundation/NSDateFormatter.h"
|
||||
#import "Foundation/NSISO8601DateFormatter.h"
|
||||
#import "Foundation/NSString.h"
|
||||
#import "Foundation/NSTimeZone.h"
|
||||
|
||||
@implementation NSISO8601DateFormatter
|
||||
|
||||
- (instancetype) init
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
if (self != nil)
|
||||
{
|
||||
_formatter = [[NSDateFormatter alloc] init];
|
||||
_timeZone = RETAIN([NSTimeZone localTimeZone]);
|
||||
|
@ -41,11 +42,11 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (oneway void) release
|
||||
- (oneway void) dealloc
|
||||
{
|
||||
RELEASE(_formatter);
|
||||
RELEASE(_timeZone);
|
||||
[super release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSTimeZone *) timeZone
|
||||
|
@ -68,32 +69,32 @@
|
|||
NSString *result = @"";
|
||||
|
||||
// Build date...
|
||||
if(_formatOptions & NSISO8601DateFormatWithYear)
|
||||
if (_formatOptions & NSISO8601DateFormatWithYear)
|
||||
{
|
||||
result = [result stringByAppendingString: @"yyyy"];
|
||||
}
|
||||
if(_formatOptions & NSISO8601DateFormatWithDashSeparatorInDate &&
|
||||
_formatOptions & NSISO8601DateFormatWithMonth)
|
||||
if (_formatOptions & NSISO8601DateFormatWithDashSeparatorInDate &&
|
||||
_formatOptions & NSISO8601DateFormatWithMonth)
|
||||
{
|
||||
result = [result stringByAppendingString: @"-"];
|
||||
}
|
||||
if(_formatOptions & NSISO8601DateFormatWithMonth)
|
||||
if (_formatOptions & NSISO8601DateFormatWithMonth)
|
||||
{
|
||||
result = [result stringByAppendingString: @"MM"];
|
||||
}
|
||||
if(_formatOptions & NSISO8601DateFormatWithDashSeparatorInDate &&
|
||||
_formatOptions & NSISO8601DateFormatWithDay)
|
||||
if (_formatOptions & NSISO8601DateFormatWithDashSeparatorInDate &&
|
||||
_formatOptions & NSISO8601DateFormatWithDay)
|
||||
{
|
||||
result = [result stringByAppendingString: @"-"];
|
||||
}
|
||||
if(_formatOptions & NSISO8601DateFormatWithDay)
|
||||
if (_formatOptions & NSISO8601DateFormatWithDay)
|
||||
{
|
||||
result = [result stringByAppendingString: @"dd"];
|
||||
}
|
||||
|
||||
// Build time...
|
||||
if(_formatOptions & NSISO8601DateFormatWithSpaceBetweenDateAndTime &&
|
||||
_formatOptions & NSISO8601DateFormatWithTime)
|
||||
if (_formatOptions & NSISO8601DateFormatWithSpaceBetweenDateAndTime &&
|
||||
_formatOptions & NSISO8601DateFormatWithTime)
|
||||
{
|
||||
result = [result stringByAppendingString: @" "];
|
||||
}
|
||||
|
@ -102,9 +103,9 @@
|
|||
// Add T in format if we have a time component...
|
||||
result = [result stringByAppendingString: @"'T'"];
|
||||
}
|
||||
if(_formatOptions & NSISO8601DateFormatWithTime)
|
||||
if (_formatOptions & NSISO8601DateFormatWithTime)
|
||||
{
|
||||
if(_formatOptions & NSISO8601DateFormatWithColonSeparatorInTime)
|
||||
if (_formatOptions & NSISO8601DateFormatWithColonSeparatorInTime)
|
||||
{
|
||||
result = [result stringByAppendingString: @"HH:mm:ss"];
|
||||
}
|
||||
|
@ -113,13 +114,13 @@
|
|||
result = [result stringByAppendingString: @"HHmmss"];
|
||||
}
|
||||
}
|
||||
if(_formatOptions & NSISO8601DateFormatWithFractionalSeconds)
|
||||
if (_formatOptions & NSISO8601DateFormatWithFractionalSeconds)
|
||||
{
|
||||
result = [result stringByAppendingString: @".SSSSSS"];
|
||||
}
|
||||
if(_formatOptions & NSISO8601DateFormatWithTimeZone)
|
||||
if (_formatOptions & NSISO8601DateFormatWithTimeZone)
|
||||
{
|
||||
if(_formatOptions & NSISO8601DateFormatWithColonSeparatorInTimeZone)
|
||||
if (_formatOptions & NSISO8601DateFormatWithColonSeparatorInTimeZone)
|
||||
{
|
||||
result = [result stringByAppendingString: @"ZZ:ZZ"];
|
||||
}
|
||||
|
@ -164,5 +165,36 @@
|
|||
return [formatter stringFromDate: date];
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
[coder encodeObject: _timeZone forKey: @"NS.timeZone"];
|
||||
[coder encodeInteger: _formatOptions forKey: @"NS.formatOptions"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[coder encodeObject: _timeZone];
|
||||
[coder encodeValueOfObjCType: @encode(NSUInteger) at: &_formatOptions];
|
||||
}
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *)decoder
|
||||
{
|
||||
if ((self = [super init]) != nil)
|
||||
{
|
||||
if ([decoder allowsKeyedCoding])
|
||||
{
|
||||
ASSIGN(_timeZone, [decoder decodeObjectForKey: @"NS.timeZone"]);
|
||||
_formatOptions = [decoder decodeIntegerForKey: @"NS.formatOptions"];
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSIGN(_timeZone, [decoder decodeObject]);
|
||||
[decoder decodeValueOfObjCType: @encode(NSUInteger) at: &_formatOptions];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -41,22 +41,24 @@
|
|||
if (((self = [super init])) != nil)
|
||||
{
|
||||
[inv retainArguments];
|
||||
_invocation = [inv retain];
|
||||
_invocation = RETAIN(inv);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithTarget: (id)target selector: (SEL)aSelector object: (id)arg
|
||||
{
|
||||
NSMethodSignature *methodSignature;
|
||||
NSInvocation *inv;
|
||||
NSMethodSignature *methodSignature;
|
||||
NSInvocation *inv;
|
||||
|
||||
methodSignature = [target methodSignatureForSelector: aSelector];
|
||||
inv = [NSInvocation invocationWithMethodSignature: methodSignature];
|
||||
[inv setTarget: target];
|
||||
[inv setSelector: aSelector];
|
||||
if ([methodSignature numberOfArguments] > 2)
|
||||
[inv setArgument: &arg atIndex: 2];
|
||||
{
|
||||
[inv setArgument: &arg atIndex: 2];
|
||||
}
|
||||
return [self initWithInvocation: inv];
|
||||
}
|
||||
|
||||
|
@ -65,16 +67,20 @@
|
|||
if (![self isCancelled])
|
||||
{
|
||||
NS_DURING
|
||||
[_invocation invoke];
|
||||
{
|
||||
[_invocation invoke];
|
||||
}
|
||||
NS_HANDLER
|
||||
_exception = [localException copy];
|
||||
{
|
||||
ASSIGN(_exception, localException);
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
}
|
||||
|
||||
- (NSInvocation *) invocation
|
||||
{
|
||||
return [[_invocation retain] autorelease];
|
||||
return AUTORELEASE(RETAIN(_invocation));
|
||||
}
|
||||
|
||||
- (id) result
|
||||
|
@ -123,8 +129,8 @@
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
[_invocation release];
|
||||
[_exception release];
|
||||
DESTROY(_invocation);
|
||||
DESTROY(_exception);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
|
@ -468,11 +468,16 @@ parseNumber(ParserState *state)
|
|||
{\
|
||||
bufferSize *= 2;\
|
||||
if (number == numberBuffer)\
|
||||
number = malloc(bufferSize);\
|
||||
{\
|
||||
number = malloc(bufferSize);\
|
||||
memcpy(number, numberBuffer, sizeof(numberBuffer));\
|
||||
}\
|
||||
else\
|
||||
number = realloc(number, bufferSize);\
|
||||
{\
|
||||
number = realloc(number, bufferSize);\
|
||||
}\
|
||||
}\
|
||||
number[parsedSize++] = (char)x; } while (0)
|
||||
number[parsedSize++] = (char)x; } while (0)
|
||||
// JSON numbers must start with a - or a digit
|
||||
if (!(c == '-' || isdigit(c)))
|
||||
{
|
||||
|
@ -508,6 +513,8 @@ parseNumber(ParserState *state)
|
|||
free(number);
|
||||
number = numberBuffer;
|
||||
}
|
||||
parseError(state);
|
||||
return nil;
|
||||
}
|
||||
BUFFER(c);
|
||||
while (isdigit(c = consumeChar(state)))
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#import "Foundation/NSEnumerator.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSHashTable.h"
|
||||
#import "Foundation/NSIndexSet.h"
|
||||
#import "Foundation/NSKeyValueCoding.h"
|
||||
#import "Foundation/NSKeyValueObserving.h"
|
||||
#import "Foundation/NSLock.h"
|
||||
|
@ -1579,7 +1580,19 @@ cifframe_callback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
options: (NSKeyValueObservingOptions)options
|
||||
context: (void*)aContext
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
NSUInteger i = [indexes firstIndex];
|
||||
|
||||
while (i != NSNotFound)
|
||||
{
|
||||
NSObject *elem = [self objectAtIndex: i];
|
||||
|
||||
[elem addObserver: anObserver
|
||||
forKeyPath: aPath
|
||||
options: options
|
||||
context: aContext];
|
||||
|
||||
i = [indexes indexGreaterThanIndex: i];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) removeObserver: (NSObject*)anObserver forKeyPath: (NSString*)aPath
|
||||
|
@ -1593,7 +1606,17 @@ cifframe_callback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
fromObjectsAtIndexes: (NSIndexSet*)indexes
|
||||
forKeyPath: (NSString*)aPath
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
NSUInteger i = [indexes firstIndex];
|
||||
|
||||
while (i != NSNotFound)
|
||||
{
|
||||
NSObject *elem = [self objectAtIndex: i];
|
||||
|
||||
[elem removeObserver: anObserver
|
||||
forKeyPath: aPath];
|
||||
|
||||
i = [indexes indexGreaterThanIndex: i];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -430,34 +430,49 @@ static NSDictionary *makeReference(unsigned ref)
|
|||
|
||||
@implementation NSKeyedArchiver
|
||||
|
||||
+ (NSData *) archivedDataWithRootObject: (id)anObject
|
||||
requiringSecureCoding: (BOOL)requiresSecureCoding
|
||||
error: (NSError **)error
|
||||
{
|
||||
NSData *d = nil;
|
||||
|
||||
if (requiresSecureCoding == NO)
|
||||
{
|
||||
NSMutableData *m = nil;
|
||||
NSKeyedArchiver *a = nil;
|
||||
|
||||
error = NULL;
|
||||
NS_DURING
|
||||
{
|
||||
m = [[NSMutableData alloc] initWithCapacity: 10240];
|
||||
a = [[NSKeyedArchiver alloc] initForWritingWithMutableData: m];
|
||||
[a encodeObject: anObject forKey: @"root"];
|
||||
[a finishEncoding];
|
||||
d = [m copy];
|
||||
DESTROY(m);
|
||||
DESTROY(a);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
DESTROY(m);
|
||||
DESTROY(a);
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
}
|
||||
|
||||
return AUTORELEASE(d);
|
||||
}
|
||||
|
||||
/*
|
||||
* When I tried this on MacOS 10.3 it encoded the object with the key 'root',
|
||||
* so this implementation does the same.
|
||||
*/
|
||||
+ (NSData*) archivedDataWithRootObject: (id)anObject
|
||||
{
|
||||
NSMutableData *m = nil;
|
||||
NSKeyedArchiver *a = nil;
|
||||
NSData *d = nil;
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
m = [[NSMutableData alloc] initWithCapacity: 10240];
|
||||
a = [[NSKeyedArchiver alloc] initForWritingWithMutableData: m];
|
||||
[a encodeObject: anObject forKey: @"root"];
|
||||
[a finishEncoding];
|
||||
d = [m copy];
|
||||
DESTROY(m);
|
||||
DESTROY(a);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
DESTROY(m);
|
||||
DESTROY(a);
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
return AUTORELEASE(d);
|
||||
return [self archivedDataWithRootObject: anObject
|
||||
requiringSecureCoding: NO
|
||||
error: NULL];
|
||||
}
|
||||
|
||||
+ (BOOL) archiveRootObject: (id)anObject toFile: (NSString*)aPath
|
||||
|
@ -502,6 +517,16 @@ static NSDictionary *makeReference(unsigned ref)
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL) requiresSecureCoding
|
||||
{
|
||||
return _requiresSecureCoding;
|
||||
}
|
||||
|
||||
- (void) setRequiresSecureCoding: (BOOL)flag
|
||||
{
|
||||
_requiresSecureCoding = flag;
|
||||
}
|
||||
|
||||
- (BOOL) allowsKeyedCoding
|
||||
{
|
||||
return YES;
|
||||
|
|
|
@ -367,12 +367,12 @@ static NSMapTable *globalClassMap = 0;
|
|||
|
||||
- (BOOL)requiresSecureCoding
|
||||
{
|
||||
return NO;
|
||||
return _requiresSecureCoding;
|
||||
}
|
||||
|
||||
- (void)setRequiresSecureCoding: (BOOL)secure
|
||||
{
|
||||
return;
|
||||
_requiresSecureCoding = secure;
|
||||
}
|
||||
|
||||
- (Class) classForClassName: (NSString*)aString
|
||||
|
|
|
@ -627,6 +627,11 @@ static NSRecursiveLock *classLock = nil;
|
|||
[[dict objectForKey: NSLocaleCollationIdentifier] UTF8String];
|
||||
const char *currency = [[dict objectForKey: NSLocaleCurrencyCode] UTF8String];
|
||||
|
||||
if (!calendar)
|
||||
{
|
||||
calendar = [[dict objectForKey: NSLocaleCalendarIdentifier] UTF8String];
|
||||
}
|
||||
|
||||
// A locale cannot be constructed without a language.
|
||||
if (language == NULL)
|
||||
return nil;
|
||||
|
@ -686,7 +691,7 @@ static NSRecursiveLock *classLock = nil;
|
|||
#endif
|
||||
}
|
||||
|
||||
- (NSString *) displayNameForKey: (id) key value: (id) value
|
||||
- (NSString *) displayNameForKey: (NSString *) key value: (id) value
|
||||
{
|
||||
#if GS_USE_ICU == 1
|
||||
int32_t length = 0;
|
||||
|
@ -868,6 +873,41 @@ static NSRecursiveLock *classLock = nil;
|
|||
return result;
|
||||
}
|
||||
|
||||
- (NSString *) languageCode
|
||||
{
|
||||
return [self objectForKey: NSLocaleLanguageCode];
|
||||
}
|
||||
|
||||
- (NSString *) countryCode
|
||||
{
|
||||
return [self objectForKey: NSLocaleLanguageCode];
|
||||
}
|
||||
|
||||
- (NSString *) scriptCode
|
||||
{
|
||||
return [self objectForKey: NSLocaleScriptCode];
|
||||
}
|
||||
|
||||
- (NSString *) variantCode
|
||||
{
|
||||
return [self objectForKey: NSLocaleVariantCode];
|
||||
}
|
||||
|
||||
- (NSCharacterSet *) exemplarCharacterSet
|
||||
{
|
||||
return [self objectForKey: NSLocaleExemplarCharacterSet];
|
||||
}
|
||||
|
||||
- (NSString *) collationIdentifier
|
||||
{
|
||||
return [self objectForKey: NSLocaleCollationIdentifier];
|
||||
}
|
||||
|
||||
- (NSString *) collatorIdentifier
|
||||
{
|
||||
return [self objectForKey: NSLocaleCollatorIdentifier];
|
||||
}
|
||||
|
||||
- (NSString *) description
|
||||
{
|
||||
return _localeId;
|
||||
|
|
|
@ -181,10 +181,8 @@ _NSLog_standard_printf_handler(NSString* message)
|
|||
#else
|
||||
|
||||
#if defined(HAVE_SYSLOG)
|
||||
#ifndef __ANDROID__ // always use syslog on Android (no stdout/stderr)
|
||||
if (GSPrivateDefaultsFlag(GSLogSyslog) == YES
|
||||
|| write(_NSLogDescriptor, buf, len) != (int)len)
|
||||
#endif
|
||||
{
|
||||
null_terminated_buf = malloc(sizeof (char) * (len + 1));
|
||||
strncpy (null_terminated_buf, buf, len);
|
||||
|
@ -337,6 +335,11 @@ NSLogv(NSString* format, va_list args)
|
|||
NSString *message;
|
||||
NSString *threadName = nil;
|
||||
NSThread *t = nil;
|
||||
/* NB. On systems like Android where there is no operating system thread
|
||||
* ID available, the value returned by GSPrivateThreadID() should actually
|
||||
* be the pointer to the NSThread object. We will check for that later.
|
||||
*/
|
||||
NSUInteger tid = GSPrivateThreadID();
|
||||
static int pid = 0;
|
||||
|
||||
if (_NSLog_printf_handler == NULL)
|
||||
|
@ -367,20 +370,20 @@ NSLogv(NSString* format, va_list args)
|
|||
#ifdef HAVE_SYSLOG
|
||||
if (GSPrivateDefaultsFlag(GSLogSyslog) == YES)
|
||||
{
|
||||
if (nil == t)
|
||||
if (nil == t || ((NSThread*)tid == t && nil == threadName))
|
||||
{
|
||||
[prefix appendFormat: @"[thread:%"PRIuPTR"] ",
|
||||
GSPrivateThreadID()];
|
||||
tid];
|
||||
}
|
||||
else if (nil == threadName)
|
||||
{
|
||||
[prefix appendFormat: @"[thread:%"PRIuPTR",%p] ",
|
||||
GSPrivateThreadID(), t];
|
||||
tid, t];
|
||||
}
|
||||
else
|
||||
{
|
||||
[prefix appendFormat: @"[thread:%"PRIuPTR",%@] ",
|
||||
GSPrivateThreadID(), threadName];
|
||||
tid, threadName];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -402,20 +405,20 @@ NSLogv(NSString* format, va_list args)
|
|||
[prefix appendString: cal];
|
||||
[prefix appendString: @" "];
|
||||
[prefix appendString: [[NSProcessInfo processInfo] processName]];
|
||||
if (nil == t)
|
||||
if (nil == t || ((NSThread*)tid == t && nil == threadName))
|
||||
{
|
||||
[prefix appendFormat: @"[%d:%"PRIuPTR"] ",
|
||||
pid, GSPrivateThreadID()];
|
||||
pid, tid];
|
||||
}
|
||||
else if (nil == threadName)
|
||||
{
|
||||
[prefix appendFormat: @"[%d:%"PRIuPTR",%p] ",
|
||||
pid, GSPrivateThreadID(), t];
|
||||
pid, tid, t];
|
||||
}
|
||||
else
|
||||
{
|
||||
[prefix appendFormat: @"[%d:%"PRIuPTR",%@] ",
|
||||
pid, GSPrivateThreadID(), threadName];
|
||||
pid, tid, threadName];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,6 +110,11 @@ static Class concreteClass = 0;
|
|||
[self name], [self object], [self userInfo]];
|
||||
}
|
||||
|
||||
- (NSUInteger) hash
|
||||
{
|
||||
return [[self name] hash] ^ [[self object] hash];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if ([self class] == abstractClass)
|
||||
|
@ -122,6 +127,22 @@ static Class concreteClass = 0;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (id)other
|
||||
{
|
||||
NSNotification *o;
|
||||
NSObject *v1;
|
||||
NSObject *v2;
|
||||
|
||||
if (NO == [(o = other) isKindOfClass: [NSNotification class]]
|
||||
|| ((v1 = [self name]) != (v2 = [o name]) && ![v1 isEqual: v2])
|
||||
|| ((v1 = [self object]) != (v2 = [o object]) && ![v1 isEqual: v2])
|
||||
|| ((v1 = [self userInfo]) != (v2 = [o userInfo]) && ![v1 isEqual: v2]))
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the notification name.
|
||||
*/
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
|
||||
/* platforms which do not support weak */
|
||||
#if (__GNUC__ == 3) && defined (__WIN32)
|
||||
#if defined (__WIN32)
|
||||
#define WEAK_ATTRIBUTE
|
||||
#undef SUPPORT_WEAK
|
||||
#else
|
||||
|
@ -1121,9 +1121,12 @@ static id gs_weak_load(id obj)
|
|||
|
||||
+ (void) _atExit
|
||||
{
|
||||
NSMapTable *m = nil;
|
||||
pthread_mutex_lock(&allocationLock);
|
||||
DESTROY(zombieMap);
|
||||
m = zombieMap;
|
||||
zombieMap = nil;
|
||||
pthread_mutex_unlock(&allocationLock);
|
||||
DESTROY(m);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -97,7 +97,7 @@ static NSArray *empty = nil;
|
|||
+ (void) initialize
|
||||
{
|
||||
empty = [NSArray new];
|
||||
[[NSObject leakAt: &empty] release];
|
||||
RELEASE([NSObject leakAt: &empty]);
|
||||
}
|
||||
|
||||
- (void) addDependency: (NSOperation *)op
|
||||
|
@ -217,6 +217,7 @@ static NSArray *empty = nil;
|
|||
RELEASE(internal->dependencies);
|
||||
RELEASE(internal->cond);
|
||||
RELEASE(internal->lock);
|
||||
RELEASE(internal->completionBlock);
|
||||
GS_DESTROY_INTERNAL(NSOperation);
|
||||
}
|
||||
[super dealloc];
|
||||
|
@ -381,7 +382,7 @@ static NSArray *empty = nil;
|
|||
|
||||
- (void) setCompletionBlock: (GSOperationCompletionBlock)aBlock
|
||||
{
|
||||
internal->completionBlock = aBlock;
|
||||
ASSIGNCOPY(internal->completionBlock, aBlock);
|
||||
}
|
||||
|
||||
- (void) setQueuePriority: (NSOperationQueuePriority)pri
|
||||
|
@ -429,8 +430,9 @@ static NSArray *empty = nil;
|
|||
|
||||
- (void) start
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
double prio = [NSThread threadPriority];
|
||||
ENTER_POOL
|
||||
|
||||
double prio = [NSThread threadPriority];
|
||||
|
||||
AUTORELEASE(RETAIN(self)); // Make sure we exist while running.
|
||||
[internal->lock lock];
|
||||
|
@ -485,7 +487,7 @@ static NSArray *empty = nil;
|
|||
NS_ENDHANDLER;
|
||||
|
||||
[self _finish];
|
||||
[pool release];
|
||||
LEAVE_POOL
|
||||
}
|
||||
|
||||
- (double) threadPriority
|
||||
|
@ -501,12 +503,11 @@ static NSArray *empty = nil;
|
|||
@end
|
||||
|
||||
@implementation NSOperation (Private)
|
||||
/* NB code calling this method must ensure that the receiver is retained
|
||||
* until after the method returns.
|
||||
*/
|
||||
- (void) _finish
|
||||
{
|
||||
/* retain while finishing so that we don't get deallocated when our
|
||||
* queue removes and releases us.
|
||||
*/
|
||||
[self retain];
|
||||
[internal->lock lock];
|
||||
if (NO == internal->finished)
|
||||
{
|
||||
|
@ -531,23 +532,27 @@ static NSArray *empty = nil;
|
|||
}
|
||||
}
|
||||
[internal->lock unlock];
|
||||
[self release];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation NSBlockOperation
|
||||
|
||||
// Initialize
|
||||
- (id) init
|
||||
+ (instancetype) blockOperationWithBlock: (GSBlockOperationBlock)block
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
{
|
||||
_executionBlocks = [[NSMutableArray alloc] initWithCapacity: 1];
|
||||
}
|
||||
return self;
|
||||
NSBlockOperation *op = [[self alloc] init];
|
||||
|
||||
[op addExecutionBlock: block];
|
||||
return AUTORELEASE(op);
|
||||
}
|
||||
|
||||
- (void) addExecutionBlock: (GSBlockOperationBlock)block
|
||||
{
|
||||
GSBlockOperationBlock blockCopy = [block copy];
|
||||
|
||||
[_executionBlocks addObject: blockCopy];
|
||||
RELEASE(blockCopy);
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
@ -556,29 +561,27 @@ static NSArray *empty = nil;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
// Managing the blocks in the Operation
|
||||
+ (instancetype)blockOperationWithBlock: (GSBlockOperationBlock)block
|
||||
{
|
||||
NSBlockOperation *op = [[self alloc] init];
|
||||
[op addExecutionBlock: block];
|
||||
return op;
|
||||
}
|
||||
|
||||
- (void)addExecutionBlock: (GSBlockOperationBlock)block
|
||||
{
|
||||
[_executionBlocks addObject: block];
|
||||
}
|
||||
|
||||
- (NSArray *) executionBlocks
|
||||
{
|
||||
return _executionBlocks;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
_executionBlocks = [[NSMutableArray alloc] initWithCapacity: 1];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) main
|
||||
{
|
||||
NSEnumerator *en = [[self executionBlocks] objectEnumerator];
|
||||
NSEnumerator *en = [[self executionBlocks] objectEnumerator];
|
||||
GSBlockOperationBlock theBlock;
|
||||
while((theBlock = [en nextObject]) != NULL)
|
||||
|
||||
while ((theBlock = [en nextObject]) != NULL)
|
||||
{
|
||||
CALL_BLOCK_NO_ARGS(theBlock);
|
||||
}
|
||||
|
@ -835,9 +838,9 @@ static NSOperationQueue *mainQueue = nil;
|
|||
internal->name
|
||||
= [[NSString alloc] initWithFormat: @"NSOperation %p", self];
|
||||
}
|
||||
s = [internal->name retain];
|
||||
s = RETAIN(internal->name);
|
||||
[internal->lock unlock];
|
||||
return [s autorelease];
|
||||
return AUTORELEASE(s);
|
||||
}
|
||||
|
||||
- (NSUInteger) operationCount
|
||||
|
@ -887,7 +890,7 @@ static NSOperationQueue *mainQueue = nil;
|
|||
if (NO == [internal->name isEqual: s])
|
||||
{
|
||||
[self willChangeValueForKey: @"name"];
|
||||
[internal->name release];
|
||||
RELEASE(internal->name);
|
||||
internal->name = [s copy];
|
||||
[self didChangeValueForKey: @"name"];
|
||||
}
|
||||
|
@ -914,10 +917,10 @@ static NSOperationQueue *mainQueue = nil;
|
|||
[internal->lock lock];
|
||||
while ((op = [internal->operations lastObject]) != nil)
|
||||
{
|
||||
[op retain];
|
||||
RETAIN(op);
|
||||
[internal->lock unlock];
|
||||
[op waitUntilFinished];
|
||||
[op release];
|
||||
RELEASE(op);
|
||||
[internal->lock lock];
|
||||
}
|
||||
[internal->lock unlock];
|
||||
|
@ -978,12 +981,17 @@ static NSOperationQueue *mainQueue = nil;
|
|||
|
||||
- (void) _thread
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
|
||||
[[[NSThread currentThread] threadDictionary] setObject: self
|
||||
forKey: threadKey];
|
||||
for (;;)
|
||||
{
|
||||
/* We use a pool for each operation in case releasing the operation
|
||||
* causes it to be deallocated, and the deallocation of the operation
|
||||
* autoreleases something which needs to be cleaned up.
|
||||
*/
|
||||
RECREATE_AUTORELEASE_POOL(arp);
|
||||
NSOperation *op;
|
||||
NSDate *when;
|
||||
BOOL found;
|
||||
|
@ -1021,11 +1029,10 @@ static NSOperationQueue *mainQueue = nil;
|
|||
{
|
||||
NS_DURING
|
||||
{
|
||||
NSAutoreleasePool *opPool = [NSAutoreleasePool new];
|
||||
|
||||
ENTER_POOL
|
||||
[NSThread setThreadPriority: [op threadPriority]];
|
||||
[op start];
|
||||
RELEASE(opPool);
|
||||
LEAVE_POOL
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
|
@ -1042,7 +1049,7 @@ static NSOperationQueue *mainQueue = nil;
|
|||
[internal->lock lock];
|
||||
internal->threadCount--;
|
||||
[internal->lock unlock];
|
||||
RELEASE(pool);
|
||||
DESTROY(arp);
|
||||
[NSThread exit];
|
||||
}
|
||||
|
||||
|
@ -1099,9 +1106,18 @@ static NSOperationQueue *mainQueue = nil;
|
|||
|| (pending > 0 && internal->threadCount < POOL))
|
||||
{
|
||||
internal->threadCount++;
|
||||
[NSThread detachNewThreadSelector: @selector(_thread)
|
||||
toTarget: self
|
||||
withObject: nil];
|
||||
NS_DURING
|
||||
{
|
||||
[NSThread detachNewThreadSelector: @selector(_thread)
|
||||
toTarget: self
|
||||
withObject: nil];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"Failed to create thread for %@: %@",
|
||||
self, localException);
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
/* Tell the thread pool that there is an operation to start.
|
||||
*/
|
||||
|
|
|
@ -22,7 +22,10 @@
|
|||
Boston, MA 02110 USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSOrthography.h>
|
||||
#import "Foundation/NSArray.h"
|
||||
#import "Foundation/NSDictionary.h"
|
||||
#import "Foundation/NSOrthography.h"
|
||||
#import "Foundation/NSString.h"
|
||||
|
||||
@implementation NSOrthography
|
||||
|
||||
|
@ -30,7 +33,7 @@
|
|||
languageMap: (NSDictionary *)map
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
if (self != nil)
|
||||
{
|
||||
ASSIGNCOPY(_dominantScript, script);
|
||||
ASSIGNCOPY(_languageMap, map);
|
||||
|
@ -38,11 +41,11 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (oneway void) release
|
||||
- (oneway void) dealloc
|
||||
{
|
||||
RELEASE(_dominantScript);
|
||||
RELEASE(_languageMap);
|
||||
[super release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *) dominantScript
|
||||
|
|
|
@ -129,6 +129,7 @@
|
|||
{
|
||||
case 1:
|
||||
[pnc setNickname: [nameArray objectAtIndex: 0]];
|
||||
break;
|
||||
case 2:
|
||||
[pnc setGivenName: [nameArray objectAtIndex: 0]];
|
||||
[pnc setFamilyName: [nameArray objectAtIndex: 1]];
|
||||
|
|
|
@ -1140,7 +1140,7 @@ scalarSize(char type)
|
|||
return;
|
||||
case 4:
|
||||
*(int32_t*)address = (int32_t)big;
|
||||
if (big > 2147483647 || big < -2147483648)
|
||||
if (big > 2147483647 || big + 2147483648 < 0)
|
||||
{
|
||||
NSLog(@"Lost information converting decoded value to int32_t");
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#import "Foundation/NSPredicate.h"
|
||||
|
||||
#import "Foundation/NSArray.h"
|
||||
#import "Foundation/NSDate.h"
|
||||
#import "Foundation/NSDictionary.h"
|
||||
#import "Foundation/NSEnumerator.h"
|
||||
#import "Foundation/NSException.h"
|
||||
|
@ -890,6 +891,18 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
}
|
||||
#endif
|
||||
|
||||
- (double) doubleValueFor: (id)value
|
||||
{
|
||||
if ([value isKindOfClass: [NSDate class]])
|
||||
{
|
||||
return [(NSDate*)value timeIntervalSinceReferenceDate];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [value doubleValue];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) _evaluateLeftValue: (id)leftResult
|
||||
rightValue: (id)rightResult
|
||||
object: (id)object
|
||||
|
@ -941,26 +954,26 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
{
|
||||
case NSLessThanPredicateOperatorType:
|
||||
{
|
||||
double ld = [leftResult doubleValue];
|
||||
double rd = [rightResult doubleValue];
|
||||
double ld = [self doubleValueFor: leftResult];
|
||||
double rd = [self doubleValueFor: rightResult];
|
||||
return (ld < rd) ? YES : NO;
|
||||
}
|
||||
case NSLessThanOrEqualToPredicateOperatorType:
|
||||
{
|
||||
double ld = [leftResult doubleValue];
|
||||
double rd = [rightResult doubleValue];
|
||||
double ld = [self doubleValueFor: leftResult];
|
||||
double rd = [self doubleValueFor: rightResult];
|
||||
return (ld <= rd) ? YES : NO;
|
||||
}
|
||||
case NSGreaterThanPredicateOperatorType:
|
||||
{
|
||||
double ld = [leftResult doubleValue];
|
||||
double rd = [rightResult doubleValue];
|
||||
double ld = [self doubleValueFor: leftResult];
|
||||
double rd = [self doubleValueFor: rightResult];
|
||||
return (ld > rd) ? YES : NO;
|
||||
}
|
||||
case NSGreaterThanOrEqualToPredicateOperatorType:
|
||||
{
|
||||
double ld = [leftResult doubleValue];
|
||||
double rd = [rightResult doubleValue];
|
||||
double ld = [self doubleValueFor: leftResult];
|
||||
double rd = [self doubleValueFor: rightResult];
|
||||
return (ld >= rd) ? YES : NO;
|
||||
}
|
||||
case NSEqualToPredicateOperatorType:
|
||||
|
@ -1313,6 +1326,11 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
GSPropertyListMake(_obj, nil, NO, YES, 2, &result);
|
||||
return result;
|
||||
}
|
||||
else if ([_obj isKindOfClass: [NSDate class]])
|
||||
{
|
||||
return [NSString stringWithFormat: @"CAST(%15.6f, \"NSDate\")",
|
||||
[(NSDate*)_obj timeIntervalSinceReferenceDate]];
|
||||
}
|
||||
return [_obj description];
|
||||
}
|
||||
|
||||
|
@ -1720,6 +1738,20 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
return [NSNumber numberWithDouble: sum];
|
||||
}
|
||||
|
||||
- (id) _eval_CAST: (NSArray *)expressions
|
||||
{
|
||||
id left = [expressions objectAtIndex: 0];
|
||||
id right = [expressions objectAtIndex: 1];
|
||||
|
||||
if ([right isEqualToString: @"NSDate"])
|
||||
{
|
||||
return [[NSDate alloc] initWithTimeIntervalSinceReferenceDate: [left doubleValue]];
|
||||
}
|
||||
|
||||
NSLog(@"Cast to unknown type %@", right);
|
||||
return nil;
|
||||
}
|
||||
|
||||
// add arithmetic functions: average, median, mode, stddev, sqrt, log, ln, exp, floor, ceiling, abs, trunc, random, randomn, now
|
||||
|
||||
@end
|
||||
|
|
|
@ -1602,7 +1602,10 @@ GSInitializeProcessAndroid(JNIEnv *env, jobject context)
|
|||
// initialize process
|
||||
[procLock lock];
|
||||
fallbackInitialisation = YES;
|
||||
char *argv[] = { arg0 };
|
||||
char *argv[] = {
|
||||
arg0,
|
||||
"-GSLogSyslog", "YES" // use syslog (available via logcat) instead of stdout/stderr (not available on Android)
|
||||
};
|
||||
_gnu_process_args(sizeof(argv)/sizeof(char *), argv, NULL);
|
||||
[procLock unlock];
|
||||
|
||||
|
|
|
@ -859,9 +859,9 @@ typedef enum {
|
|||
|
||||
host = [NSHost hostWithAddress: addr];
|
||||
return (NSPort*)[NSSocketPort portWithNumber: portNum
|
||||
onHost: host
|
||||
forceAddress: addr
|
||||
listener: NO];
|
||||
onHost: host
|
||||
forceAddress: addr
|
||||
listener: NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -164,41 +164,55 @@ static BOOL (*nonBaseImp)(id, SEL, unichar) = 0;
|
|||
*/
|
||||
#define IMMUTABLE(S) AUTORELEASE([(S) copyWithZone: NSDefaultMallocZone()])
|
||||
|
||||
#define IS_BIT_SET(a,i) ((((a) & (1<<(i)))) > 0)
|
||||
static inline BOOL isWhiteSpace(unichar c)
|
||||
{
|
||||
/* We can not use whitespaceAndNewlineCharacterSet here as this would lead
|
||||
* to a recursion, as this also reads in a property list.
|
||||
*
|
||||
* Copied whitespace and newline index set from NSCharacterSetData.h
|
||||
*/
|
||||
static const NSRange whitespace[] = {{9,5},{32,1},{133,1},{160,1},{5760,1},{8192,12},{8232,2},{8239,1},{8287,1},{12288,1}};
|
||||
unsigned upper = sizeof(whitespace)/sizeof(*whitespace);
|
||||
unsigned lower = 0;
|
||||
unsigned pos;
|
||||
NSRange r;
|
||||
|
||||
/* Binary search for a range containing the character to be checked
|
||||
*/
|
||||
for (pos = upper/2; upper != lower; pos = (upper+lower)/2)
|
||||
{
|
||||
r = whitespace[pos];
|
||||
if (c < r.location)
|
||||
{
|
||||
upper = pos;
|
||||
}
|
||||
else if (c >= NSMaxRange(r))
|
||||
{
|
||||
lower = pos + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (c >= r.location && c < NSMaxRange(r)) ? YES : NO;
|
||||
}
|
||||
|
||||
#define GS_IS_WHITESPACE(X) isWhiteSpace(X)
|
||||
|
||||
static NSCharacterSet *nonspace = nil;
|
||||
static NSData *whitespaceBitmap;
|
||||
static unsigned const char *whitespaceBitmapRep = NULL;
|
||||
#define GS_IS_WHITESPACE(X) IS_BIT_SET(whitespaceBitmapRep[(X)/8], (X) % 8)
|
||||
|
||||
static void setupNonspace(void)
|
||||
{
|
||||
if (nil == nonspace)
|
||||
{
|
||||
NSCharacterSet *whitespace;
|
||||
NSCharacterSet *w;
|
||||
|
||||
whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet];
|
||||
nonspace = [[whitespace invertedSet] retain];
|
||||
w = [NSCharacterSet whitespaceAndNewlineCharacterSet];
|
||||
nonspace = [[w invertedSet] retain];
|
||||
}
|
||||
}
|
||||
|
||||
static void setupWhitespace(void)
|
||||
{
|
||||
if (whitespaceBitmapRep == NULL)
|
||||
{
|
||||
NSCharacterSet *whitespace;
|
||||
|
||||
/*
|
||||
We can not use whitespaceAndNewlineCharacterSet here as this would lead
|
||||
to a recursion, as this also reads in a property list.
|
||||
whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet];
|
||||
*/
|
||||
whitespace = [NSCharacterSet characterSetWithCharactersInString:
|
||||
@" \t\r\n\f\b"];
|
||||
whitespaceBitmap = RETAIN([whitespace bitmapRepresentation]);
|
||||
whitespaceBitmapRep = [whitespaceBitmap bytes];
|
||||
}
|
||||
}
|
||||
|
||||
/* A non-spacing character is one which is part of a 'user-perceived character'
|
||||
* where the user perceived character consists of a base character followed
|
||||
|
@ -663,28 +677,43 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (locale == nil)
|
||||
{
|
||||
/* A nil locale should trigger POSIX collation (i.e. 'A'-'Z' sort
|
||||
* before 'a'), and support for this was added in ICU 4.6 under the
|
||||
* locale name en_US_POSIX, but it doesn't fit our requirements
|
||||
* (e.g. 'e' and 'E' don't compare as equal with case insensitive
|
||||
* comparison.) - so return NULL to indicate that the GNUstep
|
||||
* comparison code should be used.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
localeCString = [[locale localeIdentifier] UTF8String];
|
||||
|
||||
if (localeCString == NULL || strcmp("", localeCString) == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (NO == [locale isKindOfClass: [NSLocale class]])
|
||||
{
|
||||
if (nil == locale)
|
||||
{
|
||||
/* See comments below about the posix locale.
|
||||
* It's bad for case insensitive search, but needed for numeric
|
||||
*/
|
||||
if (mask & NSNumericSearch)
|
||||
{
|
||||
locale = [NSLocale systemLocale];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A nil locale should trigger POSIX collation (i.e. 'A'-'Z' sort
|
||||
* before 'a'), and support for this was added in ICU 4.6 under the
|
||||
* locale name en_US_POSIX, but it doesn't fit our requirements
|
||||
* (e.g. 'e' and 'E' don't compare as equal with case insensitive
|
||||
* comparison.) - so return NULL to indicate that the GNUstep
|
||||
* comparison code should be used.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
locale = [NSLocale currentLocale];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
localeCString = [[locale localeIdentifier] UTF8String];
|
||||
|
||||
if (localeCString != NULL && strcmp("", localeCString) == 0)
|
||||
{
|
||||
localeCString = NULL;
|
||||
}
|
||||
|
||||
coll = ucol_open(localeCString, &status);
|
||||
|
||||
if (U_SUCCESS(status))
|
||||
|
@ -1886,7 +1915,8 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
}
|
||||
}
|
||||
|
||||
- (NSString *) stringByAddingPercentEncodingWithAllowedCharacters: (NSCharacterSet *)aSet
|
||||
- (NSString *) stringByAddingPercentEncodingWithAllowedCharacters:
|
||||
(NSCharacterSet *)aSet
|
||||
{
|
||||
NSData *data = [self dataUsingEncoding: NSUTF8StringEncoding];
|
||||
NSString *s = nil;
|
||||
|
@ -1906,7 +1936,10 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
unsigned int hi;
|
||||
unsigned int lo;
|
||||
|
||||
if([aSet characterIsMember: c]) // if the character is in the allowed set, put it in
|
||||
/* If the character is in the allowed set *and* is in the
|
||||
* 7-bit ASCII range, it can be added unchanged.
|
||||
*/
|
||||
if (c < 128 && [aSet characterIsMember: c])
|
||||
{
|
||||
dst[dpos++] = c;
|
||||
}
|
||||
|
@ -1921,7 +1954,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
}
|
||||
s = [[NSString alloc] initWithBytes: dst
|
||||
length: dpos
|
||||
encoding: NSUTF8StringEncoding];
|
||||
encoding: NSASCIIStringEncoding];
|
||||
NSZoneFree(NSDefaultMallocZone(), dst);
|
||||
IF_NO_GC([s autorelease];)
|
||||
}
|
||||
|
@ -1943,12 +1976,12 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
{
|
||||
char c = s[index];
|
||||
|
||||
if ('%' == c && index < lastPercent)
|
||||
if ('%' == c && index <= lastPercent)
|
||||
{
|
||||
uint8_t hi = s[index+1];
|
||||
uint8_t lo = s[index+2];
|
||||
|
||||
if (isdigit(hi) && isxdigit(lo))
|
||||
if (isxdigit(hi) && isxdigit(lo))
|
||||
{
|
||||
index += 2;
|
||||
if (hi <= '9')
|
||||
|
@ -2804,10 +2837,6 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
}
|
||||
|
||||
#if GS_USE_ICU == 1
|
||||
if (nil != locale && NO == [locale isKindOfClass: [NSLocale class]])
|
||||
{
|
||||
locale = [NSLocale currentLocale];
|
||||
}
|
||||
{
|
||||
UCollator *coll = GSICUCollatorOpen(mask, locale);
|
||||
|
||||
|
@ -3057,7 +3086,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
{
|
||||
return YES;
|
||||
}
|
||||
if ([self hash] != [aString hash])
|
||||
if (nil == aString || [self hash] != [aString hash])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
@ -3489,8 +3518,6 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
|
||||
if (len == 0)
|
||||
return IMMUTABLE(self);
|
||||
if (whitespaceBitmapRep == NULL)
|
||||
setupWhitespace();
|
||||
|
||||
s = NSZoneMalloc([self zone], sizeof(unichar)*len);
|
||||
[self getCharacters: s range: ((NSRange){0, len})];
|
||||
|
@ -5784,23 +5811,6 @@ static NSFileManager *fm = nil;
|
|||
[NSException raise: NSInvalidArgumentException format: @"compare with nil"];
|
||||
|
||||
#if GS_USE_ICU == 1
|
||||
if (NO == [locale isKindOfClass: [NSLocale class]])
|
||||
{
|
||||
if (nil == locale)
|
||||
{
|
||||
/* See comments in GSICUCollatorOpen about the posix locale.
|
||||
* It's bad for case insensitive search, but needed for numeric
|
||||
*/
|
||||
if (mask & NSNumericSearch)
|
||||
{
|
||||
locale = [NSLocale systemLocale];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
locale = [NSLocale currentLocale];
|
||||
}
|
||||
}
|
||||
{
|
||||
UCollator *coll = GSICUCollatorOpen(mask, locale);
|
||||
|
||||
|
|
|
@ -845,7 +845,7 @@ pty_slave(const char* name)
|
|||
*/
|
||||
- (void) waitUntilExit
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
ENTER_POOL
|
||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
||||
NSTimer *timer = nil;
|
||||
NSDate *limit = nil;
|
||||
|
@ -874,7 +874,7 @@ pty_slave(const char* name)
|
|||
*/
|
||||
limit = [NSDate dateWithTimeIntervalSinceNow: 0.0];
|
||||
[loop runMode: NSDefaultRunLoopMode beforeDate: limit];
|
||||
IF_NO_GC([arp release];)
|
||||
LEAVE_POOL
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -1292,16 +1292,16 @@ quotedFromString(NSString *aString)
|
|||
NULL, /* thread attrs */
|
||||
1, /* inherit handles */
|
||||
0
|
||||
|CREATE_NO_WINDOW
|
||||
/* One would have thought the the CREATE_NO_WINDOW flag should be used,
|
||||
* but apparently this breaks for old 16bit applications/tools on XP.
|
||||
* So maybe we want to leave it out?
|
||||
/* We don't want a subtask to be run min a window since that would prevent
|
||||
* startup of background tasks. If a subtask wants a window, it should
|
||||
* create it itself.
|
||||
*/
|
||||
// |DETACHED_PROCESS
|
||||
|CREATE_NO_WINDOW
|
||||
/* We don't set the DETACHED_PROCESS flag as it actually means that the
|
||||
* child task should get a new Console allocated ... and that means it
|
||||
* will pop up a console window ... which looks really bad.
|
||||
*/
|
||||
// |DETACHED_PROCESS
|
||||
|CREATE_UNICODE_ENVIRONMENT,
|
||||
envp, /* env block */
|
||||
(const unichar*)[[self currentDirectoryPath] fileSystemRepresentation],
|
||||
|
|
|
@ -763,6 +763,7 @@ GSCurrentThreadDictionary(void)
|
|||
static void
|
||||
gnustep_base_thread_callback(void)
|
||||
{
|
||||
static pthread_mutex_t threadLock = PTHREAD_MUTEX_INITIALIZER;
|
||||
/*
|
||||
* Protect this function with locking ... to avoid any possibility
|
||||
* of multiple threads registering with the system simultaneously,
|
||||
|
@ -771,7 +772,7 @@ gnustep_base_thread_callback(void)
|
|||
*/
|
||||
if (entered_multi_threaded_state == NO)
|
||||
{
|
||||
[gnustep_global_lock lock];
|
||||
pthread_mutex_lock(&threadLock);
|
||||
if (entered_multi_threaded_state == NO)
|
||||
{
|
||||
/*
|
||||
|
@ -781,6 +782,12 @@ gnustep_base_thread_callback(void)
|
|||
* threaded BEFORE sending the notifications.
|
||||
*/
|
||||
entered_multi_threaded_state = YES;
|
||||
/*
|
||||
* Enter pool after setting flag, because -[NSAutoreleasePool
|
||||
* allocWithZone:] calls GSCurrentThread(), which may end up
|
||||
* calling this function, which would cause a deadlock.
|
||||
*/
|
||||
ENTER_POOL
|
||||
NS_DURING
|
||||
{
|
||||
[GSPerformHolder class]; // Force initialization
|
||||
|
@ -814,8 +821,9 @@ gnustep_base_thread_callback(void)
|
|||
fflush(stderr);
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
LEAVE_POOL
|
||||
}
|
||||
[gnustep_global_lock unlock];
|
||||
pthread_mutex_unlock(&threadLock);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -860,15 +868,9 @@ unregisterActiveThread(NSThread *thread)
|
|||
{
|
||||
if (thread->_active == YES)
|
||||
{
|
||||
/*
|
||||
* Set the thread to be inactive to avoid any possibility of recursion.
|
||||
*/
|
||||
thread->_active = NO;
|
||||
thread->_finished = YES;
|
||||
|
||||
/*
|
||||
* Let observers know this thread is exiting.
|
||||
/* Let observers know this thread is exiting.
|
||||
*/
|
||||
ENTER_POOL
|
||||
if (nc == nil)
|
||||
{
|
||||
nc = RETAIN([NSNotificationCenter defaultCenter]);
|
||||
|
@ -877,7 +879,14 @@ unregisterActiveThread(NSThread *thread)
|
|||
object: thread
|
||||
userInfo: nil];
|
||||
|
||||
/* Set the thread to be finished *after* notification it will exit.
|
||||
* This is the order OSX 10.15.4 does it (May 2020).
|
||||
*/
|
||||
thread->_active = NO;
|
||||
thread->_finished = YES;
|
||||
|
||||
[(GSRunLoopThreadInfo*)thread->_runLoopInfo invalidate];
|
||||
LEAVE_POOL
|
||||
RELEASE(thread);
|
||||
pthread_setspecific(thread_object_key, nil);
|
||||
}
|
||||
|
@ -1241,12 +1250,7 @@ unregisterActiveThread(NSThread *thread)
|
|||
}
|
||||
while (i > 0)
|
||||
{
|
||||
if (PTHREAD_SETNAME(buf) == 0)
|
||||
{
|
||||
break; // Success
|
||||
}
|
||||
|
||||
if (ERANGE == errno)
|
||||
if (PTHREAD_SETNAME(buf) == ERANGE)
|
||||
{
|
||||
/* Name must be too long ... gnu/linux uses 15 characters
|
||||
*/
|
||||
|
@ -1274,7 +1278,7 @@ unregisterActiveThread(NSThread *thread)
|
|||
}
|
||||
else
|
||||
{
|
||||
break; // Some other error
|
||||
break; // Success or some other error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,7 +116,6 @@ static Class NSDate_class;
|
|||
userInfo: (id)info
|
||||
repeats: (BOOL)f
|
||||
{
|
||||
_block = nil;
|
||||
if (ti <= 0.0)
|
||||
{
|
||||
ti = 0.0001;
|
||||
|
@ -146,18 +145,18 @@ static Class NSDate_class;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (instancetype) initWithFireDate: (NSDate *)date
|
||||
interval: (NSTimeInterval)interval
|
||||
repeats: (BOOL)repeats
|
||||
- (instancetype) initWithFireDate: (NSDate *)date
|
||||
interval: (NSTimeInterval)interval
|
||||
repeats: (BOOL)repeats
|
||||
block: (GSTimerBlock)block
|
||||
{
|
||||
ASSIGN(_block, block);
|
||||
return [self initWithFireDate: date
|
||||
interval: interval
|
||||
target: nil
|
||||
selector: NULL
|
||||
userInfo: nil
|
||||
repeats: repeats];
|
||||
ASSIGN(_block, block);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -254,7 +253,7 @@ static Class NSDate_class;
|
|||
block: block];
|
||||
[[NSRunLoop currentRunLoop] addTimer: t forMode: NSDefaultRunLoopMode];
|
||||
RELEASE(t);
|
||||
return t;
|
||||
return t;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
@ -286,12 +285,12 @@ static Class NSDate_class;
|
|||
else
|
||||
{
|
||||
id target;
|
||||
|
||||
|
||||
/* We retain the target so it won't be deallocated while we are using
|
||||
* it (if this timer gets invalidated while we are firing).
|
||||
*/
|
||||
target = RETAIN(_target);
|
||||
|
||||
|
||||
if (_selector == 0)
|
||||
{
|
||||
NS_DURING
|
||||
|
@ -328,7 +327,7 @@ static Class NSDate_class;
|
|||
}
|
||||
RELEASE(target);
|
||||
}
|
||||
|
||||
|
||||
if (_repeats == NO)
|
||||
{
|
||||
[self invalidate];
|
||||
|
|
715
Source/NSURL.m
715
Source/NSURL.m
File diff suppressed because it is too large
Load diff
|
@ -373,7 +373,7 @@ typedef struct {
|
|||
NSInputStream *input;
|
||||
NSOutputStream *output;
|
||||
NSCachedURLResponse *cachedResponse;
|
||||
id <NSURLProtocolClient> client; // Not retained
|
||||
id <NSURLProtocolClient> client;
|
||||
NSURLRequest *request;
|
||||
NSString *in;
|
||||
NSString *out;
|
||||
|
@ -526,6 +526,7 @@ static NSURLProtocol *placeholder = nil;
|
|||
}
|
||||
DESTROY(this->cachedResponse);
|
||||
DESTROY(this->request);
|
||||
DESTROY(this->client);
|
||||
#if USE_ZLIB
|
||||
if (this->compressing == YES)
|
||||
{
|
||||
|
@ -596,7 +597,7 @@ static NSURLProtocol *placeholder = nil;
|
|||
{
|
||||
this->request = [request copy];
|
||||
this->cachedResponse = RETAIN(cachedResponse);
|
||||
this->client = client; // Not retained
|
||||
this->client = RETAIN(client);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -68,16 +68,16 @@ typedef struct {
|
|||
return o;
|
||||
}
|
||||
|
||||
+ (id) requestWithURL: (NSURL *)URL
|
||||
+ (instancetype) requestWithURL: (NSURL *)URL
|
||||
{
|
||||
return [self requestWithURL: URL
|
||||
cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval: 60.0];
|
||||
}
|
||||
|
||||
+ (id) requestWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval
|
||||
+ (instancetype) requestWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval
|
||||
{
|
||||
NSURLRequest *o = [[self class] allocWithZone: NSDefaultMallocZone()];
|
||||
|
||||
|
@ -177,16 +177,16 @@ typedef struct {
|
|||
return [self initWithURL: nil];
|
||||
}
|
||||
|
||||
- (id) initWithURL: (NSURL *)URL
|
||||
- (instancetype) initWithURL: (NSURL *)URL
|
||||
{
|
||||
return [self initWithURL: URL
|
||||
cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval: 60.0];
|
||||
}
|
||||
|
||||
- (id) initWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval
|
||||
- (instancetype) initWithURL: (NSURL *)URL
|
||||
cachePolicy: (NSURLRequestCachePolicy)cachePolicy
|
||||
timeoutInterval: (NSTimeInterval)timeoutInterval
|
||||
{
|
||||
if ([URL isKindOfClass: [NSURL class]] == NO)
|
||||
{
|
||||
|
|
|
@ -81,7 +81,8 @@ typedef struct {
|
|||
}
|
||||
s = [NSScanner scannerWithString: v];
|
||||
p = [GSMimeParser new];
|
||||
c = AUTORELEASE([GSMimeHeader new]);
|
||||
c = AUTORELEASE([[GSMimeHeader alloc] initWithName: @"content-type"
|
||||
value: nil]);
|
||||
/* We just set the header body, so we know it will scan and don't need
|
||||
* to check the retrurn type.
|
||||
*/
|
||||
|
@ -113,12 +114,29 @@ typedef struct {
|
|||
{
|
||||
GSMimeHeader *h;
|
||||
|
||||
/* Remove existing headers matching the ones we are setting.
|
||||
*/
|
||||
e = [(NSArray*)headers objectEnumerator];
|
||||
while ((h = [e nextObject]) != nil)
|
||||
{
|
||||
NSString *n = [h namePreservingCase: YES];
|
||||
|
||||
[this->headers removeObjectForKey: n];
|
||||
}
|
||||
/* Set new headers, joining values where we have multiple headers
|
||||
* with the same name.
|
||||
*/
|
||||
e = [(NSArray*)headers objectEnumerator];
|
||||
while ((h = [e nextObject]) != nil)
|
||||
{
|
||||
NSString *n = [h namePreservingCase: YES];
|
||||
NSString *o = [this->headers objectForKey: n];
|
||||
NSString *v = [h fullValue];
|
||||
|
||||
if (nil != o)
|
||||
{
|
||||
n = [NSString stringWithFormat: @"%@, %@", o, n];
|
||||
}
|
||||
[self _setValue: v forHTTPHeaderField: n];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ static const int kUUIDByteCount = 16;
|
|||
*/
|
||||
@implementation NSUUID
|
||||
|
||||
+ (id) UUID
|
||||
+ (instancetype) UUID
|
||||
{
|
||||
id u;
|
||||
|
||||
|
@ -51,7 +51,7 @@ static const int kUUIDByteCount = 16;
|
|||
return AUTORELEASE(u);
|
||||
}
|
||||
|
||||
- (id) init
|
||||
- (instancetype) init
|
||||
{
|
||||
gsuuid_t localUUID;
|
||||
int result;
|
||||
|
@ -65,7 +65,7 @@ static const int kUUIDByteCount = 16;
|
|||
return [self initWithUUIDBytes: localUUID];
|
||||
}
|
||||
|
||||
- (id) initWithUUIDString: (NSString *)string
|
||||
- (instancetype) initWithUUIDString: (NSString *)string
|
||||
{
|
||||
gsuuid_t localUUID;
|
||||
const char *cString;
|
||||
|
@ -81,7 +81,7 @@ static const int kUUIDByteCount = 16;
|
|||
return [self initWithUUIDBytes: localUUID];
|
||||
}
|
||||
|
||||
- (id) initWithUUIDBytes: (gsuuid_t)bytes
|
||||
- (instancetype) initWithUUIDBytes: (gsuuid_t)bytes
|
||||
{
|
||||
if (nil != (self = [super init]))
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue