Form new stable release from trunk.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@26630 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-06-12 10:44:00 +00:00
parent acc206a148
commit aaf7b19f28
299 changed files with 23466 additions and 8472 deletions

View file

@ -1,7 +1,7 @@
1 Announcement
**************
The GNUstep Base Library, version 1.14.4, is now available.
The GNUstep Base Library, version 1.15.3, is now available.
1.1 What is the GNUstep Base Library?
=====================================
@ -18,24 +18,25 @@ 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.14.4'
1.2 Noteworthy changes in version `1.15.3'
==========================================
Minor updates
* Extended NSUserDefaults so it recognizes ../ as a relative path.
* Added TLS/SSL support for NSStream based on GNU TLS
* Added support for https to NSURLConnection using new stream code
and added basic support for digest authentication.
* Fixed various problems with and added new options to KVO.
1.3 Where can you get it? How can you compile it?
==================================================
The gnustep-base-1.14.4.tar.gz distribution file has been placed at
The gnustep-base-1.15.3.tar.gz distribution file has been placed at
`ftp://ftp.gnustep.org/pub/gnustep/core'.
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>.
Copyright (C) 2005 Free Software Foundation
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.

886
COPYING
View file

@ -1,627 +1,285 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02111 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
13. Use with the GNU Affero General Public License.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
14. Revised Versions of this License.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
NO WARRANTY
15. Disclaimer of Warranty.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@ -629,15 +287,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Copyright (C) 19yy <name of author>
This program is free software: you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@ -646,30 +304,36 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

675
COPYINGv3 Normal file
View file

@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

1689
ChangeLog

File diff suppressed because it is too large Load diff

View file

@ -272,11 +272,9 @@ notice and this notice are preserved.
<term>GNUSTEP_STACK_TRACE</term>
<desc>
<p>
When this is set to <em>YES</em> a stack trace is placed in
the user information dictionary of the NSException object
created when an exception is raised. The trace is keyed
on <code>GSStackTraceKey</code> and provides additional
information to let you know where the exception occurred.
When this is set to <em>YES</em> a stack trace is
added to the output of the description method of
a raised exception object.
</p>
</desc>
<term>GNUSTEP_STRING_ENCODING</term>
@ -489,13 +487,13 @@ notice and this notice are preserved.
<deflist>
<term>GNUSTEP_SYSTEM_ROOT</term>
<desc>
Used to specify the GNUstep system root directory ... all
Obsolete. Used to specify the GNUstep system root directory ... all
system libraries, tools, applications, headers, resources
in general are located relative to this.
</desc>
<term>GNUSTEP_NETWORK_ROOT</term>
<desc>
Used to specify the GNUstep root directory for local
Obsolete. Used to specify the GNUstep root directory for local
(non-system) resources that are intended to be shared
across a local network. Typically this is an NFS exported
directory shared by many machines. It provides an
@ -504,7 +502,7 @@ notice and this notice are preserved.
</desc>
<term>GNUSTEP_LOCAL_ROOT</term>
<desc>
Used to specify the GNUstep root directory for local
Obsolete. Used to specify the GNUstep root directory for local
(non-system) resources. Typically all locally produced
or contributed software is installed relative to this.
</desc>
@ -514,7 +512,7 @@ notice and this notice are preserved.
</p>
<deflist>
<term>GNUSTEP_USER_DIR</term>
<desc>Path for user specific GNUstep resources (eg. 'GNUstep').
<desc>Obsolete. Path for user specific GNUstep resources (eg. 'GNUstep').
Relative to the user's home directory.
</desc>
<term>GNUSTEP_USER_CONFIG_FILE</term>
@ -542,48 +540,12 @@ notice and this notice are preserved.
HOMEDRIVE and HOMEPATH environment variables (or the USERPROFILE
environment variable if the others can't be used).
</p>
<p>
Support is provided to locate OS/PLATFORM directories. A conf file
may provide the definitions below (with examples typical for
when GNUstep is installed according to the Linux
Filesystem Hierarchy standard):
</p>
<deflist>
<term>GNUSTEP_SYS_APPS</term>
<desc>Place for system/os applications (eg. '/bin')</desc>
<term>GNUSTEP_SYS_LIBS</term>
<desc>Place for system/os shared libraries (eg. '/lib')</desc>
<term>GNUSTEP_SYS_ADMIN</term>
<desc>Place for system administration tools (eg. '/sbin')</desc>
<term>GNUSTEP_PLATFORM_APPS</term>
<desc>Place for non-gnustep applications (eg. '/usr/bin')</desc>
<term>GNUSTEP_PLATFORM_LIBS</term>
<desc>Place for application shared libraries
(eg. '/usr/lib')</desc>
<term>GNUSTEP_PLATFORM_RESOURCES</term>
<desc>Place for shared application resources
(eg. '/usr/share')</desc>
<term>GNUSTEP_PLATFORM_ADMIN</term>
<desc>Place for non-critical administrative tools
(eg. '/usr/sbin')</desc>
<term>GNUSTEP_PLATFORM_LOCAL_APPS</term>
<desc>Place for machine local applications
(eg. '/usr/local/bin')</desc>
<term>GNUSTEP_PLATFORM_LOCAL_LIBS</term>
<desc>Place for machine local shared libraries
(eg. '/usr/local/lib/')</desc>
<term>GNUSTEP_PLATFORM_LOCAL_RESOURCES</term>
<desc>Place for machine local resources.
(eg. '/usr/local/share')</desc>
</deflist>
<p>
These add to the path for NSSystemDomainMask, or
NSLocalDomainMask as appropriate.
</p>
<p>
All the above values from the configuration file are made
available in the NSUserDefaults system at runtime, in the
GSConfigDomain of the defaults.<br />
GSConfigDomain (along with any defaults provided in the
GlobalDefaults.plist file in the same directory as the
config file).<br />
In addition, the configuration file may contain the key
<em>GNUSTEP_EXTRA</em> with a value set to be a comma separated
list of extra key names which are to be allowed in the config
@ -633,10 +595,11 @@ notice and this notice are preserved.
<p>
Firstly, variables in the configuration file which define
paths, are expected to by full path specifications, except
for the special case in which they begin with dot-slash (./).
In this case the text after the dot-slash is appended to
the path to the directory containing the configuration file
(or specified to contain the configuration file if no
for the special case in which they begin with dot-slash (./)
or dot-dot-slash (../).
In this case the path from the variable is appended to the
path of the directory containing the configuration file
(or the path specified to contain the configuration file if no
configuration file exists) to form the value used.
</p>
<p>
@ -644,10 +607,8 @@ notice and this notice are preserved.
as the location of the config file (or specified by
the GNUSTEP_CONFIG_FILE environment variable unless that option
was disabled when the base library was configured)
begins with a dot and slash (./) then the path used for that
file is made relative to the base library.<br />
ie the text after the dot-slash is appended to the path of the
directory containing the gnustep-base library.
begins with a dot-slash (./) or dot-dot-slash (../) then the path
used for that file is made relative to the base library.
</p>
<p>
So you can bundle the whole lot together in one directory,
@ -662,7 +623,7 @@ notice and this notice are preserved.
a path with a trailing slash so that the base library will
<em>not</em> read it, and will use the builtin default values.<br />
To do this, you would configure using the options
<code>--with-config-file=./</code> and
<code>--with-config-file=not-used/</code> and
<code>--with-default-file=myConfig</code> where <em>myConfig</em>
is a file containing the paths you want to use relative to the
location the base library gets installed in.<br />
@ -692,10 +653,6 @@ notice and this notice are preserved.
are also ignored.
</p>
<p>
User specific files are stored in the locaton given by
GNUSTEP_USER_DIR (by default, the
<code>GNUstep</code> subdirectory of the users home
directory).<br />
The defaults database for a user is stored in the
subdirectory of the users home directory given by
GNUSTEP_USER_DEFAULTS_DIR (by default, the

View file

@ -9,7 +9,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of

View file

@ -24,10 +24,187 @@ notice and this notice are preserved.
<chapter>
<heading>Base Release Notes</heading>
<p>
The release notes include descriptions of API changes, behavior
The release notes include descriptions of API changes, behaviour
changes and other information that might help developers and users
migrate to using a newer version of the library.
</p>
<section>
<heading>Version 1.16.0</heading>
<p>
This is a stable release.
</p>
Highlights:
<deflist>
<term>NSArray</term>
<desc>New OSX method stubs.</desc>
<term>NSAutoreleasePool</term>
<desc>Dummy OSX method (-drain).</desc>
<term>NSBundle</term>
<desc>New OSX method stubs.</desc>
<term>NSCoder</term>
<desc>New OSX10.5 methods for NSInteger implemented.</desc>
<term>NSConnection</term>
<desc>New OSX10.5 methods for server connections implemented.</desc>
<term>NSData</term>
<desc>New OSX method stubs.</desc>
<term>NSException</term>
<desc>Implement stack address reporting.</desc>
<term>NSIndexSet</term>
<desc>Add OSX10.5 stub for countOfIndexesInRange</desc>
<term>NSKeyvalueObserving</term>
<desc>OSX10.5 additions implemented</desc>
<term>NSSet</term>
<desc>Implemented new OSX methods.</desc>
<term>NSStream</term>
<desc>Implemented basic SSL/TLS support using gnu-TLS.</desc>
<term>NSThread</term>
<desc>Implemented new OSX methods.</desc>
<term>NSLock, NSRecursiveLock, NSConditionLock</term>
<desc>Implemented names.</desc>
<term>GSXML, NSXMLParser</term>
<desc>Fully support namespace handling and fix bugs.</desc>
<term>NSKeyValueCoding, NSKeyValueObserving</term>
<desc>Made fully functional and MacOS-X compatible.</desc>
</deflist>
<p>The current emphasis of the base library is MacOS-X compatibility,
and the headers in this release mark many non-MacOS-X methods as being
scheduled for removal by the next release (from 1.17.0).<br />
These methods will mostly be moved to the 'additions' library,
(which can be built stand-alone in conjunction with the Cocoa Foundation
framework as libgnustep-baseadd on OSX) and their declarations will
be in the headers of that library (&lt;GNUstepBase/...&gt;) rather
than in the <em>Foundation</em> directory.<br />
NB. The markup in the headers and documentation should not be
assumed to be exhaustive ... it is planned that the next stable
release of the base library will enforce MacOS-X compatibility
by default, and you will have to explicitly include headers from
&lt;GNUstepBase/...&gt; in order to use GNUstep specific
additions.<br />
You should track the unstable branch of the base library (subversion
trunk) to find out what changes your software actually needs to make.
</p>
<p>The TODO list for MacOS-X 10.5 compatibility follows,
this is all stuff which would ideally be done by the next
stable release of this library.
</p>
<list>
<item>Remove all non OSX10.5 declarations from standard headers</item>
<item>Implement most new method stubs.</item>
<item>Implement new OSX10.5 NSCalendar class.</item>
<item>Implement new OSX10.5 NSLocale class.</item>
<item>Implement new OSX10.5 NSOperation class.</item>
<item>Implement new OSX10.5 XML classes.</item>
<item>Implement NSInteger coding for NSCoder subclasses.</item>
<item>Implement support for now enumerated values
in NSComparisonPredicate.</item>
<item>Implement new OSX10.5 features of NSDateFormatter.</item>
<item>Implement new OSX10.5 features of NSExpression.</item>
<item>Implement new OSX10.5 features of NSPredicate.</item>
<item>Implement new OSX10.5 features of NSFileManager.</item>
<item>Implement new OSX10.5 features of NSProcessInfo.</item>
<item>Implement new OSX10.5 NSHashTable class.</item>
<item>Implement new OSX10.5 NSMapTable class.</item>
<item>Implement new OSX10.5 NSPointerArray class.</item>
<item>Implement new OSX10.5 NSLocale additions.</item>
<item>Implement new OSX10.5 features of NSNumberFormatter.</item>
<item>Implement new OSX10.5 features of NSNumber/NSValue.</item>
<item>Update NSDistributedNotificationCenter
with new OSX methods.</item>
</list>
</section>
<section>
<heading>Version 1.15.3</heading>
<p>
This is an unstable release.
</p>
Highlights:
<deflist>
<term>Configuration/NSUserDefaults</term>
<desc>
Syntax within the configuration file extended so that a leading
'../' in a path name denotes a relative path in a relocatable
installation.<br />
New 'GlobalDefaults.plist' file in the same directory as the main
GNUstep config file allows packagers/sysadmins to set up global
defaults easily.
</desc>
<term>NSStream</term>
<desc>
Addition of TLS/SSL support using GNU TLS on both unix-like
and mswindows systems. First draft.<br />
Additions of SOCKS proxying support for socket streams. First draft.
</desc>
<term>NSURLConnection</term>
<desc>
Added support for https using new stream code.<br />
Added support for basic and digest authentication.
</desc>
</deflist>
</section>
<section>
<heading>Version 1.15.2</heading>
<p>
This is an unstable release. Bug fixes include improved thread
safety and Key-Value observing.
</p>
Highlights:
<deflist>
<term>NSException</term>
<desc>
New MacOS X methods and improved stack trace.
</desc>
<term>NSThread</term>
<desc>
New methods from Mac OS 10.5 and new ivars
</desc>
<term>NSDecimal and NSDecimalNumber</term>
<desc>
Many improvements
</desc>
</deflist>
</section>
<section>
<heading>Version 1.15.1</heading>
<p>
This is an unstable release. There have been many bug fixes, but
also a few method additions and changes to some headers.
Also the license for this release is now GPLv3 and LGPLv3.
</p>
Highlights:
<deflist>
<term>NSUserDefaults</term>
<desc>
Stores YES or NO as a string for MacOS X compatibility.
</desc>
<term>NSErrorRecoveryAttempting</term>
<desc>
Added header (and some support in the gui library).
</desc>
<term>NSArray</term>
<desc>
Added some new methods to handle multiple objects.
</desc>
<term>Key-Value Coding</term>
<desc>
More support for key-value coding.
</desc>
<term>NSPredicate</term>
<desc>
Much improved parsing. Ivars have changed in some of the predicate
classes.
</desc>
</deflist>
</section>
<section>
<heading>Version 1.15.0</heading>
<p>
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.
</p>
</section>
<section>
<heading>Version 1.14.0</heading>
<p>
@ -60,7 +237,7 @@ notice and this notice are preserved.
<term>NSObject</term>
<desc>
Fixes for lock contention with retain/release, so the performance
of massively multithreaded applications is much better.
of massively multi-threaded applications is much better.
</desc>
<term>NSNetServices</term>
<desc>
@ -98,18 +275,18 @@ notice and this notice are preserved.
<term>NSBundle</term>
<desc>
Fix for crash when initialising the bundle system in
an applicatiuon linked with many frameworks.
an application linked with many frameworks.
</desc>
<term>NSCalendarDate</term>
<desc>
Fix for buffer overrun problem mwhen initialising
Fix for buffer overrun problem when initialising
date from string. Also fixed to return nil when
initialising from some illegal strings.
</desc>
<term>NSConnection</term>
<desc>
Some locking fixes to avoid rare deadlocks in heavily
multithreaded applications.
multi-threaded applications.
</desc>
<term>NSDecimalNumber</term>
<desc>
@ -152,17 +329,17 @@ notice and this notice are preserved.
<heading>Version 1.13.0</heading>
<p>
Several sets of classes have been added for dealing with urls and
predicates. A few minor api changes have occured as well.
predicates. A few minor api changes have occurred as well.
</p>
<deflist>
<term>Character sets</term>
<desc>
Character sets were improved with regard to ranges (chinese
Character sets were improved with regard to ranges (Chinese
characters, etc).
</desc>
<term>Keyed Archiving</term>
<desc>
Better compatibility with MacOSX. In particular, some gueses
Better compatibility with MacOSX. In particular, some guesses
are made as to how some objects should be encoded.
</desc>
<term>GNUstep configuration file</term>
@ -180,14 +357,14 @@ notice and this notice are preserved.
Most of the code was updated to compile nicely with the new
gcc objective-c++ compiler.
</desc>
<term>NSString designated initializer</term>
<term>NSString designated initialiser</term>
<desc>
The GNUstep designated initialiser for the NSString class
cluster has changed to
<code>-initWithBytesNoCopy:length:encoding:freeWhenDone:</code>
from
<code>-initWithCharactersNoCopy:length:freeWhenDone:</code>
and older code subclassing NSString will need to be updated.
and older code sub classing NSString will need to be updated.
</desc>
<term>NSBundle bundleWithIndentifier:</term>
<desc>
@ -212,7 +389,7 @@ notice and this notice are preserved.
</desc>
<term>Run loops</term>
<desc>
Removed the timeout facility for runloop watchers - you should
Removed the timeout facility for run loop watchers - you should
use standard timers instead. The watcher interface is deprecated
anyway.
</desc>
@ -248,7 +425,7 @@ notice and this notice are preserved.
Several deprecated and private methods were removed from
the public interface including
<code>+gnustepBundle</code>, and
<code>+pathForGNUstepResource:ofTpye:inDirectory:</code>.
<code>+pathForGNUstepResource:ofType:inDirectory:</code>.
</desc>
<term>NSNotificationCenter deprecated method</term>
<desc>

View file

@ -37,11 +37,3 @@ 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}.
@ifinfo
Copyright @copyright{} 2005 Free Software Foundation
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
@end ifinfo

View file

@ -69,13 +69,13 @@ are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled ``GNU Lesser General Public License'' is included exactly as
section entitled ``GNU Library General Public License'' is included exactly as
in the original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that the section entitled ``GNU Lesser General Public License'' may be
except that the section entitled ``GNU Library General Public License'' may be
included in a translation approved by the author instead of in the original
English.

View file

@ -5,7 +5,7 @@
This document is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or
Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
You should have received a copy of the GNU General Public License along

View file

@ -11,26 +11,36 @@ 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.14.4}
@section Noteworthy changes in version @samp{1.15.3}
@itemize @bullet
@item Extended NSUserDefaults so it recognizes ../ as a relative path.
@item Added TLS/SSL support for NSStream based on GNU TLS
@item Added support for https to NSURLConnection using new stream code and
added basic support for digest authentication.
@item Fixed various problems with and added new options to KVO.
@end itemize
Minor updates
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{1.14.3}
@section Noteworthy changes in version @samp{1.15.2}
Bug fixes include improved thread safety (and a change to the NSThread
class structure) and Key-Value observing.
Various bug fixes.
@section Noteworthy changes in version @samp{1.15.1}
@section Noteworthy changes in version @samp{1.14.2}
This is an unstable release. There may be API and ABI changes
from 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.
Minor configuration change so it will compile on darwin with ffcall.
@section Noteworthy changes in version @samp{1.14.1}
License changed to GPLv3.
Mostly bug fixes, particularly with regard to XML handling and handling
unichar on Windows.
@section Noteworthy changes in version @samp{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.
@section Noteworthy changes in version @samp{1.14.0}
Many portability (particularly for ms-windows) and MacOS-X compatibility fixes.
@ -38,6 +48,7 @@ New MacOS-X classes and incorporation of NSAffineTransform and NSSpellServer
which were formerly in the gui library.
Improved performance of amssively multithreaded programs.
@section Noteworthy changes in version @samp{1.13.1}
Various minor bugs and MacOS-X incompatibilities fixed.

View file

@ -25,59 +25,316 @@
#ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_
#define __GNUSTEP_GNUSTEP_H_INCLUDED_
#ifndef GNUSTEP
/* The contents of this file are designed to be usable with either
* GNUstep-base or MacOS-X Foundation.
*/
#define AUTORELEASE(object) [object autorelease]
#define TEST_AUTORELEASE(object) ({ if (object) [object autorelease]; })
#if GS_WITH_GC
#define RELEASE(object) [object release]
#define TEST_RELEASE(object) ({ if (object) [object release]; })
#ifndef RETAIN
#define RETAIN(object) ((id)object)
#endif
#ifndef RELEASE
#define RELEASE(object)
#endif
#ifndef AUTORELEASE
#define AUTORELEASE(object) ((id)object)
#endif
#define RETAIN(object) [object retain]
#define TEST_RETAIN(object) ({ if (object) [object retain]; })
#ifndef TEST_RETAIN
#define TEST_RETAIN(object) ((id)object)
#endif
#ifndef TEST_RELEASE
#define TEST_RELEASE(object)
#endif
#ifndef TEST_AUTORELEASE
#define TEST_AUTORELEASE(object) ((id)object)
#endif
#define ASSIGN(object,value) ({\
id __value = (id)(value); \
id __object = (id)(object); \
if (__value != __object) \
{ \
if (__value != nil) \
{ \
[__value retain]; \
} \
object = __value; \
if (__object != nil) \
{ \
[__object release]; \
} \
} \
})
#ifndef ASSIGN
#define ASSIGN(object,value) (object = value)
#endif
#ifndef ASSIGNCOPY
#define ASSIGNCOPY(object,value) (object = [value copy])
#endif
#ifndef DESTROY
#define DESTROY(object) (object = nil)
#endif
#define ASSIGNCOPY(object,value) ASSIGN(object, [[value copy] autorelease]);
#ifndef CREATE_AUTORELEASE_POOL
#define CREATE_AUTORELEASE_POOL(X)
#endif
#define DESTROY(object) ({ \
if (object) \
{ \
id __o = object; \
object = nil; \
[__o release]; \
} \
})
#ifndef RECREATE_AUTORELEASE_POOL
#define RECREATE_AUTORELEASE_POOL(X)
#endif
#define CREATE_AUTORELEASE_POOL(X) \
NSAutoreleasePool *(X) = [NSAutoreleasePool new]
#define IF_NO_GC(X)
#define NSLocalizedString(key, comment) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
#else
#define _(X) NSLocalizedString (X, nil)
#ifndef RETAIN
/**
* Basic retain operation ... calls [NSObject-retain]
*/
#define RETAIN(object) [object retain]
#endif
#ifndef RELEASE
/**
* Basic release operation ... calls [NSObject-release]
*/
#define RELEASE(object) [object release]
#endif
#ifndef AUTORELEASE
/**
* Basic autorelease operation ... calls [NSObject-autorelease]
*/
#define AUTORELEASE(object) [object autorelease]
#endif
#ifndef TEST_RETAIN
/**
* Tested retain - only invoke the
* objective-c method if the receiver is not nil.
*/
#define TEST_RETAIN(object) ({\
id __object = (id)(object); (__object != nil) ? [__object retain] : nil; })
#endif
#ifndef TEST_RELEASE
/**
* Tested release - only invoke the
* objective-c method if the receiver is not nil.
*/
#define TEST_RELEASE(object) ({\
id __object = (id)(object); if (__object != nil) [__object release]; })
#endif
#ifndef TEST_AUTORELEASE
/**
* Tested autorelease - only invoke the
* objective-c method if the receiver is not nil.
*/
#define TEST_AUTORELEASE(object) ({\
id __object = (id)(object); (__object != nil) ? [__object autorelease] : nil; })
#endif
#ifndef ASSIGN
/**
* ASSIGN(object,value) assigns the value to the object with
* appropriate retain and release operations.
*/
#define ASSIGN(object,value) ({\
id __value = (id)(value); \
id __object = (id)(object); \
if (__value != __object) \
{ \
if (__value != nil) \
{ \
[__value retain]; \
} \
object = __value; \
if (__object != nil) \
{ \
[__object release]; \
} \
} \
})
#endif
#ifndef ASSIGNCOPY
/**
* ASSIGNCOPY(object,value) assigns a copy of the value to the object
* with release of the original.
*/
#define ASSIGNCOPY(object,value) ({\
id __value = (id)(value); \
id __object = (id)(object); \
if (__value != __object) \
{ \
if (__value != nil) \
{ \
__value = [__value copy]; \
} \
object = __value; \
if (__object != nil) \
{ \
[__object release]; \
} \
} \
})
#endif
#ifndef DESTROY
/**
* DESTROY() is a release operation which also sets the variable to be
* a nil pointer for tidiness - we can't accidentally use a DESTROYED
* object later. It also makes sure to set the variable to nil before
* releasing the object - to avoid side-effects of the release trying
* to reference the object being released through the variable.
*/
#define DESTROY(object) ({ \
if (object) \
{ \
id __o = object; \
object = nil; \
[__o release]; \
} \
})
#endif
#ifndef CREATE_AUTORELEASE_POOL
/**
* Declares an autorelease pool variable and creates and initialises
* an autorelease pool object.
*/
#define CREATE_AUTORELEASE_POOL(X) \
NSAutoreleasePool *(X) = [NSAutoreleasePool new]
#endif
#ifndef RECREATE_AUTORELEASE_POOL
/**
* Similar, but allows reuse of variables. Be sure to use DESTROY()
* so the object variable stays nil.
*/
#define RECREATE_AUTORELEASE_POOL(X) \
if (X == nil) \
(X) = [NSAutoreleasePool new]
#endif
#define IF_NO_GC(X) X
#endif
/**
* <p>
* This function (macro) is a GNUstep extension.
* </p>
* <p>
* <code>_(@"My string to translate")</code>
* </p>
* <p>
* is exactly the same as
* </p>
* <p>
* <code>NSLocalizedString (@"My string to translate", @"")</code>
* </p>
* <p>
* It is useful when you need to translate an application
* very quickly, as you just need to enclose all strings
* inside <code>_()</code>. But please note that when you
* use this macro, you are not taking advantage of comments
* for the translator, so consider using
* <code>NSLocalizedString</code> instead when you need a
* comment.
* </p>
*/
#define _(X) NSLocalizedString (X, @"")
/* The quickest possible way to localize a static string:
static NSString *string = __(@"New Game");
NSLog (_(string)); */
/**
* <p>
* This function (macro) is a GNUstep extension.
* </p>
* <p>
* <code>__(@"My string to translate")</code>
* </p>
* <p>
* is exactly the same as
* </p>
* <p>
* <code>GSLocalizedStaticString (@"My string to translate", @"")</code>
* </p>
* <p>
* It is useful when you need to translate an application very
* quickly. You would use it as follows for static strings:
* </p>
* <p>
* <code>
* NSString *message = __(@"Hello there");
* ... more code ...
* NSLog (_(messages));
* </code>
* </p>
* <p>
* But please note that when you use this macro, you are not
* taking advantage of comments for the translator, so
* consider using <code>GSLocalizedStaticString</code>
* instead when you need a comment.
* </p>
*/
#define __(X) X
#define NSLocalizedStaticString(X, Y) X
/* The better way for a static string, with a comment - use as follows -
static NSString *string = GSLocalizedStaticString (@"New Game",
@"Menu Option");
#include <GNUstepBase/GSVersionMacros.h>
NSLog (_(string));
If you need anything more complicated than this, please initialize
the static strings manually.
*/
/**
* <p>
* This function (macro) is a GNUstep extensions, and it is used
* to localize static strings. Here is an example of a static
* string:
* </p>
* <p>
* <code>
* NSString *message = @"Hi there";
* ... some code ...
* NSLog (message);
* </code>
* </p>
* <p>
* This string can not be localized using the standard
* openstep functions/macros. By using this gnustep extension,
* you can localize it as follows:
* </p>
* <p>
* <code>
* NSString *message = GSLocalizedStaticString (@"Hi there",
* @"Greeting");
*
* ... some code ...
*
* NSLog (NSLocalizedString (message, @""));
* </code>
* </p>
* <p>
* When the tools generate the
* <code>Localizable.strings</code> file from the source
* code, they will ignore the <code>NSLocalizedString</code>
* call while they will extract the string (and the comment)
* to localize from the <code>GSLocalizedStaticString</code>
* call.
* </p>
* <p>
* When the code is compiled, instead, the
* <code>GSLocalizedStaticString</code> call is ignored (discarded,
* it is a macro which simply expands to <code>key</code>), while
* the <code>NSLocalizedString</code> will actually look up the
* string for translation in the <code>Localizable.strings</code>
* file.
* </p>
* <p>
* Please note that there is currently no macro/function to
* localize static strings using different tables. If you
* need that functionality, you have either to prepare the
* localization tables by hand, or to rewrite your code in
* such a way as not to use static strings.
* </p>
*/
#define GSLocalizedStaticString(key, comment) key
#endif /* GNUSTEP */
#endif /* __GNUSTEP_GNUSTEP_H_INCLUDED_ */

View file

@ -13,7 +13,7 @@
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -198,7 +198,7 @@ typedef gsuaddr gsaddr;
* Native character type for use in systemcalls etc.
*/
#if defined(__MINGW32__)
#define GSNativeChar unichar
#define GSNativeChar uint16_t
#else
#define GSNativeChar char
#endif

View file

@ -1,4 +1,4 @@
/** Additional functions for GNUStep
/** Additional functions and macros for GNUStep
Copyright (C) 2005 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <rfm@gnu.org>
@ -26,24 +26,36 @@
#ifndef __GSFunctions_h_GNUSTEP_BASE_INCLUDE
#define __GSFunctions_h_GNUSTEP_BASE_INCLUDE
#include "GNUstepBase/GSVersionMacros.h"
#include "GNUstepBase/GNUstep.h"
#include "GNUstepBase/preface.h"
#include "GNUstepBase/GSObjCRuntime.h"
#include "GNUstepBase/GNUstep.h"
#warning "deprecated header ... will be removed in a later release"
#if defined(__cplusplus)
extern "C" {
#endif
#define GSLocalizedStringFromTableInFramework(key, tbl, fpth, comment) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" \
table: [bundle pathForGNUstepResource:(tbl) ofType: nil inDirectory: (fpth)]
/* Now Support for Quick Localization */
/* The quickest possible way to localize a string:
NSLog (_(@"New Game"));
Please make use of the longer functions taking a comment when you
get the time to localize seriously your code.
*/
#if GS_API_VERSION(GS_API_NONE,011500)
@class NSArray;
@class NSString;
/**
* Try to locate file/directory (aName).(anExtension) in paths.
* Will return the first found or nil if nothing is found.
* Will return the first found or nil if nothing is found.<br />
* Deprecated ... may be removed in later release.
*/
GS_EXPORT NSString *GSFindNamedFile(NSArray *paths, NSString *aName,
NSString *anExtension);

View file

@ -28,6 +28,9 @@
#include <Foundation/NSObject.h>
#include <Foundation/NSZone.h>
/* To turn assertions on, define GSI_ARRAY_CHECKS */
#define GSI_ARRAY_CHECKS 1
#if defined(__cplusplus)
extern "C" {
#endif
@ -37,15 +40,14 @@ extern "C" {
#define INLINE inline
#endif
/* To turn assertions on, define GSI_ARRAY_CHECKS */
#ifdef GSI_ARRAY_CHECKS
#define GSI_ARRAY_CHECK NSCAssert(array->count <= array->cap && array->old <= array->cap && array->old >= 1, NSInternalInconsistencyException)
#define GSI_ARRAY_CHECK NSCAssert(array->count <= array->cap && array->old <= array->cap, NSInternalInconsistencyException)
#else
#define GSI_ARRAY_CHECK
#endif
/*
This file should be INCLUDED in files wanting to use the GSIArray
* This file should be INCLUDED in files wanting to use the GSIArray
* functions - these are all declared inline for maximum performance.
*
* The file including this one may predefine some macros to alter
@ -300,7 +302,7 @@ GSIArrayAddItemNoRetain(GSIArray array, GSIArrayItem item)
*/
static INLINE unsigned
GSIArraySearch(GSIArray array, GSIArrayItem item,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned int upper = array->count;
unsigned int lower = 0;
@ -333,7 +335,7 @@ GSIArraySearch(GSIArray array, GSIArrayItem item,
static INLINE unsigned
GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned int index;
@ -356,7 +358,7 @@ GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item,
#ifdef GSI_ARRAY_CHECKS
static INLINE void
GSIArrayCheckSort(GSIArray array,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned int i;
@ -364,18 +366,21 @@ GSIArrayCheckSort(GSIArray array,
{
#ifdef GSI_ARRAY_CHECKS
NSCAssert(((*sorter)(array->ptr[i-1], array->ptr[i])
!= NSOrderedDescending), NSInvalidArgumentException);
#endif
!= NSOrderedDecending), NSInvalidArgumentException);
}
}
#endif
static INLINE void
GSIArrayInsertSorted(GSIArray array, GSIArrayItem item,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned int index;
#ifdef GSI_ARRAY_CHECKS
GSIArrayCheckSort(array, sorter);
#endif
index = GSIArrayInsertionPosition(array, item, sorter);
GSIArrayInsertItem(array, item, index);
#ifdef GSI_ARRAY_CHECKS
@ -385,10 +390,13 @@ GSIArrayInsertSorted(GSIArray array, GSIArrayItem item,
static INLINE void
GSIArrayInsertSortedNoRetain(GSIArray array, GSIArrayItem item,
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem))
{
unsigned int index;
#ifdef GSI_ARRAY_CHECKS
GSIArrayCheckSort(array, sorter);
#endif
index = GSIArrayInsertionPosition(array, item, sorter);
GSIArrayInsertItemNoRetain(array, item, index);
#ifdef GSI_ARRAY_CHECKS

View file

@ -34,6 +34,8 @@
#include <Foundation/Foundation.h>
#endif
#include "GNUstepBase/GSObjCRuntime.h"
#if defined(__cplusplus)
extern "C" {
#endif
@ -54,6 +56,11 @@ extern "C" {
- (void) _becomeThreaded: (NSNotification*)n;
@end
/** Global lock to be used by classes when operating on any global
data that invoke other methods which also access global; thus,
creating the potential for deadlock. */
GS_EXPORT NSRecursiveLock *gnustep_global_lock;
#if defined(__cplusplus)
}
#endif

View file

@ -28,15 +28,16 @@
#ifndef __GSMime_h_GNUSTEP_BASE_INCLUDE
#define __GSMime_h_GNUSTEP_BASE_INCLUDE
#include <GNUstepBase/GSVersionMacros.h>
#import <GNUstepBase/GSVersionMacros.h>
#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST)
#ifdef NeXT_Foundation_LIBRARY
#include <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#else
#include <Foundation/NSObject.h>
#include <Foundation/NSString.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import <Foundation/NSMapTable.h>
#endif
#if defined(__cplusplus)
@ -71,22 +72,27 @@ extern "C" {
NSString *name;
NSString *value;
NSMutableDictionary *objects;
NSMutableDictionary *params;
NSMutableDictionary *params;
}
+ (NSString*) makeQuoted: (NSString*)v always: (BOOL)flag;
+ (NSString*) makeToken: (NSString*)t preservingCase: (BOOL)preserve;
+ (NSString*) makeToken: (NSString*)t;
- (id) copyWithZone: (NSZone*)z;
- (NSString*) fullValue;
- (id) initWithName: (NSString*)n
value: (NSString*)v;
- (id) initWithName: (NSString*)n
value: (NSString*)v
parameters: (NSDictionary*)p;
- (NSString*) name;
- (NSString*) namePreservingCase: (BOOL)preserve;
- (id) objectForKey: (NSString*)k;
- (NSDictionary*) objects;
- (NSString*) parameterForKey: (NSString*)k;
- (NSDictionary*) parameters;
- (NSDictionary*) parametersPreservingCase: (BOOL)preserve;
- (NSMutableData*) rawMimeData;
- (NSMutableData*) rawMimeDataPreservingCase: (BOOL)preserve;
- (void) setName: (NSString*)s;
- (void) setObject: (id)o forKey: (NSString*)k;
- (void) setParameter: (NSString*)v forKey: (NSString*)k;
@ -220,6 +226,7 @@ extern "C" {
- (BOOL) isInHeaders;
- (GSMimeDocument*) mimeDocument;
- (BOOL) parse: (NSData*)d;
- (BOOL) parseHeaders: (NSData*)d remaining: (NSData**)body;
- (BOOL) parseHeader: (NSString*)aHeader;
- (BOOL) scanHeaderBody: (NSScanner*)scanner into: (GSMimeHeader*)info;
- (NSString*) scanName: (NSScanner*)scanner;
@ -228,7 +235,6 @@ extern "C" {
- (NSString*) scanToken: (NSScanner*)scanner;
- (void) setBuggyQuotes: (BOOL)flag;
- (void) setDefaultCharset: (NSString*)aName;
- (void) setIsHttp;
@end

View file

@ -40,19 +40,25 @@
/*
* For MacOS-X compatibility, we define the MacOS-X version constants and
* we allow MAC_OS_X_VERSION_MAX_ALLOWED instead of GS_OPENSTEP_V
* we allow MAC_OS_X_VERSION_MIN_ALLOWED or MAC_OS_X_VERSION_MAX_ALLOWED
* instead of GS_OPENSTEP_V
*/
#ifndef MAC_OS_X_VERSION_10_2
#define MAC_OS_X_VERSION_10_2 100200
#define MAC_OS_X_VERSION_10_3 100300
#define MAC_OS_X_VERSION_10_4 100400
#define MAC_OS_X_VERSION_10_5 100500
#endif /* MAC_OS_X_VERSION_10_2 */
#ifndef GS_OPENSTEP_V
#ifdef MAC_OS_X_VERSION_MIN_ALLOWED
#define GS_OPENSTEP_V MAC_OS_X_VERSION_MIN_ALLOWED
#else
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
#define GS_OPENSTEP_V MAC_OS_X_VERSION_MAX_ALLOWED
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
#endif /* MAC_OS_X_VERSION_MIN_ALLOWED */
#endif /* GS_OPENSTEP_V */
/*

View file

@ -331,7 +331,8 @@ extern "C" {
- (void) startElement: (NSString*)elementName
prefix: (NSString*)prefix
href: (NSString*)href
attributes: (NSMutableDictionary*)elementAttributes;
attributes: (NSMutableDictionary*)elementAttributes
namespaces: (NSMutableDictionary*)elementNamespaces;
/** <override-dummy /> */
- (void) unparsedEntityDecl: (NSString*)name
public: (NSString*)publicId
@ -363,6 +364,20 @@ extern "C" {
* GSXPathString *result = [p evaluateExpression: @"string(/body/text())"];
* NSLog (@"Got %@", [result stringValue]);
*
* If the XML document contains namespaces, you first need to register them
* with the parser by using registerNamespaceWithPrefix:href:, as in:
*
* GSXPathContext *p = [[GSXPathContext alloc] initWithDocument: document];
* if ([p registerNamespaceWithPrefix: @"a" href="http://www.gnustep.org/demo"] == NO)
* {
* // Error registering namespace, do something about it.
* }
*
* and then you can use the namespace prefix in your expressions, as in
*
* GSXPathString *result = [p evaluateExpression: @"string(/a:body/text())"];
* NSLog (@"Got %@", [result stringValue]);
*
*/
@interface GSXPathContext : NSObject
{
@ -371,6 +386,12 @@ extern "C" {
}
- (id) initWithDocument: (GSXMLDocument*)d;
- (GSXPathObject*) evaluateExpression: (NSString*)XPathExpression;
/*
* Registers a new namespace. Return YES if succesful, NO if not.
*/
- (BOOL) registerNamespaceWithPrefix: (NSString *)prefix
href: (NSString *)href;
@end
/** XPath queries return a GSXPathObject. GSXPathObject in itself is
@ -442,6 +463,7 @@ extern "C" {
#include <Foundation/NSURLHandle.h>
#include <Foundation/NSURLConnection.h>
@class NSArray;
@class NSDictionary;
@ -504,13 +526,10 @@ extern "C" {
@interface GSXMLRPC : NSObject <NSURLHandleClient>
{
@private
#ifdef GNUSTEP
NSURLHandle *handle;
#else
NSString *connectionURL;
NSURLConnection *connection;
NSMutableData *response;
#endif
NSTimer *timer;
id result;
id delegate; // Not retained.
@ -629,7 +648,7 @@ extern "C" {
* Raises an exception if parsing fails.<br />
* Used internally when making a method call to a remote server.
*/
- (NSDictionary*) parseResponse: (NSData*)response
- (NSDictionary*) parseResponse: (NSData*)resp
params: (NSMutableArray*)params;
/**

View file

@ -132,9 +132,6 @@
/* Built in default value for GNUstep user defaults directory */
#undef GNUSTEP_TARGET_USER_DEFAULTS_DIR
/* Built in default value for GNUstep user directory */
#undef GNUSTEP_TARGET_USER_DIR
/* Built in default value for GNUstep user_dir admin apps */
#undef GNUSTEP_TARGET_USER_DIR_ADMIN_APPS
@ -174,6 +171,9 @@
/* Define if this constant is defined */
#undef HANDLE_LONG_LONG_MAX
/* Define to 1 if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <bfd.h> header file. */
#undef HAVE_BFD_H
@ -208,6 +208,18 @@
/* Define to 1 if you have the `getgrgid' function. */
#undef HAVE_GETGRGID
/* Define to 1 if you have the `getgrgid_r' function. */
#undef HAVE_GETGRGID_R
/* Define to 1 if you have the `getgrnam' function. */
#undef HAVE_GETGRNAM
/* Define to 1 if you have the `getgrnam_r' function. */
#undef HAVE_GETGRNAM_R
/* Define to 1 if you have the `gethostbyaddr_r' function. */
#undef HAVE_GETHOSTBYADDR_R
/* Define to 1 if you have the `getlogin' function. */
#undef HAVE_GETLOGIN
@ -220,15 +232,24 @@
/* Define to 1 if you have the `getpwnam' function. */
#undef HAVE_GETPWNAM
/* Define to 1 if you have the `getpwnam_r' function. */
#undef HAVE_GETPWNAM_R
/* Define to 1 if you have the `getpwuid' function. */
#undef HAVE_GETPWUID
/* Define to 1 if you have the `getpwuid_r' function. */
#undef HAVE_GETPWUID_R
/* Define if you have this function */
#undef HAVE_GICONV
/* Define to 1 if you have the <gmp.h> header file. */
#undef HAVE_GMP_H
/* Define if libgnutls available */
#undef HAVE_GNUTLS
/* Define to 1 if you have the <grp.h> header file. */
#undef HAVE_GRP_H
@ -238,6 +259,9 @@
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
/* Define to 1 if you have the `inet_ntop' function. */
#undef HAVE_INET_NTOP
/* Define to 1 if you have the `inet_pton' function. */
#undef HAVE_INET_PTON
@ -274,6 +298,9 @@
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if libxml available */
#undef HAVE_LIBXML
@ -379,6 +406,9 @@
/* Define to 1 if you have the `setpgrp' function. */
#undef HAVE_SETPGRP
/* Define to 1 if you have the `setrlimit' function. */
#undef HAVE_SETRLIMIT
/* Define to 1 if you have the `shmctl' function. */
#undef HAVE_SHMCTL
@ -400,6 +430,9 @@
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `strerror_r' function. */
#undef HAVE_STRERROR_R
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
@ -415,6 +448,9 @@
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/cdefs.h> header file. */
#undef HAVE_SYS_CDEFS_H
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
@ -441,6 +477,9 @@
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
/* Define to 1 if you have the <sys/rusage.h> header file. */
#undef HAVE_SYS_RUSAGE_H

View file

@ -9,7 +9,7 @@
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of

View file

@ -30,6 +30,7 @@
#import <GNUstepBase/GSVersionMacros.h>
#import <objc/objc.h>
#import <Foundation/FoundationErrors.h>
#import <Foundation/NSObjCRuntime.h>
#import <GNUstepBase/GSConfig.h>
#import <Foundation/NSDebug.h>

View file

@ -0,0 +1,81 @@
/* Interface for FoundationErrors for GNUstep
Copyright (C) 2008 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <rfm@gnu.org>
Date: 2008
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef __FoundationErrors_h_GNUSTEP_BASE_INCLUDE
#define __FoundationErrors_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#import <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
/* These are those of the NSError code values for the NSCocoaErrorDomain
* which are defined in the foundation/base library.
*/
enum {
NSFileErrorMaximum = 1023,
NSFileErrorMinimum = 0,
NSFileLockingError = 255,
NSFileNoSuchFileError = 4,
NSFileReadCorruptFileError = 259,
NSFileReadInapplicableStringEncodingError = 261,
NSFileReadInvalidFileNameError = 258,
NSFileReadNoPermissionError = 257,
NSFileReadNoSuchFileError = 260,
NSFileReadUnknownError = 256,
NSFileReadUnsupportedSchemeError = 262,
NSFileWriteInapplicableStringEncodingError = 517,
NSFileWriteInvalidFileNameError = 514,
NSFileWriteNoPermissionError = 513,
NSFileWriteOutOfSpaceError = 640,
NSFileWriteUnknownError = 512,
NSFileWriteUnsupportedSchemeError = 518,
NSFormattingError = 2048,
NSFormattingErrorMaximum = 2559,
NSFormattingErrorMinimum = 2048,
NSKeyValueValidationError = 1024,
NSUserCancelledError = 3072,
NSValidationErrorMaximum = 2047,
NSValidationErrorMinimum = 1024,
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
NSExecutableArchitectureMismatchError = 3585,
NSExecutableErrorMaximum = 3839,
NSExecutableErrorMinimum = 3584,
NSExecutableLinkError = 3588,
NSExecutableLoadError = 3587,
NSExecutableNotLoadableError = 3584,
NSExecutableRuntimeMismatchError = 3586,
NSFileReadTooLargeError = 263,
NSFileReadUnknownStringEncodingError = 264,
#endif
GSFoundationPlaceHolderError = 9999
};
#endif
#endif

View file

@ -92,7 +92,7 @@ extern "C" {
#endif
@end
#if OS_API_VERSION(GS_API_NONE,GS_API_NONE)
#if GS_API_VERSION(GS_API_NONE,011700)
@interface NSArchiver (GNUstep)
/*

View file

@ -26,15 +26,17 @@
#define __NSArray_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSRange.h>
#import <Foundation/NSUtilities.h>
#if defined(__cplusplus)
extern "C" {
#endif
@class NSEnumerator;
@class NSString;
@class NSURL;
@class NSIndexSet;
@interface NSArray : NSObject <NSCoding, NSCopying, NSMutableCopying>
@ -72,6 +74,9 @@ extern "C" {
- (id) lastObject;
- (id) objectAtIndex: (unsigned)index; // Primitive
#if OS_API_VERSION(100400, GS_API_LATEST)
- (NSArray *) objectsAtIndexes: (NSIndexSet *)indexes;
#endif
- (id) firstObjectCommonWithArray: (NSArray*)otherArray;
- (BOOL) isEqualToArray: (NSArray*)otherArray;
@ -125,9 +130,17 @@ extern "C" {
#endif
- (id) initWithCapacity: (unsigned)numItems; // Primitive
- (void) insertObject: (id)anObject atIndex: (unsigned)index; // Primitive
#if OS_API_VERSION(100400, GS_API_LATEST)
- (void) insertObjects: (NSArray *)objects atIndexes: (NSIndexSet *)indexes;
#endif
- (void) removeObjectAtIndex: (unsigned)index; // Primitive
- (void) removeObjectsAtIndexes: (NSIndexSet *)indexes;
- (void) replaceObjectAtIndex: (unsigned)index
withObject: (id)anObject; // Primitive
#if OS_API_VERSION(100400, GS_API_LATEST)
- (void) replaceObjectsAtIndexes: (NSIndexSet *)indexes
withObjects: (NSArray *)objects;
#endif
- (void) replaceObjectsInRange: (NSRange)aRange
withObjectsFromArray: (NSArray*)anArray;
- (void) replaceObjectsInRange: (NSRange)aRange

View file

@ -219,6 +219,12 @@ typedef struct autorelease_array_list
*/
- (id) autorelease;
#if OS_API_VERSION(100400, GS_API_LATEST)
/** Not implemented
*/
- (void) drain;
#endif
/**
* Destroys the receiver (calls -dealloc).
*/

View file

@ -42,6 +42,15 @@ extern "C" {
@class NSMutableArray;
@class NSMutableDictionary;
#if OS_API_VERSION(100500,GS_API_LATEST)
enum {
NSBundleExecutableArchitectureI386 = 0x00000007,
NSBundleExecutableArchitecturePPC = 0x00000012,
NSBundleExecutableArchitecturePPC64 = 0x01000012,
NSBundleExecutableArchitectureX86_64 = 0x01000007,
};
#endif
/**
* Notification posted when a bundle is loaded. The notification object is
* the [NSBundle] itself. The notification also contains a <em>userInfo</em>
@ -322,10 +331,12 @@ GS_EXPORT NSString* const NSLoadedClasses;
+ (NSArray *) preferredLocalizationsFromArray: (NSArray *)localizationsArray
forPreferences: (NSArray *)preferencesArray;
#if OS_API_VERSION(100200,GS_API_LATEST)
/**
* Returns a boolean indicating whether code for the bundle has been loaded.
*/
- (BOOL) isLoaded;
#endif
/**
* This method returns the same information as
@ -351,12 +362,22 @@ GS_EXPORT NSString* const NSLoadedClasses;
/** Returns the info property list associated with the bundle. */
- (NSDictionary*) infoDictionary;
#if OS_API_VERSION(100200,GS_API_LATEST)
/** Returns a localized info property list based on the preferred
* localization or the most appropriate localization if the preferred
* one cannot be found.
*/
- (NSDictionary*) localizedInfoDictionary;
/** Not implemented
*/
- (NSString*) developmentLocalization;
/** Not implemented
*/
- (id) objectForInfoDictionaryKey: (NSString *)key;
#endif
/** Returns all the localizations in the bundle. */
- (NSArray*) localizations;
@ -373,13 +394,27 @@ GS_EXPORT NSString* const NSLoadedClasses;
*/
- (BOOL) load;
#if OS_API_VERSION(100200,GS_API_LATEST)
/** * Not implemented
*/
- (BOOL) unload;
#endif
/** Returns the path to the executable code in the bundle */
- (NSString *) executablePath;
#endif
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Not implemented */
- (NSArray *) executableArchitectures;
/** Not implemented */
- (BOOL) preflightAndReturnError: (NSError **)error;
/** Not implemented */
- (BOOL) loadAndReturnError: (NSError **)error;
#endif
@end
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
#if GS_API_VERSION(GS_API_NONE, 011700)
/**
* Augments [NSBundle], including methods for handling libraries in the GNUstep
* fashion, for rapid localization, and other purposes.
@ -529,157 +564,6 @@ GS_EXPORT NSString* const NSLoadedClasses;
#define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \
[bundle localizedStringForKey:(key) value:@"" table:(tbl)]
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
#define NSLocalizedStringFromTableInFramework(key, tbl, fpth, comment) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" \
table: [bundle pathForGNUstepResource:(tbl) ofType: nil inDirectory: (fpth)]
#endif /* GNUSTEP */
/* Now Support for Quick Localization */
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
/* The quickest possible way to localize a string:
NSLog (_(@"New Game"));
Please make use of the longer functions taking a comment when you
get the time to localize seriously your code.
*/
/**
* <p>
* This function (macro) is a GNUstep extension.
* </p>
* <p>
* <code>_(@"My string to translate")</code>
* </p>
* <p>
* is exactly the same as
* </p>
* <p>
* <code>NSLocalizedString (@"My string to translate", @"")</code>
* </p>
* <p>
* It is useful when you need to translate an application
* very quickly, as you just need to enclose all strings
* inside <code>_()</code>. But please note that when you
* use this macro, you are not taking advantage of comments
* for the translator, so consider using
* <code>NSLocalizedString</code> instead when you need a
* comment.
* </p>
*/
#define _(X) NSLocalizedString (X, @"")
/* The quickest possible way to localize a static string:
static NSString *string = __(@"New Game");
NSLog (_(string)); */
/**
* <p>
* This function (macro) is a GNUstep extension.
* </p>
* <p>
* <code>__(@"My string to translate")</code>
* </p>
* <p>
* is exactly the same as
* </p>
* <p>
* <code>NSLocalizedStaticString (@"My string to translate", @"")</code>
* </p>
* <p>
* It is useful when you need to translate an application very
* quickly. You would use it as follows for static strings:
* </p>
* <p>
* <code>
* NSString *message = __(@"Hello there");
* ... more code ...
* NSLog (_(messages));
* </code>
* </p>
* <p>
* But please note that when you use this macro, you are not
* taking advantage of comments for the translator, so
* consider using <code>NSLocalizedStaticString</code>
* instead when you need a comment.
* </p>
*/
#define __(X) X
/* The better way for a static string, with a comment - use as follows -
static NSString *string = NSLocalizedStaticString (@"New Game",
@"Menu Option");
NSLog (_(string));
If you need anything more complicated than this, please initialize
the static strings manually.
*/
/**
* <p>
* This function (macro) is a GNUstep extensions, and it is used
* to localize static strings. Here is an example of a static
* string:
* </p>
* <p>
* <code>
* NSString *message = @"Hi there";
* ... some code ...
* NSLog (message);
* </code>
* </p>
* <p>
* This string can not be localized using the standard
* openstep functions/macros. By using this gnustep extension,
* you can localize it as follows:
* </p>
* <p>
* <code>
* NSString *message = NSLocalizedStaticString (@"Hi there",
* @"Greeting");
*
* ... some code ...
*
* NSLog (NSLocalizedString (message, @""));
* </code>
* </p>
* <p>
* When the tools generate the
* <code>Localizable.strings</code> file from the source
* code, they will ignore the <code>NSLocalizedString</code>
* call while they will extract the string (and the comment)
* to localize from the <code>NSLocalizedStaticString</code>
* call.
* </p>
* <p>
* When the code is compiled, instead, the
* <code>NSLocalizedStaticString</code> call is ignored (discarded,
* it is a macro which simply expands to <code>key</code>), while
* the <code>NSLocalizedString</code> will actually look up the
* string for translation in the <code>Localizable.strings</code>
* file.
* </p>
* <p>
* Please note that there is currently no macro/function to
* localize static strings using different tables. If you
* need that functionality, you have either to prepare the
* localization tables by hand, or to rewrite your code in
* such a way as not to use static strings.
* </p>
*/
#define NSLocalizedStaticString(key, comment) key
#endif /* GS_API_NONE */
#if defined(__cplusplus)
}

View file

@ -352,6 +352,18 @@ extern "C" {
*/
- (void) encodeObject: (id)anObject forKey: (NSString*)aKey;
#endif
#if OS_API_VERSION(100500, GS_API_LATEST)
/** <override-subclass />
* Encodes anInteger and associates the encoded value with key.
*/
- (void) encodeInteger: (NSInteger)anInteger forKey: (NSString *)key;
/** <override-subclass />
* Decodes an integer associated with the key.
*/
- (NSInteger) decodeIntegerForKey: (NSString *)key;
#endif
@end
#if defined(__cplusplus)

View file

@ -62,6 +62,11 @@ typedef enum _NSPredicateOperatorType
NSEndsWithPredicateOperatorType,
NSInPredicateOperatorType,
NSCustomSelectorPredicateOperatorType
#if OS_API_VERSION(100500,GS_API_LATEST)
,
NSContainsPredicateOperatorType = 99,
NSBetweenPredicateOperatorType
#endif
} NSPredicateOperatorType;
@interface NSComparisonPredicate : NSPredicate

View file

@ -42,6 +42,10 @@ typedef enum _NSCompoundPredicateType
} NSCompoundPredicateType;
@interface NSCompoundPredicate : NSPredicate
{
NSCompoundPredicateType _type;
NSArray *_subs;
}
+ (NSPredicate *) andPredicateWithSubpredicates: (NSArray *)list;
+ (NSPredicate *) notPredicateWithSubpredicate: (NSPredicate *)predicate;

View file

@ -149,6 +149,13 @@ GS_EXPORT NSString* const NSConnectionProxyCount; /* Objects received */
+ (NSDistantObject*) rootProxyForConnectionWithRegisteredName: (NSString*)n
host: (NSString*)h usingNameServer: (NSPortNameServer*)s;
#if OS_API_VERSION(100500,GS_API_LATEST)
+ (id) serviceConnectionWithName: (NSString *)name
rootObject: (id)root;
+ (id) serviceConnectionWithName: (NSString *)name
rootObject: (id)root
usingNameServer: (NSPortNameServer *)server;
#endif
- (void) addRequestMode: (NSString*)mode;
- (void) addRunLoop: (NSRunLoop*)loop;

View file

@ -35,9 +35,21 @@ extern "C" {
#endif
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
@class NSError;
@class NSURL;
#endif
#if OS_API_VERSION(100400,GS_API_LATEST)
enum {
NSMappedRead = 1,
NSUncachedRead = 2
};
enum {
NSAtomicWrite = 1
};
#endif
@interface NSData : NSObject <NSCoding, NSCopying, NSMutableCopying>
// Allocating and Initializing a Data Object
@ -118,6 +130,16 @@ extern "C" {
count: (unsigned int)numInts
atIndex: (unsigned int)index;
#if OS_API_VERSION(100400,GS_API_LATEST)
/** Not implemented */
- (BOOL) writeToFile: (NSString *)path
options: (NSUInteger)writeOptionsMask
error: (NSError **)errorPtr;
/** Not implemented */
- (BOOL) writeToURL: (NSURL *)url
options: (NSUInteger)writeOptionsMask
error: (NSError **)errorPtr;
#endif
@end
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)

View file

@ -0,0 +1,59 @@
/** Interface for NSErrorRecoveryAttempting for GNUStep
Copyright (C) 2007 Free Software Foundation, Inc.
Written by: Fred Kiefer <fredkiefer@gmx.de>
Date: July 2007
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef __NSErrorRecoveryAttempting_h_GNUSTEP_BASE_INCLUDE
#define __NSErrorRecoveryAttempting_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
#import <Foundation/NSObject.h>
#if defined(__cplusplus)
extern "C" {
#endif
/**
* These methods define the informal error recovery protocol
*/
@interface NSObject (NSErrorRecoveryAttempting)
- (BOOL) attemptRecoveryFromError: (NSError*)error
optionIndex: (unsigned int)recoveryOptionIndex;
- (void) attemptRecoveryFromError: (NSError*)error
optionIndex: (unsigned int)recoveryOptionIndex
delegate: (id)delegate
didRecoverSelector: (SEL)didRecoverSelector
contextInfo: (void*)contextInfo;
@end
#if defined(__cplusplus)
}
#endif
#endif
#endif /* __NSErrorRecoveryAttempting_h_GNUSTEP_BASE_INCLUDE*/

View file

@ -83,9 +83,10 @@ extern "C" {
*/
@interface NSException : NSObject <NSCoding, NSCopying>
{
@private
NSString *_e_name;
NSString *_e_reason;
NSDictionary *_e_info;
void *_reserved;
}
/**
@ -116,6 +117,14 @@ extern "C" {
format: (NSString*)format
arguments: (va_list)argList;
#if OS_API_VERSION(100500,GS_API_LATEST) && GS_API_VERSION(011501,GS_API_LATEST)
/** Returns an array of the call stack return addresses at the point when
* the exception was raised. Re-raising the exception does not change
* this value.
*/
- (NSArray*) callStackReturnAddresses;
#endif
/**
* <init/>Initializes a newly allocated NSException object with a
* name, reason and a dictionary userInfo.
@ -147,61 +156,84 @@ extern "C" {
- (NSString*) reason;
/** Returns the exception userInfo dictionary.<br />
* There is a GNUstep extension, enabled when the GNUSTEP_STACK_TRACE
* environment variable is set to YES, which causes a stack trace to
* be placed in this dictionary (keyed on GSStackTraceKey) at the point
* when the exception is raised. This can be useful for determining
* where an exception ocurred.
*/
- (NSDictionary*) userInfo;
@end
/**
* A generic exception for general purpose usage.
/** An exception when character set conversion fails.
*/
GS_EXPORT NSString* const NSCharacterConversionException;
/** Attempt to use an invalidated destination.
*/
GS_EXPORT NSString* const NSDestinationInvalidException;
/** A generic exception for general purpose usage.
*/
GS_EXPORT NSString* const NSGenericException;
/**
* An exception for cases where unexpected state is detected within an object.
/** An exception for cases where unexpected state is detected within an object.
*/
GS_EXPORT NSString* const NSInternalInconsistencyException;
/**
* An exception used when an invalid argument is passed to a method
/** An exception used when an invalid argument is passed to a method
* or function.
*/
GS_EXPORT NSString* const NSInvalidArgumentException;
/**
* An exception used when the system fails to allocate required memory.
/** Attempt to use a receive port which has been invalidated.
*/
GS_EXPORT NSString * const NSInvalidReceivePortException;
/** Attempt to use a send port which has been invalidated.
*/
GS_EXPORT NSString * const NSInvalidSendPortException;
/** An exception used when the system fails to allocate required memory.
*/
GS_EXPORT NSString* const NSMallocException;
/**
* An exception used when an illegal range is encountered ... usually this
* is used to provide more information than an invalid argument exception.
*/
GS_EXPORT NSString* const NSRangeException;
/**
* An exception when character set conversion fails.
*/
GS_EXPORT NSString* const NSCharacterConversionException;
/**
* An exception when a remote object is sent a message from a thread
/** An exception when a remote object is sent a message from a thread
* unable to access the object.
*/
GS_EXPORT NSString* const NSObjectInaccessibleException;
/** Attempt to send to an object which is no longer available.
*/
GS_EXPORT NSString* const NSObjectNotAvailableException;
/** UNused ... for MacOS-X compatibility.
*/
GS_EXPORT NSString* const NSOldStyleException;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
/**
* An exception used when some form of parsing fails.
/** An exception used when some form of parsing fails.
*/
GS_EXPORT NSString* const NSParseErrorException;
#endif
/** Some failure to receive on a port.
*/
GS_EXPORT NSString * const NSPortReceiveException;
/** Some failure to send on a port.
*/
GS_EXPORT NSString * const NSPortSendException;
/**
* Exception raised by [NSPort], [NSConnection], and friends if sufficient
* time elapses while waiting for a response, or if the receiving port is
* invalidated before a request can be received. See
* [NSConnection-setReplyTimeout:].
*/
GS_EXPORT NSString * const NSPortTimeoutException; /* OPENSTEP */
/** An exception used when an illegal range is encountered ... usually this
* is used to provide more information than an invalid argument exception.
*/
GS_EXPORT NSString* const NSRangeException;
/**
* The actual structure for an NSHandler. You shouldn't need to worry about it.
*/

View file

@ -28,13 +28,15 @@
#if OS_API_VERSION(100400, GS_API_LATEST)
#import <Foundation/NSPredicate.h>
#import <Foundation/NSObject.h>
#if defined(__cplusplus)
extern "C" {
#endif
@class NSArray;
@class NSMutableDictionary;
@class NSString;
typedef enum _NSExpressionType
{
@ -46,6 +48,9 @@ typedef enum _NSExpressionType
} NSExpressionType;
@interface NSExpression : NSObject <NSCoding, NSCopying>
{
NSExpressionType _type;
}
+ (NSExpression *) expressionForConstantValue: (id)obj;
+ (NSExpression *) expressionForEvaluatedObject;

View file

@ -173,8 +173,8 @@
#import <Foundation/NSObject.h>
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
#import <Foundation/NSUtilities.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#if defined(__cplusplus)
extern "C" {
@ -186,7 +186,7 @@ extern "C" {
@class NSDate;
@class NSArray;
@class NSMutableArray;
@class NSEnumerator;
@class NSDirectoryEnumerator;
@interface NSFileManager : NSObject

View file

@ -112,6 +112,8 @@ extern "C" {
@end
#if GS_API_VERSION(GS_API_NONE,011700)
/**
* Adds synonym for +currentHost.
*/
@ -122,6 +124,7 @@ extern "C" {
*/
+ (NSHost*) localHost; /* All local IP addresses */
@end
#endif
#if defined(__cplusplus)
}

View file

@ -87,6 +87,13 @@ extern "C" {
*/
- (unsigned int) count;
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Not implemented
* Returns the number of indexes set within the specified range.
*/
- (NSUInteger) countOfIndexesInRange: (NSRange)range;
#endif
/**
* Returns the first index value in the receiver or NSNotFound if the
* receiver is empty.
@ -206,7 +213,6 @@ extern "C" {
- (void) removeIndexesInRange: (NSRange)aRange;
/**
* Not implemented.<br />
* Moves all the indexes from anIndex upwards by the amount specified.<br />
* If amount is negative, index values below anIndex will be overwritten
* by the shifted values.<br />

View file

@ -95,7 +95,7 @@ extern "C" {
@end
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
#if GS_API_VERSION(GS_API_NONE, 011700)
@interface NSInvocation (GNUstep)
/**
* Returns the status of the flag set by -setSendsToSuper:

View file

@ -37,6 +37,8 @@ extern "C" {
@class NSArray;
@class NSMutableArray;
@class NSSet;
@class NSMutableSet;
@class NSDictionary;
@class NSError;
@class NSString;
@ -91,17 +93,67 @@ GS_EXPORT NSString* const NSUndefinedKeyException;
- (void) handleTakeValue: (id)anObject forUnboundKey: (NSString*)aKey;
/**
* <strong>Not implemented</strong> ... I don't know what this method
* is good for ... do we need to copy MacOS-X and implement it?
* Returns a mutable array value for a given key. This method:
* <list>
* <item>Searches the receiver for methods matching the patterns
* insertObject:in&lt;Key&gt;AtIndex: and
* removeObjectFrom&lt;Key&gt;AtIndex:. If both
* methods are found, each message sent to the proxy array will result in the
* invocation of one or more of these methods. If
* replaceObjectIn&lt;Key&gt;AtIndex:withObject:
* is also found in the receiver it
* will be used when appropriate for better performance.</item>
* <item>If the set of methods is not found, searches the receiver for a the
* method set&lt;Key&gt;:. Each message sent to the proxy array will result in
* the invocation of set&lt;Key&gt;:</item>
* <item>If the previous do not match, and accessInstanceVariablesDirectly
* returns YES, searches for an instance variable matching _&lt;key&gt; or
* &lt;key&gt; (in that order). If the instance variable is found,
* messages sent
* to the proxy object will be forwarded to the instance variable.</item>
* <item>If none of the previous are found, raises an NSUndefinedKeyException
* </item>
* </list>
*/
- (NSMutableArray*) mutableArrayValueForKey: (NSString*)aKey;
/**
* <strong>Not implemented</strong> ... I don't know what this method
* is good for ... do we need to copy MacOS-X and implement it?
* Returns a mutable array value for the given key path.
*/
- (NSMutableArray*) mutableArrayValueForKeyPath: (NSString*)aKey;
/**
* Returns a mutable set value for a given key. This method:
* <list>
* <item>Searches the receiver for methods matching the patterns
* add&lt;Key&gt;Object:, remove&lt;Key&gt;Object:,
* add&lt;Key&gt;:, and remove&lt;Key&gt;:, which
* correspond to the NSMutableSet methods addObject:, removeObject:,
* unionSet:, and minusSet:, respectively. If at least one addition
* and one removal method are found, each message sent to the proxy set
* will result in the invocation of one or more of these methods. If
* intersect&lt;Key&gt;: or set&lt;Key&gt;:
* is also found in the receiver, the method(s)
* will be used when appropriate for better performance.</item>
* <item>If the set of methods is not found, searches the receiver for a the
* method set&lt;Key&gt;:. Each message sent to the proxy set will result in
* the invocation of set&lt;Key&gt;:</item>
* <item>If the previous do not match, and accessInstanceVariablesDirectly
* returns YES, searches for an instance variable matching _&lt;key&gt; or
* &lt;key&gt; (in that order). If the instance variable is found,
* messages sent
* to the proxy object will be forwarded to the instance variable.</item>
* <item>If none of the previous are found, raises an NSUndefinedKeyException
* </item>
* </list>
*/
- (NSMutableSet*) mutableSetValueForKey: (NSString *)aKey;
/**
* Returns a mutable set value for the given key path.
*/
- (NSMutableSet*) mutableSetValueForKeyPath: (NSString*)aKey;
/**
* This method is invoked by the NSKeyValueCoding mechanism when an attempt
* is made to set an null value for a scalar attribute. This implementation

View file

@ -42,6 +42,10 @@ extern "C" {
typedef enum {
NSKeyValueObservingOptionNew = 1,
NSKeyValueObservingOptionOld = 2
#if OS_API_VERSION(100500,GS_API_LATEST)
, NSKeyValueObservingOptionInitial = 4,
NSKeyValueObservingOptionPrior = 8
#endif
} NSKeyValueObservingOptions;
typedef enum {
@ -62,6 +66,9 @@ GS_EXPORT NSString *const NSKeyValueChangeIndexesKey;
GS_EXPORT NSString *const NSKeyValueChangeKindKey;
GS_EXPORT NSString *const NSKeyValueChangeNewKey;
GS_EXPORT NSString *const NSKeyValueChangeOldKey;
#if OS_API_VERSION(100500,GS_API_LATEST)
GS_EXPORT NSString *const NSKeyValueChangeNotificationIsPriorKey;
#endif
/* Given that the receiver has been registered as an observer
* of the value at a key path relative to an object,
@ -203,10 +210,10 @@ GS_EXPORT NSString *const NSKeyValueChangeOldKey;
/**
* Tells the observing system that when NSKeyValueObserverNotification
* protocol messages are sent for any key in the keys array, they should
* also be sent for dependentKey.
* protocol messages are sent for any key in the triggerKeys array,
* they should also be sent for dependentKey.
*/
+ (void) setKeys: (NSArray*)keys
+ (void) setKeys: (NSArray*)triggerKeys
triggerChangeNotificationsForDependentKey: (NSString*)dependentKey;
/**

View file

@ -62,7 +62,8 @@ extern "C" {
@interface NSLock : NSObject <NSLocking, GCFinalization>
{
@private
void *_mutex;
void *_mutex;
NSString *_name;
}
/**
@ -85,6 +86,16 @@ extern "C" {
*/
- (void) unlock;
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Return the name of the receiver or nil of none has been set.
*/
- (NSString*) name;
/** Sets the name of the receiver (for use in debugging).
*/
- (void) setName: (NSString*)name;
#endif
@end
/**
@ -98,6 +109,7 @@ extern "C" {
void *_condition;
void *_mutex;
int _condition_value;
NSString *_name;
}
/**
@ -163,6 +175,16 @@ extern "C" {
*/
- (void) unlock;
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Return the name of the receiver or nil of none has been set.
*/
- (NSString*) name;
/** Sets the name of the receiver (for use in debugging).
*/
- (void) setName: (NSString*)name;
#endif
@end
@ -177,6 +199,7 @@ extern "C" {
{
@private
void *_mutex;
NSString *_name;
}
/**
@ -200,6 +223,16 @@ extern "C" {
*/
- (void) unlock;
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Return the name of the receiver or nil of none has been set.
*/
- (NSString*) name;
/** Sets the name of the receiver (for use in debugging).
*/
- (void) setName: (NSString*)name;
#endif
@end
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)

View file

@ -153,7 +153,7 @@ typedef struct {
@end
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
#if GS_API_VERSION(GS_API_NONE, 011700)
/**
* Declares a convenience method for getting the entire array of raw type and
* size information.

View file

@ -90,6 +90,12 @@ typedef enum
NSNetServicesTimeoutError = -72007L
} NSNetServicesError;
enum {
NSNetServiceNoAutoRename = 1 << 0
};
typedef NSUInteger NSNetServiceOptions;
GS_EXPORT NSString * const NSNetServicesErrorCode;
GS_EXPORT NSString * const NSNetServicesErrorDomain;
@ -141,6 +147,13 @@ GS_EXPORT NSString * const NSNetServicesErrorDomain;
- (void) scheduleInRunLoop: (NSRunLoop *) aRunLoop
forMode: (NSString *) mode;
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Not implemented */
- (NSInteger)port;
/** Not implemented */
- (void) publishWithOptions: (NSNetServiceOptions)options;
#endif
- (void) publish;
- (void) resolve;
- (void) resolveWithTimeout: (NSTimeInterval) timeout;

View file

@ -29,13 +29,22 @@
#ifndef __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE
#define __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#import <GNUstepBase/preface.h>
#import <GNUstepBase/GSConfig.h>
#import <GNUstepBase/GSObjCRuntime.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef gsaddr NSInteger;
typedef gsuaddr NSUInteger;
#if OS_API_VERSION(100500,GS_API_LATEST)
GS_EXPORT NSString *NSStringFromProtocol(Protocol *aProtocol);
GS_EXPORT Protocol *NSProtocolFromString(NSString *aProtocolName);
#endif
GS_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
GS_EXPORT NSString *NSStringFromSelector(SEL aSelector);
GS_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
GS_EXPORT Class NSClassFromString(NSString *aClassName);

View file

@ -27,15 +27,18 @@
#ifndef __NSObject_h_GNUSTEP_BASE_INCLUDE
#define __NSObject_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#import <Foundation/NSObjCRuntime.h>
#import <GNUstepBase/preface.h>
#include <GNUstepBase/GSConfig.h>
#include <objc/objc.h>
#include <objc/typedstream.h>
#import <objc/objc.h>
#import <objc/typedstream.h>
#import <Foundation/NSZone.h>
#ifndef GS_WITH_GC
#define GS_WITH_GC 0
#endif
#import <GNUstepBase/GNUstep.h>
#if defined(__cplusplus)
extern "C" {
#endif
@ -291,17 +294,18 @@ enum {NSNotFound = 0x7fffffff};
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
/** Global lock to be used by classes when operating on any global
data that invoke other methods which also access global; thus,
creating the potential for deadlock. */
GS_EXPORT NSRecursiveLock *gnustep_global_lock;
@interface NSObject (NEXTSTEP)
- error:(const char *)aString, ...;
/* - (const char *) name;
Removed because OpenStep has -(NSString*)name; */
@end
/** Global lock to be used by classes when operating on any global
data that invoke other methods which also access global; thus,
creating the potential for deadlock. */
GS_EXPORT NSRecursiveLock *gnustep_global_lock;
#if GS_API_VERSION(GS_API_NONE, 011700)
@interface NSObject (GNUstep)
- (BOOL) isInstance;
- (id) makeImmutableCopyOnFail: (BOOL)force;
@ -312,6 +316,7 @@ GS_EXPORT NSRecursiveLock *gnustep_global_lock;
- (id) read: (TypedStream*)aStream;
- (id) write: (TypedStream*)aStream;
@end
#endif
/**
* Provides a number of GNUstep-specific methods that are used to aid
@ -412,190 +417,6 @@ GS_EXPORT NSRecursiveLock *gnustep_global_lock;
inModes: (NSArray*)modes;
@end
/*
* RETAIN(), RELEASE(), and AUTORELEASE() are placeholders for the
* future day when we have garbage collecting.
*/
#ifndef GS_WITH_GC
#define GS_WITH_GC 0
#endif
#if GS_WITH_GC
#ifndef RETAIN
#define RETAIN(object) ((id)object)
#endif
#ifndef RELEASE
#define RELEASE(object)
#endif
#ifndef AUTORELEASE
#define AUTORELEASE(object) ((id)object)
#endif
#ifndef TEST_RETAIN
#define TEST_RETAIN(object) ((id)object)
#endif
#ifndef TEST_RELEASE
#define TEST_RELEASE(object)
#endif
#ifndef TEST_AUTORELEASE
#define TEST_AUTORELEASE(object) ((id)object)
#endif
#ifndef ASSIGN
#define ASSIGN(object,value) (object = value)
#endif
#ifndef ASSIGNCOPY
#define ASSIGNCOPY(object,value) (object = [value copy])
#endif
#ifndef DESTROY
#define DESTROY(object) (object = nil)
#endif
#ifndef CREATE_AUTORELEASE_POOL
#define CREATE_AUTORELEASE_POOL(X)
#endif
#ifndef RECREATE_AUTORELEASE_POOL
#define RECREATE_AUTORELEASE_POOL(X)
#endif
#define IF_NO_GC(X)
#else
#ifndef RETAIN
/**
* Basic retain operation ... calls [NSObject-retain]
*/
#define RETAIN(object) [object retain]
#endif
#ifndef RELEASE
/**
* Basic release operation ... calls [NSObject-release]
*/
#define RELEASE(object) [object release]
#endif
#ifndef AUTORELEASE
/**
* Basic autorelease operation ... calls [NSObject-autorelease]
*/
#define AUTORELEASE(object) [object autorelease]
#endif
#ifndef TEST_RETAIN
/**
* Tested retain - only invoke the
* objective-c method if the receiver is not nil.
*/
#define TEST_RETAIN(object) ({\
id __object = (id)(object); (__object != nil) ? [__object retain] : nil; })
#endif
#ifndef TEST_RELEASE
/**
* Tested release - only invoke the
* objective-c method if the receiver is not nil.
*/
#define TEST_RELEASE(object) ({\
id __object = (id)(object); if (__object != nil) [__object release]; })
#endif
#ifndef TEST_AUTORELEASE
/**
* Tested autorelease - only invoke the
* objective-c method if the receiver is not nil.
*/
#define TEST_AUTORELEASE(object) ({\
id __object = (id)(object); (__object != nil) ? [__object autorelease] : nil; })
#endif
#ifndef ASSIGN
/**
* ASSIGN(object,value) assigns the value to the object with
* appropriate retain and release operations.
*/
#define ASSIGN(object,value) ({\
id __value = (id)(value); \
id __object = (id)(object); \
if (__value != __object) \
{ \
if (__value != nil) \
{ \
[__value retain]; \
} \
object = __value; \
if (__object != nil) \
{ \
[__object release]; \
} \
} \
})
#endif
#ifndef ASSIGNCOPY
/**
* ASSIGNCOPY(object,value) assigns a copy of the value to the object
* with release of the original.
*/
#define ASSIGNCOPY(object,value) ({\
id __value = (id)(value); \
id __object = (id)(object); \
if (__value != __object) \
{ \
if (__value != nil) \
{ \
__value = [__value copy]; \
} \
object = __value; \
if (__object != nil) \
{ \
[__object release]; \
} \
} \
})
#endif
#ifndef DESTROY
/**
* DESTROY() is a release operation which also sets the variable to be
* a nil pointer for tidiness - we can't accidentally use a DESTROYED
* object later. It also makes sure to set the variable to nil before
* releasing the object - to avoid side-effects of the release trying
* to reference the object being released through the variable.
*/
#define DESTROY(object) ({ \
if (object) \
{ \
id __o = object; \
object = nil; \
[__o release]; \
} \
})
#endif
#ifndef CREATE_AUTORELEASE_POOL
/**
* Declares an autorelease pool variable and creates and initialises
* an autorelease pool object.
*/
#define CREATE_AUTORELEASE_POOL(X) \
NSAutoreleasePool *(X) = [NSAutoreleasePool new]
#endif
#ifndef RECREATE_AUTORELEASE_POOL
/**
* Similar, but allows reuse of variables. Be sure to use DESTROY()
* so the object variable stays nil.
*/
#define RECREATE_AUTORELEASE_POOL(X) \
if (X == nil) \
(X) = [NSAutoreleasePool new]
#endif
#define IF_NO_GC(X) X
#endif
#if defined(__cplusplus)
}
#endif

View file

@ -161,6 +161,9 @@ typedef enum
NSCachesDirectory = 13, /** location of users cache files */
NSApplicationSupportDirectory = 14, /** location of app support files */
#endif
#if OS_API_VERSION(100500, GS_API_LATEST)
NSDownloadsDirectory = 15, /** location of downloaded files */
#endif
NSAllApplicationsDirectory = 100, /** all app directories */
NSAllLibrariesDirectory = 101, /** all library resources */

View file

@ -0,0 +1,152 @@
/**Interface for NSPointerFunctions for GNUStep
Copyright (C) 2008 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <rfm@gnu.org>
Date: 2008
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef __NSPointerFunctions_h_GNUSTEP_BASE_INCLUDE
#define __NSPointerFunctions_h_GNUSTEP_BASE_INCLUDE
#import <Foundation/NSObject.h>
#if OS_API_VERSION(100500, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
/** Options flags come in three groups ...<br />
* Memory management options (only one of which may be set)<br />
* Personality options (only one of which may be set)<br />
* Others.
*/
enum {
/** Garbage collected strong references , or retain counting if GC
* is not active. */
NSPointerFunctionsStrongMemory = (0<<0),
/** Garbage collected weak references */
NSPointerFunctionsZeroingWeakgMemory = (1<<0),
/** Non-GC memory */
NSPointerFunctionsOpaqueMemory = (2<<0),
/** Heap (calloc/free) memory */
NSPointerFunctionsMallocMemory = (3<<0),
/** MACH virtual memory (not implemented) */
NSPointerFunctionsMachVirtualMemory = (4<<0),
/** Use the -hash and -isEqual: methods for storing objects, and the
* -description method to describe them. */
NSPointerFunctionsObjectPersonality = (0<<8),
/** Use the pointer (shifted) as a hash, and compare for bitwise quality.
*/
NSPointerFunctionsOpaquePersonality = (1<<8),
/** Use the pointer (shifted) as a hash, and compare for bitwise quality,
* but use -description to desribe the objects.
*/
NSPointerFunctionsObjectPointerPersonality = (2<<8),
/** Use strcmp for comparison and a hash of the string contents. Describe
* assuming that the string contains UTF-8 data.
*/
NSPointerFunctionsCStringPersonality = (3<<8),
/** Use memcmp for comparison and a hash of the sructure contents.
* A size function must be set so that the size of the memcmp and hash
* are known,
*/
NSPointerFunctionsStructPersonality = (4<<8),
/** Use unmodified integer value for both hash and equality test.
*/
NSPointerFunctionsIntegerPersonality = (5<<8),
/** Request the memory aquire function to allocate/copy items.
*/
NSPointerFunctionsCopyIn = (1<<16)
};
/** An integer value containing memory option, personality option,
* and copying option.
*/
typedef NSUInteger NSPointerFunctionsOptions;
@interface NSPointerFunctions : NSObject <NSCopying>
+ (id) pointerFunctionsWithOptions: (NSPointerFunctionsOptions)options;
- (id) initWithOptions: (NSPointerFunctionsOptions)options;
- (void* (*)(const void *item,
NSUInteger (*size)(const void *item), BOOL shouldCopy)) aquireFunction;
- (NSString (*)(const void *item)) descriptionFunction;
- (NSUInteger (*)(const void *item,
NSUInteger (*size)(const void *item))) hashFunction;
- (BOOL (*)(const void *item1, const void *item2,
NSUInteger (*size)(const void *item))) isEqualFunction;
- (void (*)(const void *item,
NSUInteger (*size)(const void *item))) relinquishFunction;
- (void) setAcquireFunction: (void* (*)(const void *item,
NSUInteger (*size)(const void *item), BOOL shouldCopy))func;
- (void) setDescriptionFunction: (NSString (*)(const void *item))func;
- (void) setHashFunction: (NSUInteger (*)(const void *item,
NSUInteger (*size)(const void *item)))func;
- (void) setIsEqualFunction: (BOOL (*)(const void *item1, const void *item2,
NSUInteger (*size)(const void *item)))func;
- (void) setRelinquishFunction: (NSUInteger (*)(const void *item,
NSUInteger (*size)(const void *item)))func;
- (void) setSizeFunction: (NSUInteger (*)(const void *item))func;
- (void) setUsesStrongWriteBarrier: (BOOL)flag;
- (void) setUsesWeakReadAndWriteBarriers: (BOOL)flag;
- (NSUInteger (*)(const void *item)) sizeFunction;
- (BOOL) usesStrongWriteBarrier;
- (BOOL) usesWeak ReadAndWriteBarriers;
@end
#if defined(__cplusplus)
}
#endif
#endif /* OS_API_VERSION(100500, GS_API_LATEST) */
#endif /* __NSPointerFunctions_h_GNUSTEP_BASE_INCLUDE */

View file

@ -61,14 +61,6 @@ extern "C" {
- (void) handlePortMessage: (NSPortMessage*)aMessage;
@end
/**
* Exception raised by [NSPort], [NSConnection], and friends if sufficient
* time elapses while waiting for a response, or if the receiving port is
* invalidated before a request can be received. See
* [NSConnection-setReplyTimeout:].
*/
GS_EXPORT NSString * const NSPortTimeoutException; /* OPENSTEP */
/**
* <p><code>NSPort</code> is an abstract class defining interfaces underlying
* communications in the distributed objects framework. Each side of a
@ -266,40 +258,6 @@ typedef SOCKET NSSocketNativeHandle;
* Returns port number of underlying socket.
*/
- (uint16_t) portNumber;
// This is the OS X interface
/*
{
NSSocketNativeHandle _socket;
int _protocolFamily;
int _socketType;
int _protocol;
NSData *_remoteAddrData;
}
- (id) init;
- (id) initWithTCPPort: (unsigned short)portNumber;
- (id) initWithProtocolFamily: (int)family
socketType: (int)type
protocol: (int)protocol
address: (NSData *)addrData;
- (id) initWithProtocolFamily: (int)family
socketType: (int)type
protocol: (int)protocol
socket: (NSSocketNativeHandle)socket;
- (id) initRemoteWithTCPPort: (unsigned short)portNumber
host: (NSString *)hostname;
- (id) initRemoteWithProtocolFamily: (int)family
socketType: (int)type
protocol: (int)protocol
address: (NSData *)addrData;
- (NSData *) address;
- (int) protocol;
- (int) protocolFamily;
- (NSSocketNativeHandle) socket;
- (int) socketType;
*/
@end

View file

@ -51,9 +51,19 @@ extern "C" {
@end
@interface NSArray (NSPredicate)
/** Evaluate each object in the array using the specified predicate and
* return an array containing all the objects which evaluate to YES.
*/
- (NSArray *) filteredArrayUsingPredicate: (NSPredicate *)predicate;
@end
@interface NSMutableArray (NSPredicate)
/** Evaluate each object in the array using the specified predicate and
* remove each objects which evaluates to NO.
*/
- (void) filterUsingPredicate: (NSPredicate *)predicate;
@end
#if defined(__cplusplus)
}
#endif

View file

@ -189,9 +189,17 @@ enum {
*/
- (void) setProcessName: (NSString*)newName;
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Not implemented */
- (NSUInteger) processorCount;
/** Not implemented */
- (NSUInteger) activeProcessorCount;
/** Not implemented */
- (unsigned long long) physicalMemory;
#endif
@end
#if OS_API_VERSION(GS_API_NONE,GS_API_NONE)
#if GS_API_VERSION(GS_API_NONE,011700)
/**
* Provides GNUstep-specific methods for controlled debug logging (a GNUstep
@ -235,7 +243,7 @@ enum {
* auto-initialize it are working.<br />
* It is also safe to call this method to override the effects
* of the automatic initialisation, which some applications may need
* to do when using GNUstep libraries embeddedm within other frameworks.
* to do when using GNUstep libraries embedded within other frameworks.
*/
+ (void) initializeWithArguments: (char**)argv
count: (int)argc

View file

@ -132,9 +132,10 @@ typedef enum {
* &lt;*D2002-03-22 11:30:00 +0100&gt;
* </example>
* In XML format, a date object is an element whose name is
* <code>date</code> and whose content is a date in the above format.
* <code>date</code> and whose content is a date in the format
* YYYY-MM-DDTHH:MM:SSZ (or the above dfate format).
* <example>
* &lt;date&gt;2002-03-22 11:30:00 +0100&lt;/date&gt;
* &lt;date&gt;2002-03-22T11:30:00Z&lt;/date&gt;
* </example>
* </desc>
* <term>[NSDictionary]</term>

View file

@ -138,6 +138,9 @@ typedef enum {
extra: (void*)extra
forMode: (NSString*)mode;
@end
@interface NSObject (RunLoopEvents)
- (BOOL) runLoopShouldBlock: (BOOL*)shouldTrigger;
@end
@class NSStream;
@interface NSRunLoop(GNUstepExtensions)
- (void) addEvent: (void*)data

View file

@ -99,6 +99,16 @@ extern "C" {
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (BOOL) scanDecimal: (NSDecimal*)value;
#endif
#if OS_API_VERSION(100500, GS_API_LATEST)
/** Not implemented */
- (BOOL) scanHexDouble: (double *)result;
/** Not implemented */
- (BOOL) scanHexFloat: (float *)result;
/** Not implemented */
- (BOOL) scanHexLongLong: (unsigned long long *)result;
/** Not implemented */
- (BOOL) scanInteger: (NSInteger *)value;
#endif
@end
#if defined(__cplusplus)

View file

@ -92,7 +92,7 @@ extern "C" {
intoData: (NSMutableData*)d;
@end
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
#if GS_API_VERSION(GS_API_NONE, 011700)
/**
* GNUstep extends serialization by having the option to make the
* resulting data more compact by ensuring that repeated strings

View file

@ -78,6 +78,11 @@ extern "C" {
- (id) member: (id)anObject;
- (NSEnumerator*) objectEnumerator;
#if OS_API_VERSION(100500,GS_API_LATEST)
- (NSSet *) setByAddingObject: (id)anObject;
- (NSSet *) setByAddingObjectsFromSet: (NSSet *)other;
- (NSSet *) setByAddingObjectsFromArray: (NSArray *)other;
#endif
@end
@interface NSMutableSet: NSSet

View file

@ -47,6 +47,12 @@ extern "C" {
@class NSMutableArray;
@class NSMutableDictionary;
#if OS_API_VERSION(100500,GS_API_LATEST)
GS_EXPORT NSString *const NSGrammarCorrections;
GS_EXPORT NSString *const NSGrammarRange;
GS_EXPORT NSString *const NSGrammarUserDescription;
#endif
@interface NSSpellServer : NSObject
{
@private
@ -126,6 +132,24 @@ findMisspelledWordInString: (NSString *)stringToCheck
- (void) spellServer: (NSSpellServer *)sender
didForgetWord: (NSString *)word
inLanguage: (NSString *)language;
#if OS_API_VERSION(100300,GS_API_LATEST)
/** Not implemented */
- (NSArray *) spellServer: (NSSpellServer *)sender
suggestCompletionsForPartialWordRange: (NSRange)range
inString: (NSString *)string
language: (NSString *)language;
#endif
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Not implemented */
- (NSRange) spellServer: (NSSpellServer *)sender
checkGrammarInString: (NSString *)stringToCheck
language: (NSString *)language
details: (NSArray **)details;
#endif
@end
#if defined(__cplusplus)

View file

@ -254,18 +254,18 @@ typedef enum {
/**
* Creates and returns by reference an NSInputStream object and
* NSOutputStream object for a local socket connection with the
* specified path. To use them you need to open them and wait
* on the NSStreamEventOpenCompleted event on one of them
* NSOutputStream object for a local socket or named pipe connection
* with the specified path. To use them you need to open them and wait
* on the NSStreamEventOpenCompleted event on one of them.
*/
+ (void) getLocalStreamsToPath: (NSString *)path
inputStream: (NSInputStream **)inputStream
outputStream: (NSOutputStream **)outputStream;
/**
* Creates and returns by reference an NSInputStream object and NSOutputStream
* object for a anonymous local socket. Although you still need to open them,
* the open will be instantanious, and no NSStreamEventOpenCompleted event
* will be delivered.
* object for a anonymous local socket or pipe. Although you still need to
* open them, the open will be instantaneous, and no NSStreamEventOpenCompleted
* event will be delivered.
*/
+ (void) pipeWithInputStream: (NSInputStream **)inputStream
outputStream: (NSOutputStream **)outputStream;
@ -329,6 +329,15 @@ GS_EXPORT NSString * const NSStreamSOCKSProxyVersion4;
GS_EXPORT NSString * const NSStreamSOCKSProxyVersion5;
GS_EXPORT NSString * const NSStreamSOCKSProxyVersionKey;
/** May be used to read the local IP address of a tcp/ip network stream. */
GS_EXPORT NSString * const GSStreamLocalAddressKey;
/** May be used to read the local port of a tcp/ip network stream. */
GS_EXPORT NSString * const GSStreamLocalPortKey;
/** May be used to read the remote IP address of a tcp/ip network stream. */
GS_EXPORT NSString * const GSStreamRemoteAddressKey;
/** May be used to read the remote port of a tcp/ip network stream. */
GS_EXPORT NSString * const GSStreamRemotePortKey;
/**
* Informal protocol for delegates of instance of the [NSStream] class.
*/

View file

@ -36,13 +36,19 @@ extern "C" {
/**
* Type for representing unicode characters. (16-bit)
*/
typedef unsigned short unichar;
typedef uint16_t unichar;
#if OS_API_VERSION(100500,GS_API_LATEST)
#define NSMaximumStringLength (INT_MAX-1)
#endif
@class NSArray;
@class NSCharacterSet;
@class NSData;
@class NSDictionary;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
@class NSError;
@class NSLocale;
@class NSURL;
#endif
@ -55,7 +61,14 @@ enum
NSBackwardsSearch = 4,
NSAnchoredSearch = 8,
NSNumericSearch = 64 /* MacOS-X 10.2 */
#if OS_API_VERSION(100500,GS_API_LATEST)
,
NSDiacriticInsensitiveSearch = 128,
NSWidthInsensitiveSearch = 256,
NSForcedOrderingSearch = 512
#endif
};
typedef NSUInteger NSStringCompareOptions;
/**
* <p>Enumeration of available encodings for converting between bytes and
@ -97,6 +110,7 @@ typedef enum _NSStringEncoding
NSShiftJISStringEncoding = 8,
NSISOLatin2StringEncoding = 9, // ISO-8859-2; East European
NSUnicodeStringEncoding = 10,
NSUTF16StringEncoding = NSUnicodeStringEncoding, // An alias
NSWindowsCP1251StringEncoding = 11,
NSWindowsCP1252StringEncoding = 12, // WinLatin1
NSWindowsCP1253StringEncoding = 13, // Greek
@ -127,12 +141,29 @@ typedef enum _NSStringEncoding
NSGSM0338StringEncoding, // GSM (mobile phone) default alphabet
NSBIG5StringEncoding, // Traditional chinese
NSKoreanEUCStringEncoding // Korean
#if OS_API_VERSION(100400,GS_API_LATEST)
,
NSUTF16BigEndianStringEncoding = 0x90000100,
NSUTF16LittleEndianStringEncoding = 0x94000100,
NSUTF32StringEncoding = 0x8c000100,
NSUTF32BigEndianStringEncoding = 0x98000100,
NSUTF32LittleEndianStringEncoding = 0x9c000100
#endif
} NSStringEncoding;
enum {
NSOpenStepUnicodeReservedBase = 0xF400
};
#if OS_API_VERSION(100400,GS_API_LATEST)
enum {
NSStringEncodingConversionAllowLossy = 1,
NSStringEncodingConversionExternalRepresentation = 2
};
typedef NSUInteger NSStringEncodingConversionOptions;
#endif
/**
* <p>
* <code>NSString</code> objects represent an immutable string of Unicode 3.0
@ -203,6 +234,14 @@ enum {
encoding: (NSStringEncoding)encoding
freeWhenDone: (BOOL)flag;
#endif
#if OS_API_VERSION(100500,GS_API_LATEST)
+ (id) stringWithContentsOfFile: (NSString*)path
usedEncoding: (NSStringEncoding*)enc
error: (NSError**)error;
- (id) initWithContentsOfFile: (NSString*)path
usedEncoding: (NSStringEncoding*)enc
error: (NSError**)error;
#endif
- (id) initWithCharactersNoCopy: (unichar*)chars
length: (unsigned int)length
freeWhenDone: (BOOL)flag;
@ -619,9 +658,33 @@ enum {
- (const char *)UTF8String;
#endif
#if OS_API_VERSION(100300,GS_API_LATEST)
/** Not implemented */
- (void) getParagraphStart: (NSUInteger *)startPtr
end: (NSUInteger *)parEndPtr
contentsEnd: (NSUInteger *)contentsEndPtr
forRange: (NSRange)range;
/** Not implemented */
- (NSRange) paragraphRangeForRange: (NSRange)range;
#endif
#if OS_API_VERSION(100500,GS_API_LATEST)
- (BOOL) boolValue;
- (NSArray *) componentsSeparatedByCharactersInSet: (NSCharacterSet *)separator;
- (NSInteger) integerValue;
- (long long) longLongValue;
/** Not implemented */
- (NSRange) rangeOfComposedCharacterSequencesForRange: (NSRange)range;
/** Not implemented */
- (NSRange) rangeOfString: (NSString *)aString
options: (NSStringCompareOptions)mask
range: (NSRange)searchRange
locale: (NSLocale *)locale;
#endif
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
+ (Class) constantStringClass;
- (BOOL) boolValue;
#endif /* GS_API_NONE */
@end
@ -694,7 +757,7 @@ enum {
extern struct objc_class _NSConstantStringClassReference;
#endif
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
#if GS_API_VERSION(GS_API_NONE, 011700)
@interface NSMutableString (GNUstep)
- (NSString*) immutableProxy;

View file

@ -32,48 +32,276 @@
#import <Foundation/NSException.h>
#import <Foundation/NSAutoreleasePool.h> // for struct autorelease_thread_vars
@class NSArray;
#if defined(__cplusplus)
extern "C" {
#endif
/**
* This class encapsulates OpenStep threading. See [NSLock] and its
* subclasses for handling synchronisation between threads.<br />
* Each process begins with a main thread and additional threads can
* be created using NSThread. The GNUstep implementation of OpenStep
* has been carefully designed so that the internals of the base
* library do not use threading (except for methods which explicitly
* deal with threads of course) so that you can write applications
* without threading. Non-threaded applications are more efficient
* (no locking is required) and are easier to debug during development.
*/
@interface NSThread : NSObject
{
@private
id _target;
id _arg;
SEL _selector;
@public
NSString *_name;
unsigned _stackSize;
BOOL _cancelled;
BOOL _active;
NSHandler *_exception_handler;
BOOL _finished;
NSHandler *_exception_handler; // Not retained.
NSMutableDictionary *_thread_dictionary;
struct autorelease_thread_vars _autorelease_vars;
id _gcontext;
void *_runLoopInfo; // Per-thread runloop related info.
void *_reserved; // For future expansion
}
/**
* <p>
* Returns the NSThread object corresponding to the current thread.
* </p>
* <p>
* NB. In GNUstep the library internals use the GSCurrentThread()
* function as a more efficient mechanism for doing this job - so
* you cannot use a category to override this method and expect
* the library internals to use your implementation.
* </p>
*/
+ (NSThread*) currentThread;
/**
* <p>Create a new thread - use this method rather than alloc-init. The new
* thread will begin executing the message given by aSelector, aTarget, and
* anArgument. This should have no return value, and must set up an
* autorelease pool if retain/release memory management is used. It should
* free this pool before it finishes execution.</p>
*/
+ (void) detachNewThreadSelector: (SEL)aSelector
toTarget: (id)aTarget
withObject: (id)anArgument;
/**
* Terminates the current thread.<br />
* Normally you don't need to call this method explicitly,
* since exiting the method with which the thread was detached
* causes this method to be called automatically.
*/
+ (void) exit;
/**
* Returns a flag to say whether the application is multi-threaded or not.<br />
* An application is considered to be multi-threaded if any thread other
* than the main thread has been started, irrespective of whether that
* thread has since terminated.<br />
* NB. This method returns YES if called within a handler processing
* <code>NSWillBecomeMultiThreadedNotification</code>
*/
+ (BOOL) isMultiThreaded;
+ (void) setThreadPriority: (double)pri;
+ (void) sleepUntilDate: (NSDate*)date;
+ (double) threadPriority;
- (NSMutableDictionary*) threadDictionary;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2,GS_API_LATEST) \
&& GS_API_VERSION(010200,GS_API_LATEST)
+ (void) setThreadPriority: (double)pri;
+ (double) threadPriority;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST) \
&& GS_API_VERSION(011501,GS_API_LATEST)
/** Returns an array of the call stack return addresses.
*/
+ (NSArray*) callStackReturnAddresses;
/** Returns a boolean indicating whether this thread is the main thread of
* the process.
*/
+ (BOOL) isMainThread;
/** Returns the main thread of the process.
*/
+ (NSThread*) mainThread;
/** Suspends execution of the process for the specified period.
*/
+ (void) sleepForTimeInterval: (NSTimeInterval)ti;
/** Cancels the receiving thread.
*/
- (void) cancel;
/** <init/>
*/
- (id) init;
/** Initialises the receiver to send the message aSelector to the object aTarget
* with the argument anArgument (which may be nil).<br />
* The arguments aTarget and aSelector are retained while the thread is
* running.
*/
- (id) initWithTarget: (id)aTarget
selector: (SEL)aSelector
object: (id)anArgument;
/** Returns a boolean indicating whether the receiving
* thread has been cancelled.
*/
- (BOOL) isCancelled;
/** Returns a boolean indicating whether the receiving
* thread has been started (and has not yet finished or been cancelled).
*/
- (BOOL) isExecuting;
/** Returns a boolean indicating whether the receiving
* thread has completed executing.
*/
- (BOOL) isFinished;
/** Returns a boolean indicating whether this thread is the main thread of
* the process.
*/
- (BOOL) isMainThread;
/** FIXME ... what does this do?
*/
- (void) main;
/** Returns the name of the receiver.
*/
- (NSString*) name;
/** Sets the name of the receiver.
*/
- (void) setName: (NSString*)aName;
/** Sets the size of the receiver's stack.
*/
- (void) setStackSize: (unsigned)stackSize;
/** Returns the size of the receiver's stack.
*/
- (unsigned) stackSize;
/** Starts the receiver executing.
*/
- (void) start;
#endif
@end
#if GS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
@interface NSObject(NSMainThreadPerformAdditions)
/**
* Extra methods to permit messages to be sent to an object such that they
* are executed in <em>another</em> thread.<br />
* The main thread is the thread in which the GNUstep system is started,
* and where the GNUstep gui is used, it is the thread in which gui
* drawing operations <strong>must</strong> be performed.
*/
@interface NSObject(NSThreadPerformAdditions)
#if GS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
/**
* <p>This method performs aSelector on the receiver, passing anObject as
* an argument, but does so in the main thread of the program. The receiver
* and anObject are both retained until the method is performed.
* </p>
* <p>The selector is performed when the runloop of the main thread next
* runs in one of the modes specified in anArray.<br />
* Where this method has been called more than once before the runloop
* of the main thread runs in the required mode, the order in which the
* operations in the main thread is done is the same as that in which
* they were added using this method.
* </p>
* <p>If there are no modes in anArray,
* the method has no effect and simply returns immediately.
* </p>
* <p>The argument aFlag specifies whether the method should wait until
* the selector has been performed before returning.<br />
* <strong>NB.</strong> This method does <em>not</em> cause the runloop of
* the main thread to be run ... so if the runloop is not executed by some
* code in the main thread, the thread waiting for the perform to complete
* will block forever.
* </p>
* <p>As a special case, if aFlag == YES and the current thread is the main
* thread, the modes array is ignored and the selector is performed immediately.
* This behavior is necessary to avoid the main thread being blocked by
* waiting for a perform which will never happen because the runloop is
* not executing.
* </p>
*/
- (void) performSelectorOnMainThread: (SEL)aSelector
withObject: (id)anObject
waitUntilDone: (BOOL)aFlag
modes: (NSArray*)anArray;
/**
* Invokes -performSelectorOnMainThread:withObject:waitUntilDone:modes:
* using the supplied arguments and an array containing common modes.<br />
* These modes consist of NSRunLoopMode, NSConnectionreplyMode, and if
* in an application, the NSApplication modes.
*/
- (void) performSelectorOnMainThread: (SEL)aSelector
withObject: (id)anObject
waitUntilDone: (BOOL)aFlag;
@end
#endif
#if GS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
/**
* <p>This method performs aSelector on the receiver, passing anObject as
* an argument, but does so in the specified thread. The receiver
* and anObject are both retained until the method is performed.
* </p>
* <p>The selector is performed when the runloop of aThread next
* runs in one of the modes specified in anArray.<br />
* Where this method has been called more than once before the runloop
* of the thread runs in the required mode, the order in which the
* operations in the thread is done is the same as that in which
* they were added using this method.
* </p>
* <p>If there are no modes in anArray,
* the method has no effect and simply returns immediately.
* </p>
* <p>The argument aFlag specifies whether the method should wait until
* the selector has been performed before returning.<br />
* <strong>NB.</strong> This method does <em>not</em> cause the runloop of
* aThread to be run ... so if the runloop is not executed by some
* code in aThread, the thread waiting for the perform to complete
* will block forever.
* </p>
* <p>As a special case, if aFlag == YES and the current thread is aThread,
* the modes array is ignored and the selector is performed immediately.
* This behavior is necessary to avoid the current thread being blocked by
* waiting for a perform which will never happen because the runloop is
* not executing.
* </p>
*/
- (void) performSelector: (SEL)aSelector
onThread: (NSThread*)aThread
withObject: (id)anObject
waitUntilDone: (BOOL)aFlag
modes: (NSArray*)anArray;
/**
* Invokes -performSelector:onThread:withObject:waitUntilDone:modes:
* using the supplied arguments and an array containing common modes.<br />
* These modes consist of NSRunLoopMode, NSConnectionreplyMode, and if
* in an application, the NSApplication modes.
*/
- (void) performSelector: (SEL)aSelector
onThread: (NSThread*)aThread
withObject: (id)anObject
waitUntilDone: (BOOL)aFlag;
#endif
@end
#if GS_API_VERSION(GS_API_NONE, GS_API_NONE)
/*

View file

@ -32,6 +32,7 @@ extern "C" {
@class NSArray;
@class NSDate;
@class NSDictionary;
@class NSLocale;
@class NSString;
@interface NSTimeZone : NSObject
@ -75,6 +76,29 @@ extern "C" {
- (int) secondsFromGMTForDate: (NSDate*)aDate;
#endif
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Not implemented */
- (NSTimeInterval) daylightSavingTimeOffsetForDate: (NSDate *)aDate;
/** Not implemented */
- (NSDate *) nextDaylightSavingTimeTransitionAfterDate: (NSDate *)aDate;
/** Not implemented */
- (NSTimeInterval) daylightSavingTimeOffset;
/** Not implemented */
- (NSDate *) nextDaylightSavingTimeTransition;
enum {
NSTimeZoneNameStyleStandard,
NSTimeZoneNameStyleShortStandard,
NSTimeZoneNameStyleDaylightSaving,
NSTimeZoneNameStyleShortDaylightSaving
};
typedef NSInteger NSTimeZoneNameStyle;
- (NSString *)localizedName: (NSTimeZoneNameStyle)style
locale: (NSLocale *)locale;
GS_EXPORT NSString * const NSSystemTimeZoneDidChangeNotification;
#endif
#if OS_API_VERSION(GS_API_OPENSTEP, GS_API_MACOSX)
- (NSTimeZoneDetail*) timeZoneDetailForDate: (NSDate*)date;
- (NSString*) timeZoneName;
@ -87,6 +111,7 @@ extern "C" {
*/
+ (NSTimeZone*) defaultTimeZone;
+ (NSTimeZone*) timeZoneWithAbbreviation: (NSString*)abbreviation;
@end
#if OS_API_VERSION(GS_API_OPENSTEP, GS_API_MACOSX)

View file

@ -26,9 +26,6 @@
#define __NSTimer_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
/* This class is currently thrown together. When it is cleaned up, it
may no longer be concrete. */
#import <Foundation/NSDate.h>
#if defined(__cplusplus)
@ -39,9 +36,12 @@ extern "C" {
* NB. NSRunLoop is optimised using a hack that knows about the
* class layout for the fire date and invialidation flag in NSTimer.
* These MUST remain the first two items in the class.
* Other classes must not attempt to use instance variables as
* they are subject to change.
*/
@interface NSTimer : NSObject
{
@private
NSDate *_date; /* Must be first - for NSRunLoop optimisation */
BOOL _invalidated; /* Must be 2nd - for NSRunLoop optimisation */
BOOL _repeats;
@ -76,17 +76,19 @@ extern "C" {
- (void) invalidate;
- (id) userInfo;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (BOOL) isValid;
- (NSTimeInterval) timeInterval;
#endif
#if OS_API_VERSION(100200, GS_API_LATEST)
- (id) initWithFireDate: (NSDate*)fd
interval: (NSTimeInterval)ti
target: (id)object
selector: (SEL)selector
userInfo: (id)info
repeats: (BOOL)f;
- (BOOL) isValid;
- (void) setFireDate: (NSDate*)fireDate;
- (NSTimeInterval) timeInterval;
#endif
@end

View file

@ -72,7 +72,7 @@ extern "C" {
/** <init />
* Initialises the receiver with the specified request (performing
* a deep copy so that ithe request does not change during loading)
* a deep copy so that the request does not change during loading)
* and delegate.<br />
* This automatically initiates an asynchronous load for the request.<br />
* Processing of the request is done in the thread which calls this

View file

@ -63,7 +63,8 @@ GS_EXPORT NSString* const NSRegistrationDomain;
#ifndef NO_GNUSTEP
/**
* User defaults domain for GNUstep config file.
* User defaults domain for GNUstep config file and for any defaults
* stored in the GlobalDefaults.plist file alongside the config file.
*/
GS_EXPORT NSString* const GSConfigDomain;
#endif
@ -180,7 +181,7 @@ GS_EXPORT NSString* const NSLanguageCode;
GS_EXPORT NSString* const NSFormalName;
#ifndef NO_GNUSTEP
/** Key for locale dictionary: name of locale. */
GS_EXPORT NSString* const NSLocale;
GS_EXPORT NSString* const GSLocale;
#endif
#endif
@ -363,8 +364,8 @@ GS_EXPORT NSString* const NSLocale;
/**
* Sets a boolean value for defaultName in the application domain.<br />
* Calls -setObject:forKey: to make the change by storing a boolean
* [NSNumber] instance.
* Calls -setObject:forKey: to make the change by storing a string
* containing either the word YES or NO.
*/
- (void) setBool: (BOOL)value forKey: (NSString*)defaultName;

View file

@ -25,6 +25,8 @@
#ifndef __NSUtilties_h_GNUSTEP_BASE_INCLUDE
#define __NSUtilties_h_GNUSTEP_BASE_INCLUDE
#warning The use of NSUtilities.h is deprecated
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSString.h>
#import <Foundation/NSDictionary.h>

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -19,7 +19,8 @@
#
# You should have received a copy of the GNU General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02111 USA
#
all:

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of

32
NEWS
View file

@ -1,30 +1,42 @@
1 News
******
The currently released version of the library is `1.14.4'.
The currently released version of the library is `1.15.3'.
See the `ReleaseNotes.html' document for more information.
1.1 Noteworthy changes in version `1.14.4'
1.1 Noteworthy changes in version `1.15.3'
==========================================
Minor updates
* Extended NSUserDefaults so it recognizes ../ as a relative path.
1.2 Noteworthy changes in version `1.14.3'
* Added TLS/SSL support for NSStream based on GNU TLS
* Added support for https to NSURLConnection using new stream code
and added basic support for digest authentication.
* Fixed various problems with and added new options to KVO.
1.2 Noteworthy changes in version `1.15.2'
==========================================
Various bug fixes.
Bug fixes include improved thread safety (and a change to the NSThread
class structure) and Key-Value observing.
1.3 Noteworthy changes in version `1.14.2'
1.3 Noteworthy changes in version `1.15.1'
==========================================
Minor configuration change so it will compile on darwin with ffcall.
This is an unstable release. There may be API and ABI changes from
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.4 Noteworthy changes in version `1.14.1'
1.4 Noteworthy changes in version `1.15.0'
==========================================
License changed to GPLv3. Mostly bug fixes, particularly with regard
to XML handling and handling unichar on Windows.
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.5 Noteworthy changes in version `1.14.0'
==========================================

View file

@ -9,7 +9,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of

View file

@ -18,21 +18,21 @@
NSDateFormatString = "%A, %d %B, %Y";
NSDateTimeOrdering = DMYH;
NSEarlierTimeDesignations = (antes, menos, hace); /* Not sure */
NSHourNameDesignations = ((0, medianoche), (12, mediod\U00eda), (10, ma\U00f1ana), (14, tarde), (19, noche));
NSHourNameDesignations = ((0, medianoche), (12, "mediod\U00eda"), (10, "ma\U00f1ana"), (14, tarde), (19, noche));
NSLaterTimeDesignations = (pasado); /* Not sure */
NSMonthNameArray = (enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre);
NSNextDayDesignations = (ma\U00f1ana);
NSNextNextDayDesignations = (pasado ma\U00f1ana);
NSNextDayDesignations = ("ma\U00f1ana");
NSNextNextDayDesignations = ("pasado ma\U00f1ana");
NSPriorDayDesignations = (ayer);
NSShortDateFormatString = "%d/%m/%Y";
NSShortMonthNameArray = (ene, feb, mar, apr, may, jun, jul, ago, sep, oct, nov, dic);
NSShortTimeDateFormatString = "%d %b, %Y %H:%M";
NSShortWeekDayNameArray = (dom, lun, mar, mi\U00e9, jue, vie, s\U00e1b);
NSShortWeekDayNameArray = (dom, lun, mar, "mi\U00e9", jue, vie, "s\U00e1b");
NSThisDayDesignations = (hoy);
NSTimeDateFormatString = "%a %d %b %H:%M:%S %z %Y";
NSTimeFormatString = "%H:%M:%S";
NSWeekDayNameArray = (domingo, lunes, martes, mi\U00e9rcoles, jueves, viernes, s\U00e1bado);
NSYearMonthWeekDesignations = (a\U00f1o, mes, semana);
NSWeekDayNameArray = (domingo, lunes, martes, "mi\U00e9rcoles", jueves, viernes, "s\U00e1bado");
NSYearMonthWeekDesignations = ("a\U00f1o", mes, semana);
}

View file

@ -1,166 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
Preamble
0. Additional Definitions.
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
1. Exception to Section 3 of the GNU GPL.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
2. Conveying Modified Versions.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
3. Object Code Incorporating Material from Library Header Files.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
4. Combined Works.
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -68,6 +68,8 @@ SSL_PRINCIPAL_CLASS = GSSSLHandle
SSL_BUNDLE_LIBS = $(SSLLIBS) -lgnustep-base -lobjc
SSL_NEEDS_GUI = NO
endif
endif

View file

@ -87,37 +87,21 @@ sslError(int err)
SSL_load_error_strings();
switch (err)
if (err == SSL_ERROR_SYSCALL)
{
case SSL_ERROR_NONE:
str = @"No error: really helpful";
break;
case SSL_ERROR_ZERO_RETURN:
str = @"Zero Return error";
break;
case SSL_ERROR_WANT_READ:
str = @"Want Read Error";
break;
case SSL_ERROR_WANT_WRITE:
str = @"Want Write Error";
break;
case SSL_ERROR_WANT_X509_LOOKUP:
str = @"Want X509 Lookup Error";
break;
case SSL_ERROR_SYSCALL:
{
NSError *e = [NSError _last];
NSError *e = [NSError _last];
str = [NSString stringWithFormat: @"Syscall error %d - %@",
[e code], [e description]];
}
else if (err == SSL_ERROR_NONE)
{
str = @"No error: really helpful";
}
else
{
str = [NSString stringWithFormat: @"%s", ERR_reason_error_string(err)];
str = [NSString stringWithFormat: @"Syscall error %d - %@",
[e code], [e description]];
}
break;
case SSL_ERROR_SSL:
str = @"SSL Error: really helpful";
break;
default:
str = @"Standard system error: really helpful";
break;
}
return str;
}
@ -270,10 +254,8 @@ sslError(int err)
/*
* Some other error ... not just a timeout or disconnect
*/
NSLog(@"unable to accept SSL connection from %@:%@ - %@",
NSWarnLog(@"unable to accept SSL connection from %@:%@ - %@",
address, service, sslError(err));
ERR_print_errors_fp(stderr);
}
RELEASE(self);
return NO;
@ -369,7 +351,6 @@ sslError(int err)
RELEASE(final);
if (err != SSL_ERROR_NONE)
{
if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
{
/*
@ -377,7 +358,6 @@ sslError(int err)
*/
NSLog(@"unable to make SSL connection to %@:%@ - %@",
address, service, sslError(err));
ERR_print_errors_fp(stderr);
}
RELEASE(self);
return NO;

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -40,6 +40,7 @@ Additions_OBJC_FILES =\
GSMime.m \
GSXML.m \
GSFunctions.m \
GSInsensitiveDictionary.m \
behavior.m
ifneq ($(OBJC_RUNTIME_LIB), gnu)

View file

@ -908,20 +908,49 @@ static void MD5Transform (uint32_t buf[4], uint32_t const in[16])
*/
@implementation NSError(GSCategories)
#ifndef HAVE_STRERROR
static const char *
strerror(int eno)
#if !defined(__MINGW32__)
#if !defined(HAVE_STRERROR_R)
#if defined(HAVE_STRERROR)
static int
strerror_r(int eno, char *buf, int len)
{
const char *ptr;
int result;
[gnustep_global_lock lock];
ptr = strerror(eno);
if (ptr == 0)
{
strncpy(buf, "unknown error number", len);
result = -1;
}
else
{
strncpy(buf, strerror(eno), len);
result = 0;
}
[gnustep_global_lock unlock];
return result;
}
#else
static int
strerror_r(int eno, char *buf, int len)
{
extern char *sys_errlist[];
extern int sys_nerr;
if (eno < 0 || eno >= sys_nerr)
{
return("unknown error number");
strncpy(buf, "unknown error number", len);
return -1;
}
return(sys_errlist[eno]);
strncpy(buf, sys_errlist[eno], len);
return 0;
}
#endif
#endif
#endif
/*
* Returns an NSError instance encapsulating the last system error.
@ -959,10 +988,15 @@ strerror(int eno)
nil];
#else
NSString *message;
char buf[BUFSIZ];
/* FIXME ... not all are POSIX, should we use NSMachErrorDomain for some? */
domain = NSPOSIXErrorDomain;
message = [NSString stringWithCString: strerror(code)
if (strerror_r(code, buf, BUFSIZ) < 0)
{
sprintf(buf, "%ld", code);
}
message = [NSString stringWithCString: buf
encoding: [NSString defaultCStringEncoding]];
/* FIXME ... can we do better localisation? */
info = [NSMutableDictionary dictionaryWithObjectsAndKeys:

View file

@ -0,0 +1,484 @@
/** Interface to concrete implementation of NSDictionary
Copyright (C) 2007 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Date: May 2007
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "config.h"
#include "Foundation/NSDictionary.h"
#include "Foundation/NSAutoreleasePool.h"
#include "Foundation/NSEnumerator.h"
#include "Foundation/NSString.h"
#include "Foundation/NSException.h"
#include "Foundation/NSPortCoder.h"
#include "Foundation/NSDebug.h"
// For private method _decodeArrayOfObjectsForKey:
#include "Foundation/NSKeyedArchiver.h"
#include "GNUstepBase/GSObjCRuntime.h"
#include "GNUstepBase/GSCategories.h"
/*
* The 'Fastmap' stuff provides an inline implementation of a mapping
* table - for maximum performance.
*/
#define GSI_MAP_KTYPES GSUNION_OBJ
#define GSI_MAP_VTYPES GSUNION_OBJ
#define GSI_MAP_HASH(M, X) [[X.obj lowercaseString] hash]
#define GSI_MAP_EQUAL(M, X,Y) (([X.obj caseInsensitiveCompare: Y.obj]\
== NSOrderedSame) ? YES : NO)
#define GSI_MAP_RETAIN_KEY(M, X) ((X).obj) = \
[((id)(X).obj) copyWithZone: map->zone]
#include "GNUstepBase/GSIMap.h"
@interface _GSInsensitiveDictionary : NSDictionary
{
@public
GSIMapTable_t map;
}
@end
@interface _GSMutableInsensitiveDictionary : NSMutableDictionary
{
@public
GSIMapTable_t map;
}
@end
@interface _GSInsensitiveDictionaryKeyEnumerator : NSEnumerator
{
_GSInsensitiveDictionary *dictionary;
GSIMapEnumerator_t enumerator;
}
@end
@interface _GSInsensitiveDictionaryObjectEnumerator : _GSInsensitiveDictionaryKeyEnumerator
@end
@implementation _GSInsensitiveDictionary
static SEL nxtSel;
static SEL objSel;
+ (void) initialize
{
if (self == [_GSInsensitiveDictionary class])
{
nxtSel = @selector(nextObject);
objSel = @selector(objectForKey:);
}
}
- (id) copyWithZone: (NSZone*)zone
{
return RETAIN(self);
}
- (unsigned) count
{
return map.nodeCount;
}
- (void) dealloc
{
GSIMapEmptyMap(&map);
[super dealloc];
}
- (void) encodeWithCoder: (NSCoder*)aCoder
{
if ([aCoder allowsKeyedCoding])
{
[super encodeWithCoder: aCoder];
}
else
{
unsigned count = map.nodeCount;
SEL sel = @selector(encodeObject:);
IMP imp = [aCoder methodForSelector: sel];
GSIMapEnumerator_t enumerator = GSIMapEnumeratorForMap(&map);
GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &count];
while (node != 0)
{
(*imp)(aCoder, sel, node->key.obj);
(*imp)(aCoder, sel, node->value.obj);
node = GSIMapEnumeratorNextNode(&enumerator);
}
GSIMapEndEnumerator(&enumerator);
}
}
- (unsigned) hash
{
return map.nodeCount;
}
- (id) init
{
return [self initWithObjects: 0 forKeys: 0 count: 0];
}
- (id) initWithCoder: (NSCoder*)aCoder
{
if ([aCoder allowsKeyedCoding])
{
self = [super initWithCoder: aCoder];
}
else
{
unsigned count;
id key;
id value;
SEL sel = @selector(decodeValueOfObjCType:at:);
IMP imp = [aCoder methodForSelector: sel];
const char *type = @encode(id);
[aCoder decodeValueOfObjCType: @encode(unsigned)
at: &count];
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), count);
while (count-- > 0)
{
(*imp)(aCoder, sel, type, &key);
(*imp)(aCoder, sel, type, &value);
GSIMapAddPairNoRetain(&map, (GSIMapKey)key, (GSIMapVal)value);
}
}
return self;
}
/* Designated initialiser */
- (id) initWithObjects: (id*)objs forKeys: (id*)keys count: (unsigned)c
{
unsigned int i;
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), c);
for (i = 0; i < c; i++)
{
GSIMapNode node;
if (keys[i] == nil)
{
IF_NO_GC(AUTORELEASE(self));
[NSException raise: NSInvalidArgumentException
format: @"Tried to init dictionary with nil key"];
}
if (objs[i] == nil)
{
IF_NO_GC(AUTORELEASE(self));
[NSException raise: NSInvalidArgumentException
format: @"Tried to init dictionary with nil value"];
}
node = GSIMapNodeForKey(&map, (GSIMapKey)keys[i]);
if (node)
{
IF_NO_GC(RETAIN(objs[i]));
RELEASE(node->value.obj);
node->value.obj = objs[i];
}
else
{
GSIMapAddPair(&map, (GSIMapKey)keys[i], (GSIMapVal)objs[i]);
}
}
return self;
}
/*
* This avoids using the designated initialiser for performance reasons.
*/
- (id) initWithDictionary: (NSDictionary*)other
copyItems: (BOOL)shouldCopy
{
NSZone *z = GSObjCZone(self);
unsigned c = [other count];
GSIMapInitWithZoneAndCapacity(&map, z, c);
if (c > 0)
{
NSEnumerator *e = [other keyEnumerator];
IMP nxtObj = [e methodForSelector: nxtSel];
IMP otherObj = [other methodForSelector: objSel];
BOOL isProxy = [other isProxy];
unsigned i;
for (i = 0; i < c; i++)
{
GSIMapNode node;
id k;
id o;
if (isProxy == YES)
{
k = [e nextObject];
o = [other objectForKey: k];
}
else
{
k = (*nxtObj)(e, nxtSel);
o = (*otherObj)(other, objSel, k);
}
k = [k copyWithZone: z];
if (k == nil)
{
IF_NO_GC(AUTORELEASE(self));
[NSException raise: NSInvalidArgumentException
format: @"Tried to init dictionary with nil key"];
}
if (shouldCopy)
{
o = [o copyWithZone: z];
}
else
{
o = RETAIN(o);
}
if (o == nil)
{
IF_NO_GC(AUTORELEASE(self));
[NSException raise: NSInvalidArgumentException
format: @"Tried to init dictionary with nil value"];
}
node = GSIMapNodeForKey(&map, (GSIMapKey)k);
if (node)
{
RELEASE(node->value.obj);
node->value.obj = o;
}
else
{
GSIMapAddPairNoRetain(&map, (GSIMapKey)k, (GSIMapVal)o);
}
}
}
return self;
}
- (BOOL) isEqualToDictionary: (NSDictionary*)other
{
unsigned count;
if (other == self)
{
return YES;
}
count = map.nodeCount;
if (count == [other count])
{
if (count > 0)
{
GSIMapEnumerator_t enumerator;
GSIMapNode node;
IMP otherObj = [other methodForSelector: objSel];
enumerator = GSIMapEnumeratorForMap(&map);
while ((node = GSIMapEnumeratorNextNode(&enumerator)) != 0)
{
id o1 = node->value.obj;
id o2 = (*otherObj)(other, objSel, node->key.obj);
if (o1 != o2 && [o1 isEqual: o2] == NO)
{
GSIMapEndEnumerator(&enumerator);
return NO;
}
}
GSIMapEndEnumerator(&enumerator);
}
return YES;
}
return NO;
}
- (NSEnumerator*) keyEnumerator
{
return AUTORELEASE([[_GSInsensitiveDictionaryKeyEnumerator allocWithZone:
NSDefaultMallocZone()] initWithDictionary: self]);
}
- (NSEnumerator*) objectEnumerator
{
return AUTORELEASE([[_GSInsensitiveDictionaryObjectEnumerator allocWithZone:
NSDefaultMallocZone()] initWithDictionary: self]);
}
- (id) objectForKey: aKey
{
if (aKey != nil)
{
GSIMapNode node = GSIMapNodeForKey(&map, (GSIMapKey)aKey);
if (node)
{
return node->value.obj;
}
}
return nil;
}
@end
@implementation _GSMutableInsensitiveDictionary
+ (void) initialize
{
if (self == [_GSMutableInsensitiveDictionary class])
{
GSObjCAddClassBehavior(self, [_GSInsensitiveDictionary class]);
}
}
- (id) copyWithZone: (NSZone*)zone
{
NSDictionary *copy = [_GSInsensitiveDictionary allocWithZone: zone];
return [copy initWithDictionary: self copyItems: NO];
}
- (id) init
{
return [self initWithCapacity: 0];
}
/* Designated initialiser */
- (id) initWithCapacity: (unsigned)cap
{
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), cap);
return self;
}
- (id) makeImmutableCopyOnFail: (BOOL)force
{
#if !defined(NDEBUG) && defined(GNUSTEP_BASE_LIBRARY)
GSDebugAllocationRemove(isa, self);
#endif
isa = [_GSInsensitiveDictionary class];
#if !defined(NDEBUG) && defined(GNUSTEP_BASE_LIBRARY)
GSDebugAllocationAdd(isa, self);
#endif
return self;
}
- (void) setObject: (id)anObject forKey: (id)aKey
{
GSIMapNode node;
if (aKey == nil)
{
NSException *e;
e = [NSException exceptionWithName: NSInvalidArgumentException
reason: @"Tried to add nil key to dictionary"
userInfo: self];
[e raise];
}
if ([aKey isKindOfClass: [NSString class]] == NO)
{
NSException *e;
e = [NSException exceptionWithName: NSInvalidArgumentException
reason: @"Tried to add non-string key"
userInfo: self];
[e raise];
}
node = GSIMapNodeForKey(&map, (GSIMapKey)aKey);
if (node)
{
IF_NO_GC(RETAIN(anObject));
RELEASE(node->value.obj);
node->value.obj = anObject;
}
else
{
GSIMapAddPair(&map, (GSIMapKey)aKey, (GSIMapVal)anObject);
}
}
- (void) removeAllObjects
{
GSIMapCleanMap(&map);
}
- (void) removeObjectForKey: (id)aKey
{
if (aKey == nil)
{
NSWarnMLog(@"attempt to remove nil key from dictionary %@", self);
return;
}
GSIMapRemoveKey(&map, (GSIMapKey)aKey);
}
@end
@implementation _GSInsensitiveDictionaryKeyEnumerator
- (id) initWithDictionary: (NSDictionary*)d
{
[super init];
dictionary = (_GSInsensitiveDictionary*)RETAIN(d);
enumerator = GSIMapEnumeratorForMap(&dictionary->map);
return self;
}
- (id) nextObject
{
GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
if (node == 0)
{
return nil;
}
return node->key.obj;
}
- (void) dealloc
{
GSIMapEndEnumerator(&enumerator);
RELEASE(dictionary);
[super dealloc];
}
@end
@implementation _GSInsensitiveDictionaryObjectEnumerator
- (id) nextObject
{
GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
if (node == 0)
{
return nil;
}
return node->value.obj;
}
@end

View file

@ -19,7 +19,8 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
$Date$ $Revision$
*/
@ -315,3 +316,8 @@
@end
/* Global lock to be used by classes when operating on any global
data that invoke other methods which also access global; thus,
creating the potential for deadlock. */
NSRecursiveLock *gnustep_global_lock = nil;

View file

@ -52,13 +52,16 @@
*/
#include "config.h"
#include <Foundation/Foundation.h>
#include "GNUstepBase/GSMime.h"
#include "GNUstepBase/GSXML.h"
#include "GNUstepBase/GSCategories.h"
#include "GNUstepBase/Unicode.h"
#include <string.h>
#include <ctype.h>
#include <string.h>
#include <ctype.h>
#import <Foundation/Foundation.h>
#import "GNUstepBase/GSMime.h"
#import "GNUstepBase/GSXML.h"
#import "GNUstepBase/GSCategories.h"
#import "GNUstepBase/Unicode.h"
#include "../GSPrivate.h"
static NSCharacterSet *whitespace = nil;
static NSCharacterSet *rfc822Specials = nil;
@ -1358,101 +1361,19 @@ wordData(NSString *word)
*/
- (BOOL) parse: (NSData*)d
{
unsigned l = [d length];
if (flags.complete == 1)
{
return NO; /* Already completely parsed! */
}
if (l > 0)
if ([d length] > 0)
{
NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'", l, l, l, [d bytes]);
if (flags.inBody == 0)
{
[data appendBytes: [d bytes] length: [d length]];
bytes = (unsigned char*)[data mutableBytes];
dataEnd = [data length];
while (flags.inBody == 0)
{
if ([self _unfoldHeader] == NO)
{
return YES; /* Needs more data to fill line. */
}
if (flags.inBody == 0)
{
NSString *header;
header = [self _decodeHeader];
if (header == nil)
{
return NO; /* Couldn't handle words. */
}
if ([self parseHeader: header] == NO)
{
flags.hadErrors = 1;
return NO; /* Header not parsed properly. */
}
}
else
{
NSDebugMLLog(@"GSMime", @"Parsed end of headers", "");
}
}
/*
* All headers have been parsed, so we empty our internal buffer
* (which we will now use to store decoded data) and place unused
* information back in the incoming data object to act as input.
*/
d = AUTORELEASE([data copy]);
[data setLength: 0];
/*
* If we have finished parsing the headers, we may have http
* continuation header(s), in which case, we must start parsing
* headers again.
*/
if (flags.inBody == 1)
{
NSDictionary *info;
GSMimeHeader *hdr;
info = [[document headersNamed: @"http"] lastObject];
if (info != nil)
{
NSString *val;
val = [info objectForKey: NSHTTPPropertyStatusCodeKey];
if (val != nil)
{
int v = [val intValue];
if (v >= 100 && v < 200)
{
/*
* This is an intermediary response ... so we have
* to restart the parsing operation!
*/
NSDebugMLLog(@"GSMime",
@"Parsed http continuation", "");
flags.inBody = 0;
}
}
}
/*
* If there is a zero content length, parsing is complete.
*/
hdr = [document headerNamed: @"content-length"];
if (hdr != nil && [[hdr value] intValue] == 0)
{
[document setContent: @""];
flags.inBody = 0;
flags.complete = 1;
return NO; // No more data needed
}
}
}
{
if ([self parseHeaders: d remaining: &d] == YES)
{
return YES;
}
}
if ([d length] > 0)
{
if (flags.inBody == 1)
@ -1496,6 +1417,136 @@ wordData(NSString *word)
}
}
- (BOOL) parseHeaders: (NSData*)d remaining: (NSData**)body
{
NSDictionary *info;
GSMimeHeader *hdr;
unsigned l = [d length];
if (flags.complete == 1 || flags.inBody == 1)
{
return NO; /* Headers already parsed! */
}
if (body != 0)
{
*body = nil;
}
if (l == 0)
{
/* Add a CRLF to either end the current header line or act as
* the blank linme terminating the headers.
*/
if ([self parseHeaders: [NSData dataWithBytes: "\r\n" length: 2]
remaining: body] == YES)
{
/* Still in headers ... so we add a CRLF to terminate them.
*/
[self parseHeaders: [NSData dataWithBytes: "\r\n" length: 2]
remaining: body];
}
flags.wantEndOfLine = 0;
flags.inBody = 0;
flags.complete = 1; /* Finished parsing */
return NO; /* Want no more data */
}
NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'", l, l, l, [d bytes]);
[data appendBytes: [d bytes] length: [d length]];
bytes = (unsigned char*)[data mutableBytes];
dataEnd = [data length];
while (flags.inBody == 0)
{
if ([self _unfoldHeader] == NO)
{
return YES; /* Needs more data to fill line. */
}
if (flags.inBody == 0)
{
NSString *header;
header = [self _decodeHeader];
if (header == nil)
{
flags.hadErrors = 1;
return NO; /* Couldn't handle words. */
}
if ([self parseHeader: header] == NO)
{
flags.hadErrors = 1;
return NO; /* Header not parsed properly. */
}
}
else
{
NSDebugMLLog(@"GSMime", @"Parsed end of headers", "");
}
}
/*
* All headers have been parsed, so we empty our internal buffer
* (which we will now use to store decoded data) and place unused
* information back in the incoming data object to act as input.
*/
d = AUTORELEASE([data copy]);
if (body != 0)
{
*body = d;
}
[data setLength: 0];
/*
* We have finished parsing the headers, but we may have http
* continuation header(s), in which case, we must start parsing
* headers again.
*/
info = [[document headersNamed: @"http"] lastObject];
if (info != nil && flags.isHttp == 1)
{
NSString *val;
val = [info objectForKey: NSHTTPPropertyStatusCodeKey];
if (val != nil)
{
int v = [val intValue];
if (v >= 100 && v < 200)
{
/*
* This is an intermediary response ... so we have
* to restart the parsing operation!
*/
NSDebugMLLog(@"GSMime",
@"Parsed http continuation", "");
flags.inBody = 0;
if ([d length] == 0)
{
/* We need more data, so we have to return YES
* to ask our caller to provide it.
*/
return YES;
}
return [self parseHeaders: d remaining: body];
}
}
}
/*
* If there is a zero content length, all parsing is complete,
* not just header parsing.
*/
hdr = [document headerNamed: @"content-length"];
if (hdr != nil && [[hdr value] intValue] == 0)
{
[document setContent: @""];
flags.inBody = 0;
flags.complete = 1;
}
return NO; // No more data needed
}
/**
* <p>
* This method is called to parse a header line <em>for the
@ -2161,6 +2212,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
{
flags.isHttp = 1;
}
@end
@implementation GSMimeParser (Private)
@ -2777,7 +2829,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
- (BOOL) _unfoldHeader
{
char c;
BOOL unwrappingComplete = NO;
BOOL unfoldingComplete = NO;
lineStart = lineEnd = input;
NSDebugMLLog(@"GSMimeH", @"entry: input:%u dataEnd:%u lineStart:%u '%*.*s'",
@ -2788,7 +2840,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
* first thing we need to do is unfold any folded lines into a single
* unfolded line (lineStart to lineEnd).
*/
while (input < dataEnd && unwrappingComplete == NO)
while (input < dataEnd && unfoldingComplete == NO)
{
if ((c = bytes[input]) != '\r' && c != '\n')
{
@ -2808,7 +2860,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
if (length == 0)
{
/* An empty line cannot be folded. */
unwrappingComplete = YES;
unfoldingComplete = YES;
}
else if ((c = bytes[input]) != '\r' && c != '\n' && isspace(c))
{
@ -2821,13 +2873,13 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
else
{
/* No folding ... done. */
unwrappingComplete = YES;
unfoldingComplete = YES;
}
}
}
}
if (unwrappingComplete == YES)
if (unfoldingComplete == YES)
{
if (lineEnd == lineStart)
{
@ -2857,12 +2909,12 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
input = lineStart; /* Reset to try again with more data. */
}
NSDebugMLLog(@"GSMimeH", @"exit: inBody:%d unwrappingComplete: %d "
NSDebugMLLog(@"GSMimeH", @"exit: inBody:%d unfoldingComplete: %d "
@"input:%u dataEnd:%u lineStart:%u '%*.*s'", flags.inBody,
unwrappingComplete,
unfoldingComplete,
input, dataEnd, lineStart, lineEnd - lineStart, lineEnd - lineStart,
&bytes[lineStart]);
return unwrappingComplete;
return unfoldingComplete;
}
- (BOOL) _scanHeaderParameters: (NSScanner*)scanner into: (GSMimeHeader*)info
@ -2998,38 +3050,57 @@ static NSCharacterSet *tokenSet = nil;
}
/**
* Convert the supplied string to a standardized token by making it
* lowercase and removing all illegal characters.
* Convert the supplied string to a standardized token by removing
* all illegal characters. If preserve is NO then the result is
* converted to lowercase.<br />
* Returns an autoreleased (and possibly modified) copy of the original.
*/
+ (NSString*) makeToken: (NSString*)t
+ (NSString*) makeToken: (NSString*)t preservingCase: (BOOL)preserve
{
NSRange r;
NSMutableString *m = nil;
NSRange r;
t = [t lowercaseString];
r = [t rangeOfCharacterFromSet: nonToken];
if (r.length > 0)
{
NSMutableString *m = [t mutableCopy];
m = [t mutableCopy];
while (r.length > 0)
{
[m deleteCharactersInRange: r];
r = [m rangeOfCharacterFromSet: nonToken];
}
t = AUTORELEASE(m);
t = m;
}
if (preserve == NO)
{
t = [t lowercaseString];
}
else
{
t = AUTORELEASE([t copy]);
}
TEST_RELEASE(m);
return t;
}
/**
* Convert the supplied string to a standardized token by making it
* lowercase and removing all illegal characters.
*/
+ (NSString*) makeToken: (NSString*)t
{
return [self makeToken: t preservingCase: NO];
}
- (id) copyWithZone: (NSZone*)z
{
GSMimeHeader *c = [GSMimeHeader allocWithZone: z];
NSEnumerator *e;
NSString *k;
c = [c initWithName: [self name]
c = [c initWithName: [self namePreservingCase: YES]
value: [self value]
parameters: [self parameters]];
parameters: [self parametersPreservingCase: YES]];
e = [objects keyEnumerator];
while ((k = [e nextObject]) != nil)
{
@ -3042,8 +3113,8 @@ static NSCharacterSet *tokenSet = nil;
{
RELEASE(name);
RELEASE(value);
RELEASE(objects);
RELEASE(params);
TEST_RELEASE(objects);
TEST_RELEASE(params);
[super dealloc];
}
@ -3058,6 +3129,41 @@ static NSCharacterSet *tokenSet = nil;
return desc;
}
/** Returns the full value of the header including any parameters and
* preserving case. This is an unfolded (long) line with no escape
* sequences (ie contains a unicode string not necessarily plain ASCII).<br />
* If you just want the plain value excluding any parameters, use the
* -value method instead.
*/
- (NSString*) fullValue
{
if ([params count] > 0)
{
NSMutableString *m;
NSEnumerator *e;
NSString *k;
m = [value mutableCopy];
e = [params keyEnumerator];
while ((k = [e nextObject]) != nil)
{
NSString *v;
v = [GSMimeHeader makeQuoted: [params objectForKey: k] always: NO];
[m appendString: @"; "];
[m appendString: k];
[m appendString: @"="];
[m appendString: v];
}
k = [m makeImmutableCopyOnFail: YES];
return AUTORELEASE(k);
}
else
{
return value;
}
}
- (id) init
{
return [self initWithName: @"unknown" value: @"none" parameters: nil];
@ -3082,8 +3188,6 @@ static NSCharacterSet *tokenSet = nil;
value: (NSString*)v
parameters: (NSDictionary*)p
{
objects = [NSMutableDictionary new];
params = [NSMutableDictionary new];
[self setName: n];
[self setValue: v];
[self setParameters: p];
@ -3095,7 +3199,24 @@ static NSCharacterSet *tokenSet = nil;
*/
- (NSString*) name
{
return name;
return [self namePreservingCase: NO];
}
/**
* Returns the name of this header as originally set (without conversion
* to lowercase) if preserve is YES, but as a lowercase string if preserve
* is NO.
*/
- (NSString*) namePreservingCase: (BOOL)preserve
{
if (preserve == YES)
{
return name;
}
else
{
return [name lowercaseString];
}
}
/**
@ -3126,7 +3247,7 @@ static NSCharacterSet *tokenSet = nil;
k = [GSMimeHeader makeToken: k];
p = [params objectForKey: k];
}
return p;
return p;
}
/**
@ -3136,7 +3257,37 @@ static NSCharacterSet *tokenSet = nil;
*/
- (NSDictionary*) parameters
{
return AUTORELEASE([params copy]);
return [self parametersPreservingCase: NO];
}
/**
* Returns the parameters of this header ... a dictionary whose keys
* are strings preserving the case originally used to set the values
* or all lowercase depending on the preserve argument.
*/
- (NSDictionary*) parametersPreservingCase: (BOOL)preserve
{
NSMutableDictionary *m;
NSEnumerator *e;
NSString *k;
m = [NSMutableDictionary dictionaryWithCapacity: [params count]];
e = [params keyEnumerator];
if (preserve == YES)
{
while ((k = [e nextObject]) != nil)
{
[m setObject: [params objectForKey: k] forKey: k];
}
}
else
{
while ((k = [e nextObject]) != nil)
{
[m setObject: [params objectForKey: k] forKey: [k lowercaseString]];
}
}
return [m makeImmutableCopyOnFail: NO];
}
/**
@ -3144,92 +3295,229 @@ static NSCharacterSet *tokenSet = nil;
* and including a terminating CR-LF
*/
- (NSMutableData*) rawMimeData
{
return [self rawMimeDataPreservingCase: NO];
}
static unsigned
appendBytes(NSMutableData *m, unsigned offset, unsigned fold,
const char *bytes, unsigned size)
{
if (offset + size > fold && size + 8 <= fold)
{
unsigned len = [m length];
/* This would take the line beyond the folding limit,
* so we fold at this point.
* If we already have space at the end of the line,
* we remove it because the wrapping counts as a space.
*/
if (len > 0 && ((unsigned char*)[m bytes])[len - 1] == ' ')
{
[m setLength: --len];
}
[m appendBytes: "\r\n\t" length: 3];
offset = 8;
if (size > 0 && isspace(bytes[0]))
{
/* The folding counts as a space character,
* so we refrain from writing the next character
* if it is also a space.
*/
size--;
bytes++;
}
}
if (size > 0)
{
/* Append the supplied byte data and update the offset
* on the current line.
*/
[m appendBytes: bytes length: size];
offset += size;
}
return offset;
}
static unsigned
appendString(NSMutableData *m, unsigned offset, unsigned fold,
NSString *str, BOOL *ok)
{
unsigned pos = 0;
unsigned size = [str length];
*ok = YES;
while (pos < size)
{
NSRange r = NSMakeRange(pos, size - pos);
r = [str rangeOfCharacterFromSet: whitespace
options: NSLiteralSearch
range: r];
if (r.length > 0 && r.location == pos)
{
/* Found space at the start of the string, so we reduce
* it to a single space in the output, or omit it entirely
* if the string is nothing but space.
*/
pos++;
while (pos < size
&& [whitespace characterIsMember: [str characterAtIndex: pos]])
{
pos++;
}
if (pos < size)
{
offset = appendBytes(m, offset, fold, " ", 1);
}
}
else if (r.length == 0)
{
NSString *sub;
NSData *d;
/* No space found ... we must output the entire string without
* folding it.
*/
sub = [str substringWithRange: NSMakeRange(pos, size - pos)];
pos = size;
d = wordData(sub);
offset = appendBytes(m, offset, fold, [d bytes], [d length]);
}
else
{
NSString *sub;
NSData *d;
/* Output the substring up to the first space.
*/
sub = [str substringWithRange: NSMakeRange(pos, r.location - pos)];
pos = r.location;
d = wordData(sub);
offset = appendBytes(m, offset, fold, [d bytes], [d length]);
}
if (offset > fold)
{
*ok = NO;
}
}
return offset;
}
/**
* Returns the full text of the header, built from its component parts,
* and including a terminating CR-LF.<br />
* If preserve is YES then we attempt to build the text using the same
* case as it was originally parsed/set from, otherwise we use common
* conventions of capitalising the header names and using lowercase
* parameter names.
*/
- (NSMutableData*) rawMimeDataPreservingCase: (BOOL)preserve
{
NSMutableData *md = [NSMutableData dataWithCapacity: 128];
NSEnumerator *e = [params keyEnumerator];
NSString *k;
NSData *d = [[self name] dataUsingEncoding: NSASCIIStringEncoding];
unsigned l = [d length];
char buf[l];
unsigned int i = 0;
NSString *n;
NSData *d;
unsigned fold = 78; // Maybe pass as a parameter in a later release?
unsigned offset = 0;
BOOL conv = YES;
BOOL ok = YES;
#define LIM 120
/*
* Capitalise the header name. However, the version header is a special
* case - it is defined as being literally 'MIME-Version'
*/
memcpy(buf, [d bytes], l);
if (l == 12 && memcmp(buf, "mime-version", 12) == 0)
if (fold == 0)
{
memcpy(buf, "MIME-Version", 12);
fold = 78; // This is what the RFCs say we should limit length to.
}
else
n = [self namePreservingCase: preserve];
d = [n dataUsingEncoding: NSASCIIStringEncoding];
if (preserve == YES)
{
while (i < l)
{
if (conv == YES)
{
if (islower(buf[i]))
{
buf[i] = toupper(buf[i]);
}
}
if (buf[i++] == '-')
{
conv = YES;
}
else
{
conv = NO;
}
/* Protect the user ... MIME-Version *must* have the correct case.
*/
if ([n caseInsensitiveCompare: @"MIME-Version"] == NSOrderedSame)
{
offset = appendBytes(md, offset, fold, "MIME-Version", 12);
}
else
{
offset = appendBytes(md, offset, fold, [d bytes], [d length]);
}
}
[md appendBytes: buf length: l];
d = wordData(value);
if ([md length] + [d length] + 2 > LIM)
{
[md appendBytes: ":\r\n\t" length: 4];
[md appendData: d];
l = [md length] + 8;
}
else
{
[md appendBytes: ": " length: 2];
[md appendData: d];
l = [md length];
unsigned l = [d length];
char buf[l];
unsigned i = 0;
/*
* Capitalise the header name. However, the version header is a special
* case - it is defined as being literally 'MIME-Version'
*/
memcpy(buf, [d bytes], l);
if (l == 12 && strncasecmp(buf, "mime-version", 12) == 0)
{
memcpy(buf, "MIME-Version", 12);
}
else
{
while (i < l)
{
if (conv == YES)
{
if (islower(buf[i]))
{
buf[i] = toupper(buf[i]);
}
}
if (buf[i++] == '-')
{
conv = YES;
}
else
{
conv = NO;
}
}
}
offset = appendBytes(md, offset, fold, buf, l);
}
if (offset > fold)
{
NSLog(@"Name '%@' too long for folding at %u in header", n, fold);
}
offset = appendBytes(md, offset, fold, ":", 1);
offset = appendBytes(md, offset, fold, " ", 1);
offset = appendString(md, offset, fold, value, &ok);
if (ok == NO)
{
NSLog(@"Value for '%@' too long for folding at %u in header", n, fold);
}
while ((k = [e nextObject]) != nil)
{
NSString *v;
NSData *kd;
NSData *vd;
unsigned kl;
unsigned vl;
v = [GSMimeHeader makeQuoted: [params objectForKey: k] always: NO];
kd = wordData(k);
vd = wordData(v);
kl = [kd length];
vl = [vd length];
if ((l + kl + vl + 3) > LIM)
{
[md appendBytes: ";\r\n\t" length: 4];
[md appendData: kd];
[md appendBytes: "=" length: 1];
[md appendData: vd];
l = kl + vl + 9;
}
else
{
[md appendBytes: "; " length: 2];
[md appendData: kd];
[md appendBytes: "=" length: 1];
[md appendData: vd];
l += kl + vl + 3;
if (preserve == NO)
{
k = [k lowercaseString];
}
offset = appendBytes(md, offset, fold, ";", 1);
offset = appendBytes(md, offset, fold, " ", 1);
offset = appendString(md, offset, fold, k, &ok);
if (ok == NO)
{
NSLog(@"Parameter name '%@' in '%@' too long for folding at %u",
k, n, fold);
}
offset = appendBytes(md, offset, fold, "=", 1);
offset = appendString(md, offset, fold, v, &ok);
if (ok == NO)
{
NSLog(@"Parameter value for '%@' in '%@' too long for folding at %u",
k, n, fold);
}
}
[md appendBytes: "\r\n" length: 2];
@ -3237,13 +3525,14 @@ static NSCharacterSet *tokenSet = nil;
}
/**
* Sets the name of this header ... converts to lowercase and removes
* illegal characters. If given a nil or empty string argument,
* sets the name to 'unknown'.
* Sets the name of this header ... and removes illegal characters.<br />
* If given a nil or empty string argument, sets the name to 'unknown'.<br />
* NB. The value returned by the -name method will be a lowercase version
* of thae name.
*/
- (void) setName: (NSString*)s
{
s = [GSMimeHeader makeToken: s];
s = [GSMimeHeader makeToken: s preservingCase: YES];
if ([s length] == 0)
{
s = @"unknown";
@ -3265,6 +3554,10 @@ static NSCharacterSet *tokenSet = nil;
}
else
{
if (objects == nil)
{
objects = [NSMutableDictionary new];
}
[objects setObject: o forKey: k];
}
}
@ -3277,13 +3570,17 @@ static NSCharacterSet *tokenSet = nil;
*/
- (void) setParameter: (NSString*)v forKey: (NSString*)k
{
k = [GSMimeHeader makeToken: k];
k = [GSMimeHeader makeToken: k preservingCase: YES];
if (v == nil)
{
[params removeObjectForKey: k];
}
else
{
if (params == nil)
{
params = [_GSMutableInsensitiveDictionary new];
}
[params setObject: v forKey: k];
}
}
@ -3294,13 +3591,20 @@ static NSCharacterSet *tokenSet = nil;
*/
- (void) setParameters: (NSDictionary*)d
{
NSMutableDictionary *m = [NSMutableDictionary new];
NSEnumerator *e = [d keyEnumerator];
NSString *k;
NSMutableDictionary *m = nil;
unsigned c = [d count];
while ((k = [e nextObject]) != nil)
if (c > 0)
{
[m setObject: [d objectForKey: k] forKey: [GSMimeHeader makeToken: k]];
NSEnumerator *e = [d keyEnumerator];
NSString *k;
m = [[_GSMutableInsensitiveDictionary alloc] initWithCapacity: c];
while ((k = [e nextObject]) != nil)
{
[m setObject: [d objectForKey: k]
forKey: [GSMimeHeader makeToken: k preservingCase: YES]];
}
}
DESTROY(params);
params = m;
@ -3332,7 +3636,8 @@ static NSCharacterSet *tokenSet = nil;
}
/**
* Returns the value of this header (excluding any parameters)
* Returns the value of this header (excluding any parameters).<br />
* Use the -fullValue m,ethod if you want parameter included.
*/
- (NSString*) value
{

View file

@ -22,7 +22,8 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>GSObjCRuntime function and macro reference</title>
$Date$ $Revision$
@ -51,6 +52,8 @@
#include "GNUstepBase/GNUstep.h"
#include "GNUstepBase/GSCategories.h"
#include "../GSPrivate.h"
#include <objc/Protocol.h>
#include <string.h>
@ -975,7 +978,7 @@ GSMethodFromList(GSMethodList list,
/* For the GNU runtime we have use strcmp instead of sel_eq
for free standing method lists. */
if ((isFree == YES && strcmp((char *)method_name, (char *)sel) == 0)
|| (isFree == NO && sel_eq(method_name, sel)))
|| (isFree == NO && sel_eq(method_name, sel)))
{
return method;
}
@ -1757,6 +1760,82 @@ GSObjCGetVal(NSObject *self, const char *key, SEL sel,
val = nil;
break;
case _C_STRUCT_B:
if (strcmp(@encode(NSPoint), type) == 0)
{
NSPoint v;
if (sel == 0)
{
memcpy((char*)&v, ((char *)self + offset), sizeof(v));
}
else
{
NSPoint (*imp)(id, SEL) =
(NSPoint (*)(id, SEL))[self methodForSelector: sel];
v = (*imp)(self, sel);
}
val = [NSValue valueWithPoint: v];
}
else if (strcmp(@encode(NSRange), type) == 0)
{
NSRange v;
if (sel == 0)
{
memcpy((char*)&v, ((char *)self + offset), sizeof(v));
}
else
{
NSRange (*imp)(id, SEL) =
(NSRange (*)(id, SEL))[self methodForSelector: sel];
v = (*imp)(self, sel);
}
val = [NSValue valueWithRange: v];
}
else if (strcmp(@encode(NSRect), type) == 0)
{
NSRect v;
if (sel == 0)
{
memcpy((char*)&v, ((char *)self + offset), sizeof(v));
}
else
{
NSRect (*imp)(id, SEL) =
(NSRect (*)(id, SEL))[self methodForSelector: sel];
v = (*imp)(self, sel);
}
val = [NSValue valueWithRect: v];
}
else if (strcmp(@encode(NSSize), type) == 0)
{
NSSize v;
if (sel == 0)
{
memcpy((char*)&v, ((char *)self + offset), sizeof(v));
}
else
{
NSSize (*imp)(id, SEL) =
(NSSize (*)(id, SEL))[self methodForSelector: sel];
v = (*imp)(self, sel);
}
val = [NSValue valueWithSize: v];
}
else
{
[NSException raise: NSInvalidArgumentException
format: @"key-value get method unsupported struct"];
}
break;
default:
[NSException raise: NSInvalidArgumentException
format: @"key-value get method has unsupported type"];
@ -1764,6 +1843,7 @@ GSObjCGetVal(NSObject *self, const char *key, SEL sel,
return val;
}
}
/**
* Calls GSObjCGetVal()
*/
@ -2090,12 +2170,93 @@ GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,
}
break;
case _C_STRUCT_B:
if (strcmp(@encode(NSPoint), type) == 0)
{
NSPoint v = [val pointValue];
if (sel == 0)
{
NSPoint *ptr = (NSPoint*)((char *)self + offset);
*ptr = v;
}
else
{
void (*imp)(id, SEL, NSPoint) =
(void (*)(id, SEL, NSPoint))[self methodForSelector: sel];
(*imp)(self, sel, v);
}
}
else if (strcmp(@encode(NSRange), type) == 0)
{
NSRange v = [val rangeValue];
if (sel == 0)
{
NSRange *ptr = (NSRange*)((char *)self + offset);
*ptr = v;
}
else
{
void (*imp)(id, SEL, NSRange) =
(void (*)(id, SEL, NSRange))[self methodForSelector: sel];
(*imp)(self, sel, v);
}
}
else if (strcmp(@encode(NSRect), type) == 0)
{
NSRect v = [val rectValue];
if (sel == 0)
{
NSRect *ptr = (NSRect*)((char *)self + offset);
*ptr = v;
}
else
{
void (*imp)(id, SEL, NSRect) =
(void (*)(id, SEL, NSRect))[self methodForSelector: sel];
(*imp)(self, sel, v);
}
}
else if (strcmp(@encode(NSSize), type) == 0)
{
NSSize v = [val sizeValue];
if (sel == 0)
{
NSSize *ptr = (NSSize*)((char *)self + offset);
*ptr = v;
}
else
{
void (*imp)(id, SEL, NSSize) =
(void (*)(id, SEL, NSSize))[self methodForSelector: sel];
(*imp)(self, sel, v);
}
}
else
{
[NSException raise: NSInvalidArgumentException
format: @"key-value set method unsupported struct"];
}
break;
default:
[NSException raise: NSInvalidArgumentException
format: @"key-value set method has unsupported type"];
}
}
}
/**
* Calls GSObjCSetVal()
*/
@ -2203,52 +2364,12 @@ GSAutoreleasedBuffer(unsigned size)
/*
* Getting a system error message on a variety of systems.
* Currently 8bit string ... perhaps we should move to unicode.
* Deprecated function.
*/
#ifdef __MINGW32__
const char *GetErrorMsg(DWORD msgId)
{
void *lpMsgBuf = 0;
FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
msgId,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPSTR)&lpMsgBuf,
(DWORD)0,
NULL);
return (const char*)lpMsgBuf;
}
#else
#ifndef HAVE_STRERROR
const char *
strerror(int eno)
{
extern char *sys_errlist[];
extern int sys_nerr;
if (eno < 0 || eno >= sys_nerr)
{
return("unknown error number");
}
return(sys_errlist[eno]);
}
#endif
#endif /* __MINGW32__ */
const char *
GSLastErrorStr(long error_id)
{
#ifdef __MINGW32__
return GetErrorMsg(GetLastError());
#else
return strerror(error_id);
#endif
return [[[NSError _last] localizedDescription] cString];
}

View file

@ -52,29 +52,7 @@
#include "GNUstepBase/GSMime.h"
#include "GNUstepBase/GSXML.h"
#ifndef NeXT_Foundation_LIBRARY
#include <Foundation/NSArray.h>
#include <Foundation/NSBundle.h>
#include <Foundation/NSCalendarDate.h>
#include <Foundation/NSCharacterSet.h>
#include <Foundation/NSData.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSException.h>
#include <Foundation/NSFileManager.h>
#include <Foundation/NSHashTable.h>
#include <Foundation/NSInvocation.h>
#include <Foundation/NSMapTable.h>
#include <Foundation/NSRunLoop.h>
#include <Foundation/NSString.h>
#include <Foundation/NSTimeZone.h>
#include <Foundation/NSTimer.h>
#include <Foundation/NSURL.h>
#include <Foundation/NSURLHandle.h>
#include <Foundation/NSValue.h>
#else
#include <Foundation/Foundation.h>
#endif
/* libxml headers */
#include <libxml/tree.h>
@ -92,6 +70,7 @@
#include <libxml/HTMLparser.h>
#include <libxml/xmlmemory.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#ifdef HAVE_LIBXSLT
#include <libxslt/xslt.h>
@ -2413,11 +2392,6 @@ static NSString *endMarker = @"At end of incremental parse";
*/
#define HANDLER ((GSSAXHandler*)(((xmlParserCtxtPtr)ctx)->_private))
#ifdef GNUSTEP
static NSString *applePList
= @"file://localhost/System/Library/DTDs/PropertyList.dtd";
#endif
static xmlParserInputPtr
loadEntityFunction(void *ctx,
const unsigned char *eid, const unsigned char *url)
@ -2462,7 +2436,7 @@ loadEntityFunction(void *ctx,
range: NSMakeRange(0, [local length])];
#ifdef GNUSTEP
if ([location isEqual: applePList] == YES)
if ([location rangeOfString: @"/DTDs/PropertyList"].length > 0)
{
file = [location substringFromIndex: 6];
if ([[NSFileManager defaultManager] fileExistsAtPath: file] == NO)
@ -2820,29 +2794,63 @@ startElementNsFunction(void *ctx, const unsigned char *name,
int nb_attributes, int nb_defaulted,
const unsigned char **atts)
{
NSMutableDictionary *dict;
NSMutableDictionary *adict = nil;
NSMutableDictionary *ndict = nil;
NSString *elem;
NSCAssert(ctx,@"No Context");
elem = UTF8Str(name);
dict = [NSMutableDictionary dictionary];
if (atts != NULL)
{
int i;
int j;
adict = [NSMutableDictionary dictionaryWithCapacity: nb_attributes];
for (i = j = 0; i < nb_attributes; i++, j += 5)
{
NSString *key = UTF8Str(atts[j]);
NSString *obj = UTF8StrLen(atts[j+3], atts[j+4]-atts[j+3]);
[dict setObject: obj forKey: key];
[adict setObject: obj forKey: key];
}
}
if (nb_namespaces > 0)
{
int i;
int pos = 0;
ndict = [NSMutableDictionary dictionaryWithCapacity: nb_namespaces];
for (i = 0; i < nb_namespaces; i++)
{
NSString *key;
NSString *obj;
if (namespaces[pos] == 0)
{
key = @"";
}
else
{
key = UTF8Str(namespaces[pos]);
}
pos++;
if (namespaces[pos] == 0)
{
obj = @"";
}
else
{
obj = UTF8Str(namespaces[pos]);
}
pos++;
[ndict setObject: obj forKey: key];
}
}
[HANDLER startElement: elem
prefix: UTF8Str(prefix)
href: UTF8Str(href)
attributes: dict];
attributes: adict
namespaces: ndict];
}
static void
@ -3049,6 +3057,18 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
[self startElement: elementName attributes: elementAttributes];
}
- (void) startElement: (NSString*)elementName
prefix: (NSString*)prefix
href: (NSString*)href
attributes: (NSMutableDictionary*)elementAttributes
namespaces: (NSMutableDictionary*)elementNamespaces
{
[self startElement: elementName
prefix: prefix
href: href
attributes: elementAttributes];
}
/**
* Called when a closing tag has been processed.
*/
@ -3707,15 +3727,16 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
}
- (NSString *) description
{
return [NSString_class stringWithFormat: @"NodeSet (count %d)", [self count]];
return [NSString_class stringWithFormat: @"NodeSet (count %u)", [self count]];
}
@end
/**
* <p>Use of the GSXPathContext claass is simple ... you just need to look up
* xpath to learn the syntax of xpath expressions, then you can apply those
* expressions to a context to retrieve data from a document.
* <p>Use of the GSXPathContext class is simple ... you just need to
* look up xpath to learn the syntax of xpath expressions, then you
* can apply those expressions to a context to retrieve data from a
* document.
* </p>
* <example>
* GSXMLParser *p = [GSXMLParser parserWithContentsOfFile: @"xp.xml"];
@ -3779,6 +3800,19 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
return result;
}
- (BOOL) registerNamespaceWithPrefix: (NSString *)prefix
href: (NSString *)href
{
if (xmlXPathRegisterNs (_lib, UTF8STRING(prefix), UTF8STRING(href)) != 0)
{
return NO;
}
else
{
return YES;
}
}
- (void) dealloc
{
xmlXPathFreeContext (_lib);
@ -4621,7 +4655,7 @@ static void indentation(unsigned level, NSMutableString *str)
}
else
{
[str appendFormat: @"<i4>%d</i4>", i];
[str appendFormat: @"<i4>%ld</i4>", i];
}
}
else
@ -5193,7 +5227,7 @@ static void indentation(unsigned level, NSMutableString *str)
return method;
}
- (NSDictionary*) parseResponse: (NSData*)response
- (NSDictionary*) parseResponse: (NSData*)resp
params: (NSMutableArray*)params
{
GSXPathContext *ctx = nil;
@ -5207,7 +5241,7 @@ static void indentation(unsigned level, NSMutableString *str)
{
GSXMLDocument *doc = nil;
parser = [GSXMLParser parserWithData: response];
parser = [GSXMLParser parserWithData: resp];
[parser substituteEntities: YES];
[parser saveMessages: YES];
if ([parser parse] == YES)
@ -5444,11 +5478,11 @@ static void indentation(unsigned level, NSMutableString *str)
if (code == 200)
{
NSData *response = [handle availableResourceData];
NSData *resp = [handle availableResourceData];
NS_DURING
{
fault = [self parseResponse: response params: params];
fault = [self parseResponse: resp params: params];
}
NS_HANDLER
{

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of

View file

@ -108,8 +108,8 @@ internal_unicode_enc(void)
iconv_close(conv);
return unicode_enc;
}
NSLog(@"Could not initialise iconv() for UTF16, using UCS-2");
NSLog(@"Using characters outside 16 bits may give incorrect results");
fprintf(stderr, "Could not initialise iconv() for UTF16, using UCS-2\n");
fprintf(stderr, "Using characters outside 16 bits may give bad results.\n");
unicode_enc = UNICODE_INT;
conv = iconv_open(unicode_enc, "ASCII");
@ -207,8 +207,10 @@ static struct _strenc_ str_encoding_table[] = {
"NSISO2022JPStringEncoding","ISO-2022-JP",0,0,0},
{NSMacOSRomanStringEncoding,
"NSMacOSRomanStringEncoding","MACINTOSH",0,0,0},
#if defined(GNUSTEP)
{NSProprietaryStringEncoding,
"NSProprietaryStringEncoding","",0,0,0},
#endif
// GNUstep additions
{NSISOCyrillicStringEncoding,
@ -2020,6 +2022,9 @@ GSPrivateDefaultCStringEncoding()
if (defEnc == GSUndefinedEncoding)
{
char *encoding;
#if HAVE_LANGINFO_CODESET
char encbuf[BUFSIZ];
#endif
unsigned int count;
GSSetupEncodingTable();
@ -2033,10 +2038,16 @@ GSPrivateDefaultCStringEncoding()
if (natEnc == GSUndefinedEncoding)
{
/* Encoding not set */
#if HAVE_LANGINFO_CODESET
/* Take it from the system locale information. */
encoding = nl_langinfo(CODESET);
[gnustep_global_lock lock];
strncpy(encbuf, nl_langinfo(CODESET), sizeof(encbuf)-1);
[gnustep_global_lock unlock];
encbuf[sizeof(encbuf)-1] = '\0';
encoding = encbuf;
/*
* First handle the fallback response from nl_langinfo() ...
* if we are getting the default value we can't assume that

View file

@ -14,8 +14,8 @@
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# You should have received a copy of the GNU General Public
# License along with this library; see the file COPYING.LIB.

View file

@ -10,7 +10,7 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -126,6 +126,7 @@ NSZone.h
BaseAdditions_AGSDOC_FILES = \
../Documentation/BaseAdditions.gsdoc \
GNUstep.h \
GSCategories.h \
GSIArray.h \
GSIMap.h \

View file

@ -57,8 +57,8 @@ ifneq ($(base),no)
LIBRARY_NAME += libgnustep-base
endif
libgnustep-base_SUBPROJECTS=Additions
libgnustep-baseadd_SUBPROJECTS=Additions
libgnustep-base_SUBPROJECTS = Additions
libgnustep-baseadd_SUBPROJECTS = Additions
ifeq ($(GNUSTEP_TARGET_OS), mingw32)
libgnustep-base_SUBPROJECTS+=win32
@ -150,6 +150,7 @@ GSHTTPAuthentication.m \
GSHTTPURLHandle.m \
GSRunLoopWatcher.m \
GSSet.m \
GSSocketStream.m \
GSStream.m \
GSString.m \
GSValue.m \
@ -294,6 +295,7 @@ tzfile.h
FOUNDATION_HEADERS = \
Foundation.h \
FoundationErrors.h \
NSAffineTransform.h \
NSArchiver.h \
NSArray.h \
@ -320,6 +322,7 @@ NSDistributedLock.h \
NSDistributedNotificationCenter.h \
NSEnumerator.h \
NSError.h \
NSErrorRecoveryAttempting.h \
NSException.h \
NSExpression.h \
NSFileHandle.h \
@ -403,6 +406,9 @@ $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h
ifeq ($(HAVE_INET_PTON), no)
GNU_CFILES += inet_pton.c
endif
ifeq ($(HAVE_INET_NTOP), no)
GNU_CFILES += inet_ntop.c
endif
# The Objective-C source files to be compiled
libgnustep-base_OBJC_FILES = $(GNU_MFILES) \
@ -430,6 +436,8 @@ libbase-resources_LOCALIZED_RESOURCE_FILES =
libbase-resources_RESOURCE_DIRS =
libbase-resources_RESOURCE_FILES = Info-gnustep.plist
libgnustep-base_NEEDS_GUI = NO
libgnustep-baseadd_NEEDS_GUI = NO
-include Makefile.preamble

View file

@ -25,18 +25,20 @@
$Date$ $Revision$
*/
#include "config.h"
#include "GNUstepBase/preface.h"
#include "Foundation/NSArray.h"
#include "GNUstepBase/GSObjCRuntime.h"
#include "Foundation/NSException.h"
#include "Foundation/NSPortCoder.h"
#include "Foundation/NSDebug.h"
#include "Foundation/NSValue.h"
#import "config.h"
#import "GNUstepBase/preface.h"
#import "Foundation/NSArray.h"
#import "GNUstepBase/GSObjCRuntime.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSException.h"
#import "Foundation/NSPortCoder.h"
#import "Foundation/NSDebug.h"
#import "Foundation/NSValue.h"
// For private method _decodeArrayOfObjectsForKey:
#include "Foundation/NSKeyedArchiver.h"
#import "Foundation/NSKeyedArchiver.h"
#include "GSPrivate.h"
#import "GSPrivate.h"
static SEL eqSel;
static SEL oaiSel;
@ -712,6 +714,21 @@ static Class GSInlineArrayClass;
{
[self _raiseRangeExceptionWithIndex: index from: _cmd];
}
if (!anObject)
{
NSException *exception;
NSDictionary *info;
info = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithUnsignedInt: index], @"Index",
_contents_array[index], @"OLdObject",
self, @"Array", nil, nil];
exception = [NSException exceptionWithName: NSInvalidArgumentException
reason: @"Tried to replace object in array with nil"
userInfo: info];
[exception raise];
}
/*
* Swap objects in order so that there is always a valid object in the
* array in case a retain or release causes an exception.

View file

@ -44,18 +44,18 @@
* attributes argument and use the values from the string.
*/
#include "config.h"
#include "GNUstepBase/preface.h"
#include "GNUstepBase/GSLock.h"
#include "Foundation/NSAttributedString.h"
#include "Foundation/NSException.h"
#include "Foundation/NSRange.h"
#include "Foundation/NSDebug.h"
#include "Foundation/NSArray.h"
#include "Foundation/NSLock.h"
#include "Foundation/NSThread.h"
#include "Foundation/NSNotification.h"
#include "Foundation/NSZone.h"
#import "config.h"
#import "GNUstepBase/preface.h"
#import "GNUstepBase/GSLock.h"
#import "Foundation/NSAttributedString.h"
#import "Foundation/NSException.h"
#import "Foundation/NSRange.h"
#import "Foundation/NSDebug.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSLock.h"
#import "Foundation/NSThread.h"
#import "Foundation/NSNotification.h"
#import "Foundation/NSZone.h"
#define SANITY_CHECKS 0

View file

@ -22,13 +22,13 @@
Boston, MA 02111 USA.
*/
#include "config.h"
#include "Foundation/NSValue.h"
#include "Foundation/NSString.h"
#include "Foundation/NSException.h"
#include "Foundation/NSCoder.h"
#include "Foundation/NSObjCRuntime.h"
#include "GNUstepBase/preface.h"
#import "config.h"
#import "Foundation/NSValue.h"
#import "Foundation/NSString.h"
#import "Foundation/NSException.h"
#import "Foundation/NSCoder.h"
#import "Foundation/NSObjCRuntime.h"
#import "GNUstepBase/preface.h"
#define TYPE_ORDER 0
#include "GSConcreteValueTemplate.m"

View file

@ -22,14 +22,14 @@
Boston, MA 02111 USA.
*/
#include "config.h"
#include "Foundation/NSSet.h"
#include "Foundation/NSAutoreleasePool.h"
#include "Foundation/NSException.h"
#include "Foundation/NSUtilities.h"
#include "Foundation/NSString.h"
#include "Foundation/NSPortCoder.h"
#include "Foundation/NSDebug.h"
#import "config.h"
#import "Foundation/NSSet.h"
#import "Foundation/NSAutoreleasePool.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSException.h"
#import "Foundation/NSString.h"
#import "Foundation/NSPortCoder.h"
#import "Foundation/NSDebug.h"
#define GSI_MAP_RETAIN_VAL(M, X)

View file

@ -23,18 +23,18 @@
*/
#include "config.h"
#include "Foundation/NSDictionary.h"
#include "Foundation/NSAutoreleasePool.h"
#include "Foundation/NSUtilities.h"
#include "Foundation/NSString.h"
#include "Foundation/NSException.h"
#include "Foundation/NSPortCoder.h"
#include "Foundation/NSDebug.h"
#import "config.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSAutoreleasePool.h"
#import "Foundation/NSString.h"
#import "Foundation/NSException.h"
#import "Foundation/NSPortCoder.h"
#import "Foundation/NSDebug.h"
// For private method _decodeArrayOfObjectsForKey:
#include "Foundation/NSKeyedArchiver.h"
#import "Foundation/NSKeyedArchiver.h"
#include "GNUstepBase/GSObjCRuntime.h"
#import "GNUstepBase/GSObjCRuntime.h"
/*
* The 'Fastmap' stuff provides an inline implementation of a mapping

View file

@ -21,16 +21,16 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "Foundation/NSException.h"
#include "Foundation/NSCoder.h"
#include "Foundation/NSDistantObject.h"
#include "Foundation/NSDebug.h"
#include "GSInvocation.h"
#include <config.h>
#include <objc/objc-api.h>
#include <avcall.h>
#include <callback.h>
#include "callframe.h"
#import "Foundation/NSException.h"
#import "Foundation/NSCoder.h"
#import "Foundation/NSDistantObject.h"
#import "Foundation/NSDebug.h"
#import "GSInvocation.h"
#import <config.h>
#import <objc/objc-api.h>
#import <avcall.h>
#import <callback.h>
#import "callframe.h"
#ifndef INLINE
#define INLINE inline
@ -144,6 +144,78 @@ static vacallReturnTypeInfo returnTypeInfo [STATIC_CALLBACK_LIST_SIZE];
static void
GSInvocationCallback(void *callback_data, va_alist args);
/* Count the number of subtypes in a structure
*/
static const char *gs_subtypes(const char *type, int *result)
{
int count = 0;
if (*type == _C_STRUCT_B)
{
type++;
while (*type != _C_STRUCT_E && *type++ != '='); /* skip "<name>=" */
while (*type != '\0' && *type != _C_STRUCT_E)
{
count++;
if (*type == _C_STRUCT_B)
{
/* count a nested structure as a single type.
*/
type = gs_subtypes (type, 0);
}
else
{
type = objc_skip_typespec (type);
}
}
if (*type == _C_STRUCT_E)
{
type++; /* step past end of struct */
}
}
if (result != 0)
{
*result = count;
}
return type;
}
/* return the index'th subtype
*/
static const char *gs_subtype(const char *type, int index)
{
int count = 0;
if (*type != _C_STRUCT_B)
{
return "";
}
type++;
while (*type != _C_STRUCT_E && *type++ != '='); /* skip "<name>=" */
while (*type != '\0' && *type != _C_STRUCT_E)
{
if (count++ == index)
{
return type;
}
if (*type == _C_STRUCT_B)
{
/* count and skip a nested structure as a single type.
*/
type = gs_subtypes (type, 0);
}
else
{
type = objc_skip_typespec (type);
}
}
if (*type == _C_STRUCT_E)
{
type++; /* step past end of struct */
}
return type;
}
/*
* Recursively calculate the offset using the offset of the previous
* sub-type

View file

@ -21,16 +21,16 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "Foundation/NSException.h"
#include "Foundation/NSCoder.h"
#include "Foundation/NSDistantObject.h"
#include "Foundation/NSData.h"
#include "Foundation/NSDebug.h"
#include "GSInvocation.h"
#include <config.h>
#include <objc/objc-api.h>
#include "cifframe.h"
#include "mframe.h"
#import "Foundation/NSException.h"
#import "Foundation/NSCoder.h"
#import "Foundation/NSDistantObject.h"
#import "Foundation/NSData.h"
#import "Foundation/NSDebug.h"
#import "GSInvocation.h"
#import <config.h>
#import <objc/objc-api.h>
#import "cifframe.h"
#import "mframe.h"
#ifndef INLINE
#define INLINE inline
@ -141,37 +141,40 @@ gs_find_by_receiver_best_typed_sel (id receiver, SEL sel)
@implementation GSFFIInvocation
static IMP gs_objc_msg_forward (SEL sel)
static IMP gs_objc_msg_forward2 (id receiver, SEL sel)
{
const char *sel_type;
cifframe_t *cframe;
ffi_closure *cclosure;
NSMethodSignature *sig;
/* Determine the method types so we can construct the frame. We may not
get the right one, though. What to do then? Perhaps it can be fixed up
in the callback, but only under limited circumstances.
*/
sel_type = sel_get_type (sel);
sig = nil;
sig = [receiver methodSignatureForSelector: sel];
if (sel_type)
if (sig == nil)
{
sig = [NSMethodSignature signatureWithObjCTypes: sel_type];
}
else
{
static NSMethodSignature *def = nil;
const char *sel_type;
/*
* Default signature is for a method returning an object.
/* Determine the method types so we can construct the frame. We may not
get the right one, though. What to do then? Perhaps it can be fixed up
in the callback, but only under limited circumstances.
*/
if (def == nil)
sel_type = sel_get_type (sel);
if (sel_type)
{
def = RETAIN([NSMethodSignature signatureWithObjCTypes: "@@:"]);
sig = [NSMethodSignature signatureWithObjCTypes: sel_type];
}
else
{
static NSMethodSignature *def = nil;
/*
* Default signature is for a method returning an object.
*/
if (def == nil)
{
def = RETAIN([NSMethodSignature signatureWithObjCTypes: "@@:"]);
}
sig = def;
}
sig = def;
}
NSCAssert1(sig, @"No signature for selector %@", NSStringFromSelector(sel));
@ -188,7 +191,7 @@ static IMP gs_objc_msg_forward (SEL sel)
[NSException raise: NSMallocException format: @"Allocating closure"];
}
if (ffi_prep_closure(cclosure, &(cframe->cif),
GSFFIInvocationCallback, cframe) != FFI_OK)
GSFFIInvocationCallback, cframe) != FFI_OK)
{
[NSException raise: NSGenericException format: @"Preping closure"];
}
@ -196,9 +199,18 @@ static IMP gs_objc_msg_forward (SEL sel)
return (IMP)cclosure;
}
static IMP gs_objc_msg_forward (SEL sel)
{
return gs_objc_msg_forward2 (nil, sel);
}
+ (void) load
{
#if HAVE_FORWARD2
__objc_msg_forward2 = gs_objc_msg_forward2;
#else
__objc_msg_forward = gs_objc_msg_forward;
#endif
}
- (id) initWithArgframe: (arglist_t)frame selector: (SEL)aSelector
@ -522,7 +534,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
not the invocation so it will be demallocd at the end of this call
*/
if ([sig methodReturnType] && *[sig methodReturnType] == _C_ID
&& ((NSInvocation_t *)invocation)->_validReturn == YES)
&& ((NSInvocation_t *)invocation)->_validReturn == YES)
{
AUTORELEASE(*(id *)retp);
((NSInvocation_t *)invocation)->_validReturn = NO;

View file

@ -22,22 +22,26 @@
Boston, MA 02111 USA.
*/
#include "config.h"
#include "Foundation/NSArray.h"
#include "Foundation/NSString.h"
#include "Foundation/NSException.h"
#include "Foundation/NSValue.h"
#include "Foundation/NSData.h"
#include "Foundation/NSURL.h"
#include "Foundation/NSURLHandle.h"
#include "Foundation/NSNotification.h"
#include "Foundation/NSRunLoop.h"
#include "Foundation/NSByteOrder.h"
#include "Foundation/NSLock.h"
#include "Foundation/NSFileHandle.h"
#include "Foundation/NSDebug.h"
#include "GNUstepBase/GSMime.h"
#include "GSPrivate.h"
#import "config.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSString.h"
#import "Foundation/NSException.h"
#import "Foundation/NSValue.h"
#import "Foundation/NSData.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSURL.h"
#import "Foundation/NSURLHandle.h"
#import "Foundation/NSNotification.h"
#import "Foundation/NSRunLoop.h"
#import "Foundation/NSByteOrder.h"
#import "Foundation/NSLock.h"
#import "Foundation/NSFileHandle.h"
#import "Foundation/NSDebug.h"
#import "GNUstepBase/GSMime.h"
#import "GSPrivate.h"
GS_EXPORT NSString * const GSTelnetNotification;
GS_EXPORT NSString * const GSTelnetErrorKey;

View file

@ -24,27 +24,27 @@
#define _FILE_OFFSET_BITS 64
#include "config.h"
#import "config.h"
#include "GNUstepBase/preface.h"
#include "Foundation/NSObject.h"
#include "Foundation/NSData.h"
#include "Foundation/NSArray.h"
#include "Foundation/NSString.h"
#include "Foundation/NSFileHandle.h"
#include "GNUstepBase/GSFileHandle.h"
#include "Foundation/NSException.h"
#include "Foundation/NSRunLoop.h"
#include "Foundation/NSNotification.h"
#include "Foundation/NSNotificationQueue.h"
#include "Foundation/NSHost.h"
#include "Foundation/NSByteOrder.h"
#include "Foundation/NSProcessInfo.h"
#include "Foundation/NSUserDefaults.h"
#include "Foundation/NSDebug.h"
#include "GSPrivate.h"
#import "GNUstepBase/preface.h"
#import "Foundation/NSObject.h"
#import "Foundation/NSData.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSString.h"
#import "Foundation/NSFileHandle.h"
#import "GNUstepBase/GSFileHandle.h"
#import "Foundation/NSException.h"
#import "Foundation/NSRunLoop.h"
#import "Foundation/NSNotification.h"
#import "Foundation/NSNotificationQueue.h"
#import "Foundation/NSHost.h"
#import "Foundation/NSByteOrder.h"
#import "Foundation/NSProcessInfo.h"
#import "Foundation/NSUserDefaults.h"
#import "Foundation/NSDebug.h"
#import "GSPrivate.h"
#include "../Tools/gdomap.h"
#import "../Tools/gdomap.h"
#include <time.h>
#include <sys/time.h>

View file

@ -48,33 +48,38 @@
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "GNUstepBase/preface.h"
#include "Foundation/NSString.h"
#include "Foundation/NSArray.h"
#include "Foundation/NSCharacterSet.h"
#include "Foundation/NSException.h"
#include "Foundation/NSValue.h"
#include "Foundation/NSDictionary.h"
#include "Foundation/NSUserDefaults.h"
#include "Foundation/NSFileManager.h"
#include "Foundation/NSPortCoder.h"
#include "Foundation/NSPathUtilities.h"
#include "Foundation/NSRange.h"
#include "Foundation/NSException.h"
#include "Foundation/NSData.h"
#include "Foundation/NSBundle.h"
#include "Foundation/NSURL.h"
#include "Foundation/NSMapTable.h"
#include "Foundation/NSLock.h"
#include "Foundation/NSZone.h"
#include "Foundation/NSDebug.h"
#include "GNUstepBase/GSLocale.h"
#include "GSPrivate.h"
#import "GNUstepBase/preface.h"
#import "Foundation/NSString.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSCharacterSet.h"
#import "Foundation/NSException.h"
#import "Foundation/NSValue.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSUserDefaults.h"
#import "Foundation/NSFileManager.h"
#import "Foundation/NSPortCoder.h"
#import "Foundation/NSPathUtilities.h"
#import "Foundation/NSRange.h"
#import "Foundation/NSException.h"
#import "Foundation/NSData.h"
#import "Foundation/NSBundle.h"
#import "Foundation/NSURL.h"
#import "Foundation/NSMapTable.h"
#import "Foundation/NSLock.h"
#import "Foundation/NSZone.h"
#import "Foundation/NSDebug.h"
#import "GNUstepBase/GSLocale.h"
#import "GSPrivate.h"
#include <string.h> // for strstr()
#include <sys/stat.h>

View file

@ -22,14 +22,15 @@
Boston, MA 02111 USA.
*/
#include "GSURLPrivate.h"
#include "Foundation/NSDictionary.h"
#include "Foundation/NSScanner.h"
#include "Foundation/NSSet.h"
#include "Foundation/NSDebug.h"
#include "Foundation/NSValue.h"
#include "GNUstepBase/GSLock.h"
#include "GNUstepBase/GSMime.h"
#import "GSURLPrivate.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSScanner.h"
#import "Foundation/NSSet.h"
#import "Foundation/NSDebug.h"
#import "Foundation/NSValue.h"
#import "GNUstepBase/GSLock.h"
#import "GNUstepBase/GSMime.h"
static NSMutableDictionary *domainMap = nil;
@ -149,7 +150,7 @@ static GSMimeParser *mimeParser = nil;
+ (NSURLProtectionSpace*) protectionSpaceForAuthentication: (NSString*)auth
requestURL: (NSURL*)URL;
{
if (auth != nil)
if ([auth isKindOfClass: [NSString class]] == YES)
{
NSString *method = nil;
NSURLProtectionSpace *space;

View file

@ -23,29 +23,31 @@
Boston, MA 02111 USA.
*/
#include "config.h"
#include "Foundation/NSArray.h"
#include "Foundation/NSByteOrder.h"
#include "Foundation/NSData.h"
#include "Foundation/NSDebug.h"
#include "Foundation/NSException.h"
#include "Foundation/NSFileHandle.h"
#include "Foundation/NSHost.h"
#include "Foundation/NSLock.h"
#include "Foundation/NSMapTable.h"
#include "Foundation/NSNotification.h"
#include "Foundation/NSPathUtilities.h"
#include "Foundation/NSProcessInfo.h"
#include "Foundation/NSRunLoop.h"
#include "Foundation/NSString.h"
#include "Foundation/NSURL.h"
#include "Foundation/NSURLHandle.h"
#include "Foundation/NSValue.h"
#include "GNUstepBase/GSMime.h"
#include "GNUstepBase/GSLock.h"
#include "NSCallBacks.h"
#include "GSURLPrivate.h"
#include "GSPrivate.h"
#import "config.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSEnumerator.h"
#import "Foundation/NSByteOrder.h"
#import "Foundation/NSData.h"
#import "Foundation/NSDebug.h"
#import "Foundation/NSException.h"
#import "Foundation/NSFileHandle.h"
#import "Foundation/NSHost.h"
#import "Foundation/NSLock.h"
#import "Foundation/NSMapTable.h"
#import "Foundation/NSNotification.h"
#import "Foundation/NSPathUtilities.h"
#import "Foundation/NSProcessInfo.h"
#import "Foundation/NSRunLoop.h"
#import "Foundation/NSString.h"
#import "Foundation/NSURL.h"
#import "Foundation/NSURLHandle.h"
#import "Foundation/NSValue.h"
#import "GNUstepBase/GSMime.h"
#import "GNUstepBase/GSLock.h"
#import "NSCallBacks.h"
#import "GSURLPrivate.h"
#import "GSPrivate.h"
#include <string.h>
#ifdef HAVE_UNISTD_H
@ -68,13 +70,13 @@
* captialisation of headers (some http software is faulty like that).
*/
static unsigned int
_non_retained_id_hash(void *table, NSString* o)
_id_hash(void *table, NSString* o)
{
return [[o uppercaseString] hash];
}
static BOOL
_non_retained_id_is_equal(void *table, NSString *o, NSString *p)
_id_is_equal(void *table, NSString *o, NSString *p)
{
return ([o caseInsensitiveCompare: p] == NSOrderedSame) ? YES : NO;
}
@ -87,11 +89,11 @@ typedef NSString *(*NSMT_describe_func_t)(NSMapTable *, const void *);
static const NSMapTableKeyCallBacks writeKeyCallBacks =
{
(NSMT_hash_func_t) _non_retained_id_hash,
(NSMT_is_equal_func_t) _non_retained_id_is_equal,
(NSMT_retain_func_t) _NS_non_retained_id_retain,
(NSMT_release_func_t) _NS_non_retained_id_release,
(NSMT_describe_func_t) _NS_non_retained_id_describe,
(NSMT_hash_func_t) _id_hash,
(NSMT_is_equal_func_t) _id_is_equal,
(NSMT_retain_func_t) _NS_id_retain,
(NSMT_release_func_t) _NS_id_release,
(NSMT_describe_func_t) _NS_id_describe,
NSNotAPointerMapKey
};
@ -382,8 +384,10 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
+ (BOOL) canInitWithURL: (NSURL*)newUrl
{
if ([[newUrl scheme] isEqualToString: @"http"]
|| [[newUrl scheme] isEqualToString: @"https"])
NSString *scheme = [newUrl scheme];
if ([scheme isEqualToString: @"http"]
|| [scheme isEqualToString: @"https"])
{
return YES;
}

Some files were not shown because too many files have changed in this diff Show more