Add tag for the last release.
This commit is contained in:
parent
3b609f1adb
commit
a6e24b9eaf
30
tags/gpgme-1.1.8/AUTHORS
Normal file
30
tags/gpgme-1.1.8/AUTHORS
Normal file
@ -0,0 +1,30 @@
|
||||
Package: gpgme
|
||||
Maintainer: Marcus Brinkmann <marcus@g10code.com>
|
||||
Bug reports: bug-gpgme@gnupg.org
|
||||
Security related bug reports: security@gnupg.org
|
||||
License (software): LGPLv2.1+
|
||||
License (manual): GPLv3+
|
||||
|
||||
|
||||
FSF <gnu@gnu.org>
|
||||
- Code taken from GnuPG 1.0: gpgme/w32-util.c, GnuPG 1.1: jnlib/.
|
||||
|
||||
g10 Code GmbH <code@g10code.com>
|
||||
- All stuff since mid march 2001.
|
||||
|
||||
Werner Koch <wk@gnupg.org>
|
||||
- Design and most stuff.
|
||||
|
||||
Wojciech Polak <polak@lodz.pdi.net>
|
||||
- gpgme.spec
|
||||
|
||||
|
||||
Copyright 2001, 2002 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
340
tags/gpgme-1.1.8/COPYING
Normal file
340
tags/gpgme-1.1.8/COPYING
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
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
|
||||
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 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 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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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 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.
|
||||
|
||||
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.
|
||||
|
||||
NO 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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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>
|
||||
|
||||
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 2 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, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year 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, 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 your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
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.
|
510
tags/gpgme-1.1.8/COPYING.LESSER
Normal file
510
tags/gpgme-1.1.8/COPYING.LESSER
Normal file
@ -0,0 +1,510 @@
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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.]
|
||||
|
||||
Preamble
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
^L
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
^L
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
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 "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.
|
||||
|
||||
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".)
|
||||
|
||||
"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.
|
||||
|
||||
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.
|
||||
^L
|
||||
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.
|
||||
^L
|
||||
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.
|
||||
^L
|
||||
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.
|
||||
^L
|
||||
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.
|
||||
^L
|
||||
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
|
||||
^L
|
||||
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.1 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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!
|
||||
|
||||
|
856
tags/gpgme-1.1.8/ChangeLog
Normal file
856
tags/gpgme-1.1.8/ChangeLog
Normal file
@ -0,0 +1,856 @@
|
||||
2008-12-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Release GPGME 1.1.8.
|
||||
|
||||
* configure.ac: Bump API revision.
|
||||
|
||||
2008-11-03 Marcus Brinkmann <marcus@g10code.com>
|
||||
|
||||
* configure.ac: Replace gpgme paths with src.
|
||||
* gpgme: Move to ...
|
||||
* src: ... this new directory.
|
||||
|
||||
2008-10-20 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac (AC_CONFIG_FILES): Add gpgme.h.
|
||||
(GNUPG_FIX_HDR_VERSION): Remove.
|
||||
|
||||
2008-10-17 Marcus Brinkmann <marcus@g10code.com>
|
||||
|
||||
Release GPGME 1.1.7.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump for release.
|
||||
|
||||
2008-09-19 Moritz <moritz@gnu.org>
|
||||
|
||||
* configure.ac: Remove bogus "esac".
|
||||
|
||||
2008-09-16 Marcus Brinkmann <marcus@g10code.com>
|
||||
|
||||
* configure.ac (_XOPEN_SOURCE) [apple-darwin]: Define it.
|
||||
|
||||
2008-07-04 Werner Koch <wk@g10code.com>
|
||||
|
||||
* config.guess, config.sub: Update to 2007-11-19. Also update
|
||||
missing et al scripts.
|
||||
|
||||
2008-04-01 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac (AC_INIT): Fix quoting.
|
||||
|
||||
2008-01-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Bump required version of automake up to 1.10.
|
||||
* autogen.sh: Fix aclocal check.
|
||||
|
||||
2008-01-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Release GPGME 1.1.6.
|
||||
|
||||
* configure.ac: Support gpgconf.
|
||||
|
||||
2007-09-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* assuan-pipe-connect.c (pipe_connect_gpgme): Do not close process
|
||||
handle here. Use this function also on Unix systems.
|
||||
|
||||
* assuan-pipe-connect.c (pipe_connect_gpgme): Fix last change.
|
||||
|
||||
* assuan-pipe-connect.c (pipe_connect_gpgme): New function, use it
|
||||
if _ASSUAN_IN_GPGME_BUILD_ASSUAN.
|
||||
|
||||
2007-09-17 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac: Use the svn version magic.
|
||||
|
||||
2007-09-07 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Check for C++, Qt and support --enable-w32-qt.
|
||||
* m4/pkg.m4: New file.
|
||||
|
||||
2007-08-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (--enable-w32-glib): Use --enableval, not
|
||||
--withval.
|
||||
|
||||
2007-07-16 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* assuan/assuan-socket.c (_assuan_close): Always use close().
|
||||
* assuan/assuan.h (_gpgme_io_close): New prototype.
|
||||
(close): New macro, define as _gpgme_io_close.
|
||||
|
||||
2007-07-13 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* assuan/assuan-io.c (_assuan_simple_read, _assuan_simple_write):
|
||||
Always use read/write (which means _gpgme_io_read and
|
||||
_gpgme_io_write).
|
||||
|
||||
2007-07-09 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 1.1.5.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump for release.
|
||||
|
||||
2007-07-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (GPGSM_DEFAULT) [*-mingw32*]: Initialize it.
|
||||
(HAVE_ASSUAN_H): Set to 1 if we have it.
|
||||
(funopen): Use AC_REPLACE_FUNCS.
|
||||
(USE_DESCRIPTOR_PASSING): Define to 1 if we have it. Do not
|
||||
define it at all if we don't.
|
||||
(NETLIBS) [have_w32_system]: Add -lws2_32.
|
||||
(DIRSEP_C, DIRSEP_S, EXPSEP_C, EXPSEP_S, PATHSEP_S)
|
||||
[HAVE_DOSISH_SYSTEM]: Remove definitions.
|
||||
|
||||
* assuan/assuan.h (_assuan_funopen): Define to _gpgme_funopen.
|
||||
* assuan/funopen.c: Move to ../gpgme/funopen.c.
|
||||
* assuan/Makefile.am (libassuan_la_SOURCES): Remove funopen.c.
|
||||
|
||||
2007-07-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* assuan/Makefile.am (INCLUDES): Include $(top_srcdir)/gpgme.
|
||||
* assuan/assuan.h: Include <ath.h> instead of trying to duplicate
|
||||
the definitions.
|
||||
|
||||
* assuan/: Update files to 2007-07-04 version of assuan.
|
||||
|
||||
* autogen.sh: Use = not == in test.
|
||||
|
||||
2007-03-05 Werner Koch <wk@g10code.com>
|
||||
|
||||
Released 1.1.4.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump for release.
|
||||
|
||||
* autogen.sh: New option --force.
|
||||
|
||||
2007-01-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 1.1.3.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump for release.
|
||||
|
||||
2007-01-26 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac: Changed gpg and gpgsm version checks to work with
|
||||
arbitrary names of the gpg binary. New option --disable-gpg-test
|
||||
and --disable-gpgsm-test.
|
||||
|
||||
2007-01-09 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac (NEED_GPG_VERSION, NEED_GPGSM_VERSION): Must define
|
||||
after it may have been changed by an option.
|
||||
|
||||
2007-01-08 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac: Require gpg-error 1.4 due to the use of
|
||||
gpg_error_from_syserror.
|
||||
(HAVE_ASSUAN_H): New.
|
||||
|
||||
2007-01-05 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Add options --with-gpg-version and
|
||||
--with-gpgsm-version to allow overriding the minimum version
|
||||
requirements.
|
||||
|
||||
2006-12-17 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Fix two typos in last change.
|
||||
|
||||
2006-12-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Use descriptor passing only if --enable-fd-passing
|
||||
is provided.
|
||||
|
||||
* configure.ac: Add check for use of descriptor passing.
|
||||
|
||||
2006-11-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (NEED_GPG_VERSION): Bump to 1.3.0.
|
||||
|
||||
2006-09-19 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Turn stpcpy into a replacement function.
|
||||
Check for unistd.h and add setenv as replacement function.
|
||||
|
||||
2006-07-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Check for network libraries and set NETLIBS.
|
||||
|
||||
2006-07-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* lang, lang/cl: New subdirectories.
|
||||
* lang/Makefile.am, lang/README: New files.
|
||||
* configure.ac (AC_CONFIG_FILES): Add lang/Makefile,
|
||||
lang/cl/Makefile and lang/cl/gpgme.asd.
|
||||
* Makefile.am (SUBDIRS): Add lang.
|
||||
|
||||
2006-03-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump for release.
|
||||
|
||||
2006-02-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 1.1.1.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_CURRENT, LIBGPGME_LT_AGE): Bump for
|
||||
release.
|
||||
(LIBGPGME_LT_REVISION): Reset to 0 for release.
|
||||
|
||||
2006-01-05 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac: Test for inline feature.
|
||||
(AH_BOTTOM): New to define the pure attribute.
|
||||
|
||||
2006-01-03 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac: Append SVN revision to the version.
|
||||
|
||||
2005-11-18 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac (BUILD_REVISION): New.
|
||||
|
||||
2005-11-17 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Add support for --enable-w32-glib (disabled by
|
||||
default). Invoke AM_PATH_GLIB_2_0.
|
||||
|
||||
2005-11-16 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac (CFLAGS) [W32]: Make sure that -mms-bitfields are used.
|
||||
|
||||
2005-11-15 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac: Create BUILD_FILEVERSION from SVN Revision.
|
||||
|
||||
* autogen.sh [W32]: Build shared and static versions of the library.
|
||||
|
||||
2005-10-20 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* w32-dll/ChangeLog, w32-dll/build-dll, w32-dll/gpgme.def: Remove
|
||||
files.
|
||||
|
||||
* configure.ac: Instead checking for windres and dlltool, invoke
|
||||
AC_LIBTOOL_WIN32_DLL and AC_LIBTOOL_RC.
|
||||
* src/Makefile.am [HAVE_W32_SYSTEM]: Use libtool, which simplifies
|
||||
the rules.
|
||||
|
||||
2005-10-01 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 1.1.0.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_CURRENT, LIBGPGME_LT_AGE): Bump for
|
||||
release.
|
||||
(LIBGPGME_LT_REVISION): Reset to 0 for release.
|
||||
|
||||
2005-09-12 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (HAVE_PTH): Don't add $PTH_CFLAGS to $CFLAGS here.
|
||||
|
||||
2005-08-26 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac (SEPCONSTANTS): New to define DIRSEP_C et al.
|
||||
|
||||
2005-08-19 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac [W32]: Create values for versioninfo.rc and list
|
||||
substuture versioninfo.rc.
|
||||
* configure.ac: Define ENABLE_GPGSM.
|
||||
|
||||
2005-08-08 Werner Koch <wk@g10code.com>
|
||||
|
||||
* configure.ac (stpcpy): Changed from replace to test.
|
||||
|
||||
2005-03-24 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (AH_BOTTOM): Removed.
|
||||
|
||||
2005-03-09 Werner Koch <wk@g10code.com>
|
||||
|
||||
* acinclude.m4 (GNUPG_CHECK_VA_COPY): Assume no when cross-compiling.
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Include autogen.sh
|
||||
|
||||
* autogen.sh: Added the usual code to build for W32 (--build-w32).
|
||||
|
||||
* configure.ac: Fixed the mingw32 host string, removed OS/2 stuff.
|
||||
(HAVE_DRIVE_LETTERS): Removed.
|
||||
(HAVE_W32_SYSTEM): Added.
|
||||
(AC_GNU_SOURCE): New to replace the identical AH_VERBATIM.
|
||||
(AH_BOTTOM): Added.
|
||||
|
||||
2004-12-28 Werner Koch <wk@g10code.com>
|
||||
|
||||
Released 1.0.2.
|
||||
|
||||
* Makefile.am (AUTOMAKE_OPTIONS): Build bzip 2 version.
|
||||
(ACLOCAL_AMFLAGS): Add -I m4.
|
||||
* configure.ac: Require automake 1.9.3 and autoconf 2.59.
|
||||
* acinclude.m4: Changed quoting for automake 1.9.
|
||||
* README: Use SHA1 instead of MD5.
|
||||
|
||||
2004-12-11 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Replace ttyname_r if it doesn't exist (and warn in
|
||||
that case).
|
||||
|
||||
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* README: Refer to COPYING.LESSER and "each file" instead of
|
||||
COPYING.
|
||||
* COPYING.LESSER: New file.
|
||||
* gpgme.spec.in (%doc): Add COPYING.LESSER.
|
||||
* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
|
||||
2.1 or later.
|
||||
* TODO: Add copyright notice.
|
||||
* README.CVS: Likewise.
|
||||
|
||||
* configure.ac (GPGSM_VERSION): Fix filter to get it.
|
||||
|
||||
2004-10-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 1.0.1.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump up to 2.
|
||||
(AC_INIT): Set version to 1.0.1.
|
||||
|
||||
* configure.ac: Set HAVE_GPGSM to true only if $GPGSM is not "no".
|
||||
|
||||
2004-09-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 1.0.0.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump up to 1.
|
||||
(AC_INIT): Set version to 1.0.0.
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove README-alpha.
|
||||
* README-alpha: Remove file.
|
||||
|
||||
2004-09-17 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Disable AC_CONFIG_MACRO_DIR for now.
|
||||
|
||||
2004-09-14 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Improve diagnostics with version check.
|
||||
|
||||
* configure.ac: Print diagnostics about found thread libraries at
|
||||
the end. Check for the versions of GPG and GPGSM and print the
|
||||
found versions at the end.
|
||||
(HAVE_GPGSM): Do not require GPGSM to exist and be readable.
|
||||
(AC_CONFIG_MACRO_DIR): Invoke with argument m4.
|
||||
|
||||
* acinclude.m4: Add copyright notice.
|
||||
(jm_GLIBC21, AM_PATH_GPG_ERROR, _AC_PTH_ERROR, _AC_PTH_VERBOSE,
|
||||
AC_CHECK_PTH): Removed.
|
||||
|
||||
2004-06-23 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Check for <sys/uio.h>.
|
||||
|
||||
2004-06-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 0.9.0.
|
||||
|
||||
* configure.ac (AC_INIT): Set version number to 0.9.0.
|
||||
(LIBGPGME_LT_CURRENT, LIBGPGME_LT_AGE): Bump up by one.
|
||||
(LIBGPGME_LT_REVISION): Reset to zero.
|
||||
|
||||
2004-05-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (GPGME_CONFIG_API_VERSION): New variable,
|
||||
substitute it.
|
||||
|
||||
2004-04-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 0.4.7.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump it up.
|
||||
|
||||
2004-04-02 Thomas Schwinge <schwinge@nic-nac-project.de>
|
||||
|
||||
* autogen.sh: Added ACLOCAL_FLAGS.
|
||||
|
||||
2004-04-06 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.4.6.
|
||||
|
||||
* config.guess, config.sub, ltmain.sh: Updated to those from
|
||||
libtools 1.5.4.
|
||||
|
||||
2004-03-07 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 0.4.5.
|
||||
|
||||
* configure.ac (NEED_GPGSM_VERSION): Bump up to 1.9.6.
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove autogen.sh and README.CVS.
|
||||
|
||||
2004-02-18 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac: Make the check for funopen fail with just a
|
||||
warning.
|
||||
|
||||
2004-02-11 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* autogen.sh (check_version): Removed bashism and simplified.
|
||||
|
||||
2004-02-10 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac: Fixed funopen test change.
|
||||
|
||||
2004-02-06 Moritz Schulte <mo@g10code.com>
|
||||
|
||||
* configure.ac: Fix funopen replacement mechanism.
|
||||
|
||||
2004-01-31 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Add invocation of AC_SYS_LARGEFILE, AC_TYPE_OFF_T
|
||||
and AC_FUNC_FSEEKO.
|
||||
|
||||
2004-01-12 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.4.4.
|
||||
|
||||
* configure.ac: Bumbed LT_Revision; now at C12/A1/R1.
|
||||
(NEED_GPGSM_VERSION): Set to 1.9.3.
|
||||
(min_automake_version): Added.
|
||||
* README.CVS: New.
|
||||
* Makefile.am (EXTRA_DIST): Added README.CVS.
|
||||
* autogen.sh: Updated.
|
||||
|
||||
2003-11-19 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* acinclude.m4: Add AM_PATH_GPG_ERROR.
|
||||
* configure.ac: Check for timegm. Made warning messages more
|
||||
prominent.
|
||||
|
||||
2003-10-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 0.4.3.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_CURRENT, LIBGPGME_LT_AGE): Bump up by 1.
|
||||
(LIBGPGME_LT_REVISION): Set to 0.
|
||||
|
||||
2003-09-13 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Require libgpg-error 0.5.
|
||||
|
||||
* acinclude.m4: Remove libtool cruft, add jm_GLIBC21.
|
||||
* configure.ac: Add check for getenv_r, and call jm_GLIBC21.
|
||||
Define HAVE_THREAD_SAFE_GETENV if appropriate.
|
||||
|
||||
2003-09-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Remove GPGME_CONFIG_LIBS and GPGME_CONFIG_CFLAGS.
|
||||
|
||||
2003-09-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Move invocation of AC_CANONICAL_HOST up to
|
||||
suppress warning by autoconf.
|
||||
|
||||
2003-08-30 Robert Schiele <rschiele@uni-mannheim.de>
|
||||
|
||||
* gpgme.spec.in: %{_infodir}/dir is not packaged,
|
||||
remove to prevent checking failure.
|
||||
|
||||
2003-08-18 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: If building Assuan, check for funopen and
|
||||
fopencookie, and make isascii, putc_unlocked and memrchr
|
||||
replacement functions.
|
||||
(AM_PATH_GPG_ERROR): Require 0.3.
|
||||
|
||||
2003-07-31 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to 0.4.3.
|
||||
|
||||
2003-07-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (LIBGPGME_LT_REVISION): Bump up to 1.
|
||||
|
||||
Released 0.4.2.
|
||||
|
||||
2003-07-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Complain if libgpg-error is not found.
|
||||
|
||||
2003-06-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to 0.4.2.
|
||||
|
||||
2003-06-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (LIBGPGME_LT_CURRENT): Bump up to 11.
|
||||
|
||||
* configure.ac: Use AM_PATH_GPG_ERROR.
|
||||
|
||||
* configure.ac: Check for libgpg-error. Define
|
||||
GPG_ERR_SOURCE_DEFAULT.
|
||||
|
||||
2003-05-26 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (NEED_GPG_VERSION): Bump up to 1.2.2.
|
||||
|
||||
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
In all files, replace the Gpgme* type names with the new gpgme_*
|
||||
type names.
|
||||
|
||||
2003-02-01 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* assuan/: Update files to 2002-11-10 version of assuan.
|
||||
|
||||
2003-01-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* bonobo/gpgme.c, bonobo/main.c, bonobo/main.h, bonobo/Makefile,
|
||||
bonobo/Makefile.am, bonobo/Makefile.in: Dead files removed.
|
||||
* configure.ac: Remove automake conditional BUILD_BONOBO
|
||||
(AC_CONFIG_FILES): Remove bonobo/Makefile.
|
||||
* Makefile.am (bonobo): Remove variable.
|
||||
(SUBDIRS): Remove ${bonobo}.
|
||||
|
||||
* configure.ac: Remove all uses of GNUPG_CHECK_TYPEDEF, for byte,
|
||||
ushort, ulong, u16 and u32.
|
||||
* acinclude.m4 (GNUPG_CHECK_TYPEDEF): Remove macro.
|
||||
|
||||
2002-12-24 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: New conditional HAVE_LD_VERSION_SCRIPT.
|
||||
Call AC_CANONICAL_HOST, use host instead target.
|
||||
|
||||
2002-12-23 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Bump up to 0.4.1.
|
||||
|
||||
Released 0.4.0.
|
||||
|
||||
2002-12-23 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* autogen.sh (automake_vers): Require 1.7 (really 1.7.1) for the
|
||||
conditional source distribution bug fix.
|
||||
|
||||
2002-12-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (LIBGPGME_LT_CURRENT): Increase by one.
|
||||
(LIBGPGME_LT_AGE, LIBGPGME_LT_REVISION): Set to 0.
|
||||
|
||||
2002-11-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* NEWS: Add note about moving "gpgmeplug" to the "cryptplug"
|
||||
package.
|
||||
* README: Remove instructions related to "gpgmeplug".
|
||||
* configure.ac: Remove enable option "gpgmeplug" and automake
|
||||
conditional BUILD_GPGMEPLUG, as well as the status info about it.
|
||||
(GPGMEPLUG): Remove variable.
|
||||
* Makefile.am (gpgmeplug): Remove variable.
|
||||
(SUBDIRS): Remove ${gpgmeplug}.
|
||||
* cryptplug.h, gpgme-openpgp.c, gpgmeplug.dox, gpgme-smime.c,
|
||||
Makefile.am, gpgmeplug.c, ChangeLog: Files removed.
|
||||
|
||||
2002-11-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Disable GPGSM for all dosish systems.
|
||||
|
||||
2002-10-12 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Add automake conditional HAVE_GPGSM.
|
||||
|
||||
2002-10-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version up to 0.4.0.
|
||||
(NEED_GPG_VERSION): Bump up to 1.2.0.
|
||||
(NEED_GPGSM_VERSION): Bump up to 0.9.0.
|
||||
* README: Update version numbers.
|
||||
* NEWS: Start entry for 0.4.0.
|
||||
|
||||
2002-09-20 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.3.11.
|
||||
|
||||
* configure.ac: Bump up LIBGPGME_LT_REVISION.
|
||||
|
||||
* configure.ac (AC_CHECK_HEADERS): Check for sys/select.h.
|
||||
|
||||
2002-09-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* autogen.sh (autoconf_vers): Bump up to 2.53 to get the @&t@
|
||||
quadrigraph. Always cutting the edge!
|
||||
|
||||
2002-09-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Create and substitute LTLIBOBJS.
|
||||
|
||||
2002-09-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 0.3.10.
|
||||
|
||||
* NEWS: Update for 0.3.9 release.
|
||||
* configure.ac: Bump up LIBGPGME_LT_REVISION.
|
||||
|
||||
2002-08-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.spec.in: Changed user name in Wojciech Polak's email
|
||||
address from ghostface to polak per request by himself.
|
||||
|
||||
2002-08-28 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* acinclude.m4 (GNUPG_CHECK_VA_COPY): New.
|
||||
* configure.ac: Use it.
|
||||
|
||||
2002-08-23 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac (GPGME_CONFIG_CFLAGS): Renamed from GPGME_CFLAGS
|
||||
and removed the libpath because it is set by the config script.
|
||||
|
||||
2002-08-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Bump version number to 0.3.10.
|
||||
|
||||
* NEWS: Add template for development version.
|
||||
|
||||
2002-08-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 0.3.9.
|
||||
|
||||
* NEWS: Update for 0.3.9 release.
|
||||
* Makefile.am (EXTRA_DIST): Add gpgme.spec.in.
|
||||
|
||||
2002-08-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* jnlib/argparse.c, jnlib/argparse.h, jnlib/ChangeLog,
|
||||
jnlib/dotlock.c, jnlib/dotlock.h, jnlib/libjnlib-config.h,
|
||||
jnlib/logging.c, jnlib/logging.h,jnlib/Makefile.am,
|
||||
jnlib/mischelp.h, jnlib/README, jnlib/stringhelp.c,
|
||||
jnlib/stringhelp.h, jnlib/strlist.c, jnlib/strlist.h,
|
||||
jnlib/types.h, jnlib/xmalloc.c, jnlib/xmalloc.h: Remove files.
|
||||
|
||||
2002-08-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Makefile.am (SUBDIRS): Remove jnlib.
|
||||
* configure.ac: Don't check for unsigned short or unsigned long.
|
||||
Don't check for memicmp, strlwr, strtoul, memmove, stricmp.
|
||||
Make stpcpy a replaced function.
|
||||
Don't define HAVE_JNLIB_LOGGING.
|
||||
Don't generate jnlib/Makefile.
|
||||
|
||||
2002-07-02 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac: Bumbed version number to 0.3.9; add a comment on
|
||||
when to change it.
|
||||
|
||||
* gpgme.spec.in: New. Contributed by Wojciech Polak.
|
||||
* Makefile.am (dist-hook): New.
|
||||
|
||||
* AUTHORS: Added Wojciech and bug reporting addresses.
|
||||
|
||||
2002-06-25 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.3.8.
|
||||
|
||||
* configure.ac: Bumbed LT version to 9/3/0.
|
||||
(NEED_GPGSM_VERSION): Need 0.3.8 due to fixed export command.
|
||||
|
||||
2002-06-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
Released 0.3.7.
|
||||
|
||||
* configure.ac (AC_INIT): Set version to 0.3.7.
|
||||
(LIBGPGME_LT_REVISION): Add one.
|
||||
|
||||
* README: Document version requirement correctly.
|
||||
|
||||
2002-06-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* acinclude.m4: Fix Pth check so that it doesn't error out if pth
|
||||
is not found.
|
||||
|
||||
2002-06-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Add checks for Pth and pthreads.
|
||||
* acinclude.m4: Add slightly hacked check for pth (seems to be an
|
||||
autoconf version problem).
|
||||
|
||||
2002-05-21 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac (NEED_GPGSM_VERSION): We need gpgsm 0.3.7.
|
||||
|
||||
2002-05-03 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.3.6.
|
||||
|
||||
2002-04-05 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* acconfig.h: File removed.
|
||||
* configure.ac (NEED_GPG_VERSION): Add description.
|
||||
(NEED_GPGSM_VERSION): Likewise.
|
||||
(HAVE_DOSISH_SYSTEM): Likewise.
|
||||
(HAVE_DRIVE_LETTERS): Likewise.
|
||||
(GPG_PATH): Likewise.
|
||||
(GPGSM_PATH): Likewise.
|
||||
* acinclude.m4 (GNUPG_CHECK_TYPEDEF): Likewise.
|
||||
|
||||
2002-04-01 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.3.5.
|
||||
|
||||
2002-03-17 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac: Add automake conditional HAVE_DOSISH_SYSTEM.
|
||||
|
||||
2002-03-04 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac: Bumbed version to 0.3.4-cvs to continue development.
|
||||
|
||||
Released 0.3.4.
|
||||
|
||||
* configure.ac: Bumbed LT version numbers to (7,1,0), requires
|
||||
gpgsm 0.3.1.
|
||||
|
||||
2002-03-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (AC_INIT): Change version number to snapshot CVS
|
||||
version.
|
||||
|
||||
2002-02-13 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac (vasprintf,fopencookie): Add checks.
|
||||
|
||||
2002-02-12 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to 0.3.3.
|
||||
* jnlib/Makefile.am: Rever to older version that includes xmalloc
|
||||
but not dotlock and some other files. Reported by Stéphane
|
||||
Corthésy.
|
||||
|
||||
2002-02-10 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Released 0.3.2.
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to 0.3.2.
|
||||
* jnlib/libjnlibconfig.h: Revert to older version that doesn't
|
||||
expect libgcrypt. Reported by Jose Carlos Garcia Sogo
|
||||
<jsogo@debian.org>.
|
||||
|
||||
2002-02-09 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Released 0.3.1.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_CURRENT): Bump it up to 6!
|
||||
(NEED_GPGSM_VERSION): Bump it up to 0.3.0!
|
||||
(AC_INIT): Bump version to 0.3.1
|
||||
|
||||
2002-01-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (HAVE_JNLIB_LOGGING): Define always for assuan.
|
||||
|
||||
2001-12-19 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.ac (VERSION,PACKAGE): Defined and subst. Used for
|
||||
AM_INIT_AUTOMAKE and moved all version number more to the top.
|
||||
|
||||
2001-12-18 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* autogen.sh (libtool_vers): Bump to 1.4.
|
||||
|
||||
* configure.ac (LIBGPGME_LT_CURRENT): Increment.
|
||||
(LIBGPGME_LT_AGE): Reset.
|
||||
Improve comment.
|
||||
Fix wrong comment character.
|
||||
|
||||
2001-12-18 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* acinclude.m4 (GNUPG_FIX_HDR_VERSION): Fixed for new automake.
|
||||
|
||||
2001-12-14 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (GPG): Substitute this variable.
|
||||
(GPGSM): Likewise.
|
||||
|
||||
2001-11-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (AC_CONFIG_FILES): Add tests/gpg/Makefile and
|
||||
tests/gpgsm/Makefile.
|
||||
|
||||
2001-11-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Makefile.am (gpgmeplug): New variable, set to gpgmeplug if
|
||||
[BUILD_GPGMEPLUG].
|
||||
* configure.ac (AC_CONFIG_FILES): Add gpgmeplug/Makefile.
|
||||
Support --enable-gpgmeplug.
|
||||
|
||||
2001-11-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* autogen.sh: Tighten version dependencies.
|
||||
|
||||
2001-11-20 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Makefile.am (SUBDIRS): Support building the assuan library
|
||||
(currently if GPGSM_PATH is set)..
|
||||
* configure.ac: Support building the assuan library.
|
||||
* assuan: New directory, populated with the Assuan library
|
||||
(copied from the newpg repository).
|
||||
|
||||
2001-11-20 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.ac (NEED_GPGSM_VERSION): New variable. Treat it
|
||||
similarly to NEED_GPG_VERSION.
|
||||
* acconfig.h: Likewise.
|
||||
|
||||
2001-11-18 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* configure.in: Renamed to ...
|
||||
* configure.ac: ... this. Update to autoconf 2.52. Lots of small
|
||||
changes in the transition. Support --with-gpg=PATH and
|
||||
--with-gpgsm=PATH options. Check if test suites can be run.
|
||||
* acconfig.h: Add GPGSM_PATH.
|
||||
* Makefile.am: New variable `tests', set to `tests' if
|
||||
RUN_GPG_TESTS.
|
||||
(SUBDIRS): Replace string `tests' with variable `tests'.
|
||||
|
||||
2001-10-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* autogen.sh: Invoke automake with `-a' (add missing files).
|
||||
Do not invoke configure.
|
||||
|
||||
2001-09-17 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.2.3.
|
||||
|
||||
* configure.in (NEED_GPG_VERSION): Set to 1.0.6. Incremented LT
|
||||
current and age.
|
||||
|
||||
* Makefile.am (SUBDIRS): Add doc
|
||||
|
||||
2001-06-12 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.2.2.
|
||||
|
||||
2001-04-05 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* configure.in (NEED_GPG_VERSION): Set to 1.0.4g
|
||||
|
||||
2001-04-02 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.2.1.
|
||||
|
||||
Changed the copyright notices all over the place.
|
||||
|
||||
2001-02-28 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Released 0.2.0.
|
||||
|
||||
2001-01-18 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* autogen.sh: Added option --build-w32.
|
||||
|
||||
|
||||
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
237
tags/gpgme-1.1.8/INSTALL
Normal file
237
tags/gpgme-1.1.8/INSTALL
Normal file
@ -0,0 +1,237 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
6. Often, you can also type `make uninstall' to remove the installed
|
||||
files again.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
54
tags/gpgme-1.1.8/Makefile.am
Normal file
54
tags/gpgme-1.1.8/Makefile.am
Normal file
@ -0,0 +1,54 @@
|
||||
# Makefile.am - Top level Makefile for GPGME.
|
||||
# Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
# Copyright (C) 2001, 2002, 2004, 2005, 2008 g10 Code GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
#
|
||||
# GPGME 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.1 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# GPGME 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 program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AUTOMAKE_OPTIONS = dist-bzip2
|
||||
|
||||
EXTRA_DIST = gpgme.spec.in autogen.sh
|
||||
|
||||
if BUILD_ASSUAN
|
||||
assuan = assuan
|
||||
else
|
||||
assuan =
|
||||
endif
|
||||
|
||||
if BUILD_COMPLUS
|
||||
complus = complus
|
||||
else
|
||||
complus =
|
||||
endif
|
||||
|
||||
if RUN_GPG_TESTS
|
||||
tests = tests
|
||||
else
|
||||
tests =
|
||||
endif
|
||||
|
||||
SUBDIRS = ${assuan} src ${tests} doc ${complus} lang
|
||||
|
||||
# Fix the version of the spec file and create a file named VERSION
|
||||
# to be used for patch's Prereq: feature.
|
||||
dist-hook:
|
||||
@set -e; \
|
||||
sed -e 's/@pkg_version@/$(VERSION)/g' \
|
||||
$(top_srcdir)/gpgme.spec.in > $(distdir)/gpgme.spec
|
||||
echo "$(VERSION)" > $(distdir)/VERSION
|
1255
tags/gpgme-1.1.8/NEWS
Normal file
1255
tags/gpgme-1.1.8/NEWS
Normal file
File diff suppressed because it is too large
Load Diff
123
tags/gpgme-1.1.8/README
Normal file
123
tags/gpgme-1.1.8/README
Normal file
@ -0,0 +1,123 @@
|
||||
GPGME - GnuPG Made Easy
|
||||
---------------------------
|
||||
|
||||
Copyright 2004, 2006 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE.
|
||||
|
||||
|
||||
Introduction
|
||||
--------------
|
||||
|
||||
GnuPG Made Easy (GPGME) is a C language library that allows to add
|
||||
support for cryptography to a program. It is designed to make access
|
||||
to public key crypto engines like GnuPG or GpgSM easier for
|
||||
applications. GPGME provides a high-level crypto API for encryption,
|
||||
decryption, signing, signature verification and key management.
|
||||
|
||||
GPGME uses GnuPG and GpgSM as its backends to support OpenPGP and the
|
||||
Cryptographic Message Syntax (CMS).
|
||||
|
||||
GPGME runs best on GNU/Linux or *BSD systems. Other Unices may
|
||||
require small portability fixes, send us your patches.
|
||||
|
||||
See the file COPYING.LESSER and each file for copyright and warranty
|
||||
information.
|
||||
|
||||
|
||||
Installation
|
||||
--------------
|
||||
|
||||
See the file INSTALL for generic installation instructions.
|
||||
|
||||
Check that you have unmodified sources. See below on how to do this.
|
||||
Don't skip it - this is an important step!
|
||||
|
||||
To build GPGME, you need to install libgpg-error. You need at least
|
||||
libgpg-error 0.5.
|
||||
|
||||
For support of the OpenPGP protocol (default), you should use the
|
||||
latest version of GnuPG 1.2 or 1.4, available at:
|
||||
ftp://ftp.gnupg.org/gcrypt/gnupg/
|
||||
|
||||
You need at least GnuPG 1.2.2.
|
||||
|
||||
If configure can't find the `gpg' binary in your path, you can specify
|
||||
the location with the --with-gpg=/path/to/gpg argument to configure.
|
||||
|
||||
For support of the CMS (Cryptographic Message Syntax) protocol, you
|
||||
need the latest CVS version of GnuPG 1.9, which is available in the
|
||||
GnuPG repository:
|
||||
http://www.gnupg.org/download/cvs_access.html
|
||||
Use the tag `GNUPG-1-9-BRANCH'. There are also snapshots available at:
|
||||
ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/
|
||||
|
||||
You need at least GpgSM 1.9.6.
|
||||
|
||||
If configure can't find the `gpgsm' binary in your path, you can
|
||||
specify the location with the --with-gpgsm=/path/to/gpgsm argument to
|
||||
configure.
|
||||
|
||||
For building the CVS version of GPGME please see the file README.CVS
|
||||
for more information.
|
||||
|
||||
|
||||
How to Verify the Source
|
||||
--------------------------
|
||||
|
||||
In order to check that the version of GPGME which you are going to
|
||||
install is an original and unmodified one, you can do it in one of the
|
||||
following ways:
|
||||
|
||||
a) If you have a trusted Version of GnuPG installed, you can simply check
|
||||
the supplied signature:
|
||||
|
||||
$ gpg --verify gpgme-x.y.z.tar.gz.sig
|
||||
|
||||
This checks that the detached signature gpgme-x.y.z.tar.gz.sig is
|
||||
indeed a a signature of gpgme-x.y.z.tar.gz. The key used to create
|
||||
this signature is either of:
|
||||
|
||||
"pub 1024D/57548DCD 1998-07-07 Werner Koch (gnupg sig) <dd9jn@gnu.org>"
|
||||
"pub 1024D/87978569 1999-05-13
|
||||
Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
|
||||
Marcus Brinkmann <mb@g10code.com>"
|
||||
|
||||
If you do not have this key, you can get it from any keyserver. You
|
||||
have to make sure that this is really the key and not a faked one.
|
||||
You can do this by comparing the output of:
|
||||
|
||||
$ gpg --fingerprint 0x57548DCD
|
||||
|
||||
with the fingerprint published elsewhere.
|
||||
|
||||
b) If you don't have any of the above programs, you have to verify
|
||||
the SHA1 checksum:
|
||||
|
||||
$ sha1sum gpgme-x.y.z.tar.gz
|
||||
|
||||
This should yield an output _similar_ to this:
|
||||
|
||||
fd9351b26b3189c1d577f0970f9dcadc3412def1 gpgme-x.y.z.tar.gz
|
||||
|
||||
Now check that this checksum is _exactly_ the same as the one
|
||||
published via the announcement list and probably via Usenet.
|
||||
|
||||
|
||||
Documentation
|
||||
---------------
|
||||
|
||||
For information how to use the library you can read the info manual,
|
||||
which is also a reference book, in the doc/ directory. The programs
|
||||
in the tests/gpg/ directory may also prove useful.
|
||||
|
||||
Please subscribe to the gnupg-devel@gnupg.org mailing list if you want
|
||||
to do serious work.
|
||||
|
51
tags/gpgme-1.1.8/README.SVN
Normal file
51
tags/gpgme-1.1.8/README.SVN
Normal file
@ -0,0 +1,51 @@
|
||||
If you are building from Subversion, run the script
|
||||
|
||||
./autogen.sh
|
||||
|
||||
first, to make sure that you have all the necessary maintainer tools
|
||||
are installed and to build the actual configuration files. If you
|
||||
have just updated from SVN, you should add the option "--force" to
|
||||
autogen.sh so that meta data from SVN is noticed. Then run
|
||||
|
||||
./configure --enable-maintainer-mode
|
||||
|
||||
followed by the usual make.
|
||||
|
||||
If autogen.sh complains about insufficient versions of the required
|
||||
tools, or the tools are not installed, you may use environment
|
||||
variables to override the default tool names:
|
||||
|
||||
AUTOMAKE_SUFFIX is used as a suffix for all tools from the automake
|
||||
package. For example
|
||||
AUTOMAKE_SUFFIX="-1.7" ./autogen.sh
|
||||
uses "automake-1.7" and "aclocal-1.7.
|
||||
AUTOMAKE_PREFIX is used as a prefix for all tools from the automake
|
||||
page and may be combined with AUTOMAKE_SUFFIX. e.g.:
|
||||
AUTOMAKE_PREFIX=/usr/foo/bin ./autogen.sh
|
||||
uses "automake" and "aclocal" in the /usr/foo/bin
|
||||
directory.
|
||||
AUTOCONF_SUFFIX is used as a suffix for all tools from the automake
|
||||
package
|
||||
AUTOCONF_PREFIX is used as a prefix for all tools from the automake
|
||||
package
|
||||
GETTEXT_SUFFIX is used as a suffix for all tools from the gettext
|
||||
package
|
||||
GETTEXT_PREFIX is used as a prefix for all tools from the gettext
|
||||
package
|
||||
|
||||
It is also possible to use the variable name AUTOMAKE, AUTOCONF,
|
||||
ACLOCAL, AUTOHEADER, GETTEXT and MSGMERGE to directly specify the name
|
||||
of the programs to run. It is however better to use the suffix and
|
||||
prefix forms as described above because that does not require
|
||||
knowledge about the actual tools used by autgen.sh.
|
||||
|
||||
|
||||
Please don't use autopoint, libtoolize or autoreconf unless you are
|
||||
the current maintainer and want to update the standard configuration
|
||||
files. All those files should be in the SVN and only updated manually
|
||||
if the maintainer decides that newer versions are required. The
|
||||
maintainer should also make sure that the required version of automake
|
||||
et al. are properly indicated at the top of configure.ac and take care
|
||||
to copy the files and not merely use symlinks.
|
||||
|
||||
|
33
tags/gpgme-1.1.8/THANKS
Normal file
33
tags/gpgme-1.1.8/THANKS
Normal file
@ -0,0 +1,33 @@
|
||||
For a list of the authors of the source code of GPGME, please see the
|
||||
file AUTHORS. The following people supported GPGME development in
|
||||
various ways (for example by finding bugs or giving advice), and we
|
||||
want to thank them for their help. If we forgot you, please let us
|
||||
know.
|
||||
|
||||
Adriaan de Groot adridg@cs.kun.nl
|
||||
Albrecht Dreß albrecht.dress@arcor.de
|
||||
Alfons Hoogervorst alfons@proteus.demon.nl
|
||||
Daniel Mueller daniel@danm.de
|
||||
Enno Cramer uebergeek@web.de
|
||||
Frank Heckenbach frank@g-n-u.de
|
||||
Igor Belyi gpgme@katehok.ac93.org
|
||||
Jan-Oliver Wagner jan@intevation.de
|
||||
Johannes Poehlmann jhp@caldera.de
|
||||
Jose C. García Sogo jose@jaimedelamo.eu.org
|
||||
Mark Mutz mutz@kde.org
|
||||
Miguel Coca mcoca@gnu.org
|
||||
Noel Torres envite@rolamasao.org
|
||||
Stéphane Corthésy stephane@sente.ch
|
||||
Timo Schulz twoaday@freakmail.de
|
||||
Tommy Reynolds reynolds@redhat.com
|
||||
|
||||
|
||||
Copyright 2001, 2002, 2004 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
206
tags/gpgme-1.1.8/TODO
Normal file
206
tags/gpgme-1.1.8/TODO
Normal file
@ -0,0 +1,206 @@
|
||||
Hey Emacs, this is -*- outline -*- mode!
|
||||
|
||||
* Before release:
|
||||
** Figure out if _gpgme_io_pipe should pre-create reader/writer and if we
|
||||
then can use !start_it in most invocations. Note that gpgme_io_dup
|
||||
probably should always use !start_it, because currently it will
|
||||
always create reader/writer if they don't exist(!?).
|
||||
** Some gpg tests fail with gpg 1.3.4-cvs (gpg/t-keylist-sig)
|
||||
The test is currently disabled there and in gpg/t-import.
|
||||
** When gpg supports it, write binary subpackets directly,
|
||||
and parse SUBPACKET status lines.
|
||||
** A few months after 1.1.7:
|
||||
Remove GPGME_CONF_PATHNAME macro.
|
||||
|
||||
* ABI's to break:
|
||||
** gpgme_edit_cb_t: Add "processed" return argument
|
||||
(see edit.c::command_handler).
|
||||
** I/O and User Data could be made extensible. But this can be done
|
||||
without breaking the ABI hopefully.
|
||||
* All enums that should be enums need to have a maximum value to ensure
|
||||
a certain minimum width for extensibility.
|
||||
** Compatibility interfaces that can be removed in future versions:
|
||||
*** gpgme_data_new_from_filepart
|
||||
*** gpgme_data_new_from_file
|
||||
*** gpgme_data_new_with_read_cb
|
||||
*** gpgme_data_rewind
|
||||
*** gpgme_op_import_ext
|
||||
*** gpgme_get_sig_key
|
||||
*** gpgme_get_sig_ulong_attr
|
||||
*** gpgme_get_sig_string_attr
|
||||
*** GPGME_SIG_STAT_*
|
||||
*** gpgme_get_sig_status
|
||||
*** gpgme_trust_item_release
|
||||
*** gpgme_trust_item_get_string_attr
|
||||
*** gpgme_trust_item_get_ulong_attr
|
||||
*** gpgme_attr_t
|
||||
*** All Gpgme* typedefs.
|
||||
|
||||
|
||||
* Thread support:
|
||||
** When GNU Pth supports sendmsg/recvmsg, wrap them properly.
|
||||
** Without timegm (3) support our ISO time parser is not thread safe.
|
||||
There is a configure time warning, though.
|
||||
|
||||
* New features:
|
||||
** Flow control for data objects.
|
||||
Currently, gpgme_data_t objects are assumed to be blocking. To
|
||||
break this assumption, we need either (A) a way for an user I/O
|
||||
callback to store the current operation in a continuation that can
|
||||
be resumed later. While the continuation exists, file descriptors
|
||||
associated with this operation must be removed from their
|
||||
respective event loop. or (B) a way for gpgme data objects to be
|
||||
associated with a waitable object, that can be registered with the
|
||||
user event loop. Neither is particularly simple.
|
||||
** Extended notation support. When gpg supports arbitrary binary
|
||||
notation data, provide a user interface for that.
|
||||
** notification system
|
||||
We need a simple notification system, probably a simple callback
|
||||
with a string and some optional arguments. This is for example
|
||||
required to notify an application of a changed smartcard, The
|
||||
application can then do whatever is required. There are other
|
||||
usages too. This notfication system should be independent of any
|
||||
contextes of course.
|
||||
** --learn-code support
|
||||
This might be integrated with import. we still need to work out how
|
||||
to learn a card when gpg and gpgsm have support for smartcards.
|
||||
** Might need a stat() for data objects and use it for length param to gpg.
|
||||
** Implement support for photo ids.
|
||||
** Allow selection of subkeys
|
||||
** Allow to return time stamps in ISO format
|
||||
This allows us to handle years later than 2037 properly. With the
|
||||
time_t interface they are all mapped to 2037-12-31
|
||||
** New features requested by our dear users, but rejected or left for
|
||||
later consideration:
|
||||
*** Allow to export secret keys.
|
||||
Rejected because this is conceptually flawed. Secret keys on a
|
||||
smart card can not be exported, for example.
|
||||
*** Selecting the key ring, setting the version or comment in output.
|
||||
Rejected because the naive implementation is engine specific, the
|
||||
configuration is part of the engine's configuration or readily
|
||||
worked around in a different way
|
||||
*** Selecting the symmetric cipher.
|
||||
*** Exchanging keys with key servers.
|
||||
|
||||
* Documentation
|
||||
** Document validity and trust issues.
|
||||
** In gpgme.texi: Register callbacks under the right letter in the index.
|
||||
|
||||
* Engines
|
||||
** Do not create/destroy engines, but create engine and then reset it.
|
||||
Internally the reset operation still spawns a new engine process,
|
||||
but this can be replaced with a reset later. Also, be very sure to
|
||||
release everything properly at a reset and at an error. Think hard
|
||||
about where to guarantee what (ie, what happens if start fails, are
|
||||
the fds unregistered immediately - i think so?)
|
||||
Note that we need support in gpgsm to set include-certs to default
|
||||
as RESET does not reset it.
|
||||
** Optimize the case where a data object has 0an underlying fd we can pass
|
||||
directly to the engine. This will be automatic with socket I/O and
|
||||
descriptor passing.
|
||||
** Move code common to all engines up from gpg to engine.
|
||||
** engine operations can return General Error on unknown protocol
|
||||
(it's an internal error, as select_protocol checks already).
|
||||
** When server mode is implemented properly, more care has to be taken to
|
||||
release all resources on error (for example to free assuan_cmd).
|
||||
* GPG breakage:
|
||||
** gpg 1.4.2 lacks error reporting if sign/encrypt with revoked key.
|
||||
** gpg 1.4.2 does crappy error reporting (namely none at all) when
|
||||
smart card is missing for sign operation:
|
||||
[GNUPG:] CARDCTRL 4
|
||||
gpg: selecting openpgp failed: ec=6.110
|
||||
gpg: signing failed: general error
|
||||
[GNUPG:] BEGIN_ENCRYPTION 2 10
|
||||
gpg: test: sign+encrypt failed: general error
|
||||
** Without agent and with wrong passphrase, gpg 1.4.2 enters into an
|
||||
infinite loop.
|
||||
** Use correct argv[0]
|
||||
In rungpg.c:build_argv we use
|
||||
argv[argc] = strdup ("gpg"); /* argv[0] */
|
||||
This should be changed to take the real file name used in account.
|
||||
|
||||
|
||||
* Operations
|
||||
** Include cert values -2, -1, 0 and 1 should be defined as macros.
|
||||
** If an operation failed, make sure that the result functions don't return
|
||||
corrupt partial information. !!!
|
||||
NOTE: The EOF status handler is not called in this case !!!
|
||||
** Verify must not fail on NODATA premature if auto-key-retrieval failed.
|
||||
It should not fail silently if it knows there is an error. !!!
|
||||
** All operations: Better error reporting. !!
|
||||
** Export status handler need much more work. !!!
|
||||
** Import should return a useful error when one happened.
|
||||
*** Import does not take notice of NODATA status report.
|
||||
*** When GPGSM does issue IMPORT_OK status reports, make sure to check for
|
||||
them in tests/gpgs m/t-import.c.
|
||||
** Verify can include info about version/algo/class, but currently
|
||||
this is only available for gpg, not gpgsm.
|
||||
** Return ENC_TO output in verify result. Again, this is not available
|
||||
for gpgsm.
|
||||
** Genkey should return something more useful than General_Error.
|
||||
** If possible, use --file-setsize to set the file size for proper progress
|
||||
callback handling. Write data interface for file size.
|
||||
** Optimize the file descriptor list, so the number of open fds is
|
||||
always known easily.
|
||||
** Encryption: It should be verified that the behaviour for partially untrusted
|
||||
recipients is correct.
|
||||
** When GPG issues INV_something for invalid signers, catch them.
|
||||
|
||||
* Error Values
|
||||
** Map ASSUAN/GpgSM ERR error values in a better way than is done now. !!
|
||||
** Some error values should identify the source more correctly (mostly error
|
||||
values derived from status messages).
|
||||
** In rungpg.c we need to check the version of the engine
|
||||
This requires a way to get the cached version number from the
|
||||
engine layer.
|
||||
|
||||
|
||||
* Tests
|
||||
** Write a fake gpg-agent so that we can supply known passphrases to
|
||||
gpgsm and setup the configuration files to use the agent. Without
|
||||
this we are testing a currently running gpg-agent which is not a
|
||||
clever idea. !
|
||||
** t-data
|
||||
*** Test gpgme_data_release_and_get_mem.
|
||||
*** Test gpgme_data_seek for invalid types.
|
||||
** t-keylist
|
||||
Write a test for ext_keylist.
|
||||
** Test reading key signatures.
|
||||
|
||||
* Debug
|
||||
** Tracepoints should be added at: Every public interface enter/leave,
|
||||
before and in every callback, at major decision points, at every
|
||||
internal data point which might easily be observed by the outside
|
||||
(system handles). We also trace handles and I/O support threads in
|
||||
the w32 implementation because that's fragile code.
|
||||
Files left to do:
|
||||
data-fd.c data-mem.c data-stream.c data-user.c debug.c rungpg.c
|
||||
engine.c engine-gpgsm.c funopen.c w32-glib-io.c wait.c
|
||||
wait-global.c wait-private.c wait-user.c op-support.c decrypt.c
|
||||
decrypt-verify.c delete.c edit.c encrypt.c encrypt-sign.c export.c
|
||||
genkey.c import.c key.c keylist.c passphrase.c progress.c signers.c
|
||||
sig-notation.c trust-item.c trustlist.c verify.c
|
||||
** Handle malloc and vasprintf errors. But decide first if they should be
|
||||
ignored (and logged with 255?!), or really be assertions. !
|
||||
|
||||
* Build suite
|
||||
** Make sure everything is cleaned correctly (esp. test area).
|
||||
** Enable AC_CONFIG_MACRO_DIR and bump up autoconf version requirement.
|
||||
(To fix "./autogen.sh; ./configure --enable-maintainer-mode; touch
|
||||
configure.ac; make"). Currently worked around with ACLOCAL_AMFLAGS???
|
||||
|
||||
* Error checking
|
||||
** engine-gpgsm, with-validation
|
||||
Add error checking some time after releasing a new gpgsm.
|
||||
|
||||
|
||||
Copyright 2004, 2005 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE.
|
86
tags/gpgme-1.1.8/acinclude.m4
Normal file
86
tags/gpgme-1.1.8/acinclude.m4
Normal file
@ -0,0 +1,86 @@
|
||||
dnl Macros to configure GPGME
|
||||
dnl Copyright (C) 2004 g10 Code GmbH
|
||||
dnl
|
||||
dnl This file is part of GPGME.
|
||||
dnl
|
||||
dnl GPGME is free software; you can redistribute it and/or modify it
|
||||
dnl under the terms of the GNU Lesser General Public License as
|
||||
dnl published by the Free Software Foundation; either version 2.1 of the
|
||||
dnl License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl GPGME is distributed in the hope that it will be useful, but WITHOUT
|
||||
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
dnl Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
dnl GNUPG_FIX_HDR_VERSION(FILE, NAME)
|
||||
dnl Make the version number stored in NAME in the header file FILE the
|
||||
dnl same as the one here. This is easier than to have a .in file just
|
||||
dnl for one substitution.
|
||||
dnl We must use a temp file in the current directory because make
|
||||
dnl distcheck installs all sourcefiles RO.
|
||||
dnl (wk 2001-12-18)
|
||||
AC_DEFUN([GNUPG_FIX_HDR_VERSION],
|
||||
[ sed "s/^#define $2 \".*/#define $2 \"$VERSION\"/" $srcdir/$1 > fixhdr.tmp
|
||||
if cmp -s $srcdir/$1 fixhdr.tmp 2>/dev/null; then
|
||||
rm -f fixhdr.tmp
|
||||
else
|
||||
rm -f $srcdir/$1
|
||||
if mv fixhdr.tmp $srcdir/$1 ; then
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([[
|
||||
***
|
||||
*** Failed to fix the version string macro $2 in $1.
|
||||
*** The old file has been saved as fixhdr.tmp
|
||||
***]])
|
||||
fi
|
||||
AC_MSG_WARN([fixed the $2 macro in $1])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl GNUPG_CHECK_VA_COPY()
|
||||
dnl Do some check on how to implement va_copy.
|
||||
dnl May define MUST_COPY_VA_BY_VAL.
|
||||
dnl Actual test code taken from glib-1.1.
|
||||
AC_DEFUN([GNUPG_CHECK_VA_COPY],
|
||||
[ AC_MSG_CHECKING(whether va_lists must be copied by value)
|
||||
AC_CACHE_VAL(gnupg_cv_must_copy_va_byval,[
|
||||
if test "$cross_compiling" = yes; then
|
||||
gnupg_cv_must_copy_va_byval=no
|
||||
else
|
||||
gnupg_cv_must_copy_va_byval=no
|
||||
AC_TRY_RUN([
|
||||
#include <stdarg.h>
|
||||
void f (int i, ...)
|
||||
{
|
||||
va_list args1, args2;
|
||||
va_start (args1, i);
|
||||
args2 = args1;
|
||||
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
|
||||
exit (1);
|
||||
va_end (args1);
|
||||
va_end (args2);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
f (0, 42);
|
||||
return 0;
|
||||
}
|
||||
],gnupg_cv_must_copy_va_byval=yes)
|
||||
fi
|
||||
])
|
||||
if test "$gnupg_cv_must_copy_va_byval" = yes; then
|
||||
AC_DEFINE(MUST_COPY_VA_BYVAL,1,[used to implement the va_copy macro])
|
||||
fi
|
||||
if test "$cross_compiling" = yes; then
|
||||
AC_MSG_RESULT(assuming $gnupg_cv_must_copy_va_byval)
|
||||
else
|
||||
AC_MSG_RESULT($gnupg_cv_must_copy_va_byval)
|
||||
fi
|
||||
])
|
1045
tags/gpgme-1.1.8/assuan/ChangeLog
Normal file
1045
tags/gpgme-1.1.8/assuan/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
53
tags/gpgme-1.1.8/assuan/Makefile.am
Normal file
53
tags/gpgme-1.1.8/assuan/Makefile.am
Normal file
@ -0,0 +1,53 @@
|
||||
# Assuan Makefile
|
||||
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of Assuan.
|
||||
#
|
||||
# Assuan 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.1 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# Assuan 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 program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
EXTRA_DIST = mkerrors
|
||||
INCLUDES = -I.. -I$(top_srcdir)/src
|
||||
BUILT_SOURCES = assuan-errors.c
|
||||
MOSTLYCLEANFILES = assuan-errors.c
|
||||
|
||||
noinst_LTLIBRARIES = libassuan.la
|
||||
|
||||
AM_CPPFLAGS = -D_ASSUAN_IN_GPGME_BUILD_ASSUAN
|
||||
|
||||
#libassuan_la_LDFLAGS =
|
||||
libassuan_la_SOURCES = \
|
||||
assuan.h \
|
||||
assuan-defs.h \
|
||||
assuan-util.c \
|
||||
assuan-errors.c \
|
||||
assuan-buffer.c \
|
||||
assuan-handler.c \
|
||||
assuan-inquire.c \
|
||||
assuan-listen.c \
|
||||
assuan-connect.c \
|
||||
assuan-client.c \
|
||||
assuan-pipe-server.c \
|
||||
assuan-socket-server.c \
|
||||
assuan-pipe-connect.c \
|
||||
assuan-socket-connect.c \
|
||||
assuan-uds.c \
|
||||
assuan-io.c \
|
||||
assuan-logging.c \
|
||||
assuan-socket.c
|
||||
|
||||
assuan-errors.c : assuan.h mkerrors
|
||||
$(srcdir)/mkerrors < $(srcdir)/assuan.h > assuan-errors.c
|
45
tags/gpgme-1.1.8/assuan/README.1st
Normal file
45
tags/gpgme-1.1.8/assuan/README.1st
Normal file
@ -0,0 +1,45 @@
|
||||
This is a modified copy of the libassuan library. Don't modify it,
|
||||
but instead modify the original Assuan library and merge the changes
|
||||
back into this copy.
|
||||
|
||||
The changes to the original libassuan, that have to preserved when
|
||||
updating this directory, are:
|
||||
|
||||
* Makefile.am
|
||||
** Build the library with libtool as a convenience library, which can
|
||||
be linked into the shared library GPGME.
|
||||
** Do not install the library or the header file.
|
||||
** Define -D_ASSUAN_IN_GPGME_BUILD_ASSUAN to wrap some POSIX functions
|
||||
with ATH replacements.
|
||||
|
||||
* assuan.h
|
||||
** Preserve the block between "Begin/End GPGME specific modifications".
|
||||
In particular make sure that
|
||||
#define _ASSUAN_EXT_SYM_PREFIX _gpgme_
|
||||
#define _ASSUAN_NO_PTH
|
||||
#define _ASSUAN_NO_FIXED_SIGNALS
|
||||
#define _ASSUAN_USE_DOUBLE_FORK
|
||||
are defined. This puts all exported Assuan functions in the _gpgme
|
||||
namespace. It also wraps all system functions that are wrapped by
|
||||
GNU Pth to _gpgme wrappers.
|
||||
|
||||
* assuan-io-pth.c
|
||||
We don't need this file as GPGME doesn't use sendmsg and recvmsg.
|
||||
If it would, we would need to pick up the W32 implementation.
|
||||
|
||||
* assuan-io.c
|
||||
** _assuan_simple_read() and _assuan_simple_write() must always use
|
||||
read()/write() (which actually translates to _gpgme_io_read() and
|
||||
_gpgme_io_write()). _assuan_close must always() use close() (which
|
||||
translates to _gpgme_io_close()).
|
||||
|
||||
|
||||
Copyright 2004, 2007 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
550
tags/gpgme-1.1.8/assuan/assuan-buffer.c
Normal file
550
tags/gpgme-1.1.8/assuan/assuan-buffer.c
Normal file
@ -0,0 +1,550 @@
|
||||
/* assuan-buffer.c - read and send data
|
||||
* Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
#include <process.h>
|
||||
#endif
|
||||
#include "assuan-defs.h"
|
||||
|
||||
|
||||
/* Extended version of write(2) to guarantee that all bytes are
|
||||
written. Returns 0 on success or -1 and ERRNO on failure. */
|
||||
static int
|
||||
writen (assuan_context_t ctx, const char *buffer, size_t length)
|
||||
{
|
||||
while (length)
|
||||
{
|
||||
ssize_t nwritten = ctx->io->writefnc (ctx, buffer, length);
|
||||
|
||||
if (nwritten < 0)
|
||||
{
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
return -1; /* write error */
|
||||
}
|
||||
length -= nwritten;
|
||||
buffer += nwritten;
|
||||
}
|
||||
return 0; /* okay */
|
||||
}
|
||||
|
||||
/* Read an entire line. Returns 0 on success or -1 and ERRNo on
|
||||
failure. EOF is indictated by setting the integer at address
|
||||
R_EOF. */
|
||||
static int
|
||||
readline (assuan_context_t ctx, char *buf, size_t buflen,
|
||||
int *r_nread, int *r_eof)
|
||||
{
|
||||
size_t nleft = buflen;
|
||||
char *p;
|
||||
|
||||
*r_eof = 0;
|
||||
*r_nread = 0;
|
||||
while (nleft > 0)
|
||||
{
|
||||
ssize_t n = ctx->io->readfnc (ctx, buf, nleft);
|
||||
|
||||
if (n < 0)
|
||||
{
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
return -1; /* read error */
|
||||
}
|
||||
else if (!n)
|
||||
{
|
||||
*r_eof = 1;
|
||||
break; /* allow incomplete lines */
|
||||
}
|
||||
p = buf;
|
||||
nleft -= n;
|
||||
buf += n;
|
||||
*r_nread += n;
|
||||
|
||||
p = memrchr (p, '\n', n);
|
||||
if (p)
|
||||
break; /* at least one full line available - that's enough for now */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Function returns an Assuan error. */
|
||||
assuan_error_t
|
||||
_assuan_read_line (assuan_context_t ctx)
|
||||
{
|
||||
char *line = ctx->inbound.line;
|
||||
int nread, atticlen;
|
||||
int rc;
|
||||
char *endp = 0;
|
||||
|
||||
if (ctx->inbound.eof)
|
||||
return _assuan_error (-1);
|
||||
|
||||
atticlen = ctx->inbound.attic.linelen;
|
||||
if (atticlen)
|
||||
{
|
||||
memcpy (line, ctx->inbound.attic.line, atticlen);
|
||||
ctx->inbound.attic.linelen = 0;
|
||||
|
||||
endp = memchr (line, '\n', atticlen);
|
||||
if (endp)
|
||||
/* Found another line in the attic. */
|
||||
{
|
||||
rc = 0;
|
||||
nread = atticlen;
|
||||
atticlen = 0;
|
||||
}
|
||||
else
|
||||
/* There is pending data but not a full line. */
|
||||
{
|
||||
assert (atticlen < LINELENGTH);
|
||||
rc = readline (ctx, line + atticlen,
|
||||
LINELENGTH - atticlen, &nread, &ctx->inbound.eof);
|
||||
}
|
||||
}
|
||||
else
|
||||
/* No pending data. */
|
||||
rc = readline (ctx, line, LINELENGTH,
|
||||
&nread, &ctx->inbound.eof);
|
||||
if (rc)
|
||||
{
|
||||
if (ctx->log_fp)
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [Error: %s (%d)]\n",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd,
|
||||
strerror (errno), errno);
|
||||
return _assuan_error (ASSUAN_Read_Error);
|
||||
}
|
||||
if (!nread)
|
||||
{
|
||||
assert (ctx->inbound.eof);
|
||||
if (ctx->log_fp)
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [EOF]\n",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
return _assuan_error (-1);
|
||||
}
|
||||
|
||||
ctx->inbound.attic.pending = 0;
|
||||
nread += atticlen;
|
||||
|
||||
if (! endp)
|
||||
endp = memchr (line, '\n', nread);
|
||||
|
||||
if (endp)
|
||||
{
|
||||
unsigned monitor_result;
|
||||
int n = endp - line + 1;
|
||||
|
||||
if (n < nread)
|
||||
/* LINE contains more than one line. We copy it to the attic
|
||||
now as handlers are allowed to modify the passed
|
||||
buffer. */
|
||||
{
|
||||
int len = nread - n;
|
||||
memcpy (ctx->inbound.attic.line, endp + 1, len);
|
||||
ctx->inbound.attic.pending = memrchr (endp + 1, '\n', len) ? 1 : 0;
|
||||
ctx->inbound.attic.linelen = len;
|
||||
}
|
||||
|
||||
if (endp != line && endp[-1] == '\r')
|
||||
endp --;
|
||||
*endp = 0;
|
||||
|
||||
ctx->inbound.linelen = endp - line;
|
||||
|
||||
monitor_result = (ctx->io_monitor
|
||||
? ctx->io_monitor (ctx, 0,
|
||||
ctx->inbound.line,
|
||||
ctx->inbound.linelen)
|
||||
: 0);
|
||||
if ( (monitor_result & 2) )
|
||||
ctx->inbound.linelen = 0;
|
||||
|
||||
if (ctx->log_fp && !(monitor_result & 1))
|
||||
{
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- ",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
if (ctx->confidential)
|
||||
fputs ("[Confidential data not shown]", ctx->log_fp);
|
||||
else
|
||||
_assuan_log_print_buffer (ctx->log_fp,
|
||||
ctx->inbound.line,
|
||||
ctx->inbound.linelen);
|
||||
putc ('\n', ctx->log_fp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ctx->log_fp)
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [Invalid line]\n",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
*line = 0;
|
||||
ctx->inbound.linelen = 0;
|
||||
return _assuan_error (ctx->inbound.eof
|
||||
? ASSUAN_Line_Not_Terminated
|
||||
: ASSUAN_Line_Too_Long);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Read the next line from the client or server and return a pointer
|
||||
in *LINE to a buffer holding the line. LINELEN is the length of
|
||||
*LINE. The buffer is valid until the next read operation on it.
|
||||
The caller may modify the buffer. The buffer is invalid (i.e. must
|
||||
not be used) if an error is returned.
|
||||
|
||||
Returns 0 on success or an assuan error code.
|
||||
See also: assuan_pending_line().
|
||||
*/
|
||||
assuan_error_t
|
||||
assuan_read_line (assuan_context_t ctx, char **line, size_t *linelen)
|
||||
{
|
||||
assuan_error_t err;
|
||||
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
err = _assuan_read_line (ctx);
|
||||
*line = ctx->inbound.line;
|
||||
*linelen = ctx->inbound.linelen;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
/* Return true if a full line is buffered (i.e. an entire line may be
|
||||
read without any I/O). */
|
||||
int
|
||||
assuan_pending_line (assuan_context_t ctx)
|
||||
{
|
||||
return ctx && ctx->inbound.attic.pending;
|
||||
}
|
||||
|
||||
|
||||
assuan_error_t
|
||||
_assuan_write_line (assuan_context_t ctx, const char *prefix,
|
||||
const char *line, size_t len)
|
||||
{
|
||||
assuan_error_t rc = 0;
|
||||
size_t prefixlen = prefix? strlen (prefix):0;
|
||||
unsigned int monitor_result;
|
||||
|
||||
/* Make sure that the line is short enough. */
|
||||
if (len + prefixlen + 2 > ASSUAN_LINELENGTH)
|
||||
{
|
||||
if (ctx->log_fp)
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> "
|
||||
"[supplied line too long -truncated]\n",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
if (prefixlen > 5)
|
||||
prefixlen = 5;
|
||||
if (len > ASSUAN_LINELENGTH - prefixlen - 2)
|
||||
len = ASSUAN_LINELENGTH - prefixlen - 2 - 1;
|
||||
}
|
||||
|
||||
monitor_result = (ctx->io_monitor
|
||||
? ctx->io_monitor (ctx, 1, line, len)
|
||||
: 0);
|
||||
|
||||
/* Fixme: we should do some kind of line buffering. */
|
||||
if (ctx->log_fp && !(monitor_result & 1))
|
||||
{
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
if (ctx->confidential)
|
||||
fputs ("[Confidential data not shown]", ctx->log_fp);
|
||||
else
|
||||
{
|
||||
if (prefixlen)
|
||||
_assuan_log_print_buffer (ctx->log_fp, prefix, prefixlen);
|
||||
_assuan_log_print_buffer (ctx->log_fp, line, len);
|
||||
}
|
||||
putc ('\n', ctx->log_fp);
|
||||
}
|
||||
|
||||
if (prefixlen && !(monitor_result & 2))
|
||||
{
|
||||
rc = writen (ctx, prefix, prefixlen);
|
||||
if (rc)
|
||||
rc = _assuan_error (ASSUAN_Write_Error);
|
||||
}
|
||||
if (!rc && !(monitor_result & 2))
|
||||
{
|
||||
rc = writen (ctx, line, len);
|
||||
if (rc)
|
||||
rc = _assuan_error (ASSUAN_Write_Error);
|
||||
if (!rc)
|
||||
{
|
||||
rc = writen (ctx, "\n", 1);
|
||||
if (rc)
|
||||
rc = _assuan_error (ASSUAN_Write_Error);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
assuan_error_t
|
||||
assuan_write_line (assuan_context_t ctx, const char *line)
|
||||
{
|
||||
size_t len;
|
||||
const char *s;
|
||||
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
/* Make sure that we never take a LF from the user - this might
|
||||
violate the protocol. */
|
||||
s = strchr (line, '\n');
|
||||
len = s? (s-line) : strlen (line);
|
||||
|
||||
if (ctx->log_fp && s)
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> "
|
||||
"[supplied line contained a LF - truncated]\n",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
|
||||
return _assuan_write_line (ctx, NULL, line, len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Write out the data in buffer as datalines with line wrapping and
|
||||
percent escaping. This function is used for GNU's custom streams. */
|
||||
int
|
||||
_assuan_cookie_write_data (void *cookie, const char *buffer, size_t orig_size)
|
||||
{
|
||||
assuan_context_t ctx = cookie;
|
||||
size_t size = orig_size;
|
||||
char *line;
|
||||
size_t linelen;
|
||||
|
||||
if (ctx->outbound.data.error)
|
||||
return 0;
|
||||
|
||||
line = ctx->outbound.data.line;
|
||||
linelen = ctx->outbound.data.linelen;
|
||||
line += linelen;
|
||||
while (size)
|
||||
{
|
||||
unsigned int monitor_result;
|
||||
|
||||
/* Insert data line header. */
|
||||
if (!linelen)
|
||||
{
|
||||
*line++ = 'D';
|
||||
*line++ = ' ';
|
||||
linelen += 2;
|
||||
}
|
||||
|
||||
/* Copy data, keep space for the CRLF and to escape one character. */
|
||||
while (size && linelen < LINELENGTH-2-2)
|
||||
{
|
||||
if (*buffer == '%' || *buffer == '\r' || *buffer == '\n')
|
||||
{
|
||||
sprintf (line, "%%%02X", *(unsigned char*)buffer);
|
||||
line += 3;
|
||||
linelen += 3;
|
||||
buffer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
*line++ = *buffer++;
|
||||
linelen++;
|
||||
}
|
||||
size--;
|
||||
}
|
||||
|
||||
|
||||
monitor_result = (ctx->io_monitor
|
||||
? ctx->io_monitor (ctx, 1,
|
||||
ctx->outbound.data.line, linelen)
|
||||
: 0);
|
||||
|
||||
if (linelen >= LINELENGTH-2-2)
|
||||
{
|
||||
if (ctx->log_fp && !(monitor_result & 1))
|
||||
{
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
|
||||
if (ctx->confidential)
|
||||
fputs ("[Confidential data not shown]", ctx->log_fp);
|
||||
else
|
||||
_assuan_log_print_buffer (ctx->log_fp,
|
||||
ctx->outbound.data.line,
|
||||
linelen);
|
||||
putc ('\n', ctx->log_fp);
|
||||
}
|
||||
*line++ = '\n';
|
||||
linelen++;
|
||||
if ( !(monitor_result & 2)
|
||||
&& writen (ctx, ctx->outbound.data.line, linelen))
|
||||
{
|
||||
ctx->outbound.data.error = _assuan_error (ASSUAN_Write_Error);
|
||||
return 0;
|
||||
}
|
||||
line = ctx->outbound.data.line;
|
||||
linelen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ctx->outbound.data.linelen = linelen;
|
||||
return (int)orig_size;
|
||||
}
|
||||
|
||||
|
||||
/* Write out any buffered data
|
||||
This function is used for GNU's custom streams */
|
||||
int
|
||||
_assuan_cookie_write_flush (void *cookie)
|
||||
{
|
||||
assuan_context_t ctx = cookie;
|
||||
char *line;
|
||||
size_t linelen;
|
||||
unsigned int monitor_result;
|
||||
|
||||
if (ctx->outbound.data.error)
|
||||
return 0;
|
||||
|
||||
line = ctx->outbound.data.line;
|
||||
linelen = ctx->outbound.data.linelen;
|
||||
line += linelen;
|
||||
|
||||
monitor_result = (ctx->io_monitor
|
||||
? ctx->io_monitor (ctx, 1,
|
||||
ctx->outbound.data.line, linelen)
|
||||
: 0);
|
||||
|
||||
if (linelen)
|
||||
{
|
||||
if (ctx->log_fp && !(monitor_result & 1))
|
||||
{
|
||||
fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ",
|
||||
assuan_get_assuan_log_prefix (),
|
||||
(unsigned int)getpid (), ctx->inbound.fd);
|
||||
if (ctx->confidential)
|
||||
fputs ("[Confidential data not shown]", ctx->log_fp);
|
||||
else
|
||||
_assuan_log_print_buffer (ctx->log_fp,
|
||||
ctx->outbound.data.line, linelen);
|
||||
putc ('\n', ctx->log_fp);
|
||||
}
|
||||
*line++ = '\n';
|
||||
linelen++;
|
||||
if ( !(monitor_result & 2)
|
||||
&& writen (ctx, ctx->outbound.data.line, linelen))
|
||||
{
|
||||
ctx->outbound.data.error = _assuan_error (ASSUAN_Write_Error);
|
||||
return 0;
|
||||
}
|
||||
ctx->outbound.data.linelen = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assuan_send_data:
|
||||
* @ctx: An assuan context
|
||||
* @buffer: Data to send or NULL to flush
|
||||
* @length: length of the data to send/
|
||||
*
|
||||
* This function may be used by the server or the client to send data
|
||||
* lines. The data will be escaped as required by the Assuan protocol
|
||||
* and may get buffered until a line is full. To force sending the
|
||||
* data out @buffer may be passed as NULL (in which case @length must
|
||||
* also be 0); however when used by a client this flush operation does
|
||||
* also send the terminating "END" command to terminate the reponse on
|
||||
* a INQUIRE response. However, when assuan_transact() is used, this
|
||||
* function takes care of sending END itself.
|
||||
*
|
||||
* Return value: 0 on success or an error code
|
||||
**/
|
||||
|
||||
assuan_error_t
|
||||
assuan_send_data (assuan_context_t ctx, const void *buffer, size_t length)
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
if (!buffer && length)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
if (!buffer)
|
||||
{ /* flush what we have */
|
||||
_assuan_cookie_write_flush (ctx);
|
||||
if (ctx->outbound.data.error)
|
||||
return ctx->outbound.data.error;
|
||||
if (!ctx->is_server)
|
||||
return assuan_write_line (ctx, "END");
|
||||
}
|
||||
else
|
||||
{
|
||||
_assuan_cookie_write_data (ctx, buffer, length);
|
||||
if (ctx->outbound.data.error)
|
||||
return ctx->outbound.data.error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
assuan_error_t
|
||||
assuan_sendfd (assuan_context_t ctx, int fd)
|
||||
{
|
||||
/* It is explicitly allowed to use (NULL, -1) as a runtime test to
|
||||
check whether descriptor passing is available. */
|
||||
if (!ctx && fd == -1)
|
||||
#ifdef USE_DESCRIPTOR_PASSING
|
||||
return 0;
|
||||
#else
|
||||
return _assuan_error (ASSUAN_Not_Implemented);
|
||||
#endif
|
||||
|
||||
if (! ctx->io->sendfd)
|
||||
return set_error (ctx, Not_Implemented,
|
||||
"server does not support sending and receiving "
|
||||
"of file descriptors");
|
||||
return ctx->io->sendfd (ctx, fd);
|
||||
}
|
||||
|
||||
assuan_error_t
|
||||
assuan_receivefd (assuan_context_t ctx, int *fd)
|
||||
{
|
||||
if (! ctx->io->receivefd)
|
||||
return set_error (ctx, Not_Implemented,
|
||||
"server does not support sending and receiving "
|
||||
"of file descriptors");
|
||||
return ctx->io->receivefd (ctx, fd);
|
||||
}
|
234
tags/gpgme-1.1.8/assuan/assuan-client.c
Normal file
234
tags/gpgme-1.1.8/assuan/assuan-client.c
Normal file
@ -0,0 +1,234 @@
|
||||
/* assuan-client.c - client functions
|
||||
* Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
#define xtoi_1(p) (*(p) <= '9'? (*(p)- '0'): \
|
||||
*(p) <= 'F'? (*(p)-'A'+10):(*(p)-'a'+10))
|
||||
#define xtoi_2(p) ((xtoi_1(p) * 16) + xtoi_1((p)+1))
|
||||
|
||||
|
||||
assuan_error_t
|
||||
_assuan_read_from_server (assuan_context_t ctx, int *okay, int *off)
|
||||
{
|
||||
char *line;
|
||||
int linelen;
|
||||
assuan_error_t rc;
|
||||
|
||||
*okay = 0;
|
||||
*off = 0;
|
||||
do
|
||||
{
|
||||
rc = _assuan_read_line (ctx);
|
||||
if (rc)
|
||||
return rc;
|
||||
line = ctx->inbound.line;
|
||||
linelen = ctx->inbound.linelen;
|
||||
}
|
||||
while (*line == '#' || !linelen);
|
||||
|
||||
if (linelen >= 1
|
||||
&& line[0] == 'D' && line[1] == ' ')
|
||||
{
|
||||
*okay = 2; /* data line */
|
||||
*off = 2;
|
||||
}
|
||||
else if (linelen >= 1
|
||||
&& line[0] == 'S'
|
||||
&& (line[1] == '\0' || line[1] == ' '))
|
||||
{
|
||||
*okay = 4;
|
||||
*off = 1;
|
||||
while (line[*off] == ' ')
|
||||
++*off;
|
||||
}
|
||||
else if (linelen >= 2
|
||||
&& line[0] == 'O' && line[1] == 'K'
|
||||
&& (line[2] == '\0' || line[2] == ' '))
|
||||
{
|
||||
*okay = 1;
|
||||
*off = 2;
|
||||
while (line[*off] == ' ')
|
||||
++*off;
|
||||
}
|
||||
else if (linelen >= 3
|
||||
&& line[0] == 'E' && line[1] == 'R' && line[2] == 'R'
|
||||
&& (line[3] == '\0' || line[3] == ' '))
|
||||
{
|
||||
*okay = 0;
|
||||
*off = 3;
|
||||
while (line[*off] == ' ')
|
||||
++*off;
|
||||
}
|
||||
else if (linelen >= 7
|
||||
&& line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
|
||||
&& line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
|
||||
&& line[6] == 'E'
|
||||
&& (line[7] == '\0' || line[7] == ' '))
|
||||
{
|
||||
*okay = 3;
|
||||
*off = 7;
|
||||
while (line[*off] == ' ')
|
||||
++*off;
|
||||
}
|
||||
else if (linelen >= 3
|
||||
&& line[0] == 'E' && line[1] == 'N' && line[2] == 'D'
|
||||
&& (line[3] == '\0' || line[3] == ' '))
|
||||
{
|
||||
*okay = 5; /* end line */
|
||||
*off = 3;
|
||||
}
|
||||
else
|
||||
rc = _assuan_error (ASSUAN_Invalid_Response);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* assuan_transact:
|
||||
* @ctx: The Assuan context
|
||||
* @command: Command line to be send to the server
|
||||
* @data_cb: Callback function for data lines
|
||||
* @data_cb_arg: first argument passed to @data_cb
|
||||
* @inquire_cb: Callback function for a inquire response
|
||||
* @inquire_cb_arg: first argument passed to @inquire_cb
|
||||
* @status_cb: Callback function for a status response
|
||||
* @status_cb_arg: first argument passed to @status_cb
|
||||
*
|
||||
* FIXME: Write documentation
|
||||
*
|
||||
* Return value: 0 on success or error code. The error code may be
|
||||
* the one one returned by the server in error lines or from the
|
||||
* callback functions. Take care: When a callback returns an error
|
||||
* this function returns immediately with an error and thus the caller
|
||||
* will altter return an Assuan error (write erro in most cases).
|
||||
**/
|
||||
assuan_error_t
|
||||
assuan_transact (assuan_context_t ctx,
|
||||
const char *command,
|
||||
int (*data_cb)(void *, const void *, size_t),
|
||||
void *data_cb_arg,
|
||||
int (*inquire_cb)(void*, const char *),
|
||||
void *inquire_cb_arg,
|
||||
int (*status_cb)(void*, const char *),
|
||||
void *status_cb_arg)
|
||||
{
|
||||
assuan_error_t rc;
|
||||
int okay, off;
|
||||
char *line;
|
||||
int linelen;
|
||||
|
||||
rc = assuan_write_line (ctx, command);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if (*command == '#' || !*command)
|
||||
return 0; /* Don't expect a response for a comment line. */
|
||||
|
||||
again:
|
||||
rc = _assuan_read_from_server (ctx, &okay, &off);
|
||||
if (rc)
|
||||
return rc; /* error reading from server */
|
||||
|
||||
line = ctx->inbound.line + off;
|
||||
linelen = ctx->inbound.linelen - off;
|
||||
|
||||
if (!okay)
|
||||
{
|
||||
rc = atoi (line);
|
||||
if (rc > 0 && rc < 100)
|
||||
rc = _assuan_error (ASSUAN_Server_Fault);
|
||||
else if (rc > 0 && rc <= 405)
|
||||
rc = _assuan_error (rc);
|
||||
}
|
||||
else if (okay == 2)
|
||||
{
|
||||
if (!data_cb)
|
||||
rc = _assuan_error (ASSUAN_No_Data_Callback);
|
||||
else
|
||||
{
|
||||
char *s, *d;
|
||||
|
||||
for (s=d=line; linelen; linelen--)
|
||||
{
|
||||
if (*s == '%' && linelen > 2)
|
||||
{ /* handle escaping */
|
||||
s++;
|
||||
*d++ = xtoi_2 (s);
|
||||
s += 2;
|
||||
linelen -= 2;
|
||||
}
|
||||
else
|
||||
*d++ = *s++;
|
||||
}
|
||||
*d = 0; /* add a hidden string terminator */
|
||||
rc = data_cb (data_cb_arg, line, d - line);
|
||||
if (!rc)
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
else if (okay == 3)
|
||||
{
|
||||
if (!inquire_cb)
|
||||
{
|
||||
assuan_write_line (ctx, "END"); /* get out of inquire mode */
|
||||
_assuan_read_from_server (ctx, &okay, &off); /* dummy read */
|
||||
rc = _assuan_error (ASSUAN_No_Inquire_Callback);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = inquire_cb (inquire_cb_arg, line);
|
||||
if (!rc)
|
||||
rc = assuan_send_data (ctx, NULL, 0); /* flush and send END */
|
||||
if (!rc)
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
else if (okay == 4)
|
||||
{
|
||||
if (status_cb)
|
||||
rc = status_cb (status_cb_arg, line);
|
||||
if (!rc)
|
||||
goto again;
|
||||
}
|
||||
else if (okay == 5)
|
||||
{
|
||||
if (!data_cb)
|
||||
rc = _assuan_error (ASSUAN_No_Data_Callback);
|
||||
else
|
||||
{
|
||||
rc = data_cb (data_cb_arg, NULL, 0);
|
||||
if (!rc)
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
85
tags/gpgme-1.1.8/assuan/assuan-connect.c
Normal file
85
tags/gpgme-1.1.8/assuan/assuan-connect.c
Normal file
@ -0,0 +1,85 @@
|
||||
/* assuan-connect.c - Establish a connection (client)
|
||||
* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
/* Disconnect and release the context CTX. */
|
||||
void
|
||||
assuan_disconnect (assuan_context_t ctx)
|
||||
{
|
||||
if (ctx)
|
||||
{
|
||||
assuan_write_line (ctx, "BYE");
|
||||
ctx->finish_handler (ctx);
|
||||
ctx->deinit_handler (ctx);
|
||||
ctx->deinit_handler = NULL;
|
||||
_assuan_release_context (ctx);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the PID of the peer or -1 if not known. This function works
|
||||
in some situations where assuan_get_ucred fails. */
|
||||
pid_t
|
||||
assuan_get_pid (assuan_context_t ctx)
|
||||
{
|
||||
return (ctx && ctx->pid)? ctx->pid : -1;
|
||||
}
|
||||
|
||||
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
/* Return user credentials. PID, UID and GID amy be gived as NULL if
|
||||
you are not interested in this value. For getting the pid of the
|
||||
peer the assuan_get_pid is usually better suited. */
|
||||
assuan_error_t
|
||||
assuan_get_peercred (assuan_context_t ctx, pid_t *pid, uid_t *uid, gid_t *gid)
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
if (!ctx->peercred.valid)
|
||||
return _assuan_error (ASSUAN_General_Error);
|
||||
|
||||
#ifdef HAVE_SO_PEERCRED
|
||||
if (pid)
|
||||
*pid = ctx->peercred.pid;
|
||||
if (uid)
|
||||
*uid = ctx->peercred.uid;
|
||||
if (gid)
|
||||
*gid = ctx->peercred.gid;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_W32_SYSTEM */
|
332
tags/gpgme-1.1.8/assuan/assuan-defs.h
Normal file
332
tags/gpgme-1.1.8/assuan/assuan-defs.h
Normal file
@ -0,0 +1,332 @@
|
||||
/* assuan-defs.c - Internal definitions to Assuan
|
||||
* Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef ASSUAN_DEFS_H
|
||||
#define ASSUAN_DEFS_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include "assuan.h"
|
||||
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
#define DIRSEP_C '/'
|
||||
#else
|
||||
#define DIRSEP_C '\\'
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
#define AF_LOCAL AF_UNIX
|
||||
/* We need to prefix the structure with a sockaddr_in header so we can
|
||||
use it later for sendto and recvfrom. */
|
||||
struct sockaddr_un
|
||||
{
|
||||
short sun_family;
|
||||
unsigned short sun_port;
|
||||
struct in_addr sun_addr;
|
||||
char sun_path[108-2-4]; /* Path name. */
|
||||
};
|
||||
|
||||
/* Not needed anymore because the current mingw32 defines this in
|
||||
sys/types.h */
|
||||
/* typedef int ssize_t; */
|
||||
|
||||
/* Missing W32 functions */
|
||||
int putc_unlocked (int c, FILE *stream);
|
||||
void * memrchr (const void *block, int c, size_t size);
|
||||
char * stpcpy (char *dest, const char *src);
|
||||
#endif
|
||||
|
||||
#define LINELENGTH ASSUAN_LINELENGTH
|
||||
|
||||
|
||||
struct cmdtbl_s
|
||||
{
|
||||
const char *name;
|
||||
int (*handler)(assuan_context_t, char *line);
|
||||
};
|
||||
|
||||
|
||||
/* A structure to dispatch I/O functions. All these functions need to
|
||||
return 0 on success and set ERRNO on failure. */
|
||||
struct assuan_io
|
||||
{
|
||||
/* Routine to read from input_fd. */
|
||||
ssize_t (*readfnc) (assuan_context_t, void *, size_t);
|
||||
/* Routine to write to output_fd. */
|
||||
ssize_t (*writefnc) (assuan_context_t, const void *, size_t);
|
||||
/* Send a file descriptor. */
|
||||
assuan_error_t (*sendfd) (assuan_context_t, int);
|
||||
/* Receive a file descriptor. */
|
||||
assuan_error_t (*receivefd) (assuan_context_t, int *);
|
||||
};
|
||||
|
||||
|
||||
/* The context we use with most functions. */
|
||||
struct assuan_context_s
|
||||
{
|
||||
assuan_error_t err_no;
|
||||
const char *err_str;
|
||||
int os_errno; /* Last system error number used with certain
|
||||
error codes. */
|
||||
|
||||
/* Context specific flags (cf. assuan_flag_t). */
|
||||
struct
|
||||
{
|
||||
unsigned int no_waitpid:1; /* See ASSUAN_NO_WAITPID. */
|
||||
} flags;
|
||||
|
||||
int confidential;
|
||||
int is_server; /* Set if this is context belongs to a server */
|
||||
int in_inquire;
|
||||
char *hello_line;
|
||||
char *okay_line; /* See assuan_set_okay_line() */
|
||||
|
||||
void *user_pointer; /* For assuan_get_pointer and assuan_set_pointer (). */
|
||||
|
||||
FILE *log_fp;
|
||||
|
||||
struct {
|
||||
int fd;
|
||||
int eof;
|
||||
char line[LINELENGTH];
|
||||
int linelen; /* w/o CR, LF - might not be the same as
|
||||
strlen(line) due to embedded nuls. However a nul
|
||||
is always written at this pos. */
|
||||
struct {
|
||||
char line[LINELENGTH];
|
||||
int linelen ;
|
||||
int pending; /* i.e. at least one line is available in the attic */
|
||||
} attic;
|
||||
} inbound;
|
||||
|
||||
struct {
|
||||
int fd;
|
||||
struct {
|
||||
FILE *fp;
|
||||
char line[LINELENGTH];
|
||||
int linelen;
|
||||
int error;
|
||||
} data;
|
||||
} outbound;
|
||||
|
||||
int pipe_mode; /* We are in pipe mode, i.e. we can handle just one
|
||||
connection and must terminate then. */
|
||||
pid_t pid; /* The pid of the peer. */
|
||||
int listen_fd; /* The fd we are listening on (used by socket servers) */
|
||||
int connected_fd; /* helper */
|
||||
|
||||
struct {
|
||||
int valid; /* Whether this structure has valid information. */
|
||||
#ifdef HAVE_SO_PEERCRED
|
||||
pid_t pid; /* The pid of the peer. */
|
||||
uid_t uid; /* The uid of the peer. */
|
||||
gid_t gid; /* The gid of the peer. */
|
||||
#endif /* HAVE_SO_PEERCRED */
|
||||
} peercred;
|
||||
|
||||
/* Used for Unix domain sockets. */
|
||||
struct sockaddr_un myaddr;
|
||||
struct sockaddr_un serveraddr;
|
||||
|
||||
/* Structure used for unix domain socket buffering. FIXME: We don't
|
||||
use datagrams anymore thus we could get away with a simpler
|
||||
buffering approach. */
|
||||
struct {
|
||||
void *buffer; /* Malloced buffer. */
|
||||
int bufferallocated; /* Memory allocated. */
|
||||
int bufferoffset; /* Offset of start of buffer. */
|
||||
int buffersize; /* Bytes buffered. */
|
||||
|
||||
int pendingfds[5]; /* Array to save received descriptors. */
|
||||
int pendingfdscount; /* Number of received descriptors. */
|
||||
} uds;
|
||||
|
||||
void (*deinit_handler)(assuan_context_t);
|
||||
int (*accept_handler)(assuan_context_t);
|
||||
int (*finish_handler)(assuan_context_t);
|
||||
|
||||
struct cmdtbl_s *cmdtbl;
|
||||
size_t cmdtbl_used; /* used entries */
|
||||
size_t cmdtbl_size; /* allocated size of table */
|
||||
|
||||
void (*bye_notify_fnc)(assuan_context_t);
|
||||
void (*reset_notify_fnc)(assuan_context_t);
|
||||
void (*cancel_notify_fnc)(assuan_context_t);
|
||||
int (*option_handler_fnc)(assuan_context_t,const char*, const char*);
|
||||
void (*input_notify_fnc)(assuan_context_t, const char *);
|
||||
void (*output_notify_fnc)(assuan_context_t, const char *);
|
||||
|
||||
/* This function is called right after a command has been processed.
|
||||
It may be used to command related cleanup. */
|
||||
void (*post_cmd_notify_fnc)(assuan_context_t, int);
|
||||
|
||||
/* If set, this is called right before logging an I/O line. With
|
||||
DIRECTION set to 1 it is called for an output oeration; 0 means
|
||||
an input operation. If bit 0 is set in the return value, the
|
||||
logging of the will be suppressed. With bit 1 set, the entire
|
||||
line will be ignored. */
|
||||
unsigned int (*io_monitor)(assuan_context_t ctx,
|
||||
int direction,
|
||||
const char *line,
|
||||
size_t linelen);
|
||||
|
||||
int input_fd; /* set by INPUT command */
|
||||
int output_fd; /* set by OUTPUT command */
|
||||
|
||||
/* io routines. */
|
||||
struct assuan_io *io;
|
||||
};
|
||||
|
||||
/*-- assuan-pipe-server.c --*/
|
||||
int _assuan_new_context (assuan_context_t *r_ctx);
|
||||
void _assuan_release_context (assuan_context_t ctx);
|
||||
|
||||
/*-- assuan-uds.c --*/
|
||||
void _assuan_uds_close_fds (assuan_context_t ctx);
|
||||
void _assuan_uds_deinit (assuan_context_t ctx);
|
||||
void _assuan_init_uds_io (assuan_context_t ctx);
|
||||
|
||||
|
||||
/*-- assuan-handler.c --*/
|
||||
int _assuan_register_std_commands (assuan_context_t ctx);
|
||||
|
||||
/*-- assuan-buffer.c --*/
|
||||
assuan_error_t _assuan_read_line (assuan_context_t ctx);
|
||||
int _assuan_cookie_write_data (void *cookie, const char *buffer, size_t size);
|
||||
int _assuan_cookie_write_flush (void *cookie);
|
||||
assuan_error_t _assuan_write_line (assuan_context_t ctx, const char *prefix,
|
||||
const char *line, size_t len);
|
||||
|
||||
/*-- assuan-client.c --*/
|
||||
assuan_error_t _assuan_read_from_server (assuan_context_t ctx,
|
||||
int *okay, int *off);
|
||||
|
||||
/*-- assuan-error.c --*/
|
||||
|
||||
|
||||
/* Map error codes as used in this implementaion to the libgpg-error
|
||||
codes. */
|
||||
assuan_error_t _assuan_error (int oldcode);
|
||||
|
||||
/* Extrac the erro code from A. This works for both the old and the
|
||||
new style error codes. This needs to be whenever an error code is
|
||||
compared. */
|
||||
#define err_code(a) ((a) & 0x00ffffff)
|
||||
|
||||
/* Check whether A is the erro code for EOF. We allow forold and new
|
||||
style EOF error codes here. */
|
||||
#define err_is_eof(a) ((a) == (-1) || err_code (a) == 16383)
|
||||
|
||||
|
||||
|
||||
/*-- assuan-util.c --*/
|
||||
void *_assuan_malloc (size_t n);
|
||||
void *_assuan_calloc (size_t n, size_t m);
|
||||
void *_assuan_realloc (void *p, size_t n);
|
||||
void _assuan_free (void *p);
|
||||
|
||||
#define xtrymalloc(a) _assuan_malloc ((a))
|
||||
#define xtrycalloc(a,b) _assuan_calloc ((a),(b))
|
||||
#define xtryrealloc(a,b) _assuan_realloc((a),(b))
|
||||
#define xfree(a) _assuan_free ((a))
|
||||
|
||||
#define set_error(c,e,t) \
|
||||
assuan_set_error ((c), _assuan_error (ASSUAN_ ## e), (t))
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
const char *_assuan_w32_strerror (int ec);
|
||||
#define w32_strerror(e) _assuan_w32_strerror ((e))
|
||||
int _assuan_gpg_strerror_r (unsigned int err, char *buf, size_t buflen);
|
||||
const char *_assuan_gpg_strsource (unsigned int err);
|
||||
#endif /*HAVE_W32_SYSTEM*/
|
||||
|
||||
|
||||
/*-- assuan-logging.c --*/
|
||||
void _assuan_set_default_log_stream (FILE *fp);
|
||||
|
||||
void _assuan_log_printf (const char *format, ...)
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
|
||||
__attribute__ ((format (printf,1,2)))
|
||||
#endif
|
||||
;
|
||||
void _assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length);
|
||||
void _assuan_log_sanitized_string (const char *string);
|
||||
|
||||
|
||||
/*-- assuan-io.c --*/
|
||||
pid_t _assuan_waitpid (pid_t pid, int *status, int options);
|
||||
|
||||
ssize_t _assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size);
|
||||
ssize_t _assuan_simple_write (assuan_context_t ctx, const void *buffer,
|
||||
size_t size);
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
int _assuan_simple_sendmsg (assuan_context_t ctx, void *msg);
|
||||
int _assuan_simple_recvmsg (assuan_context_t ctx, void *msg);
|
||||
#else
|
||||
ssize_t _assuan_simple_sendmsg (assuan_context_t ctx, struct msghdr *msg);
|
||||
ssize_t _assuan_simple_recvmsg (assuan_context_t ctx, struct msghdr *msg);
|
||||
#endif
|
||||
|
||||
/*-- assuan-socket.c --*/
|
||||
int _assuan_close (int fd);
|
||||
int _assuan_sock_new (int domain, int type, int proto);
|
||||
int _assuan_sock_bind (int sockfd, struct sockaddr *addr, int addrlen);
|
||||
int _assuan_sock_connect (int sockfd, struct sockaddr *addr, int addrlen);
|
||||
|
||||
#ifdef HAVE_FOPENCOOKIE
|
||||
/* We have to implement funopen in terms of glibc's fopencookie. */
|
||||
FILE *_assuan_funopen(void *cookie,
|
||||
cookie_read_function_t *readfn,
|
||||
cookie_write_function_t *writefn,
|
||||
cookie_seek_function_t *seekfn,
|
||||
cookie_close_function_t *closefn);
|
||||
#define funopen(a,r,w,s,c) _assuan_funopen ((a), (r), (w), (s), (c))
|
||||
#endif /*HAVE_FOPENCOOKIE*/
|
||||
|
||||
/* Prototypes for replacement functions. */
|
||||
#ifndef HAVE_MEMRCHR
|
||||
void *memrchr (const void *block, int c, size_t size);
|
||||
#endif
|
||||
#ifndef HAVE_STPCPY
|
||||
char *stpcpy (char *dest, const char *src);
|
||||
#endif
|
||||
#ifndef HAVE_SETENV
|
||||
#define setenv _assuan_setenv
|
||||
#define unsetenv _assuan_unsetenv
|
||||
#define clearenv _assuan_clearenv
|
||||
int setenv (const char *name, const char *value, int replace);
|
||||
#endif
|
||||
#ifndef HAVE_PUTC_UNLOCKED
|
||||
int putc_unlocked (int c, FILE *stream);
|
||||
#endif
|
||||
|
||||
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
|
||||
#define DIMof(type,member) DIM(((type *)0)->member)
|
||||
|
||||
|
||||
#endif /*ASSUAN_DEFS_H*/
|
795
tags/gpgme-1.1.8/assuan/assuan-handler.c
Normal file
795
tags/gpgme-1.1.8/assuan/assuan-handler.c
Normal file
@ -0,0 +1,795 @@
|
||||
/* assuan-handler.c - dispatch commands
|
||||
* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
|
||||
|
||||
#define spacep(p) (*(p) == ' ' || *(p) == '\t')
|
||||
#define digitp(a) ((a) >= '0' && (a) <= '9')
|
||||
|
||||
static int my_strcasecmp (const char *a, const char *b);
|
||||
|
||||
|
||||
|
||||
static int
|
||||
dummy_handler (assuan_context_t ctx, char *line)
|
||||
{
|
||||
return set_error (ctx, Server_Fault, "no handler registered");
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
std_handler_nop (assuan_context_t ctx, char *line)
|
||||
{
|
||||
return 0; /* okay */
|
||||
}
|
||||
|
||||
static int
|
||||
std_handler_cancel (assuan_context_t ctx, char *line)
|
||||
{
|
||||
if (ctx->cancel_notify_fnc)
|
||||
ctx->cancel_notify_fnc (ctx);
|
||||
return set_error (ctx, Not_Implemented, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
std_handler_option (assuan_context_t ctx, char *line)
|
||||
{
|
||||
char *key, *value, *p;
|
||||
|
||||
for (key=line; spacep (key); key++)
|
||||
;
|
||||
if (!*key)
|
||||
return set_error (ctx, Syntax_Error, "argument required");
|
||||
if (*key == '=')
|
||||
return set_error (ctx, Syntax_Error, "no option name given");
|
||||
for (value=key; *value && !spacep (value) && *value != '='; value++)
|
||||
;
|
||||
if (*value)
|
||||
{
|
||||
if (spacep (value))
|
||||
*value++ = 0; /* terminate key */
|
||||
for (; spacep (value); value++)
|
||||
;
|
||||
if (*value == '=')
|
||||
{
|
||||
*value++ = 0; /* terminate key */
|
||||
for (; spacep (value); value++)
|
||||
;
|
||||
if (!*value)
|
||||
return set_error (ctx, Syntax_Error, "option argument expected");
|
||||
}
|
||||
if (*value)
|
||||
{
|
||||
for (p = value + strlen(value) - 1; p > value && spacep (p); p--)
|
||||
;
|
||||
if (p > value)
|
||||
*++p = 0; /* strip trailing spaces */
|
||||
}
|
||||
}
|
||||
|
||||
if (*key == '-' && key[1] == '-' && key[2])
|
||||
key += 2; /* the double dashes are optional */
|
||||
if (*key == '-')
|
||||
return set_error (ctx, Syntax_Error,
|
||||
"option should not begin with one dash");
|
||||
|
||||
if (ctx->option_handler_fnc)
|
||||
return ctx->option_handler_fnc (ctx, key, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
std_handler_bye (assuan_context_t ctx, char *line)
|
||||
{
|
||||
if (ctx->bye_notify_fnc)
|
||||
ctx->bye_notify_fnc (ctx);
|
||||
assuan_close_input_fd (ctx);
|
||||
assuan_close_output_fd (ctx);
|
||||
return -1; /* pretty simple :-) */
|
||||
}
|
||||
|
||||
static int
|
||||
std_handler_auth (assuan_context_t ctx, char *line)
|
||||
{
|
||||
return set_error (ctx, Not_Implemented, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
std_handler_reset (assuan_context_t ctx, char *line)
|
||||
{
|
||||
if (ctx->reset_notify_fnc)
|
||||
ctx->reset_notify_fnc (ctx);
|
||||
assuan_close_input_fd (ctx);
|
||||
assuan_close_output_fd (ctx);
|
||||
_assuan_uds_close_fds (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
std_handler_end (assuan_context_t ctx, char *line)
|
||||
{
|
||||
return set_error (ctx, Not_Implemented, NULL);
|
||||
}
|
||||
|
||||
assuan_error_t
|
||||
assuan_command_parse_fd (assuan_context_t ctx, char *line, int *rfd)
|
||||
{
|
||||
char *endp;
|
||||
|
||||
if ((strncmp (line, "FD", 2) && strncmp (line, "fd", 2))
|
||||
|| (line[2] != '=' && line[2] != '\0' && !spacep(&line[2])))
|
||||
return set_error (ctx, Syntax_Error, "FD[=<n>] expected");
|
||||
line += 2;
|
||||
if (*line == '=')
|
||||
{
|
||||
line ++;
|
||||
if (!digitp (*line))
|
||||
return set_error (ctx, Syntax_Error, "number required");
|
||||
*rfd = strtoul (line, &endp, 10);
|
||||
/* Remove that argument so that a notify handler won't see it. */
|
||||
memset (line, ' ', endp? (endp-line):strlen(line));
|
||||
|
||||
if (*rfd == ctx->inbound.fd)
|
||||
return set_error (ctx, Parameter_Conflict, "fd same as inbound fd");
|
||||
if (*rfd == ctx->outbound.fd)
|
||||
return set_error (ctx, Parameter_Conflict, "fd same as outbound fd");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
/* Our peer has sent the file descriptor. */
|
||||
return assuan_receivefd (ctx, rfd);
|
||||
}
|
||||
|
||||
/* Format is INPUT FD=<n> */
|
||||
static int
|
||||
std_handler_input (assuan_context_t ctx, char *line)
|
||||
{
|
||||
int rc, fd;
|
||||
|
||||
rc = assuan_command_parse_fd (ctx, line, &fd);
|
||||
if (rc)
|
||||
return rc;
|
||||
ctx->input_fd = fd;
|
||||
if (ctx->input_notify_fnc)
|
||||
ctx->input_notify_fnc (ctx, line);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Format is OUTPUT FD=<n> */
|
||||
static int
|
||||
std_handler_output (assuan_context_t ctx, char *line)
|
||||
{
|
||||
int rc, fd;
|
||||
|
||||
rc = assuan_command_parse_fd (ctx, line, &fd);
|
||||
if (rc)
|
||||
return rc;
|
||||
ctx->output_fd = fd;
|
||||
if (ctx->output_notify_fnc)
|
||||
ctx->output_notify_fnc (ctx, line);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* This is a table with the standard commands and handler for them.
|
||||
The table is used to initialize a new context and associate strings
|
||||
with default handlers */
|
||||
static struct {
|
||||
const char *name;
|
||||
int (*handler)(assuan_context_t, char *line);
|
||||
int always; /* always initialize this command */
|
||||
} std_cmd_table[] = {
|
||||
{ "NOP", std_handler_nop, 1 },
|
||||
{ "CANCEL", std_handler_cancel, 1 },
|
||||
{ "OPTION", std_handler_option, 1 },
|
||||
{ "BYE", std_handler_bye, 1 },
|
||||
{ "AUTH", std_handler_auth, 1 },
|
||||
{ "RESET", std_handler_reset, 1 },
|
||||
{ "END", std_handler_end, 1 },
|
||||
|
||||
{ "INPUT", std_handler_input },
|
||||
{ "OUTPUT", std_handler_output },
|
||||
{ "OPTION", std_handler_option, 1 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* assuan_register_command:
|
||||
* @ctx: the server context
|
||||
* @cmd_name: A string with the command name
|
||||
* @handler: The handler function to be called or NULL to use a default
|
||||
* handler.
|
||||
*
|
||||
* Register a handler to be used for a given command. Note that
|
||||
* several default handlers are already regsitered with a new context.
|
||||
* This function however allows to override them.
|
||||
*
|
||||
* Return value: 0 on success or an error code
|
||||
**/
|
||||
int
|
||||
assuan_register_command (assuan_context_t ctx,
|
||||
const char *cmd_name,
|
||||
int (*handler)(assuan_context_t, char *))
|
||||
{
|
||||
int i;
|
||||
const char *s;
|
||||
|
||||
if (cmd_name && !*cmd_name)
|
||||
cmd_name = NULL;
|
||||
|
||||
if (!cmd_name)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
if (!handler)
|
||||
{ /* find a default handler. */
|
||||
for (i=0; (s=std_cmd_table[i].name) && strcmp (cmd_name, s); i++)
|
||||
;
|
||||
if (!s)
|
||||
{ /* Try again but case insensitive. */
|
||||
for (i=0; (s=std_cmd_table[i].name)
|
||||
&& my_strcasecmp (cmd_name, s); i++)
|
||||
;
|
||||
}
|
||||
if (s)
|
||||
handler = std_cmd_table[i].handler;
|
||||
if (!handler)
|
||||
handler = dummy_handler; /* Last resort is the dummy handler. */
|
||||
}
|
||||
|
||||
if (!ctx->cmdtbl)
|
||||
{
|
||||
ctx->cmdtbl_size = 50;
|
||||
ctx->cmdtbl = xtrycalloc ( ctx->cmdtbl_size, sizeof *ctx->cmdtbl);
|
||||
if (!ctx->cmdtbl)
|
||||
return _assuan_error (ASSUAN_Out_Of_Core);
|
||||
ctx->cmdtbl_used = 0;
|
||||
}
|
||||
else if (ctx->cmdtbl_used >= ctx->cmdtbl_size)
|
||||
{
|
||||
struct cmdtbl_s *x;
|
||||
|
||||
x = xtryrealloc ( ctx->cmdtbl, (ctx->cmdtbl_size+10) * sizeof *x);
|
||||
if (!x)
|
||||
return _assuan_error (ASSUAN_Out_Of_Core);
|
||||
ctx->cmdtbl = x;
|
||||
ctx->cmdtbl_size += 50;
|
||||
}
|
||||
|
||||
ctx->cmdtbl[ctx->cmdtbl_used].name = cmd_name;
|
||||
ctx->cmdtbl[ctx->cmdtbl_used].handler = handler;
|
||||
ctx->cmdtbl_used++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
assuan_register_post_cmd_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t, int))
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
ctx->post_cmd_notify_fnc = fnc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
assuan_register_bye_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t))
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
ctx->bye_notify_fnc = fnc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
assuan_register_reset_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t))
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
ctx->reset_notify_fnc = fnc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
assuan_register_cancel_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t))
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
ctx->cancel_notify_fnc = fnc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
assuan_register_option_handler (assuan_context_t ctx,
|
||||
int (*fnc)(assuan_context_t,
|
||||
const char*, const char*))
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
ctx->option_handler_fnc = fnc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
assuan_register_input_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t, const char *))
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
ctx->input_notify_fnc = fnc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
assuan_register_output_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t, const char *))
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
ctx->output_notify_fnc = fnc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Helper to register the standards commands */
|
||||
int
|
||||
_assuan_register_std_commands (assuan_context_t ctx)
|
||||
{
|
||||
int i, rc;
|
||||
|
||||
for (i=0; std_cmd_table[i].name; i++)
|
||||
{
|
||||
if (std_cmd_table[i].always)
|
||||
{
|
||||
rc = assuan_register_command (ctx, std_cmd_table[i].name, NULL);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Process the special data lines. The "D " has already been removed
|
||||
from the line. As all handlers this function may modify the line. */
|
||||
static int
|
||||
handle_data_line (assuan_context_t ctx, char *line, int linelen)
|
||||
{
|
||||
return set_error (ctx, Not_Implemented, NULL);
|
||||
}
|
||||
|
||||
/* like ascii_strcasecmp but assume that B is already uppercase */
|
||||
static int
|
||||
my_strcasecmp (const char *a, const char *b)
|
||||
{
|
||||
if (a == b)
|
||||
return 0;
|
||||
|
||||
for (; *a && *b; a++, b++)
|
||||
{
|
||||
if (((*a >= 'a' && *a <= 'z')? (*a&~0x20):*a) != *b)
|
||||
break;
|
||||
}
|
||||
return *a == *b? 0 : (((*a >= 'a' && *a <= 'z')? (*a&~0x20):*a) - *b);
|
||||
}
|
||||
|
||||
/* Parse the line, break out the command, find it in the command
|
||||
table, remove leading and white spaces from the arguments, call the
|
||||
handler with the argument line and return the error */
|
||||
static int
|
||||
dispatch_command (assuan_context_t ctx, char *line, int linelen)
|
||||
{
|
||||
char *p;
|
||||
const char *s;
|
||||
int shift, i;
|
||||
|
||||
if (*line == 'D' && line[1] == ' ') /* divert to special handler */
|
||||
return handle_data_line (ctx, line+2, linelen-2);
|
||||
|
||||
for (p=line; *p && *p != ' ' && *p != '\t'; p++)
|
||||
;
|
||||
if (p==line)
|
||||
return set_error (ctx, Syntax_Error, "leading white-space");
|
||||
if (*p)
|
||||
{ /* Skip over leading WS after the keyword */
|
||||
*p++ = 0;
|
||||
while ( *p == ' ' || *p == '\t')
|
||||
p++;
|
||||
}
|
||||
shift = p - line;
|
||||
|
||||
for (i=0; (s=ctx->cmdtbl[i].name); i++)
|
||||
{
|
||||
if (!strcmp (line, s))
|
||||
break;
|
||||
}
|
||||
if (!s)
|
||||
{ /* and try case insensitive */
|
||||
for (i=0; (s=ctx->cmdtbl[i].name); i++)
|
||||
{
|
||||
if (!my_strcasecmp (line, s))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!s)
|
||||
return set_error (ctx, Unknown_Command, NULL);
|
||||
line += shift;
|
||||
linelen -= shift;
|
||||
|
||||
/* fprintf (stderr, "DBG-assuan: processing %s `%s'\n", s, line); */
|
||||
return ctx->cmdtbl[i].handler (ctx, line);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static int
|
||||
process_request (assuan_context_t ctx)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (ctx->in_inquire)
|
||||
return _assuan_error (ASSUAN_Nested_Commands);
|
||||
|
||||
rc = _assuan_read_line (ctx);
|
||||
if (rc)
|
||||
return rc;
|
||||
if (*ctx->inbound.line == '#' || !ctx->inbound.linelen)
|
||||
return 0; /* comment line - ignore */
|
||||
|
||||
ctx->outbound.data.error = 0;
|
||||
ctx->outbound.data.linelen = 0;
|
||||
/* dispatch command and return reply */
|
||||
rc = dispatch_command (ctx, ctx->inbound.line, ctx->inbound.linelen);
|
||||
/* check from data write errors */
|
||||
if (ctx->outbound.data.fp)
|
||||
{ /* Flush the data lines */
|
||||
fclose (ctx->outbound.data.fp);
|
||||
ctx->outbound.data.fp = NULL;
|
||||
if (!rc && ctx->outbound.data.error)
|
||||
rc = ctx->outbound.data.error;
|
||||
}
|
||||
else /* flush any data send w/o using the data fp */
|
||||
{
|
||||
assuan_send_data (ctx, NULL, 0);
|
||||
if (!rc && ctx->outbound.data.error)
|
||||
rc = ctx->outbound.data.error;
|
||||
}
|
||||
/* Error handling */
|
||||
if (!rc)
|
||||
{
|
||||
rc = assuan_write_line (ctx, ctx->okay_line? ctx->okay_line : "OK");
|
||||
}
|
||||
else if (err_is_eof (rc))
|
||||
{ /* No error checking because the peer may have already disconnect. */
|
||||
assuan_write_line (ctx, "OK closing connection");
|
||||
ctx->finish_handler (ctx);
|
||||
}
|
||||
else
|
||||
{
|
||||
char errline[300];
|
||||
|
||||
if (rc < 100)
|
||||
sprintf (errline, "ERR %d server fault (%.50s)",
|
||||
_assuan_error (ASSUAN_Server_Fault), assuan_strerror (rc));
|
||||
else
|
||||
{
|
||||
const char *text = ctx->err_no == rc? ctx->err_str:NULL;
|
||||
|
||||
#if defined(HAVE_W32_SYSTEM)
|
||||
unsigned int source, code;
|
||||
char ebuf[50];
|
||||
const char *esrc;
|
||||
|
||||
source = ((rc >> 24) & 0xff);
|
||||
code = (rc & 0x00ffffff);
|
||||
if (source
|
||||
&& !_assuan_gpg_strerror_r (rc, ebuf, sizeof ebuf)
|
||||
&& (esrc=_assuan_gpg_strsource (rc)))
|
||||
{
|
||||
/* Assume this is an libgpg-error. */
|
||||
sprintf (errline, "ERR %d %.50s <%.30s>%s%.100s",
|
||||
rc, ebuf, esrc,
|
||||
text? " - ":"", text?text:"");
|
||||
}
|
||||
else
|
||||
#elif defined(__GNUC__) && defined(__ELF__)
|
||||
/* If we have weak symbol support we try to use the error
|
||||
strings from libgpg-error without creating a dependency.
|
||||
They are used for debugging purposes only, so there is no
|
||||
problem if they are not available. We need to make sure
|
||||
that we are using ELF because only this guarantees that
|
||||
weak symbol support is available in case GNU ld is not
|
||||
used. It seems that old gcc versions don't implement the
|
||||
weak attribute properly but it works with the weak
|
||||
pragma. */
|
||||
|
||||
unsigned int source, code;
|
||||
|
||||
int gpg_strerror_r (unsigned int err, char *buf, size_t buflen)
|
||||
__attribute__ ((weak));
|
||||
const char *gpg_strsource (unsigned int err)
|
||||
__attribute__ ((weak));
|
||||
#if __GNUC__ < 3
|
||||
#pragma weak gpg_strerror_r
|
||||
#pragma weak gpg_strsource
|
||||
#endif
|
||||
|
||||
source = ((rc >> 24) & 0xff);
|
||||
code = (rc & 0x00ffffff);
|
||||
if (source && gpg_strsource && gpg_strerror_r)
|
||||
{
|
||||
/* Assume this is an libgpg-error. */
|
||||
char ebuf[50];
|
||||
|
||||
gpg_strerror_r (rc, ebuf, sizeof ebuf );
|
||||
sprintf (errline, "ERR %d %.50s <%.30s>%s%.100s",
|
||||
rc,
|
||||
ebuf,
|
||||
gpg_strsource (rc),
|
||||
text? " - ":"", text?text:"");
|
||||
}
|
||||
else
|
||||
#endif /* __GNUC__ && __ELF__ */
|
||||
sprintf (errline, "ERR %d %.50s%s%.100s",
|
||||
rc, assuan_strerror (rc), text? " - ":"", text?text:"");
|
||||
}
|
||||
rc = assuan_write_line (ctx, errline);
|
||||
}
|
||||
|
||||
if (ctx->post_cmd_notify_fnc)
|
||||
ctx->post_cmd_notify_fnc (ctx, rc);
|
||||
|
||||
ctx->confidential = 0;
|
||||
if (ctx->okay_line)
|
||||
{
|
||||
xfree (ctx->okay_line);
|
||||
ctx->okay_line = NULL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* assuan_process:
|
||||
* @ctx: assuan context
|
||||
*
|
||||
* This function is used to handle the assuan protocol after a
|
||||
* connection has been established using assuan_accept(). This is the
|
||||
* main protocol handler.
|
||||
*
|
||||
* Return value: 0 on success or an error code if the assuan operation
|
||||
* failed. Note, that no error is returned for operational errors.
|
||||
**/
|
||||
int
|
||||
assuan_process (assuan_context_t ctx)
|
||||
{
|
||||
int rc;
|
||||
|
||||
do {
|
||||
rc = process_request (ctx);
|
||||
} while (!rc);
|
||||
|
||||
if (err_is_eof (rc))
|
||||
rc = 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assuan_process_next:
|
||||
* @ctx: Assuan context
|
||||
*
|
||||
* Same as assuan_process() but the user has to provide the outer
|
||||
* loop. He should loop as long as the return code is zero and stop
|
||||
* otherwise; -1 is regular end.
|
||||
*
|
||||
* See also: assuan_get_active_fds()
|
||||
* Return value: -1 for end of server, 0 on success or an error code
|
||||
**/
|
||||
int
|
||||
assuan_process_next (assuan_context_t ctx)
|
||||
{
|
||||
return process_request (ctx);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assuan_get_active_fds:
|
||||
* @ctx: Assuan context
|
||||
* @what: 0 for read fds, 1 for write fds
|
||||
* @fdarray: Caller supplied array to store the FDs
|
||||
* @fdarraysize: size of that array
|
||||
*
|
||||
* Return all active filedescriptors for the given context. This
|
||||
* function can be used to select on the fds and call
|
||||
* assuan_process_next() if there is an active one. The first fd in
|
||||
* the array is the one used for the command connection.
|
||||
*
|
||||
* Note, that write FDs are not yet supported.
|
||||
*
|
||||
* Return value: number of FDs active and put into @fdarray or -1 on
|
||||
* error which is most likely a too small fdarray.
|
||||
**/
|
||||
int
|
||||
assuan_get_active_fds (assuan_context_t ctx, int what,
|
||||
int *fdarray, int fdarraysize)
|
||||
{
|
||||
int n = 0;
|
||||
|
||||
if (!ctx || fdarraysize < 2 || what < 0 || what > 1)
|
||||
return -1;
|
||||
|
||||
if (!what)
|
||||
{
|
||||
if (ctx->inbound.fd != -1)
|
||||
fdarray[n++] = ctx->inbound.fd;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ctx->outbound.fd != -1)
|
||||
fdarray[n++] = ctx->outbound.fd;
|
||||
if (ctx->outbound.data.fp)
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
fdarray[n++] = _get_osfhandle (fileno (ctx->outbound.data.fp));
|
||||
#else
|
||||
fdarray[n++] = fileno (ctx->outbound.data.fp);
|
||||
#endif
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
/* Two simple wrappers to make the expected function types match. */
|
||||
#ifdef HAVE_FUNOPEN
|
||||
static int
|
||||
fun1_cookie_write (void *cookie, const char *buffer, int orig_size)
|
||||
{
|
||||
return _assuan_cookie_write_data (cookie, buffer, orig_size);
|
||||
}
|
||||
#endif /*HAVE_FUNOPEN*/
|
||||
#ifdef HAVE_FOPENCOOKIE
|
||||
static ssize_t
|
||||
fun2_cookie_write (void *cookie, const char *buffer, size_t orig_size)
|
||||
{
|
||||
return _assuan_cookie_write_data (cookie, buffer, orig_size);
|
||||
}
|
||||
#endif /*HAVE_FOPENCOOKIE*/
|
||||
|
||||
/* Return a FP to be used for data output. The FILE pointer is valid
|
||||
until the end of a handler. So a close is not needed. Assuan does
|
||||
all the buffering needed to insert the status line as well as the
|
||||
required line wappping and quoting for data lines.
|
||||
|
||||
We use GNU's custom streams here. There should be an alternative
|
||||
implementaion for systems w/o a glibc, a simple implementation
|
||||
could use a child process */
|
||||
FILE *
|
||||
assuan_get_data_fp (assuan_context_t ctx)
|
||||
{
|
||||
#if defined (HAVE_FOPENCOOKIE) || defined (HAVE_FUNOPEN)
|
||||
if (ctx->outbound.data.fp)
|
||||
return ctx->outbound.data.fp;
|
||||
|
||||
#ifdef HAVE_FUNOPEN
|
||||
ctx->outbound.data.fp = funopen (ctx, 0, fun1_cookie_write,
|
||||
0, _assuan_cookie_write_flush);
|
||||
#else
|
||||
ctx->outbound.data.fp = funopen (ctx, 0, fun2_cookie_write,
|
||||
0, _assuan_cookie_write_flush);
|
||||
#endif
|
||||
|
||||
ctx->outbound.data.error = 0;
|
||||
return ctx->outbound.data.fp;
|
||||
#else
|
||||
errno = ENOSYS;
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Set the text used for the next OK reponse. This string is
|
||||
automatically reset to NULL after the next command. */
|
||||
assuan_error_t
|
||||
assuan_set_okay_line (assuan_context_t ctx, const char *line)
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
if (!line)
|
||||
{
|
||||
xfree (ctx->okay_line);
|
||||
ctx->okay_line = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: we need to use gcry_is_secure() to test whether
|
||||
we should allocate the entire line in secure memory */
|
||||
char *buf = xtrymalloc (3+strlen(line)+1);
|
||||
if (!buf)
|
||||
return _assuan_error (ASSUAN_Out_Of_Core);
|
||||
strcpy (buf, "OK ");
|
||||
strcpy (buf+3, line);
|
||||
xfree (ctx->okay_line);
|
||||
ctx->okay_line = buf;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
assuan_error_t
|
||||
assuan_write_status (assuan_context_t ctx,
|
||||
const char *keyword, const char *text)
|
||||
{
|
||||
char buffer[256];
|
||||
char *helpbuf;
|
||||
size_t n;
|
||||
assuan_error_t ae;
|
||||
|
||||
if ( !ctx || !keyword)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
if (!text)
|
||||
text = "";
|
||||
|
||||
n = 2 + strlen (keyword) + 1 + strlen (text) + 1;
|
||||
if (n < sizeof (buffer))
|
||||
{
|
||||
strcpy (buffer, "S ");
|
||||
strcat (buffer, keyword);
|
||||
if (*text)
|
||||
{
|
||||
strcat (buffer, " ");
|
||||
strcat (buffer, text);
|
||||
}
|
||||
ae = assuan_write_line (ctx, buffer);
|
||||
}
|
||||
else if ( (helpbuf = xtrymalloc (n)) )
|
||||
{
|
||||
strcpy (helpbuf, "S ");
|
||||
strcat (helpbuf, keyword);
|
||||
if (*text)
|
||||
{
|
||||
strcat (helpbuf, " ");
|
||||
strcat (helpbuf, text);
|
||||
}
|
||||
ae = assuan_write_line (ctx, helpbuf);
|
||||
xfree (helpbuf);
|
||||
}
|
||||
else
|
||||
ae = 0;
|
||||
return ae;
|
||||
}
|
241
tags/gpgme-1.1.8/assuan/assuan-inquire.c
Normal file
241
tags/gpgme-1.1.8/assuan/assuan-inquire.c
Normal file
@ -0,0 +1,241 @@
|
||||
/* assuan-inquire.c - handle inquire stuff
|
||||
* Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
#define digitp(a) ((a) >= '0' && (a) <= '9')
|
||||
#define xtoi_1(p) (*(p) <= '9'? (*(p)- '0'): \
|
||||
*(p) <= 'F'? (*(p)-'A'+10):(*(p)-'a'+10))
|
||||
#define xtoi_2(p) ((xtoi_1(p) * 16) + xtoi_1((p)+1))
|
||||
|
||||
|
||||
struct membuf
|
||||
{
|
||||
size_t len;
|
||||
size_t size;
|
||||
char *buf;
|
||||
int out_of_core;
|
||||
int too_large;
|
||||
size_t maxlen;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* A simple implemnation of a dynamic buffer. Use init_membuf() to
|
||||
create a buffer, put_membuf to append bytes and get_membuf to
|
||||
release and return the buffer. Allocation errors are detected but
|
||||
only returned at the final get_membuf(), this helps not to clutter
|
||||
the code with out of core checks. */
|
||||
|
||||
static void
|
||||
init_membuf (struct membuf *mb, int initiallen, size_t maxlen)
|
||||
{
|
||||
mb->len = 0;
|
||||
mb->size = initiallen;
|
||||
mb->out_of_core = 0;
|
||||
mb->too_large = 0;
|
||||
mb->maxlen = maxlen;
|
||||
/* we need to allocate one byte more for get_membuf */
|
||||
mb->buf = xtrymalloc (initiallen+1);
|
||||
if (!mb->buf)
|
||||
mb->out_of_core = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
put_membuf (struct membuf *mb, const void *buf, size_t len)
|
||||
{
|
||||
if (mb->out_of_core || mb->too_large)
|
||||
return;
|
||||
|
||||
if (mb->maxlen && mb->len + len > mb->maxlen)
|
||||
{
|
||||
mb->too_large = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mb->len + len >= mb->size)
|
||||
{
|
||||
char *p;
|
||||
|
||||
mb->size += len + 1024;
|
||||
/* we need to allocate one byte more for get_membuf */
|
||||
p = xtryrealloc (mb->buf, mb->size+1);
|
||||
if (!p)
|
||||
{
|
||||
mb->out_of_core = 1;
|
||||
return;
|
||||
}
|
||||
mb->buf = p;
|
||||
}
|
||||
memcpy (mb->buf + mb->len, buf, len);
|
||||
mb->len += len;
|
||||
}
|
||||
|
||||
static void *
|
||||
get_membuf (struct membuf *mb, size_t *len)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (mb->out_of_core || mb->too_large)
|
||||
{
|
||||
xfree (mb->buf);
|
||||
mb->buf = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mb->buf[mb->len] = 0; /* there is enough space for the hidden eos */
|
||||
p = mb->buf;
|
||||
*len = mb->len;
|
||||
mb->buf = NULL;
|
||||
mb->out_of_core = 1; /* don't allow a reuse */
|
||||
return p;
|
||||
}
|
||||
|
||||
static void
|
||||
free_membuf (struct membuf *mb)
|
||||
{
|
||||
xfree (mb->buf);
|
||||
mb->buf = NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assuan_inquire:
|
||||
* @ctx: An assuan context
|
||||
* @keyword: The keyword used for the inquire
|
||||
* @r_buffer: Returns an allocated buffer
|
||||
* @r_length: Returns the length of this buffer
|
||||
* @maxlen: If not 0, the size limit of the inquired data.
|
||||
*
|
||||
* A Server may use this to Send an inquire. r_buffer, r_length and
|
||||
* maxlen may all be NULL/0 to indicate that no real data is expected.
|
||||
*
|
||||
* Return value: 0 on success or an ASSUAN error code
|
||||
**/
|
||||
assuan_error_t
|
||||
assuan_inquire (assuan_context_t ctx, const char *keyword,
|
||||
unsigned char **r_buffer, size_t *r_length, size_t maxlen)
|
||||
{
|
||||
assuan_error_t rc;
|
||||
struct membuf mb;
|
||||
char cmdbuf[LINELENGTH-10]; /* (10 = strlen ("INQUIRE ")+CR,LF) */
|
||||
unsigned char *line, *p;
|
||||
int linelen;
|
||||
int nodataexpected;
|
||||
|
||||
if (!ctx || !keyword || (10 + strlen (keyword) >= sizeof (cmdbuf)))
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
nodataexpected = !r_buffer && !r_length && !maxlen;
|
||||
if (!nodataexpected && (!r_buffer || !r_length))
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
if (!ctx->is_server)
|
||||
return _assuan_error (ASSUAN_Not_A_Server);
|
||||
if (ctx->in_inquire)
|
||||
return _assuan_error (ASSUAN_Nested_Commands);
|
||||
|
||||
ctx->in_inquire = 1;
|
||||
if (nodataexpected)
|
||||
memset (&mb, 0, sizeof mb); /* avoid compiler warnings */
|
||||
else
|
||||
init_membuf (&mb, maxlen? maxlen:1024, maxlen);
|
||||
|
||||
strcpy (stpcpy (cmdbuf, "INQUIRE "), keyword);
|
||||
rc = assuan_write_line (ctx, cmdbuf);
|
||||
if (rc)
|
||||
goto leave;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
do
|
||||
{
|
||||
rc = _assuan_read_line (ctx);
|
||||
if (rc)
|
||||
goto leave;
|
||||
line = (unsigned char *) ctx->inbound.line;
|
||||
linelen = ctx->inbound.linelen;
|
||||
}
|
||||
while (*line == '#' || !linelen);
|
||||
if (line[0] == 'E' && line[1] == 'N' && line[2] == 'D'
|
||||
&& (!line[3] || line[3] == ' '))
|
||||
break; /* END command received*/
|
||||
if (line[0] == 'C' && line[1] == 'A' && line[2] == 'N')
|
||||
{
|
||||
rc = _assuan_error (ASSUAN_Canceled);
|
||||
goto leave;
|
||||
}
|
||||
if (line[0] != 'D' || line[1] != ' ' || nodataexpected)
|
||||
{
|
||||
rc = _assuan_error (ASSUAN_Unexpected_Command);
|
||||
goto leave;
|
||||
}
|
||||
if (linelen < 3)
|
||||
continue;
|
||||
line += 2;
|
||||
linelen -= 2;
|
||||
|
||||
p = line;
|
||||
while (linelen)
|
||||
{
|
||||
for (;linelen && *p != '%'; linelen--, p++)
|
||||
;
|
||||
put_membuf (&mb, line, p-line);
|
||||
if (linelen > 2)
|
||||
{ /* handle escaping */
|
||||
unsigned char tmp[1];
|
||||
p++;
|
||||
*tmp = xtoi_2 (p);
|
||||
p += 2;
|
||||
linelen -= 3;
|
||||
put_membuf (&mb, tmp, 1);
|
||||
}
|
||||
line = p;
|
||||
}
|
||||
if (mb.too_large)
|
||||
{
|
||||
rc = _assuan_error (ASSUAN_Too_Much_Data);
|
||||
goto leave;
|
||||
}
|
||||
}
|
||||
|
||||
if (!nodataexpected)
|
||||
{
|
||||
*r_buffer = get_membuf (&mb, r_length);
|
||||
if (!*r_buffer)
|
||||
rc = _assuan_error (ASSUAN_Out_Of_Core);
|
||||
}
|
||||
|
||||
leave:
|
||||
if (!nodataexpected)
|
||||
free_membuf (&mb);
|
||||
ctx->in_inquire = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
154
tags/gpgme-1.1.8/assuan/assuan-io.c
Normal file
154
tags/gpgme-1.1.8/assuan/assuan-io.c
Normal file
@ -0,0 +1,154 @@
|
||||
/* assuan-io.c - Wraps the read and write functions.
|
||||
* Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
pid_t
|
||||
_assuan_waitpid (pid_t pid, int *status, int options)
|
||||
{
|
||||
return waitpid (pid, status, options);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ssize_t
|
||||
_assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size)
|
||||
{
|
||||
#if defined(HAVE_W32_SYSTEM) && !defined(_ASSUAN_IN_GPGME_BUILD_ASSUAN)
|
||||
/* Due to the peculiarities of the W32 API we can't use read for a
|
||||
network socket and thus we try to use recv first and fallback to
|
||||
read if recv detects that it is not a network socket. */
|
||||
int n;
|
||||
|
||||
n = recv (ctx->inbound.fd, buffer, size, 0);
|
||||
if (n == -1 && WSAGetLastError () == WSAENOTSOCK)
|
||||
{
|
||||
DWORD nread = 0;
|
||||
|
||||
n = ReadFile ((HANDLE)ctx->inbound.fd, buffer, size, &nread, NULL);
|
||||
if (!n)
|
||||
{
|
||||
switch (GetLastError())
|
||||
{
|
||||
case ERROR_BROKEN_PIPE: errno = EPIPE; break;
|
||||
default: errno = EIO;
|
||||
}
|
||||
n = -1;
|
||||
}
|
||||
else
|
||||
n = (int)nread;
|
||||
}
|
||||
return n;
|
||||
#else /*!HAVE_W32_SYSTEM*/
|
||||
return read (ctx->inbound.fd, buffer, size);
|
||||
#endif /*!HAVE_W32_SYSTEM*/
|
||||
}
|
||||
|
||||
ssize_t
|
||||
_assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size)
|
||||
{
|
||||
#if defined(HAVE_W32_SYSTEM) && !defined(_ASSUAN_IN_GPGME_BUILD_ASSUAN)
|
||||
/* Due to the peculiarities of the W32 API we can't use write for a
|
||||
network socket and thus we try to use send first and fallback to
|
||||
write if send detects that it is not a network socket. */
|
||||
int n;
|
||||
|
||||
n = send (ctx->outbound.fd, buffer, size, 0);
|
||||
if (n == -1 && WSAGetLastError () == WSAENOTSOCK)
|
||||
{
|
||||
DWORD nwrite;
|
||||
|
||||
n = WriteFile ((HANDLE)ctx->outbound.fd, buffer, size, &nwrite, NULL);
|
||||
if (!n)
|
||||
{
|
||||
switch (GetLastError ())
|
||||
{
|
||||
case ERROR_BROKEN_PIPE:
|
||||
case ERROR_NO_DATA: errno = EPIPE; break;
|
||||
default: errno = EIO; break;
|
||||
}
|
||||
n = -1;
|
||||
}
|
||||
else
|
||||
n = (int)nwrite;
|
||||
}
|
||||
return n;
|
||||
#else /*!HAVE_W32_SYSTEM*/
|
||||
return write (ctx->outbound.fd, buffer, size);
|
||||
#endif /*!HAVE_W32_SYSTEM*/
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
int
|
||||
_assuan_simple_sendmsg (assuan_context_t ctx, void *msg)
|
||||
#else
|
||||
ssize_t
|
||||
_assuan_simple_sendmsg (assuan_context_t ctx, struct msghdr *msg)
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return _assuan_error (ASSUAN_Not_Implemented);
|
||||
#else
|
||||
int ret;
|
||||
while ( (ret = sendmsg (ctx->outbound.fd, msg, 0)) == -1 && errno == EINTR)
|
||||
;
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
int
|
||||
_assuan_simple_recvmsg (assuan_context_t ctx, void *msg)
|
||||
#else
|
||||
ssize_t
|
||||
_assuan_simple_recvmsg (assuan_context_t ctx, struct msghdr *msg)
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return _assuan_error (ASSUAN_Not_Implemented);
|
||||
#else
|
||||
int ret;
|
||||
while ( (ret = recvmsg (ctx->inbound.fd, msg, 0)) == -1 && errno == EINTR)
|
||||
;
|
||||
return ret;
|
||||
#endif
|
||||
}
|
157
tags/gpgme-1.1.8/assuan/assuan-listen.c
Normal file
157
tags/gpgme-1.1.8/assuan/assuan-listen.c
Normal file
@ -0,0 +1,157 @@
|
||||
/* assuan-listen.c - Wait for a connection (server)
|
||||
* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
assuan_error_t
|
||||
assuan_set_hello_line (assuan_context_t ctx, const char *line)
|
||||
{
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
if (!line)
|
||||
{
|
||||
xfree (ctx->hello_line);
|
||||
ctx->hello_line = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *buf = xtrymalloc (3+strlen(line)+1);
|
||||
if (!buf)
|
||||
return _assuan_error (ASSUAN_Out_Of_Core);
|
||||
if (strchr (line, '\n'))
|
||||
strcpy (buf, line);
|
||||
else
|
||||
{
|
||||
strcpy (buf, "OK ");
|
||||
strcpy (buf+3, line);
|
||||
}
|
||||
xfree (ctx->hello_line);
|
||||
ctx->hello_line = buf;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assuan_accept:
|
||||
* @ctx: context
|
||||
*
|
||||
* Cancel any existing connection and wait for a connection from a
|
||||
* client. The initial handshake is performed which may include an
|
||||
* initial authentication or encryption negotiation.
|
||||
*
|
||||
* Return value: 0 on success or an error if the connection could for
|
||||
* some reason not be established.
|
||||
**/
|
||||
assuan_error_t
|
||||
assuan_accept (assuan_context_t ctx)
|
||||
{
|
||||
int rc;
|
||||
const char *p, *pend;
|
||||
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
if (ctx->pipe_mode > 1)
|
||||
return -1; /* second invocation for pipemode -> terminate */
|
||||
ctx->finish_handler (ctx);
|
||||
|
||||
rc = ctx->accept_handler (ctx);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
/* Send the hello. */
|
||||
p = ctx->hello_line;
|
||||
if (p && (pend = strchr (p, '\n')))
|
||||
{ /* This is a multi line hello. Send all but the last line as
|
||||
comments. */
|
||||
do
|
||||
{
|
||||
rc = _assuan_write_line (ctx, "# ", p, pend - p);
|
||||
if (rc)
|
||||
return rc;
|
||||
p = pend + 1;
|
||||
pend = strchr (p, '\n');
|
||||
}
|
||||
while (pend);
|
||||
rc = _assuan_write_line (ctx, "OK ", p, strlen (p));
|
||||
}
|
||||
else if (p)
|
||||
rc = assuan_write_line (ctx, p);
|
||||
else
|
||||
rc = assuan_write_line (ctx, "OK Pleased to meet you");
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if (ctx->pipe_mode)
|
||||
ctx->pipe_mode = 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
assuan_get_input_fd (assuan_context_t ctx)
|
||||
{
|
||||
return ctx? ctx->input_fd : -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
assuan_get_output_fd (assuan_context_t ctx)
|
||||
{
|
||||
return ctx? ctx->output_fd : -1;
|
||||
}
|
||||
|
||||
|
||||
/* Close the fd descriptor set by the command INPUT FD=n. We handle
|
||||
this fd inside assuan so that we can do some initial checks */
|
||||
assuan_error_t
|
||||
assuan_close_input_fd (assuan_context_t ctx)
|
||||
{
|
||||
if (!ctx || ctx->input_fd == -1)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
_assuan_close (ctx->input_fd);
|
||||
ctx->input_fd = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Close the fd descriptor set by the command OUTPUT FD=n. We handle
|
||||
this fd inside assuan so that we can do some initial checks */
|
||||
assuan_error_t
|
||||
assuan_close_output_fd (assuan_context_t ctx)
|
||||
{
|
||||
if (!ctx || ctx->output_fd == -1)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
_assuan_close (ctx->output_fd);
|
||||
ctx->output_fd = -1;
|
||||
return 0;
|
||||
}
|
||||
|
316
tags/gpgme-1.1.8/assuan/assuan-logging.c
Normal file
316
tags/gpgme-1.1.8/assuan/assuan-logging.c
Normal file
@ -0,0 +1,316 @@
|
||||
/* assuan-logging.c - Default logging function.
|
||||
* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
#include <windows.h>
|
||||
#endif /*HAVE_W32_SYSTEM*/
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
static char prefix_buffer[80];
|
||||
static FILE *_assuan_log;
|
||||
static int full_logging;
|
||||
static int log_level = 1; /* Defaults to logging enabled. */
|
||||
|
||||
|
||||
/* Set the log level for general assuan commands. 0 is no logging at
|
||||
all, 1 is the standard logging and the default. Higher leveles may
|
||||
be defined in the future. Passing a level of -1 will not change
|
||||
the current log level. Returns previosu log level. */
|
||||
int
|
||||
assuan_set_assuan_log_level (int level)
|
||||
{
|
||||
int old = log_level;
|
||||
|
||||
if (level != -1)
|
||||
log_level = level;
|
||||
return old;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_assuan_set_default_log_stream (FILE *fp)
|
||||
{
|
||||
if (!_assuan_log)
|
||||
{
|
||||
_assuan_log = fp;
|
||||
full_logging = !!getenv ("ASSUAN_FULL_LOGGING");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
assuan_set_assuan_log_stream (FILE *fp)
|
||||
{
|
||||
_assuan_log = fp;
|
||||
}
|
||||
|
||||
|
||||
/* Set the per context log stream. Also enable the default log stream
|
||||
if it has not been set. */
|
||||
void
|
||||
assuan_set_log_stream (assuan_context_t ctx, FILE *fp)
|
||||
{
|
||||
if (ctx)
|
||||
{
|
||||
if (ctx->log_fp)
|
||||
fflush (ctx->log_fp);
|
||||
ctx->log_fp = fp;
|
||||
_assuan_set_default_log_stream (fp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FILE *
|
||||
assuan_get_assuan_log_stream (void)
|
||||
{
|
||||
return _assuan_log ? _assuan_log : stderr;
|
||||
}
|
||||
|
||||
|
||||
/* Set the prefix to be used for logging to TEXT or
|
||||
resets it to the default if TEXT is NULL. */
|
||||
void
|
||||
assuan_set_assuan_log_prefix (const char *text)
|
||||
{
|
||||
if (text)
|
||||
{
|
||||
strncpy (prefix_buffer, text, sizeof (prefix_buffer)-1);
|
||||
prefix_buffer[sizeof (prefix_buffer)-1] = 0;
|
||||
}
|
||||
else
|
||||
*prefix_buffer = 0;
|
||||
}
|
||||
|
||||
const char *
|
||||
assuan_get_assuan_log_prefix (void)
|
||||
{
|
||||
return prefix_buffer;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_assuan_log_printf (const char *format, ...)
|
||||
{
|
||||
va_list arg_ptr;
|
||||
FILE *fp;
|
||||
const char *prf;
|
||||
int save_errno = errno;
|
||||
|
||||
if (!log_level)
|
||||
return;
|
||||
|
||||
fp = assuan_get_assuan_log_stream ();
|
||||
prf = assuan_get_assuan_log_prefix ();
|
||||
if (*prf)
|
||||
fprintf (fp, "%s[%u]: ", prf, (unsigned int)getpid ());
|
||||
|
||||
va_start (arg_ptr, format);
|
||||
vfprintf (fp, format, arg_ptr );
|
||||
va_end (arg_ptr);
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
|
||||
/* Dump a possibly binary string (used for debugging). Distinguish
|
||||
ascii text from binary and print it accordingly. This function
|
||||
takes FILE pointer arg becuase logging may be enabled on a per
|
||||
context basis. */
|
||||
void
|
||||
_assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length)
|
||||
{
|
||||
const unsigned char *s;
|
||||
int n;
|
||||
|
||||
if (!log_level)
|
||||
return;
|
||||
|
||||
for (n=length,s=buffer; n; n--, s++)
|
||||
if ((!isascii (*s) || iscntrl (*s) || !isprint (*s)) && !(*s >= 0x80))
|
||||
break;
|
||||
|
||||
s = buffer;
|
||||
if (!n && *s != '[')
|
||||
fwrite (buffer, length, 1, fp);
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
flockfile (fp);
|
||||
#endif
|
||||
putc_unlocked ('[', fp);
|
||||
if ( length > 16 && !full_logging)
|
||||
{
|
||||
for (n=0; n < 12; n++, s++)
|
||||
fprintf (fp, " %02x", *s);
|
||||
fprintf (fp, " ...(%d bytes skipped)", (int)length - 12);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (n=0; n < length; n++, s++)
|
||||
fprintf (fp, " %02x", *s);
|
||||
}
|
||||
putc_unlocked (' ', fp);
|
||||
putc_unlocked (']', fp);
|
||||
#ifdef HAVE_FUNLOCKFILE
|
||||
funlockfile (fp);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Log a user supplied string. Escapes non-printable before
|
||||
printing. */
|
||||
void
|
||||
_assuan_log_sanitized_string (const char *string)
|
||||
{
|
||||
const unsigned char *s = (const unsigned char *) string;
|
||||
FILE *fp;
|
||||
|
||||
if (!log_level)
|
||||
return;
|
||||
|
||||
if (!*s)
|
||||
return;
|
||||
|
||||
fp = assuan_get_assuan_log_stream ();
|
||||
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
flockfile (fp);
|
||||
#endif
|
||||
|
||||
for (; *s; s++)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
switch (*s)
|
||||
{
|
||||
case '\r':
|
||||
c = 'r';
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
c = 'n';
|
||||
break;
|
||||
|
||||
case '\f':
|
||||
c = 'f';
|
||||
break;
|
||||
|
||||
case '\v':
|
||||
c = 'v';
|
||||
break;
|
||||
|
||||
case '\b':
|
||||
c = 'b';
|
||||
break;
|
||||
|
||||
default:
|
||||
if ((isascii (*s) && isprint (*s)) || (*s >= 0x80))
|
||||
putc_unlocked (*s, fp);
|
||||
else
|
||||
{
|
||||
putc_unlocked ('\\', fp);
|
||||
fprintf (fp, "x%02x", *s);
|
||||
}
|
||||
}
|
||||
|
||||
if (c)
|
||||
{
|
||||
putc_unlocked ('\\', fp);
|
||||
putc_unlocked (c, fp);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_FUNLOCKFILE
|
||||
funlockfile (fp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
const char *
|
||||
_assuan_w32_strerror (int ec)
|
||||
{
|
||||
static char strerr[256];
|
||||
|
||||
if (ec == -1)
|
||||
ec = (int)GetLastError ();
|
||||
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, ec,
|
||||
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
strerr, sizeof (strerr)-1, NULL);
|
||||
return strerr;
|
||||
}
|
||||
|
||||
static int (*my_strerror_r) (unsigned int err, char *buf, size_t buflen);
|
||||
static const char * (*my_strsource) (unsigned int err);
|
||||
|
||||
static int
|
||||
load_libgpg_error (void)
|
||||
{
|
||||
/* This code is not race free but suitable for our purpose. */
|
||||
static volatile int initialized;
|
||||
void *handle;
|
||||
|
||||
if (initialized)
|
||||
return (my_strerror_r && my_strsource)? 0:-1;
|
||||
handle = LoadLibrary ("libgpg-error-0.dll");
|
||||
if (handle)
|
||||
{
|
||||
void *foo, *bar;
|
||||
foo = GetProcAddress (handle, "gpg_strerror_r");
|
||||
bar = GetProcAddress (handle, "gpg_strsource");
|
||||
if (foo && bar)
|
||||
{
|
||||
my_strerror_r = foo;
|
||||
my_strsource = bar;
|
||||
}
|
||||
else
|
||||
CloseHandle (handle);
|
||||
}
|
||||
initialized = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
_assuan_gpg_strerror_r (unsigned int err, char *buf, size_t buflen)
|
||||
{
|
||||
if (load_libgpg_error ())
|
||||
return -1;
|
||||
return my_strerror_r (err, buf, buflen);
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
_assuan_gpg_strsource (unsigned int err)
|
||||
{
|
||||
if (load_libgpg_error ())
|
||||
return NULL;
|
||||
return my_strsource (err);
|
||||
}
|
||||
#endif /*HAVE_W32_SYSTEM*/
|
1038
tags/gpgme-1.1.8/assuan/assuan-pipe-connect.c
Normal file
1038
tags/gpgme-1.1.8/assuan/assuan-pipe-connect.c
Normal file
File diff suppressed because it is too large
Load Diff
189
tags/gpgme-1.1.8/assuan/assuan-pipe-server.c
Normal file
189
tags/gpgme-1.1.8/assuan/assuan-pipe-server.c
Normal file
@ -0,0 +1,189 @@
|
||||
/* assuan-pipe-server.c - Assuan server working over a pipe
|
||||
* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
#include <windows.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
|
||||
static void
|
||||
deinit_pipe_server (assuan_context_t ctx)
|
||||
{
|
||||
/* nothing to do for this simple server */
|
||||
}
|
||||
|
||||
static int
|
||||
accept_connection (assuan_context_t ctx)
|
||||
{
|
||||
/* This is a NOP for a pipe server */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
finish_connection (assuan_context_t ctx)
|
||||
{
|
||||
/* This is a NOP for a pipe server */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Create a new context. Note that the handlers are set up for a pipe
|
||||
server/client - this way we don't need extra dummy functions */
|
||||
int
|
||||
_assuan_new_context (assuan_context_t *r_ctx)
|
||||
{
|
||||
static struct assuan_io io = { _assuan_simple_read,
|
||||
_assuan_simple_write,
|
||||
0, 0 };
|
||||
|
||||
assuan_context_t ctx;
|
||||
int rc;
|
||||
|
||||
*r_ctx = NULL;
|
||||
ctx = xtrycalloc (1, sizeof *ctx);
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Out_Of_Core);
|
||||
ctx->input_fd = -1;
|
||||
ctx->output_fd = -1;
|
||||
|
||||
ctx->inbound.fd = -1;
|
||||
ctx->outbound.fd = -1;
|
||||
ctx->io = &io;
|
||||
|
||||
ctx->listen_fd = -1;
|
||||
/* Use the pipe server handler as a default. */
|
||||
ctx->deinit_handler = deinit_pipe_server;
|
||||
ctx->accept_handler = accept_connection;
|
||||
ctx->finish_handler = finish_connection;
|
||||
|
||||
rc = _assuan_register_std_commands (ctx);
|
||||
if (rc)
|
||||
xfree (ctx);
|
||||
else
|
||||
*r_ctx = ctx;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/* Returns true if atoi(S) denotes a valid socket. */
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
static int
|
||||
is_valid_socket (const char *s)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if ( fstat (atoi (s), &buf ) )
|
||||
return 0;
|
||||
return S_ISSOCK (buf.st_mode);
|
||||
}
|
||||
#endif /*!HAVE_W32_SYSTEM*/
|
||||
|
||||
|
||||
int
|
||||
assuan_init_pipe_server (assuan_context_t *r_ctx, int filedes[2])
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = _assuan_new_context (r_ctx);
|
||||
if (!rc)
|
||||
{
|
||||
assuan_context_t ctx = *r_ctx;
|
||||
const char *s;
|
||||
unsigned long ul;
|
||||
|
||||
ctx->is_server = 1;
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
/* MS Windows has so many different types of handle that one
|
||||
needs to tranlsate them at many place forth and back. Also
|
||||
make sure that the fiel descriptos are in binary mode. */
|
||||
setmode (filedes[0], O_BINARY);
|
||||
setmode (filedes[1], O_BINARY);
|
||||
ctx->inbound.fd = _get_osfhandle (filedes[0]);
|
||||
ctx->outbound.fd = _get_osfhandle (filedes[1]);
|
||||
#else
|
||||
s = getenv ("_assuan_connection_fd");
|
||||
if (s && *s && is_valid_socket (s) )
|
||||
{
|
||||
/* Well, we are called with an bi-directional file
|
||||
descriptor. Prepare for using sendmsg/recvmsg. In this
|
||||
case we ignore the passed file descriptors. */
|
||||
ctx->inbound.fd = ctx->outbound.fd = atoi (s);
|
||||
_assuan_init_uds_io (ctx);
|
||||
ctx->deinit_handler = _assuan_uds_deinit;
|
||||
}
|
||||
else if (filedes && filedes[0] != -1 && filedes[1] != -1 )
|
||||
{
|
||||
/* Standard pipe server. */
|
||||
ctx->inbound.fd = filedes[0];
|
||||
ctx->outbound.fd = filedes[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_assuan_release_context (*r_ctx);
|
||||
*r_ctx = NULL;
|
||||
return ASSUAN_Problem_Starting_Server;
|
||||
}
|
||||
#endif
|
||||
ctx->pipe_mode = 1;
|
||||
|
||||
s = getenv ("_assuan_pipe_connect_pid");
|
||||
if (s && (ul=strtoul (s, NULL, 10)) && ul)
|
||||
ctx->pid = (pid_t)ul;
|
||||
else
|
||||
ctx->pid = (pid_t)-1;
|
||||
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_assuan_release_context (assuan_context_t ctx)
|
||||
{
|
||||
if (ctx)
|
||||
{
|
||||
xfree (ctx->hello_line);
|
||||
xfree (ctx->okay_line);
|
||||
xfree (ctx->cmdtbl);
|
||||
xfree (ctx);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
assuan_deinit_server (assuan_context_t ctx)
|
||||
{
|
||||
if (ctx)
|
||||
{
|
||||
/* We use this function pointer to avoid linking other server
|
||||
when not needed but still allow for a generic deinit function. */
|
||||
ctx->deinit_handler (ctx);
|
||||
ctx->deinit_handler = NULL;
|
||||
_assuan_release_context (ctx);
|
||||
}
|
||||
}
|
184
tags/gpgme-1.1.8/assuan/assuan-socket-connect.c
Normal file
184
tags/gpgme-1.1.8/assuan/assuan-socket-connect.c
Normal file
@ -0,0 +1,184 @@
|
||||
/* assuan-socket-connect.c - Assuan socket based client
|
||||
* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
/* Hacks for Slowaris. */
|
||||
#ifndef PF_LOCAL
|
||||
# ifdef PF_UNIX
|
||||
# define PF_LOCAL PF_UNIX
|
||||
# else
|
||||
# define PF_LOCAL AF_UNIX
|
||||
# endif
|
||||
#endif
|
||||
#ifndef AF_LOCAL
|
||||
# define AF_LOCAL AF_UNIX
|
||||
#endif
|
||||
|
||||
#ifndef SUN_LEN
|
||||
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
|
||||
+ strlen ((ptr)->sun_path))
|
||||
#endif
|
||||
|
||||
|
||||
static int
|
||||
do_finish (assuan_context_t ctx)
|
||||
{
|
||||
if (ctx->inbound.fd != -1)
|
||||
{
|
||||
_assuan_close (ctx->inbound.fd);
|
||||
}
|
||||
ctx->inbound.fd = -1;
|
||||
ctx->outbound.fd = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
do_deinit (assuan_context_t ctx)
|
||||
{
|
||||
do_finish (ctx);
|
||||
}
|
||||
|
||||
|
||||
/* Make a connection to the Unix domain socket NAME and return a new
|
||||
Assuan context in CTX. SERVER_PID is currently not used but may
|
||||
become handy in the future. */
|
||||
assuan_error_t
|
||||
assuan_socket_connect (assuan_context_t *r_ctx,
|
||||
const char *name, pid_t server_pid)
|
||||
{
|
||||
return assuan_socket_connect_ext (r_ctx, name, server_pid, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Make a connection to the Unix domain socket NAME and return a new
|
||||
Assuan context in CTX. SERVER_PID is currently not used but may
|
||||
become handy in the future. With flags set to 1 sendmsg and
|
||||
recvmesg are used. */
|
||||
assuan_error_t
|
||||
assuan_socket_connect_ext (assuan_context_t *r_ctx,
|
||||
const char *name, pid_t server_pid,
|
||||
unsigned int flags)
|
||||
{
|
||||
static struct assuan_io io = { _assuan_simple_read,
|
||||
_assuan_simple_write };
|
||||
|
||||
assuan_error_t err;
|
||||
assuan_context_t ctx;
|
||||
int fd;
|
||||
struct sockaddr_un srvr_addr;
|
||||
size_t len;
|
||||
const char *s;
|
||||
|
||||
if (!r_ctx || !name)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
*r_ctx = NULL;
|
||||
|
||||
/* We require that the name starts with a slash, so that we
|
||||
eventually can reuse this function for other socket types. To
|
||||
make things easier we allow an optional dirver prefix. */
|
||||
s = name;
|
||||
if (*s && s[1] == ':')
|
||||
s += 2;
|
||||
if (*s != DIRSEP_C && *s != '/')
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
if (strlen (name)+1 >= sizeof srvr_addr.sun_path)
|
||||
return _assuan_error (ASSUAN_Invalid_Value);
|
||||
|
||||
err = _assuan_new_context (&ctx);
|
||||
if (err)
|
||||
return err;
|
||||
ctx->deinit_handler = ((flags&1))? _assuan_uds_deinit : do_deinit;
|
||||
ctx->finish_handler = do_finish;
|
||||
|
||||
fd = _assuan_sock_new (PF_LOCAL, SOCK_STREAM, 0);
|
||||
if (fd == -1)
|
||||
{
|
||||
_assuan_log_printf ("can't create socket: %s\n", strerror (errno));
|
||||
_assuan_release_context (ctx);
|
||||
return _assuan_error (ASSUAN_General_Error);
|
||||
}
|
||||
|
||||
memset (&srvr_addr, 0, sizeof srvr_addr);
|
||||
srvr_addr.sun_family = AF_LOCAL;
|
||||
strncpy (srvr_addr.sun_path, name, sizeof (srvr_addr.sun_path) - 1);
|
||||
srvr_addr.sun_path[sizeof (srvr_addr.sun_path) - 1] = 0;
|
||||
len = SUN_LEN (&srvr_addr);
|
||||
|
||||
|
||||
if (_assuan_sock_connect (fd, (struct sockaddr *) &srvr_addr, len) == -1)
|
||||
{
|
||||
_assuan_log_printf ("can't connect to `%s': %s\n",
|
||||
name, strerror (errno));
|
||||
_assuan_release_context (ctx);
|
||||
_assuan_close (fd);
|
||||
return _assuan_error (ASSUAN_Connect_Failed);
|
||||
}
|
||||
|
||||
ctx->inbound.fd = fd;
|
||||
ctx->outbound.fd = fd;
|
||||
ctx->io = &io;
|
||||
if ((flags&1))
|
||||
_assuan_init_uds_io (ctx);
|
||||
|
||||
/* initial handshake */
|
||||
{
|
||||
int okay, off;
|
||||
|
||||
err = _assuan_read_from_server (ctx, &okay, &off);
|
||||
if (err)
|
||||
_assuan_log_printf ("can't connect to server: %s\n",
|
||||
assuan_strerror (err));
|
||||
else if (okay != 1)
|
||||
{
|
||||
/*LOG ("can't connect to server: `");*/
|
||||
_assuan_log_sanitized_string (ctx->inbound.line);
|
||||
fprintf (assuan_get_assuan_log_stream (), "'\n");
|
||||
err = _assuan_error (ASSUAN_Connect_Failed);
|
||||
}
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
assuan_disconnect (ctx);
|
||||
}
|
||||
else
|
||||
*r_ctx = ctx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
193
tags/gpgme-1.1.8/assuan/assuan-socket-server.c
Normal file
193
tags/gpgme-1.1.8/assuan/assuan-socket-server.c
Normal file
@ -0,0 +1,193 @@
|
||||
/* assuan-socket-server.c - Assuan socket based server
|
||||
* Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
# include <windows.h>
|
||||
# if HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
# elif HAVE_WS2TCPIP_H
|
||||
# include <ws2tcpip.h>
|
||||
# endif
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <sys/un.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
static struct assuan_io io = { _assuan_simple_read,
|
||||
_assuan_simple_write };
|
||||
|
||||
|
||||
static int
|
||||
accept_connection_bottom (assuan_context_t ctx)
|
||||
{
|
||||
int fd = ctx->connected_fd;
|
||||
|
||||
ctx->peercred.valid = 0;
|
||||
#ifdef HAVE_SO_PEERCRED
|
||||
{
|
||||
struct ucred cr;
|
||||
socklen_t cl = sizeof cr;
|
||||
|
||||
if ( !getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &cr, &cl))
|
||||
{
|
||||
ctx->peercred.pid = cr.pid;
|
||||
ctx->peercred.uid = cr.uid;
|
||||
ctx->peercred.gid = cr.gid;
|
||||
ctx->peercred.valid = 1;
|
||||
|
||||
/* This overrides any already set PID if the function returns
|
||||
a valid one. */
|
||||
if (cr.pid != (pid_t)-1 && cr.pid)
|
||||
ctx->pid = cr.pid;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ctx->inbound.fd = fd;
|
||||
ctx->inbound.eof = 0;
|
||||
ctx->inbound.linelen = 0;
|
||||
ctx->inbound.attic.linelen = 0;
|
||||
ctx->inbound.attic.pending = 0;
|
||||
|
||||
ctx->outbound.fd = fd;
|
||||
ctx->outbound.data.linelen = 0;
|
||||
ctx->outbound.data.error = 0;
|
||||
|
||||
ctx->confidential = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
accept_connection (assuan_context_t ctx)
|
||||
{
|
||||
int fd;
|
||||
struct sockaddr_un clnt_addr;
|
||||
socklen_t len = sizeof clnt_addr;
|
||||
|
||||
fd = accept (ctx->listen_fd, (struct sockaddr*)&clnt_addr, &len );
|
||||
if (fd == -1)
|
||||
{
|
||||
ctx->os_errno = errno;
|
||||
return _assuan_error (ASSUAN_Accept_Failed);
|
||||
}
|
||||
|
||||
ctx->connected_fd = fd;
|
||||
return accept_connection_bottom (ctx);
|
||||
}
|
||||
|
||||
static int
|
||||
finish_connection (assuan_context_t ctx)
|
||||
{
|
||||
if (ctx->inbound.fd != -1)
|
||||
{
|
||||
_assuan_close (ctx->inbound.fd);
|
||||
}
|
||||
ctx->inbound.fd = -1;
|
||||
ctx->outbound.fd = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
deinit_socket_server (assuan_context_t ctx)
|
||||
{
|
||||
finish_connection (ctx);
|
||||
}
|
||||
|
||||
/* Initialize a server for the socket LISTEN_FD which has already be
|
||||
put into listen mode */
|
||||
int
|
||||
assuan_init_socket_server (assuan_context_t *r_ctx, int listen_fd)
|
||||
{
|
||||
return assuan_init_socket_server_ext (r_ctx, listen_fd, 0);
|
||||
}
|
||||
|
||||
/* Initialize a server using the already accepted socket FD. This
|
||||
fucntion is deprecated. */
|
||||
int
|
||||
assuan_init_connected_socket_server (assuan_context_t *r_ctx, int fd)
|
||||
{
|
||||
return assuan_init_socket_server_ext (r_ctx, fd, 2);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Flag bits: 0 - use sendmsg/recvmsg to allow descriptor passing
|
||||
1 - FD has already been accepted.
|
||||
*/
|
||||
int
|
||||
assuan_init_socket_server_ext (assuan_context_t *r_ctx, int fd,
|
||||
unsigned int flags)
|
||||
{
|
||||
assuan_context_t ctx;
|
||||
int rc;
|
||||
|
||||
*r_ctx = NULL;
|
||||
ctx = xtrycalloc (1, sizeof *ctx);
|
||||
if (!ctx)
|
||||
return _assuan_error (ASSUAN_Out_Of_Core);
|
||||
ctx->is_server = 1;
|
||||
if ((flags & 2))
|
||||
ctx->pipe_mode = 1; /* We want a second accept to indicate EOF. */
|
||||
ctx->input_fd = -1;
|
||||
ctx->output_fd = -1;
|
||||
|
||||
ctx->inbound.fd = -1;
|
||||
ctx->outbound.fd = -1;
|
||||
|
||||
if ((flags & 2))
|
||||
{
|
||||
ctx->listen_fd = -1;
|
||||
ctx->connected_fd = fd;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx->listen_fd = fd;
|
||||
ctx->connected_fd = -1;
|
||||
}
|
||||
ctx->deinit_handler = (flags & 1)? _assuan_uds_deinit:deinit_socket_server;
|
||||
ctx->accept_handler = ((flags & 2)
|
||||
? accept_connection_bottom
|
||||
: accept_connection);
|
||||
ctx->finish_handler = finish_connection;
|
||||
|
||||
ctx->io = &io;
|
||||
if ((flags & 1))
|
||||
_assuan_init_uds_io (ctx);
|
||||
|
||||
rc = _assuan_register_std_commands (ctx);
|
||||
if (rc)
|
||||
xfree (ctx);
|
||||
else
|
||||
*r_ctx = ctx;
|
||||
return rc;
|
||||
}
|
148
tags/gpgme-1.1.8/assuan/assuan-socket.c
Normal file
148
tags/gpgme-1.1.8/assuan/assuan-socket.c
Normal file
@ -0,0 +1,148 @@
|
||||
/* assuan-socket.c
|
||||
* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#include "assuan-defs.h"
|
||||
|
||||
/* Hacks for Slowaris. */
|
||||
#ifndef PF_LOCAL
|
||||
# ifdef PF_UNIX
|
||||
# define PF_LOCAL PF_UNIX
|
||||
# else
|
||||
# define PF_LOCAL AF_UNIX
|
||||
# endif
|
||||
#endif
|
||||
#ifndef AF_LOCAL
|
||||
# define AF_LOCAL AF_UNIX
|
||||
#endif
|
||||
|
||||
int
|
||||
_assuan_close (int fd)
|
||||
{
|
||||
#if defined (HAVE_W32_SYSTEM) && !defined(_ASSUAN_IN_GPGME_BUILD_ASSUAN)
|
||||
int rc = closesocket (fd);
|
||||
if (rc && WSAGetLastError () == WSAENOTSOCK)
|
||||
rc = CloseHandle (fd);
|
||||
return rc;
|
||||
#else
|
||||
return close (fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_assuan_sock_new (int domain, int type, int proto)
|
||||
{
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
return socket (domain, type, proto);
|
||||
#else
|
||||
if (domain == AF_UNIX || domain == AF_LOCAL)
|
||||
domain = AF_INET;
|
||||
return socket (domain, type, proto);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_assuan_sock_connect (int sockfd, struct sockaddr * addr, int addrlen)
|
||||
{
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
return connect (sockfd, addr, addrlen);
|
||||
#else
|
||||
struct sockaddr_in myaddr;
|
||||
struct sockaddr_un * unaddr;
|
||||
FILE * fp;
|
||||
int port = 0;
|
||||
|
||||
unaddr = (struct sockaddr_un *)addr;
|
||||
fp = fopen (unaddr->sun_path, "rb");
|
||||
if (!fp)
|
||||
return -1;
|
||||
fscanf (fp, "%d", &port);
|
||||
fclose (fp);
|
||||
/* XXX: set errno in this case */
|
||||
if (port < 0 || port > 65535)
|
||||
return -1;
|
||||
|
||||
myaddr.sin_family = AF_INET;
|
||||
myaddr.sin_port = port;
|
||||
myaddr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
|
||||
|
||||
/* we need this later. */
|
||||
unaddr->sun_family = myaddr.sin_family;
|
||||
unaddr->sun_port = myaddr.sin_port;
|
||||
unaddr->sun_addr.s_addr = myaddr.sin_addr.s_addr;
|
||||
|
||||
return connect (sockfd, (struct sockaddr *)&myaddr, sizeof myaddr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_assuan_sock_bind (int sockfd, struct sockaddr * addr, int addrlen)
|
||||
{
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
return bind (sockfd, addr, addrlen);
|
||||
#else
|
||||
if (addr->sa_family == AF_LOCAL || addr->sa_family == AF_UNIX)
|
||||
{
|
||||
struct sockaddr_in myaddr;
|
||||
struct sockaddr_un * unaddr;
|
||||
FILE * fp;
|
||||
int len = sizeof myaddr;
|
||||
int rc;
|
||||
|
||||
myaddr.sin_port = 0;
|
||||
myaddr.sin_family = AF_INET;
|
||||
myaddr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
|
||||
|
||||
rc = bind (sockfd, (struct sockaddr *)&myaddr, len);
|
||||
if (rc)
|
||||
return rc;
|
||||
rc = getsockname (sockfd, (struct sockaddr *)&myaddr, &len);
|
||||
if (rc)
|
||||
return rc;
|
||||
unaddr = (struct sockaddr_un *)addr;
|
||||
fp = fopen (unaddr->sun_path, "wb");
|
||||
if (!fp)
|
||||
return -1;
|
||||
fprintf (fp, "%d", myaddr.sin_port);
|
||||
fclose (fp);
|
||||
|
||||
/* we need this later. */
|
||||
unaddr->sun_family = myaddr.sin_family;
|
||||
unaddr->sun_port = myaddr.sin_port;
|
||||
unaddr->sun_addr.s_addr = myaddr.sin_addr.s_addr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
return bind (sockfd, addr, addrlen);
|
||||
#endif
|
||||
}
|
||||
|
313
tags/gpgme-1.1.8/assuan/assuan-uds.c
Normal file
313
tags/gpgme-1.1.8/assuan/assuan-uds.c
Normal file
@ -0,0 +1,313 @@
|
||||
/* assuan-uds.c - Assuan unix domain socket utilities
|
||||
* Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#if HAVE_SYS_UIO_H
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
#ifdef USE_DESCRIPTOR_PASSING
|
||||
/* Provide replacement for missing CMSG maccros. We assume that
|
||||
size_t matches the alignment requirement. */
|
||||
#define MY_ALIGN(n) ((((n))+ sizeof(size_t)-1) & (size_t)~(sizeof(size_t)-1))
|
||||
#ifndef CMSG_SPACE
|
||||
#define CMSG_SPACE(n) (MY_ALIGN(sizeof(struct cmsghdr)) + MY_ALIGN((n)))
|
||||
#endif
|
||||
#ifndef CMSG_LEN
|
||||
#define CMSG_LEN(n) (MY_ALIGN(sizeof(struct cmsghdr)) + (n))
|
||||
#endif
|
||||
#ifndef CMSG_FIRSTHDR
|
||||
#define CMSG_FIRSTHDR(mhdr) \
|
||||
((size_t)(mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
|
||||
? (struct cmsghdr*) (mhdr)->msg_control : (struct cmsghdr*)NULL)
|
||||
#endif
|
||||
#ifndef CMSG_DATA
|
||||
#define CMSG_DATA(cmsg) ((unsigned char*)((struct cmsghdr*)(cmsg)+1))
|
||||
#endif
|
||||
#endif /*USE_DESCRIPTOR_PASSING*/
|
||||
|
||||
|
||||
/* Read from a unix domain socket using sendmsg.
|
||||
|
||||
FIXME: We don't need the buffering. It is a leftover from the time
|
||||
when we used datagrams. */
|
||||
static ssize_t
|
||||
uds_reader (assuan_context_t ctx, void *buf, size_t buflen)
|
||||
{
|
||||
int len = ctx->uds.buffersize;
|
||||
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
if (!ctx->uds.bufferallocated)
|
||||
{
|
||||
ctx->uds.buffer = xtrymalloc (2048);
|
||||
if (!ctx->uds.buffer)
|
||||
return _assuan_error (ASSUAN_Out_Of_Core);
|
||||
ctx->uds.bufferallocated = 2048;
|
||||
}
|
||||
|
||||
while (!len) /* No data is buffered. */
|
||||
{
|
||||
struct msghdr msg;
|
||||
struct iovec iovec;
|
||||
#ifdef USE_DESCRIPTOR_PASSING
|
||||
union {
|
||||
struct cmsghdr cm;
|
||||
char control[CMSG_SPACE(sizeof (int))];
|
||||
} control_u;
|
||||
struct cmsghdr *cmptr;
|
||||
#endif /*USE_DESCRIPTOR_PASSING*/
|
||||
|
||||
memset (&msg, 0, sizeof (msg));
|
||||
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
msg.msg_iov = &iovec;
|
||||
msg.msg_iovlen = 1;
|
||||
iovec.iov_base = ctx->uds.buffer;
|
||||
iovec.iov_len = ctx->uds.bufferallocated;
|
||||
#ifdef USE_DESCRIPTOR_PASSING
|
||||
msg.msg_control = control_u.control;
|
||||
msg.msg_controllen = sizeof (control_u.control);
|
||||
#endif
|
||||
|
||||
len = _assuan_simple_recvmsg (ctx, &msg);
|
||||
if (len < 0)
|
||||
return -1;
|
||||
if (len == 0)
|
||||
return 0;
|
||||
|
||||
ctx->uds.buffersize = len;
|
||||
ctx->uds.bufferoffset = 0;
|
||||
|
||||
#ifdef USE_DESCRIPTOR_PASSING
|
||||
cmptr = CMSG_FIRSTHDR (&msg);
|
||||
if (cmptr && cmptr->cmsg_len == CMSG_LEN (sizeof(int)))
|
||||
{
|
||||
if (cmptr->cmsg_level != SOL_SOCKET
|
||||
|| cmptr->cmsg_type != SCM_RIGHTS)
|
||||
_assuan_log_printf ("unexpected ancillary data received\n");
|
||||
else
|
||||
{
|
||||
int fd = *((int*)CMSG_DATA (cmptr));
|
||||
|
||||
if (ctx->uds.pendingfdscount >= DIM (ctx->uds.pendingfds))
|
||||
{
|
||||
_assuan_log_printf ("too many descriptors pending - "
|
||||
"closing received descriptor %d\n", fd);
|
||||
_assuan_close (fd);
|
||||
}
|
||||
else
|
||||
ctx->uds.pendingfds[ctx->uds.pendingfdscount++] = fd;
|
||||
}
|
||||
}
|
||||
#endif /*USE_DESCRIPTOR_PASSING*/
|
||||
}
|
||||
|
||||
#else /*HAVE_W32_SYSTEM*/
|
||||
|
||||
len = recvfrom (ctx->inbound.fd, buf, buflen, 0, NULL, NULL);
|
||||
|
||||
#endif /*HAVE_W32_SYSTEM*/
|
||||
|
||||
/* Return some data to the user. */
|
||||
|
||||
if (len > buflen) /* We have more than the user requested. */
|
||||
len = buflen;
|
||||
|
||||
memcpy (buf, (char*)ctx->uds.buffer + ctx->uds.bufferoffset, len);
|
||||
ctx->uds.buffersize -= len;
|
||||
assert (ctx->uds.buffersize >= 0);
|
||||
ctx->uds.bufferoffset += len;
|
||||
assert (ctx->uds.bufferoffset <= ctx->uds.bufferallocated);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
/* Write to the domain server. */
|
||||
static ssize_t
|
||||
uds_writer (assuan_context_t ctx, const void *buf, size_t buflen)
|
||||
{
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
struct msghdr msg;
|
||||
struct iovec iovec;
|
||||
ssize_t len;
|
||||
|
||||
memset (&msg, 0, sizeof (msg));
|
||||
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
msg.msg_iovlen = 1;
|
||||
msg.msg_iov = &iovec;
|
||||
iovec.iov_base = (void*)buf;
|
||||
iovec.iov_len = buflen;
|
||||
|
||||
len = _assuan_simple_sendmsg (ctx, &msg);
|
||||
#else /*HAVE_W32_SYSTEM*/
|
||||
int len;
|
||||
|
||||
len = sendto (ctx->outbound.fd, buf, buflen, 0,
|
||||
(struct sockaddr *)&ctx->serveraddr,
|
||||
sizeof (struct sockaddr_in));
|
||||
#endif /*HAVE_W32_SYSTEM*/
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
static assuan_error_t
|
||||
uds_sendfd (assuan_context_t ctx, int fd)
|
||||
{
|
||||
#ifdef USE_DESCRIPTOR_PASSING
|
||||
struct msghdr msg;
|
||||
struct iovec iovec;
|
||||
union {
|
||||
struct cmsghdr cm;
|
||||
char control[CMSG_SPACE(sizeof (int))];
|
||||
} control_u;
|
||||
struct cmsghdr *cmptr;
|
||||
int len;
|
||||
char buffer[80];
|
||||
|
||||
/* We need to send some real data so that a read won't return 0
|
||||
which will be taken as an EOF. It also helps with debugging. */
|
||||
snprintf (buffer, sizeof(buffer)-1, "# descriptor %d is in flight\n", fd);
|
||||
buffer[sizeof(buffer)-1] = 0;
|
||||
|
||||
memset (&msg, 0, sizeof (msg));
|
||||
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
msg.msg_iovlen = 1;
|
||||
msg.msg_iov = &iovec;
|
||||
iovec.iov_base = buffer;
|
||||
iovec.iov_len = strlen (buffer);
|
||||
|
||||
msg.msg_control = control_u.control;
|
||||
msg.msg_controllen = sizeof (control_u.control);
|
||||
cmptr = CMSG_FIRSTHDR (&msg);
|
||||
cmptr->cmsg_len = CMSG_LEN(sizeof(int));
|
||||
cmptr->cmsg_level = SOL_SOCKET;
|
||||
cmptr->cmsg_type = SCM_RIGHTS;
|
||||
*((int*)CMSG_DATA (cmptr)) = fd;
|
||||
|
||||
len = _assuan_simple_sendmsg (ctx, &msg);
|
||||
if (len < 0)
|
||||
{
|
||||
_assuan_log_printf ("uds_sendfd: %s\n", strerror (errno));
|
||||
return _assuan_error (ASSUAN_Write_Error);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#else
|
||||
return _assuan_error (ASSUAN_Not_Implemented);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static assuan_error_t
|
||||
uds_receivefd (assuan_context_t ctx, int *fd)
|
||||
{
|
||||
#ifdef USE_DESCRIPTOR_PASSING
|
||||
int i;
|
||||
|
||||
if (!ctx->uds.pendingfdscount)
|
||||
{
|
||||
_assuan_log_printf ("no pending file descriptors!\n");
|
||||
return _assuan_error (ASSUAN_General_Error);
|
||||
}
|
||||
assert (ctx->uds.pendingfdscount <= DIM(ctx->uds.pendingfds));
|
||||
|
||||
*fd = ctx->uds.pendingfds[0];
|
||||
for (i=1; i < ctx->uds.pendingfdscount; i++)
|
||||
ctx->uds.pendingfds[i-1] = ctx->uds.pendingfds[i];
|
||||
ctx->uds.pendingfdscount--;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return _assuan_error (ASSUAN_Not_Implemented);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Close all pending fds. */
|
||||
void
|
||||
_assuan_uds_close_fds (assuan_context_t ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ctx->uds.pendingfdscount; i++)
|
||||
_assuan_close (ctx->uds.pendingfds[i]);
|
||||
ctx->uds.pendingfdscount = 0;
|
||||
}
|
||||
|
||||
/* Deinitialize the unix domain socket I/O functions. */
|
||||
void
|
||||
_assuan_uds_deinit (assuan_context_t ctx)
|
||||
{
|
||||
/* First call the finish_handler which should close descriptors etc. */
|
||||
ctx->finish_handler (ctx);
|
||||
|
||||
if (ctx->uds.buffer)
|
||||
{
|
||||
assert (ctx->uds.bufferallocated);
|
||||
ctx->uds.bufferallocated = 0;
|
||||
xfree (ctx->uds.buffer);
|
||||
}
|
||||
|
||||
_assuan_uds_close_fds (ctx);
|
||||
}
|
||||
|
||||
|
||||
/* Helper function to initialize a context for domain I/O. */
|
||||
void
|
||||
_assuan_init_uds_io (assuan_context_t ctx)
|
||||
{
|
||||
static struct assuan_io io = { uds_reader, uds_writer,
|
||||
uds_sendfd, uds_receivefd };
|
||||
|
||||
ctx->io = &io;
|
||||
ctx->uds.buffer = 0;
|
||||
ctx->uds.bufferoffset = 0;
|
||||
ctx->uds.buffersize = 0;
|
||||
ctx->uds.bufferallocated = 0;
|
||||
ctx->uds.pendingfdscount = 0;
|
||||
}
|
||||
|
171
tags/gpgme-1.1.8/assuan/assuan-util.c
Normal file
171
tags/gpgme-1.1.8/assuan/assuan-util.c
Normal file
@ -0,0 +1,171 @@
|
||||
/* assuan-util.c - Utility functions for Assuan
|
||||
* Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "assuan-defs.h"
|
||||
|
||||
static void *(*alloc_func)(size_t n) = malloc;
|
||||
static void *(*realloc_func)(void *p, size_t n) = realloc;
|
||||
static void (*free_func)(void*) = free;
|
||||
|
||||
void
|
||||
assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n),
|
||||
void *(*new_realloc_func)(void *p, size_t n),
|
||||
void (*new_free_func)(void*) )
|
||||
{
|
||||
alloc_func = new_alloc_func;
|
||||
realloc_func = new_realloc_func;
|
||||
free_func = new_free_func;
|
||||
}
|
||||
|
||||
void *
|
||||
_assuan_malloc (size_t n)
|
||||
{
|
||||
return alloc_func (n);
|
||||
}
|
||||
|
||||
void *
|
||||
_assuan_realloc (void *a, size_t n)
|
||||
{
|
||||
return realloc_func (a, n);
|
||||
}
|
||||
|
||||
void *
|
||||
_assuan_calloc (size_t n, size_t m)
|
||||
{
|
||||
void *p;
|
||||
size_t nbytes;
|
||||
|
||||
nbytes = n * m;
|
||||
if (m && nbytes / m != n)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = _assuan_malloc (nbytes);
|
||||
if (p)
|
||||
memset (p, 0, nbytes);
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
_assuan_free (void *p)
|
||||
{
|
||||
if (p)
|
||||
free_func (p);
|
||||
}
|
||||
|
||||
|
||||
/* Store the error in the context so that the error sending function
|
||||
can take out a descriptive text. Inside the assuan code, use the
|
||||
macro set_error instead of this function. */
|
||||
int
|
||||
assuan_set_error (assuan_context_t ctx, int err, const char *text)
|
||||
{
|
||||
ctx->err_no = err;
|
||||
ctx->err_str = text;
|
||||
return err;
|
||||
}
|
||||
|
||||
void
|
||||
assuan_set_pointer (assuan_context_t ctx, void *pointer)
|
||||
{
|
||||
if (ctx)
|
||||
ctx->user_pointer = pointer;
|
||||
}
|
||||
|
||||
void *
|
||||
assuan_get_pointer (assuan_context_t ctx)
|
||||
{
|
||||
return ctx? ctx->user_pointer : NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
assuan_begin_confidential (assuan_context_t ctx)
|
||||
{
|
||||
if (ctx)
|
||||
{
|
||||
ctx->confidential = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
assuan_end_confidential (assuan_context_t ctx)
|
||||
{
|
||||
if (ctx)
|
||||
{
|
||||
ctx->confidential = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
assuan_set_io_monitor (assuan_context_t ctx,
|
||||
unsigned int (*monitor)(assuan_context_t ctx,
|
||||
int direction,
|
||||
const char *line,
|
||||
size_t linelen))
|
||||
{
|
||||
if (ctx)
|
||||
{
|
||||
ctx->io_monitor = monitor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* For context CTX, set the flag FLAG to VALUE. Values for flags
|
||||
are usually 1 or 0 but certain flags might allow for other values;
|
||||
see the description of the type assuan_flag_t for details. */
|
||||
void
|
||||
assuan_set_flag (assuan_context_t ctx, assuan_flag_t flag, int value)
|
||||
{
|
||||
if (!ctx)
|
||||
return;
|
||||
switch (flag)
|
||||
{
|
||||
case ASSUAN_NO_WAITPID: ctx->flags.no_waitpid = value; break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the VALUE of FLAG in context CTX. */
|
||||
int
|
||||
assuan_get_flag (assuan_context_t ctx, assuan_flag_t flag)
|
||||
{
|
||||
if (!ctx)
|
||||
return 0;
|
||||
switch (flag)
|
||||
{
|
||||
case ASSUAN_NO_WAITPID: return ctx->flags.no_waitpid;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
580
tags/gpgme-1.1.8/assuan/assuan.h
Normal file
580
tags/gpgme-1.1.8/assuan/assuan.h
Normal file
@ -0,0 +1,580 @@
|
||||
/* assuan.h - Definitions for the Assuan IPC library
|
||||
* Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of Assuan.
|
||||
*
|
||||
* Assuan 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.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* Assuan 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef ASSUAN_H
|
||||
#define ASSUAN_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
/* To use this file with libraries the following macros are useful:
|
||||
|
||||
#define _ASSUAN_EXT_SYM_PREFIX _foo_
|
||||
|
||||
This prefixes all external symbols with "_foo_".
|
||||
|
||||
#define _ASSUAN_ONLY_GPG_ERRORS
|
||||
|
||||
If this is defined all old-style Assuan error codes are made
|
||||
inactive as well as other dereacted stuff.
|
||||
|
||||
The follwing macros are used internally in the implementation of
|
||||
libassuan:
|
||||
|
||||
#define _ASSUAN_NO_PTH
|
||||
|
||||
This avoids inclusion of special GNU Pth hacks.
|
||||
|
||||
#define _ASSUAN_NO_FIXED_SIGNALS
|
||||
|
||||
This disables changing of certain signal handler; i.e. SIGPIPE.
|
||||
|
||||
#define _ASSUAN_USE_DOUBLE_FORK
|
||||
|
||||
Use a double fork approach when connecting to a server through
|
||||
a pipe.
|
||||
*/
|
||||
/**** Begin GPGME specific modifications. ******/
|
||||
#define _ASSUAN_EXT_SYM_PREFIX _gpgme_
|
||||
#define _ASSUAN_NO_PTH
|
||||
#define _ASSUAN_NO_FIXED_SIGNALS
|
||||
#define _ASSUAN_USE_DOUBLE_FORK
|
||||
|
||||
#ifdef _ASSUAN_IN_GPGME_BUILD_ASSUAN
|
||||
#include <ath.h>
|
||||
|
||||
int _gpgme_io_close (int fd);
|
||||
int _gpgme_io_read (int fd, void *buffer, size_t count);
|
||||
int _gpgme_io_write (int fd, const void *buffer, size_t count);
|
||||
int _gpgme_io_sendmsg (int sock, const struct msghdr *msg, int flags);
|
||||
int _gpgme_io_recvmsg (int sock, struct msghdr *msg, int flags);
|
||||
|
||||
#define close _gpgme_io_close
|
||||
#define read _gpgme_io_read
|
||||
#define write _gpgme_io_write
|
||||
#define waitpid _gpgme_ath_waitpid
|
||||
#define select _gpgme_ath_select
|
||||
#define accept _gpgme_ath_accept
|
||||
#define connect _gpgme_ath_connect
|
||||
#define sendmsg _gpgme_io_sendmsg
|
||||
#define recvmsg _gpgme_io_recvmsg
|
||||
#endif /*_ASSUAN_IN_GPGME_BUILD_ASSUAN*/
|
||||
/**** End GPGME specific modifications. ******/
|
||||
|
||||
|
||||
#ifdef _ASSUAN_EXT_SYM_PREFIX
|
||||
#define _ASSUAN_PREFIX1(x,y) x ## y
|
||||
#define _ASSUAN_PREFIX2(x,y) _ASSUAN_PREFIX1(x,y)
|
||||
#define _ASSUAN_PREFIX(x) _ASSUAN_PREFIX2(_ASSUAN_EXT_SYM_PREFIX,x)
|
||||
#define assuan_ _ASSUAN_PREFIX(assuan_)
|
||||
#define assuan_register_command _ASSUAN_PREFIX(assuan_register_command)
|
||||
#define assuan_register_post_cmd_notify \
|
||||
_ASSUAN_PREFIX(assuan_register_post_cmd_notify)
|
||||
#define assuan_register_bye_notify _ASSUAN_PREFIX(assuan_register_bye_notify)
|
||||
#define assuan_register_reset_notify \
|
||||
_ASSUAN_PREFIX(assuan_register_reset_notify)
|
||||
#define assuan_register_cancel_notify \
|
||||
_ASSUAN_PREFIX(assuan_register_cancel_notify)
|
||||
#define assuan_register_input_notify \
|
||||
_ASSUAN_PREFIX(assuan_register_input_notify)
|
||||
#define assuan_register_output_notify \
|
||||
_ASSUAN_PREFIX(assuan_register_output_notify)
|
||||
#define assuan_register_option_handler \
|
||||
_ASSUAN_PREFIX(assuan_register_option_handler)
|
||||
#define assuan_process _ASSUAN_PREFIX(assuan_process)
|
||||
#define assuan_process_next _ASSUAN_PREFIX(assuan_process_next)
|
||||
#define assuan_get_active_fds _ASSUAN_PREFIX(assuan_get_active_fds)
|
||||
#define assuan_get_data_fp _ASSUAN_PREFIX(assuan_get_data_fp)
|
||||
#define assuan_set_okay_line _ASSUAN_PREFIX(assuan_set_okay_line)
|
||||
#define assuan_write_status _ASSUAN_PREFIX(assuan_write_status)
|
||||
#define assuan_command_parse_fd _ASSUAN_PREFIX(assuan_command_parse_fd)
|
||||
#define assuan_set_hello_line _ASSUAN_PREFIX(assuan_set_hello_line)
|
||||
#define assuan_accept _ASSUAN_PREFIX(assuan_accept)
|
||||
#define assuan_get_input_fd _ASSUAN_PREFIX(assuan_get_input_fd)
|
||||
#define assuan_get_output_fd _ASSUAN_PREFIX(assuan_get_output_fd)
|
||||
#define assuan_close_input_fd _ASSUAN_PREFIX(assuan_close_input_fd)
|
||||
#define assuan_close_output_fd _ASSUAN_PREFIX(assuan_close_output_fd)
|
||||
#define assuan_init_pipe_server _ASSUAN_PREFIX(assuan_init_pipe_server)
|
||||
#define assuan_deinit_server _ASSUAN_PREFIX(assuan_deinit_server)
|
||||
#define assuan_init_socket_server _ASSUAN_PREFIX(assuan_init_socket_server)
|
||||
#define assuan_init_connected_socket_server \
|
||||
_ASSUAN_PREFIX(assuan_init_connected_socket_server)
|
||||
#define assuan_init_socket_server_ext \
|
||||
_ASSUAN_PREFIX(assuan_init_socket_server_ext)
|
||||
#define assuan_pipe_connect _ASSUAN_PREFIX(assuan_pipe_connect)
|
||||
#define assuan_pipe_connect_ext _ASSUAN_PREFIX(assuan_pipe_connect_ext)
|
||||
#define assuan_socket_connect _ASSUAN_PREFIX(assuan_socket_connect)
|
||||
#define assuan_socket_connect_ext _ASSUAN_PREFIX(assuan_socket_connect_ext)
|
||||
#define assuan_disconnect _ASSUAN_PREFIX(assuan_disconnect)
|
||||
#define assuan_get_pid _ASSUAN_PREFIX(assuan_get_pid)
|
||||
#define assuan_get_peercred _ASSUAN_PREFIX(assuan_get_peercred)
|
||||
#define assuan_transact _ASSUAN_PREFIX(assuan_transact)
|
||||
#define assuan_inquire _ASSUAN_PREFIX(assuan_inquire)
|
||||
#define assuan_read_line _ASSUAN_PREFIX(assuan_read_line)
|
||||
#define assuan_pending_line _ASSUAN_PREFIX(assuan_pending_line)
|
||||
#define assuan_write_line _ASSUAN_PREFIX(assuan_write_line)
|
||||
#define assuan_send_data _ASSUAN_PREFIX(assuan_send_data)
|
||||
#define assuan_sendfd _ASSUAN_PREFIX(assuan_sendfd)
|
||||
#define assuan_receivefd _ASSUAN_PREFIX(assuan_receivefd)
|
||||
#define assuan_set_malloc_hooks _ASSUAN_PREFIX(assuan_set_malloc_hooks)
|
||||
#define assuan_set_assuan_log_level _ASSUAN_PREFIX(assuan_set_assuan_log_level)
|
||||
#define assuan_set_log_stream _ASSUAN_PREFIX(assuan_set_log_stream)
|
||||
#define assuan_set_error _ASSUAN_PREFIX(assuan_set_error)
|
||||
#define assuan_set_pointer _ASSUAN_PREFIX(assuan_set_pointer)
|
||||
#define assuan_get_pointer _ASSUAN_PREFIX(assuan_get_pointer)
|
||||
#define assuan_set_io_monitor _ASSUAN_PREFIX(assuan_set_io_monitor)
|
||||
#define assuan_begin_confidential _ASSUAN_PREFIX(assuan_begin_confidential)
|
||||
#define assuan_end_confidential _ASSUAN_PREFIX(assuan_end_confidential)
|
||||
#define assuan_strerror _ASSUAN_PREFIX(assuan_strerror)
|
||||
#define assuan_set_assuan_err_source \
|
||||
_ASSUAN_PREFIX(assuan_set_assuan_err_source)
|
||||
#define assuan_set_assuan_log_stream \
|
||||
_ASSUAN_PREFIX(assuan_set_assuan_log_stream)
|
||||
#define assuan_get_assuan_log_stream \
|
||||
_ASSUAN_PREFIX(assuan_get_assuan_log_stream)
|
||||
#define assuan_get_assuan_log_prefix \
|
||||
_ASSUAN_PREFIX(assuan_get_assuan_log_prefix)
|
||||
#define assuan_set_flag _ASSUAN_PREFIX(assuan_set_flag)
|
||||
#define assuan_get_flag _ASSUAN_PREFIX(assuan_get_flag)
|
||||
#define assuan_pipe_connect2 _ASSUAN_PREFIX(assuan_pipe_connect2)
|
||||
#define assuan_set_assuan_log_prefix \
|
||||
_ASSUAN_PREFIX(assuan_set_assuan_log_prefix)
|
||||
|
||||
/* And now the internal functions, argh... */
|
||||
#define _assuan_read_line _ASSUAN_PREFIX(_assuan_read_line)
|
||||
#define _assuan_cookie_write_data _ASSUAN_PREFIX(_assuan_cookie_write_data)
|
||||
#define _assuan_cookie_write_flush _ASSUAN_PREFIX(_assuan_cookie_write_flush)
|
||||
#define _assuan_read_from_server _ASSUAN_PREFIX(_assuan_read_from_server)
|
||||
#define _assuan_domain_init _ASSUAN_PREFIX(_assuan_domain_init)
|
||||
#define _assuan_register_std_commands \
|
||||
_ASSUAN_PREFIX(_assuan_register_std_commands)
|
||||
#define _assuan_simple_read _ASSUAN_PREFIX(_assuan_simple_read)
|
||||
#define _assuan_simple_write _ASSUAN_PREFIX(_assuan_simple_write)
|
||||
#define _assuan_simple_read _ASSUAN_PREFIX(_assuan_simple_read)
|
||||
#define _assuan_simple_write _ASSUAN_PREFIX(_assuan_simple_write)
|
||||
#define _assuan_new_context _ASSUAN_PREFIX(_assuan_new_context)
|
||||
#define _assuan_release_context _ASSUAN_PREFIX(_assuan_release_context)
|
||||
#define _assuan_malloc _ASSUAN_PREFIX(_assuan_malloc)
|
||||
#define _assuan_realloc _ASSUAN_PREFIX(_assuan_realloc)
|
||||
#define _assuan_calloc _ASSUAN_PREFIX(_assuan_calloc)
|
||||
#define _assuan_free _ASSUAN_PREFIX(_assuan_free)
|
||||
#define _assuan_log_print_buffer _ASSUAN_PREFIX(_assuan_log_print_buffer)
|
||||
#define _assuan_log_sanitized_string \
|
||||
_ASSUAN_PREFIX(_assuan_log_sanitized_string)
|
||||
#define _assuan_log_printf _ASSUAN_PREFIX(_assuan_log_printf)
|
||||
#define _assuan_set_default_log_stream \
|
||||
_ASSUAN_PREFIX(_assuan_set_default_log_stream)
|
||||
#define _assuan_w32_strerror _ASSUAN_PREFIX(_assuan_w32_strerror)
|
||||
#define _assuan_gpg_strerror_r _ASSUAN_PREFIX(_assuan_gpg_strerror_r)
|
||||
#define _assuan_gpg_strsource _ASSUAN_PREFIX(_assuan_gpg_strsource)
|
||||
#define _assuan_write_line _ASSUAN_PREFIX(_assuan_write_line)
|
||||
#define _assuan_close _ASSUAN_PREFIX(_assuan_close)
|
||||
#define _assuan_sock_new _ASSUAN_PREFIX(_assuan_sock_new)
|
||||
#define _assuan_sock_bind _ASSUAN_PREFIX(_assuan_sock_bind)
|
||||
#define _assuan_sock_connect _ASSUAN_PREFIX(_assuan_sock_connect)
|
||||
#define _assuan_error _ASSUAN_PREFIX(_assuan_error)
|
||||
#define _assuan_init_uds_io _ASSUAN_PREFIX(_assuan_init_uds_io)
|
||||
#define _assuan_uds_close_fds _ASSUAN_PREFIX(_assuan_uds_close_fds)
|
||||
#define _assuan_uds_deinit _ASSUAN_PREFIX(_assuan_uds_deinit)
|
||||
#define _assuan_simple_recvmsg _ASSUAN_PREFIX(_assuan_simple_recvmsg)
|
||||
#define _assuan_simple_sendmsg _ASSUAN_PREFIX(_assuan_simple_sendmsg)
|
||||
#define _assuan_waitpid _ASSUAN_PREFIX(_assuan_waitpid)
|
||||
|
||||
#define _assuan_funopen _gpgme_funopen
|
||||
#endif /*_ASSUAN_EXT_SYM_PREFIX*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#if 0
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Check for compiler features. */
|
||||
#if __GNUC__
|
||||
#define _ASSUAN_GCC_VERSION (__GNUC__ * 10000 \
|
||||
+ __GNUC_MINOR__ * 100 \
|
||||
+ __GNUC_PATCHLEVEL__)
|
||||
|
||||
#if _ASSUAN_GCC_VERSION > 30100
|
||||
#define _ASSUAN_DEPRECATED __attribute__ ((__deprecated__))
|
||||
#endif
|
||||
#endif
|
||||
#ifndef _ASSUAN_DEPRECATED
|
||||
#define _ASSUAN_DEPRECATED
|
||||
#endif
|
||||
|
||||
|
||||
/* Assuan error codes. These are only used by old applications or
|
||||
those applications which won't make use of libgpg-error. */
|
||||
#ifndef _ASSUAN_ONLY_GPG_ERRORS
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_No_Error 0
|
||||
#endif
|
||||
#define ASSUAN_General_Error 1
|
||||
#define ASSUAN_Out_Of_Core 2
|
||||
#define ASSUAN_Invalid_Value 3
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_Timeout 4
|
||||
#endif
|
||||
#define ASSUAN_Read_Error 5
|
||||
#define ASSUAN_Write_Error 6
|
||||
#define ASSUAN_Problem_Starting_Server 7
|
||||
#define ASSUAN_Not_A_Server 8
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_Not_A_Client 9
|
||||
#endif
|
||||
#define ASSUAN_Nested_Commands 10
|
||||
#define ASSUAN_Invalid_Response 11
|
||||
#define ASSUAN_No_Data_Callback 12
|
||||
#define ASSUAN_No_Inquire_Callback 13
|
||||
#define ASSUAN_Connect_Failed 14
|
||||
#define ASSUAN_Accept_Failed 15
|
||||
|
||||
/* Error codes above 99 are meant as status codes */
|
||||
#define ASSUAN_Not_Implemented 100
|
||||
#define ASSUAN_Server_Fault 101
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_Invalid_Command 102
|
||||
#endif
|
||||
#define ASSUAN_Unknown_Command 103
|
||||
#define ASSUAN_Syntax_Error 104
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_Parameter_Error 105
|
||||
#endif
|
||||
#define ASSUAN_Parameter_Conflict 106
|
||||
#define ASSUAN_Line_Too_Long 107
|
||||
#define ASSUAN_Line_Not_Terminated 108
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_No_Input 109
|
||||
#define ASSUAN_No_Output 110
|
||||
#endif
|
||||
#define ASSUAN_Canceled 111
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_Unsupported_Algorithm 112
|
||||
#define ASSUAN_Server_Resource_Problem 113
|
||||
#define ASSUAN_Server_IO_Error 114
|
||||
#define ASSUAN_Server_Bug 115
|
||||
#define ASSUAN_No_Data_Available 116
|
||||
#define ASSUAN_Invalid_Data 117
|
||||
#endif
|
||||
#define ASSUAN_Unexpected_Command 118
|
||||
#define ASSUAN_Too_Much_Data 119
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_Inquire_Unknown 120
|
||||
#define ASSUAN_Inquire_Error 121
|
||||
#define ASSUAN_Invalid_Option 122
|
||||
#define ASSUAN_Invalid_Index 123
|
||||
#define ASSUAN_Unexpected_Status 124
|
||||
#define ASSUAN_Unexpected_Data 125
|
||||
#define ASSUAN_Invalid_Status 126
|
||||
#define ASSUAN_Locale_Problem 127
|
||||
#endif
|
||||
#define ASSUAN_Not_Confirmed 128
|
||||
|
||||
/* Warning: Don't use the Error codes, below they are deprecated. */
|
||||
#ifndef _ASSUAN_IN_LIBASSUAN
|
||||
#define ASSUAN_Bad_Certificate 201
|
||||
#define ASSUAN_Bad_Certificate_Chain 202
|
||||
#define ASSUAN_Missing_Certificate 203
|
||||
#define ASSUAN_Bad_Signature 204
|
||||
#define ASSUAN_No_Agent 205
|
||||
#define ASSUAN_Agent_Error 206
|
||||
#define ASSUAN_No_Public_Key 207
|
||||
#define ASSUAN_No_Secret_Key 208
|
||||
#define ASSUAN_Invalid_Name 209
|
||||
|
||||
#define ASSUAN_Cert_Revoked 301
|
||||
#define ASSUAN_No_CRL_For_Cert 302
|
||||
#define ASSUAN_CRL_Too_Old 303
|
||||
#define ASSUAN_Not_Trusted 304
|
||||
|
||||
#define ASSUAN_Card_Error 401
|
||||
#define ASSUAN_Invalid_Card 402
|
||||
#define ASSUAN_No_PKCS15_App 403
|
||||
#define ASSUAN_Card_Not_Present 404
|
||||
#define ASSUAN_Invalid_Id 405
|
||||
|
||||
/* Error codes in the range 1000 to 9999 may be used by applications
|
||||
at their own discretion. */
|
||||
#define ASSUAN_USER_ERROR_FIRST 1000
|
||||
#define ASSUAN_USER_ERROR_LAST 9999
|
||||
#endif
|
||||
|
||||
typedef int assuan_error_t;
|
||||
|
||||
typedef assuan_error_t AssuanError _ASSUAN_DEPRECATED;
|
||||
|
||||
/* This is a list of pre-registered ASSUAN commands */
|
||||
/* Note, these command IDs are now deprectated and solely exists for
|
||||
compatibility reasons. */
|
||||
typedef enum
|
||||
{
|
||||
ASSUAN_CMD_NOP = 0,
|
||||
ASSUAN_CMD_CANCEL, /* cancel the current request */
|
||||
ASSUAN_CMD_BYE,
|
||||
ASSUAN_CMD_AUTH,
|
||||
ASSUAN_CMD_RESET,
|
||||
ASSUAN_CMD_OPTION,
|
||||
ASSUAN_CMD_DATA,
|
||||
ASSUAN_CMD_END,
|
||||
ASSUAN_CMD_INPUT,
|
||||
ASSUAN_CMD_OUTPUT,
|
||||
|
||||
ASSUAN_CMD_USER = 256 /* Other commands should be used with this offset*/
|
||||
} AssuanCommand;
|
||||
|
||||
|
||||
#else /*!_ASSUAN_ONLY_GPG_ERRORS*/
|
||||
|
||||
typedef int assuan_error_t;
|
||||
|
||||
#endif /*!_ASSUAN_ONLY_GPG_ERRORS*/
|
||||
|
||||
|
||||
/* Definitions of flags for assuan_set_flag(). */
|
||||
typedef enum
|
||||
{
|
||||
/* When using a pipe server, by default Assuan will wait for the
|
||||
forked process to die in assuan_disconnect. In certain cases
|
||||
this is not desirable. By setting this flag, the waitpid will
|
||||
be skipped and the caller is responsible to cleanup a forked
|
||||
process. */
|
||||
ASSUAN_NO_WAITPID = 1
|
||||
}
|
||||
assuan_flag_t;
|
||||
|
||||
#define ASSUAN_LINELENGTH 1002 /* 1000 + [CR,]LF */
|
||||
|
||||
struct assuan_context_s;
|
||||
typedef struct assuan_context_s *assuan_context_t;
|
||||
#ifndef _ASSUAN_ONLY_GPG_ERRORS
|
||||
typedef struct assuan_context_s *ASSUAN_CONTEXT _ASSUAN_DEPRECATED;
|
||||
#endif /*_ASSUAN_ONLY_GPG_ERRORS*/
|
||||
|
||||
/*-- assuan-handler.c --*/
|
||||
int assuan_register_command (assuan_context_t ctx,
|
||||
const char *cmd_string,
|
||||
int (*handler)(assuan_context_t, char *));
|
||||
int assuan_register_post_cmd_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t, int));
|
||||
int assuan_register_bye_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t));
|
||||
int assuan_register_reset_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t));
|
||||
int assuan_register_cancel_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t));
|
||||
int assuan_register_input_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t, const char *));
|
||||
int assuan_register_output_notify (assuan_context_t ctx,
|
||||
void (*fnc)(assuan_context_t, const char *));
|
||||
|
||||
int assuan_register_option_handler (assuan_context_t ctx,
|
||||
int (*fnc)(assuan_context_t,
|
||||
const char*, const char*));
|
||||
|
||||
int assuan_process (assuan_context_t ctx);
|
||||
int assuan_process_next (assuan_context_t ctx);
|
||||
int assuan_get_active_fds (assuan_context_t ctx, int what,
|
||||
int *fdarray, int fdarraysize);
|
||||
|
||||
|
||||
FILE *assuan_get_data_fp (assuan_context_t ctx);
|
||||
assuan_error_t assuan_set_okay_line (assuan_context_t ctx, const char *line);
|
||||
assuan_error_t assuan_write_status (assuan_context_t ctx,
|
||||
const char *keyword, const char *text);
|
||||
|
||||
/* Negotiate a file descriptor. If LINE contains "FD=N", returns N
|
||||
assuming a local file descriptor. If LINE contains "FD" reads a
|
||||
file descriptor via CTX and stores it in *RDF (the CTX must be
|
||||
capable of passing file descriptors). */
|
||||
assuan_error_t assuan_command_parse_fd (assuan_context_t ctx, char *line,
|
||||
int *rfd);
|
||||
|
||||
/*-- assuan-listen.c --*/
|
||||
assuan_error_t assuan_set_hello_line (assuan_context_t ctx, const char *line);
|
||||
assuan_error_t assuan_accept (assuan_context_t ctx);
|
||||
int assuan_get_input_fd (assuan_context_t ctx);
|
||||
int assuan_get_output_fd (assuan_context_t ctx);
|
||||
assuan_error_t assuan_close_input_fd (assuan_context_t ctx);
|
||||
assuan_error_t assuan_close_output_fd (assuan_context_t ctx);
|
||||
|
||||
|
||||
/*-- assuan-pipe-server.c --*/
|
||||
int assuan_init_pipe_server (assuan_context_t *r_ctx, int filedes[2]);
|
||||
void assuan_deinit_server (assuan_context_t ctx);
|
||||
|
||||
/*-- assuan-socket-server.c --*/
|
||||
int assuan_init_socket_server (assuan_context_t *r_ctx, int listen_fd);
|
||||
int assuan_init_connected_socket_server (assuan_context_t *r_ctx,
|
||||
int fd) _ASSUAN_DEPRECATED;
|
||||
int assuan_init_socket_server_ext (assuan_context_t *r_ctx, int fd,
|
||||
unsigned int flags);
|
||||
|
||||
/*-- assuan-pipe-connect.c --*/
|
||||
assuan_error_t assuan_pipe_connect (assuan_context_t *ctx,
|
||||
const char *name,
|
||||
const char *const argv[],
|
||||
int *fd_child_list);
|
||||
assuan_error_t assuan_pipe_connect2 (assuan_context_t *ctx,
|
||||
const char *name,
|
||||
const char *const argv[],
|
||||
int *fd_child_list,
|
||||
void (*atfork) (void*, int),
|
||||
void *atforkvalue) _ASSUAN_DEPRECATED;
|
||||
assuan_error_t assuan_pipe_connect_ext (assuan_context_t *ctx,
|
||||
const char *name,
|
||||
const char *const argv[],
|
||||
int *fd_child_list,
|
||||
void (*atfork) (void *, int),
|
||||
void *atforkvalue,
|
||||
unsigned int flags);
|
||||
|
||||
/*-- assuan-socket-connect.c --*/
|
||||
assuan_error_t assuan_socket_connect (assuan_context_t *ctx,
|
||||
const char *name,
|
||||
pid_t server_pid);
|
||||
assuan_error_t assuan_socket_connect_ext (assuan_context_t *ctx,
|
||||
const char *name,
|
||||
pid_t server_pid,
|
||||
unsigned int flags);
|
||||
|
||||
/*-- assuan-connect.c --*/
|
||||
void assuan_disconnect (assuan_context_t ctx);
|
||||
pid_t assuan_get_pid (assuan_context_t ctx);
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
assuan_error_t assuan_get_peercred (assuan_context_t ctx,
|
||||
pid_t *pid, uid_t *uid, gid_t *gid);
|
||||
#endif
|
||||
|
||||
/*-- assuan-client.c --*/
|
||||
assuan_error_t
|
||||
assuan_transact (assuan_context_t ctx,
|
||||
const char *command,
|
||||
int (*data_cb)(void *, const void *, size_t),
|
||||
void *data_cb_arg,
|
||||
int (*inquire_cb)(void*, const char *),
|
||||
void *inquire_cb_arg,
|
||||
int (*status_cb)(void*, const char *),
|
||||
void *status_cb_arg);
|
||||
|
||||
|
||||
/*-- assuan-inquire.c --*/
|
||||
assuan_error_t assuan_inquire (assuan_context_t ctx, const char *keyword,
|
||||
unsigned char **r_buffer, size_t *r_length,
|
||||
size_t maxlen);
|
||||
|
||||
/*-- assuan-buffer.c --*/
|
||||
assuan_error_t assuan_read_line (assuan_context_t ctx,
|
||||
char **line, size_t *linelen);
|
||||
int assuan_pending_line (assuan_context_t ctx);
|
||||
assuan_error_t assuan_write_line (assuan_context_t ctx, const char *line );
|
||||
assuan_error_t assuan_send_data (assuan_context_t ctx,
|
||||
const void *buffer, size_t length);
|
||||
|
||||
/* The file descriptor must be pending before assuan_receivefd is
|
||||
called. This means that assuan_sendfd should be called *before* the
|
||||
trigger is sent (normally via assuan_write_line ("INPUT FD")). */
|
||||
assuan_error_t assuan_sendfd (assuan_context_t ctx, int fd);
|
||||
assuan_error_t assuan_receivefd (assuan_context_t ctx, int *fd);
|
||||
|
||||
/*-- assuan-util.c --*/
|
||||
void assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n),
|
||||
void *(*new_realloc_func)(void *p, size_t n),
|
||||
void (*new_free_func)(void*) );
|
||||
void assuan_set_log_stream (assuan_context_t ctx, FILE *fp);
|
||||
int assuan_set_error (assuan_context_t ctx, int err, const char *text);
|
||||
void assuan_set_pointer (assuan_context_t ctx, void *pointer);
|
||||
void *assuan_get_pointer (assuan_context_t ctx);
|
||||
|
||||
void assuan_begin_confidential (assuan_context_t ctx);
|
||||
void assuan_end_confidential (assuan_context_t ctx);
|
||||
|
||||
void assuan_set_io_monitor (assuan_context_t ctx,
|
||||
unsigned int (*monitor)(assuan_context_t ctx,
|
||||
int direction,
|
||||
const char *line,
|
||||
size_t linelen));
|
||||
|
||||
/* For context CTX, set the flag FLAG to VALUE. Values for flags
|
||||
are usually 1 or 0 but certain flags might allow for other values;
|
||||
see the description of the type assuan_flag_t for details. */
|
||||
void assuan_set_flag (assuan_context_t ctx, assuan_flag_t flag, int value);
|
||||
|
||||
/* Return the VALUE of FLAG in context CTX. */
|
||||
int assuan_get_flag (assuan_context_t ctx, assuan_flag_t flag);
|
||||
|
||||
|
||||
/*-- assuan-errors.c --*/
|
||||
|
||||
#ifndef _ASSUAN_ONLY_GPG_ERRORS
|
||||
/* Return a string describing the assuan error. The use of this
|
||||
function is deprecated; it is better to call
|
||||
assuan_set_assuan_err_source once and then make use libgpg-error. */
|
||||
const char *assuan_strerror (assuan_error_t err);
|
||||
#endif /*_ASSUAN_ONLY_GPG_ERRORS*/
|
||||
|
||||
/* Enable gpg-error style error codes. ERRSOURCE is one of gpg-error
|
||||
sources. Note, that this function is not thread-safe and should be
|
||||
used right at startup. Switching back to the old style mode is not
|
||||
supported. */
|
||||
void assuan_set_assuan_err_source (int errsource);
|
||||
|
||||
/*-- assuan-logging.c --*/
|
||||
|
||||
/* Set the log level for general assuan commands. 0 is no logging at
|
||||
all, 1 is the standard logging and the default. Higher leveles may
|
||||
be defined in the future. Passing a level of -1 will not change
|
||||
the current log level. Returns previous log level. Note, that
|
||||
this function is not thread-safe and should in general be used
|
||||
right at startup. */
|
||||
int assuan_set_assuan_log_level (int level);
|
||||
|
||||
/* Set the stream to which assuan should log message not associated
|
||||
with a context. By default, this is stderr. The default value
|
||||
will be changed when the first log stream is associated with a
|
||||
context. Note, that this function is not thread-safe and should
|
||||
in general be used right at startup. */
|
||||
extern void assuan_set_assuan_log_stream (FILE *fp);
|
||||
|
||||
/* Return the stream which is currently being using for global logging. */
|
||||
extern FILE *assuan_get_assuan_log_stream (void);
|
||||
|
||||
/* Set the prefix to be used at the start of a line emitted by assuan
|
||||
on the log stream. The default is the empty string. Note, that
|
||||
this function is not thread-safe and should in general be used
|
||||
right at startup. */
|
||||
void assuan_set_assuan_log_prefix (const char *text);
|
||||
|
||||
/* Return a prefix to be used at the start of a line emitted by assuan
|
||||
on the log stream. The default implementation returns the empty
|
||||
string, i.e. "" */
|
||||
const char *assuan_get_assuan_log_prefix (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* ASSUAN_H */
|
248
tags/gpgme-1.1.8/assuan/mkerrors
Executable file
248
tags/gpgme-1.1.8/assuan/mkerrors
Executable file
@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
# mkerrors - Extract error strings from assuan.h
|
||||
# and create C source for assuan_strerror
|
||||
# Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of Assuan.
|
||||
#
|
||||
# Assuan 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.1 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# Assuan 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 program; if not, see <http://www.gnu.org/licenses/>.
|
||||
cat <<EOF
|
||||
/* Generated automatically by mkerrors */
|
||||
/* Do not edit! See mkerrors for copyright notice. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#undef _ASSUAN_IN_LIBASSUAN /* undef to get all error codes. */
|
||||
#include "assuan.h"
|
||||
|
||||
/* If true the modern gpg-error style error codes are used in the
|
||||
API. */
|
||||
static unsigned int err_source;
|
||||
|
||||
/* Enable gpg-error style error codes. ERRSOURCE is one of gpg-error
|
||||
sources. Note, that this function is not thread-safe and should be
|
||||
used right at startup. Switching back to the old style mode is not
|
||||
supported. */
|
||||
void
|
||||
assuan_set_assuan_err_source (int errsource)
|
||||
{
|
||||
errsource &= 0xff;
|
||||
err_source = errsource? errsource : 31 /*GPG_ERR_SOURCE_ANY*/;
|
||||
}
|
||||
|
||||
|
||||
/* Helper to map old style Assuan error codes to gpg-error codes.
|
||||
This is used internally to keep an compatible ABI. */
|
||||
assuan_error_t
|
||||
_assuan_error (int oldcode)
|
||||
{
|
||||
unsigned int n;
|
||||
|
||||
if (!err_source)
|
||||
{
|
||||
if (oldcode == -1)
|
||||
return -1;
|
||||
else
|
||||
return (oldcode & 0x00ffffff); /* Make sure that the gpg-error
|
||||
source part is cleared. */
|
||||
}
|
||||
|
||||
switch (oldcode)
|
||||
{
|
||||
case ASSUAN_General_Error: n = 257; break;
|
||||
case ASSUAN_Accept_Failed: n = 258; break;
|
||||
case ASSUAN_Connect_Failed: n = 259; break;
|
||||
case ASSUAN_Invalid_Response: n = 260; break;
|
||||
case ASSUAN_Invalid_Value: n = 261; break;
|
||||
case ASSUAN_Line_Not_Terminated: n = 262; break;
|
||||
case ASSUAN_Line_Too_Long: n = 263; break;
|
||||
case ASSUAN_Nested_Commands: n = 264; break;
|
||||
case ASSUAN_No_Data_Callback: n = 265; break;
|
||||
case ASSUAN_No_Inquire_Callback: n = 266; break;
|
||||
case ASSUAN_Not_A_Server: n = 267; break;
|
||||
case ASSUAN_Not_Implemented: n = 69; break;
|
||||
case ASSUAN_Parameter_Conflict: n = 280; break;
|
||||
case ASSUAN_Problem_Starting_Server: n = 269; break;
|
||||
case ASSUAN_Server_Fault: n = 80; break;
|
||||
case ASSUAN_Syntax_Error: n = 276; break;
|
||||
case ASSUAN_Too_Much_Data: n = 273; break;
|
||||
case ASSUAN_Unexpected_Command: n = 274; break;
|
||||
case ASSUAN_Unknown_Command: n = 275; break;
|
||||
case ASSUAN_Canceled: n = 277; break;
|
||||
case ASSUAN_No_Secret_Key: n = 17; break;
|
||||
case ASSUAN_Not_Confirmed: n = 114; break;
|
||||
|
||||
case ASSUAN_Read_Error:
|
||||
switch (errno)
|
||||
{
|
||||
case 0: n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break;
|
||||
case EAGAIN:
|
||||
if (errno > 0 && errno < 4096)
|
||||
{
|
||||
n = (EAGAIN | (1 << 15));
|
||||
break;
|
||||
}
|
||||
default: n = 270; /*GPG_ERR_ASS_READ_ERROR*/ break;
|
||||
}
|
||||
break;
|
||||
|
||||
case ASSUAN_Write_Error:
|
||||
switch (errno)
|
||||
{
|
||||
case 0: n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break;
|
||||
case EAGAIN:
|
||||
if (errno > 0 && errno < 4096)
|
||||
{
|
||||
n = (EAGAIN | (1 << 15));
|
||||
break;
|
||||
}
|
||||
default: n = 271; /*GPG_ERR_ASS_WRITE_ERROR*/ break;
|
||||
}
|
||||
break;
|
||||
|
||||
case ASSUAN_Out_Of_Core:
|
||||
switch (errno)
|
||||
{
|
||||
case 0: /* Should not happen but a user might have provided
|
||||
an incomplete implemented malloc function. Give
|
||||
him a chance to correct this fault but make sure
|
||||
an error is indeed returned. */
|
||||
n = 16381; /*GPG_ERR_MISSING_ERRNO*/
|
||||
break;
|
||||
case ENOMEM:
|
||||
if (errno > 0 && errno < 4096)
|
||||
{
|
||||
n = (ENOMEM | (1 << 15));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
n = 16382; /*GPG_ERR_UNKNOWN_ERRNO*/
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case -1: n = 16383 /*GPG_ERR_EOF*/; break;
|
||||
|
||||
default:
|
||||
n = 257;
|
||||
break;
|
||||
}
|
||||
|
||||
return ((err_source << 24) | (n & 0x00ffffff));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assuan_strerror:
|
||||
* @err: Error code
|
||||
*
|
||||
* This function returns a textual representaion of the given
|
||||
* errorcode. If this is an unknown value, a string with the value
|
||||
* is returned (Beware: it is hold in a static buffer).
|
||||
*
|
||||
* Return value: String with the error description.
|
||||
**/
|
||||
const char *
|
||||
assuan_strerror (assuan_error_t err)
|
||||
{
|
||||
const char *s;
|
||||
static char buf[50];
|
||||
|
||||
switch (err)
|
||||
{
|
||||
EOF
|
||||
|
||||
awk '
|
||||
/ASSUAN_No_Error/ { okay=1 }
|
||||
!okay {next}
|
||||
/^#define[ ]+ASSUAN_[A-Za-z_]*/ { print_code($2) }
|
||||
/ASSUAN_USER_ERROR_LAST/ { exit 0 }
|
||||
|
||||
|
||||
function print_code( s )
|
||||
{
|
||||
printf " case %s: s=\"", s ;
|
||||
gsub(/_/, " ", s );
|
||||
printf "%s\"; break;\n", tolower(substr(s,8));
|
||||
}
|
||||
'
|
||||
|
||||
cat <<EOF
|
||||
case -1: s = "EOF (-1)"; break;
|
||||
default:
|
||||
{
|
||||
unsigned int source, code, n;
|
||||
|
||||
source = ((err >> 24) & 0xff);
|
||||
code = (err & 0x00ffffff);
|
||||
if (source)
|
||||
{
|
||||
/* Assume this is an libgpg-error and try to map the codes
|
||||
back. */
|
||||
switch (code)
|
||||
{
|
||||
case 257: n = ASSUAN_General_Error ; break;
|
||||
case 258: n = ASSUAN_Accept_Failed ; break;
|
||||
case 259: n = ASSUAN_Connect_Failed ; break;
|
||||
case 260: n = ASSUAN_Invalid_Response ; break;
|
||||
case 261: n = ASSUAN_Invalid_Value ; break;
|
||||
case 262: n = ASSUAN_Line_Not_Terminated ; break;
|
||||
case 263: n = ASSUAN_Line_Too_Long ; break;
|
||||
case 264: n = ASSUAN_Nested_Commands ; break;
|
||||
case 265: n = ASSUAN_No_Data_Callback ; break;
|
||||
case 266: n = ASSUAN_No_Inquire_Callback ; break;
|
||||
case 267: n = ASSUAN_Not_A_Server ; break;
|
||||
case 69: n = ASSUAN_Not_Implemented ; break;
|
||||
case 280: n = ASSUAN_Parameter_Conflict ; break;
|
||||
case 269: n = ASSUAN_Problem_Starting_Server; break;
|
||||
case 270: n = ASSUAN_Read_Error ; break;
|
||||
case 271: n = ASSUAN_Write_Error ; break;
|
||||
case 80: n = ASSUAN_Server_Fault ; break;
|
||||
case 276: n = ASSUAN_Syntax_Error ; break;
|
||||
case 273: n = ASSUAN_Too_Much_Data ; break;
|
||||
case 274: n = ASSUAN_Unexpected_Command ; break;
|
||||
case 275: n = ASSUAN_Unknown_Command ; break;
|
||||
case 277: n = ASSUAN_Canceled ; break;
|
||||
case 114: n = ASSUAN_Not_Confirmed ; break;
|
||||
case ((1<<15)|86): n = ASSUAN_Out_Of_Core ; break;
|
||||
default: n = 0; break;
|
||||
}
|
||||
if (n)
|
||||
s = assuan_strerror (n);
|
||||
else
|
||||
{
|
||||
sprintf (buf, "ec=%u.%u", source, code );
|
||||
s=buf;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (buf, "ec=%d", err );
|
||||
s=buf;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
EOF
|
162
tags/gpgme-1.1.8/autogen.sh
Executable file
162
tags/gpgme-1.1.8/autogen.sh
Executable file
@ -0,0 +1,162 @@
|
||||
#! /bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
#
|
||||
# Copyright (C) 2003 g10 Code GmbH
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
configure_ac="configure.ac"
|
||||
|
||||
cvtver () {
|
||||
awk 'NR==1 {split($NF,A,".");X=1000000*A[1]+1000*A[2]+A[3];print X;exit 0}'
|
||||
}
|
||||
|
||||
check_version () {
|
||||
if [ `("$1" --version || echo "0") | cvtver` -ge "$2" ]; then
|
||||
return 0
|
||||
fi
|
||||
echo "**Error**: "\`$1\'" not installed or too old." >&2
|
||||
echo ' Version '$3' or newer is required.' >&2
|
||||
[ -n "$4" ] && echo ' Note that this is part of '\`$4\''.' >&2
|
||||
DIE="yes"
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
DIE=no
|
||||
FORCE=
|
||||
if test "$1" = "--force"; then
|
||||
FORCE=" --force"
|
||||
shift
|
||||
fi
|
||||
|
||||
# Used to cross-compile for Windows.
|
||||
if test "$1" = "--build-w32"; then
|
||||
tmp=`dirname $0`
|
||||
tsdir=`cd "$tmp"; pwd`
|
||||
shift
|
||||
if [ ! -f $tsdir/config.guess ]; then
|
||||
echo "$tsdir/config.guess not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
build=`$tsdir/config.guess`
|
||||
|
||||
[ -z "$w32root" ] && w32root="$HOME/w32root"
|
||||
echo "Using $w32root as standard install directory" >&2
|
||||
|
||||
# See whether we have the Debian cross compiler package or the
|
||||
# old mingw32/cpd system
|
||||
if i586-mingw32msvc-gcc --version >/dev/null 2>&1 ; then
|
||||
host=i586-mingw32msvc
|
||||
crossbindir=/usr/$host/bin
|
||||
else
|
||||
host=i386--mingw32
|
||||
if ! mingw32 --version >/dev/null; then
|
||||
echo "We need at least version 0.3 of MingW32/CPD" >&2
|
||||
exit 1
|
||||
fi
|
||||
crossbindir=`mingw32 --install-dir`/bin
|
||||
# Old autoconf version required us to setup the environment
|
||||
# with the proper tool names.
|
||||
CC=`mingw32 --get-path gcc`
|
||||
CPP=`mingw32 --get-path cpp`
|
||||
AR=`mingw32 --get-path ar`
|
||||
RANLIB=`mingw32 --get-path ranlib`
|
||||
export CC CPP AR RANLIB
|
||||
fi
|
||||
|
||||
if [ -f "$tsdir/config.log" ]; then
|
||||
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
|
||||
echo "Pease run a 'make distclean' first" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
./configure --enable-maintainer-mode --prefix=${w32root} \
|
||||
--host=i586-mingw32msvc --build=${build} \
|
||||
--with-gpg-error-prefix=${w32root} \
|
||||
--enable-shared --enable-static --enable-w32-glib \
|
||||
PKG_CONFIG_LIBDIR="$w32root/lib/pkgconfig"
|
||||
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Grep the required versions from configure.ac
|
||||
autoconf_vers=`sed -n '/^AC_PREREQ(/ {
|
||||
s/^.*(\(.*\))/\1/p
|
||||
q
|
||||
}' ${configure_ac}`
|
||||
autoconf_vers_num=`echo "$autoconf_vers" | cvtver`
|
||||
|
||||
automake_vers=`sed -n '/^min_automake_version=/ {
|
||||
s/^.*="\(.*\)"/\1/p
|
||||
q
|
||||
}' ${configure_ac}`
|
||||
automake_vers_num=`echo "$automake_vers" | cvtver`
|
||||
|
||||
#gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
|
||||
#s/^.*(\(.*\))/\1/p
|
||||
#q
|
||||
#}' ${configure_ac}`
|
||||
#gettext_vers_num=`echo "$gettext_vers" | cvtver`
|
||||
|
||||
|
||||
if [ -z "$autoconf_vers" -o -z "$automake_vers" ]
|
||||
then
|
||||
echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Allow to override the default tool names
|
||||
AUTOCONF=${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX}
|
||||
AUTOHEADER=${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX}
|
||||
|
||||
AUTOMAKE=${AUTOMAKE_PREFIX}${AUTOMAKE:-automake}${AUTOMAKE_SUFFIX}
|
||||
ACLOCAL=${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX}
|
||||
|
||||
#GETTEXT=${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX}
|
||||
#MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX}
|
||||
|
||||
DIE=no
|
||||
|
||||
|
||||
if check_version $AUTOCONF $autoconf_vers_num $autoconf_vers ; then
|
||||
check_version $AUTOHEADER $autoconf_vers_num $autoconf_vers autoconf
|
||||
fi
|
||||
if check_version $AUTOMAKE $automake_vers_num $automake_vers; then
|
||||
check_version $ACLOCAL $automake_vers_num $automake_vers automake
|
||||
fi
|
||||
#if check_version $GETTEXT $gettext_vers_num $gettext_vers; then
|
||||
# check_version $MSGMERGE $gettext_vers_num $gettext_vers gettext
|
||||
#fi
|
||||
|
||||
if test "$DIE" = "yes"; then
|
||||
cat <<EOF
|
||||
|
||||
Note that you may use alternative versions of the tools by setting
|
||||
the corresponding environment variables; see README.CVS for details.
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running aclocal -I m4 ${ACLOCAL_FLAGS:+$ACLOCAL_FLAGS }..."
|
||||
$ACLOCAL -I m4 $ACLOCAL_FLAGS
|
||||
echo "Running autoheader..."
|
||||
$AUTOHEADER
|
||||
echo "Running automake --gnu ..."
|
||||
$AUTOMAKE --gnu;
|
||||
echo "Running autoconf${FORCE} ..."
|
||||
$AUTOCONF${FORCE}
|
||||
|
||||
echo "You may now run \"./configure --enable-maintainer-mode && make\"."
|
99
tags/gpgme-1.1.8/compile
Executable file
99
tags/gpgme-1.1.8/compile
Executable file
@ -0,0 +1,99 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Usage:
|
||||
# compile PROGRAM [ARGS]...
|
||||
# `-o FOO.o' is removed from the args passed to the actual compile.
|
||||
|
||||
prog=$1
|
||||
shift
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
args=
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we do something ugly here.
|
||||
ofile=$2
|
||||
shift
|
||||
case "$ofile" in
|
||||
*.o | *.obj)
|
||||
;;
|
||||
*)
|
||||
args="$args -o $ofile"
|
||||
ofile=
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
args="$args $1"
|
||||
;;
|
||||
*)
|
||||
args="$args $1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$prog" $args
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir $lockdir > /dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir $lockdir; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$prog" $args
|
||||
status=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
mv "$cofile" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir $lockdir
|
||||
exit $status
|
15
tags/gpgme-1.1.8/complus/ChangeLog
Normal file
15
tags/gpgme-1.1.8/complus/ChangeLog
Normal file
@ -0,0 +1,15 @@
|
||||
2001-07-30 Werner Koch <wk@gnupg.org>
|
||||
|
||||
Encryption basically works.
|
||||
|
||||
|
||||
Copyright 2001 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
49
tags/gpgme-1.1.8/complus/Makefile.am
Normal file
49
tags/gpgme-1.1.8/complus/Makefile.am
Normal file
@ -0,0 +1,49 @@
|
||||
# Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
# Copyright (C) 2001 g10 Code GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
#
|
||||
# GPGME 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.
|
||||
#
|
||||
# GPGME 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
# Because WIDL does not yet fully support generation of typelibs, we
|
||||
# have to distribute a binary type library. To generate a new one,
|
||||
# copy the idl file to a system with an install MIDL and run the
|
||||
# command "midl /nocpp gpgcom.idl". Sorry, there is no other way yet.
|
||||
|
||||
EXTRA_DIST = gpgcom.idl gpgcom.tlb gpgcom.rc vbtest.html vbtest.vbs README
|
||||
|
||||
# No need to install this because we are cross-compiling anyway.
|
||||
noinst_PROGRAMS = gpgcom tgpgcom
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/jnlib
|
||||
LDADD = ../gpgme/libgpgme.la -L ../jnlib -ljnlib -lole32 -loleaut32
|
||||
gpgcom_LDADD = gpgcom_res.o $(LDADD)
|
||||
|
||||
gpgcom_SOURCES = gpgcom.c main.h \
|
||||
debug.c utf8.c \
|
||||
igpgme.h igpgme.c
|
||||
|
||||
tgpgcom_SOURCES = tgpgcom.c\
|
||||
debug.c \
|
||||
igpgme.h
|
||||
|
||||
#regtlb_SOURCES = regtlb.c
|
||||
#guidgen_SOURCES = guidgen.c
|
||||
|
||||
gpgcom_res.o: gpgcom.rc
|
||||
mingw32 windres $< gpgcom_res.o
|
||||
|
72
tags/gpgme-1.1.8/complus/README
Normal file
72
tags/gpgme-1.1.8/complus/README
Normal file
@ -0,0 +1,72 @@
|
||||
How to install and use the Gpgcom Windows Component
|
||||
===================================================
|
||||
2001-07-31
|
||||
|
||||
|
||||
Installation should be pretty easy:
|
||||
-----------------------------------
|
||||
|
||||
* Get and install the latest GnuPG binary for windows
|
||||
(ftp://ftp.gnupg.org/gcrypt/binary/gnupg-w32-1.0.6.zip)
|
||||
|
||||
* Check that you have an untampered version of this package by
|
||||
comparing an MD5SUM against the one on the webpage or by checking
|
||||
the signature of the package using "gpg --verify". See the
|
||||
webpacge for details.
|
||||
|
||||
* Because you are reading this file, you probably have already
|
||||
unpacked it distribution using a unzip utility :-). You should
|
||||
find these files:
|
||||
|
||||
README - This file
|
||||
gpgcom.exe - The Gpgcom server
|
||||
vbtest.html - A Test webpage
|
||||
vbtest.vbs - A VB script to be used with the cscript utility
|
||||
|
||||
* If you are updating Gpgcom, run the old Gpgcom like this:
|
||||
|
||||
c:\gnupg\gpgcom -UnregServer
|
||||
|
||||
(Replace c:\gnupg with the actually used path)
|
||||
|
||||
* Copy the file gpgcom.exe to a some location. C:\gnupg seems to be
|
||||
a good choice.
|
||||
|
||||
* Register the component using this command:
|
||||
|
||||
c:\gnupg\gpgcom -RegServer
|
||||
|
||||
* Ready
|
||||
|
||||
Testing the installation:
|
||||
-------------------------
|
||||
|
||||
* Make sure that you have a working GnuPG (gpg.exe) and that at least
|
||||
one key is installed.
|
||||
|
||||
* Edit the vbtest.vbs script and replace "alice" in the line
|
||||
|
||||
gpg.AddRecipient "alice"
|
||||
|
||||
with a keyID or user name you have in your key ring.
|
||||
|
||||
* Run the test script:
|
||||
|
||||
cscript vbtest.vbs
|
||||
|
||||
and you should see a valid MIME message with the encrypted text.
|
||||
|
||||
|
||||
Using Gpgcom
|
||||
------------
|
||||
|
||||
Gpgcom currently support only encryption but will be extended to the
|
||||
full range of operations GnuPG provides. The 2 examples should goive
|
||||
yopu a hint on how to use it. We suggest that you always set armor to
|
||||
true, so that the returned text is a string. If you don't use armor,
|
||||
the "ciphertext" property will return an array with the binary
|
||||
message.
|
||||
|
||||
|
||||
|
||||
|
40
tags/gpgme-1.1.8/complus/debug.c
Normal file
40
tags/gpgme-1.1.8/complus/debug.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* debug.c - COM+ debug helpers
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <ole2.h>
|
||||
|
||||
|
||||
const char *
|
||||
debugstr_guid (const GUID *id)
|
||||
{
|
||||
static char str[100];
|
||||
|
||||
if (!id)
|
||||
return "(null)";
|
||||
sprintf( str, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||
id->Data1, id->Data2, id->Data3,
|
||||
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
|
||||
id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
|
||||
return str;
|
||||
}
|
||||
|
598
tags/gpgme-1.1.8/complus/example.c
Normal file
598
tags/gpgme-1.1.8/complus/example.c
Normal file
@ -0,0 +1,598 @@
|
||||
/*
|
||||
* Copyright 1999 Marcus Meissner
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "mmsystem.h"
|
||||
#include "winerror.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
#include "initguid.h"
|
||||
#include "vfw.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LPVOID *obj);
|
||||
static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile* iface);
|
||||
static ULONG WINAPI IAVIFile_fnRelease(IAVIFile* iface);
|
||||
static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile*iface,AVIFILEINFOW*afi,LONG size);
|
||||
static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam);
|
||||
static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi);
|
||||
static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG size);
|
||||
static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG *size);
|
||||
static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile*iface);
|
||||
static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile*iface,DWORD fccType,LONG lParam);
|
||||
|
||||
struct ICOM_VTABLE(IAVIFile) iavift = {
|
||||
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||
IAVIFile_fnQueryInterface,
|
||||
IAVIFile_fnAddRef,
|
||||
IAVIFile_fnRelease,
|
||||
IAVIFile_fnInfo,
|
||||
IAVIFile_fnGetStream,
|
||||
IAVIFile_fnCreateStream,
|
||||
IAVIFile_fnWriteData,
|
||||
IAVIFile_fnReadData,
|
||||
IAVIFile_fnEndRecord,
|
||||
IAVIFile_fnDeleteStream
|
||||
};
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj);
|
||||
static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface);
|
||||
static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface);
|
||||
static HRESULT WINAPI IAVIStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2);
|
||||
static HRESULT WINAPI IAVIStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size);
|
||||
static LONG WINAPI IAVIStream_fnFindSample(IAVIStream*iface,LONG pos,LONG flags);
|
||||
static HRESULT WINAPI IAVIStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG *formatsize);
|
||||
static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize);
|
||||
static HRESULT WINAPI IAVIStream_fnRead(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
|
||||
static HRESULT WINAPI IAVIStream_fnWrite(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
|
||||
static HRESULT WINAPI IAVIStream_fnDelete(IAVIStream*iface,LONG start,LONG samples);
|
||||
static HRESULT WINAPI IAVIStream_fnReadData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG *lpread);
|
||||
static HRESULT WINAPI IAVIStream_fnWriteData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG size);
|
||||
static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen);
|
||||
|
||||
struct ICOM_VTABLE(IAVIStream) iavist = {
|
||||
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||
IAVIStream_fnQueryInterface,
|
||||
IAVIStream_fnAddRef,
|
||||
IAVIStream_fnRelease,
|
||||
IAVIStream_fnCreate,
|
||||
IAVIStream_fnInfo,
|
||||
IAVIStream_fnFindSample,
|
||||
IAVIStream_fnReadFormat,
|
||||
IAVIStream_fnSetFormat,
|
||||
IAVIStream_fnRead,
|
||||
IAVIStream_fnWrite,
|
||||
IAVIStream_fnDelete,
|
||||
IAVIStream_fnReadData,
|
||||
IAVIStream_fnWriteData,
|
||||
IAVIStream_fnSetInfo
|
||||
};
|
||||
|
||||
typedef struct IAVIStreamImpl {
|
||||
/* IUnknown stuff */
|
||||
ICOM_VFIELD(IAVIStream);
|
||||
DWORD ref;
|
||||
/* IAVIStream stuff */
|
||||
LPVOID lpInputFormat;
|
||||
DWORD inputformatsize;
|
||||
BOOL iscompressing;
|
||||
DWORD curframe;
|
||||
|
||||
/* Compressor stuff */
|
||||
HIC hic;
|
||||
LPVOID lpCompressFormat;
|
||||
ICINFO icinfo;
|
||||
DWORD compbufsize;
|
||||
LPVOID compbuffer;
|
||||
|
||||
DWORD decompbufsize;
|
||||
LPVOID decompbuffer;
|
||||
LPVOID decompformat;
|
||||
AVICOMPRESSOPTIONS aco;
|
||||
|
||||
LPVOID lpPrev; /* pointer to decompressed frame later */
|
||||
LPVOID lpPrevFormat; /* pointer to decompressed info later */
|
||||
} IAVIStreamImpl;
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileInit
|
||||
*/
|
||||
void WINAPI
|
||||
AVIFileInit(void) {
|
||||
FIXME("(),stub!\n");
|
||||
}
|
||||
|
||||
typedef struct IAVIFileImpl {
|
||||
/* IUnknown stuff */
|
||||
ICOM_VFIELD(IAVIFile);
|
||||
DWORD ref;
|
||||
/* IAVIFile stuff... */
|
||||
} IAVIFileImpl;
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LPVOID *obj) {
|
||||
ICOM_THIS(IAVIFileImpl,iface);
|
||||
|
||||
TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(refiid),obj);
|
||||
if ( !memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) ||
|
||||
!memcmp(&IID_IAVIFile,refiid,sizeof(IID_IAVIFile))
|
||||
) {
|
||||
*obj = iface;
|
||||
return S_OK;
|
||||
}
|
||||
return OLE_E_ENUM_NOMORE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile* iface) {
|
||||
ICOM_THIS(IAVIFileImpl,iface);
|
||||
|
||||
FIXME("(%p)->AddRef()\n",iface);
|
||||
return ++(This->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IAVIFile_fnRelease(IAVIFile* iface) {
|
||||
ICOM_THIS(IAVIFileImpl,iface);
|
||||
|
||||
FIXME("(%p)->Release()\n",iface);
|
||||
if (!--(This->ref)) {
|
||||
HeapFree(GetProcessHeap(),0,iface);
|
||||
return 0;
|
||||
}
|
||||
return This->ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile*iface,AVIFILEINFOW*afi,LONG size) {
|
||||
FIXME("(%p)->Info(%p,%ld)\n",iface,afi,size);
|
||||
|
||||
/* FIXME: fill out struct? */
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam) {
|
||||
FIXME("(%p)->GetStream(%p,0x%08lx,%ld)\n",iface,avis,fccType,lParam);
|
||||
/* FIXME: create interface etc. */
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi) {
|
||||
ICOM_THIS(IAVIStreamImpl,iface);
|
||||
char fcc[5];
|
||||
IAVIStreamImpl *istream;
|
||||
|
||||
FIXME("(%p,%p,%p)\n",This,avis,asi);
|
||||
istream = (IAVIStreamImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IAVIStreamImpl));
|
||||
istream->ref = 1;
|
||||
ICOM_VTBL(istream) = &iavist;
|
||||
fcc[4]='\0';
|
||||
memcpy(fcc,(char*)&(asi->fccType),4);
|
||||
FIXME("\tfccType '%s'\n",fcc);
|
||||
memcpy(fcc,(char*)&(asi->fccHandler),4);
|
||||
FIXME("\tfccHandler '%s'\n",fcc);
|
||||
FIXME("\tdwFlags 0x%08lx\n",asi->dwFlags);
|
||||
FIXME("\tdwCaps 0x%08lx\n",asi->dwCaps);
|
||||
FIXME("\tname '%s'\n",debugstr_w(asi->szName));
|
||||
|
||||
istream->curframe = 0;
|
||||
*avis = (PAVISTREAM)istream;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG size) {
|
||||
FIXME("(%p)->WriteData(0x%08lx,%p,%ld)\n",iface,ckid,lpData,size);
|
||||
/* FIXME: write data to file */
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG *size) {
|
||||
FIXME("(%p)->ReadData(0x%08lx,%p,%p)\n",iface,ckid,lpData,size);
|
||||
/* FIXME: read at most size bytes from file */
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile*iface) {
|
||||
FIXME("(%p)->EndRecord()\n",iface);
|
||||
/* FIXME: end record? */
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile*iface,DWORD fccType,LONG lParam) {
|
||||
FIXME("(%p)->DeleteStream(0x%08lx,%ld)\n",iface,fccType,lParam);
|
||||
/* FIXME: delete stream? */
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileOpenA
|
||||
*/
|
||||
HRESULT WINAPI AVIFileOpenA(
|
||||
PAVIFILE * ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler
|
||||
) {
|
||||
IAVIFileImpl *iavi;
|
||||
|
||||
FIXME("(%p,%s,0x%08lx,%s),stub!\n",ppfile,szFile,(DWORD)uMode,debugstr_guid(lpHandler));
|
||||
iavi = (IAVIFileImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IAVIFileImpl));
|
||||
iavi->ref = 1;
|
||||
ICOM_VTBL(iavi) = &iavift;
|
||||
*ppfile = (LPVOID)iavi;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj) {
|
||||
ICOM_THIS(IAVIStreamImpl,iface);
|
||||
|
||||
TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(refiid),obj);
|
||||
if ( !memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) ||
|
||||
!memcmp(&IID_IAVIStream,refiid,sizeof(IID_IAVIStream))
|
||||
) {
|
||||
*obj = This;
|
||||
return S_OK;
|
||||
}
|
||||
/* can return IGetFrame interface too */
|
||||
return OLE_E_ENUM_NOMORE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface) {
|
||||
ICOM_THIS(IAVIStreamImpl,iface);
|
||||
|
||||
FIXME("(%p)->AddRef()\n",iface);
|
||||
return ++(This->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface) {
|
||||
ICOM_THIS(IAVIStreamImpl,iface);
|
||||
|
||||
FIXME("(%p)->Release()\n",iface);
|
||||
if (!--(This->ref)) {
|
||||
HeapFree(GetProcessHeap(),0,This);
|
||||
return 0;
|
||||
}
|
||||
return This->ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2) {
|
||||
FIXME("(%p)->Create(0x%08lx,0x%08lx)\n",iface,lParam1,lParam2);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size) {
|
||||
FIXME("(%p)->Info(%p,%ld)\n",iface,psi,size);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static LONG WINAPI IAVIStream_fnFindSample(IAVIStream*iface,LONG pos,LONG flags) {
|
||||
FIXME("(%p)->FindSample(%ld,0x%08lx)\n",iface,pos,flags);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG *formatsize) {
|
||||
FIXME("(%p)->ReadFormat(%ld,%p,%p)\n",iface,pos,format,formatsize);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* IAVIStream::SetFormat
|
||||
*/
|
||||
static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize) {
|
||||
IAVIStreamImpl *as = (IAVIStreamImpl*)iface;
|
||||
|
||||
FIXME("(%p)->SetFormat(%ld,%p,%ld)\n",iface,pos,format,formatsize);
|
||||
if (as->lpInputFormat) HeapFree(GetProcessHeap(),0,as->lpInputFormat);
|
||||
as->inputformatsize = formatsize;
|
||||
as->lpInputFormat = HeapAlloc(GetProcessHeap(),0,formatsize);
|
||||
memcpy(as->lpInputFormat,format,formatsize);
|
||||
if (as->iscompressing) {
|
||||
int xsize;
|
||||
/* Set up the Compressor part */
|
||||
xsize = ICCompressGetFormatSize(as->hic,as->lpInputFormat);
|
||||
as->lpCompressFormat = HeapAlloc(GetProcessHeap(),0,xsize);
|
||||
ICCompressGetFormat(as->hic,as->lpInputFormat,as->lpCompressFormat);
|
||||
ICCompressBegin(as->hic,as->lpInputFormat,as->lpCompressFormat);
|
||||
as->compbufsize = ICCompressGetSize(as->hic,as->lpInputFormat,as->lpCompressFormat);
|
||||
as->compbuffer = HeapAlloc(GetProcessHeap(),0,as->compbufsize);
|
||||
|
||||
/* Set up the Decompressor part (for prev frames?) */
|
||||
xsize=ICDecompressGetFormatSize(as->hic,as->lpCompressFormat);
|
||||
as->decompformat = HeapAlloc(GetProcessHeap(),0,xsize);
|
||||
ICDecompressGetFormat(as->hic,as->lpCompressFormat,as->decompformat);
|
||||
as->decompbufsize=((LPBITMAPINFOHEADER)as->decompbuffer)->biSizeImage;
|
||||
as->decompbuffer = HeapReAlloc(GetProcessHeap(),0,as->decompbuffer,as->decompbufsize);
|
||||
memset(as->decompbuffer,0xff,as->decompbufsize);
|
||||
assert(HeapValidate(GetProcessHeap(),0,NULL));
|
||||
|
||||
ICDecompressGetFormat(as->hic,as->lpCompressFormat,as->decompformat);
|
||||
ICDecompressBegin(as->hic,as->lpCompressFormat,as->decompformat);
|
||||
as->lpPrev = as->lpPrevFormat = NULL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnRead(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread) {
|
||||
FIXME("(%p)->Read(%ld,%ld,%p,%ld,%p,%p)\n",iface,start,samples,buffer,buffersize,bytesread,samplesread);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnWrite(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten) {
|
||||
IAVIStreamImpl *as = (IAVIStreamImpl*)iface;
|
||||
DWORD ckid,xflags;
|
||||
|
||||
FIXME("(%p)->Write(%ld,%ld,%p,%ld,0x%08lx,%p,%p)\n",iface,start,samples,buffer,buffersize,flags,sampwritten,byteswritten);
|
||||
|
||||
ICCompress(
|
||||
as->hic,flags,
|
||||
as->lpCompressFormat,
|
||||
as->compbuffer,
|
||||
as->lpInputFormat,buffer,
|
||||
&ckid,&xflags,
|
||||
as->curframe,0xffffff/*framesize*/,as->aco.dwQuality,
|
||||
as->lpPrevFormat,as->lpPrev
|
||||
);
|
||||
ICDecompress(
|
||||
as->hic,
|
||||
flags, /* FIXME: check */
|
||||
as->lpCompressFormat,
|
||||
as->compbuffer,
|
||||
as->decompformat,
|
||||
as->decompbuffer
|
||||
);
|
||||
/* We now have a prev format for the next compress ... */
|
||||
as->lpPrevFormat = as->decompformat;
|
||||
as->lpPrev = as->decompbuffer;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnDelete(IAVIStream*iface,LONG start,LONG samples) {
|
||||
FIXME("(%p)->Delete(%ld,%ld)\n",iface,start,samples);
|
||||
return E_FAIL;
|
||||
}
|
||||
static HRESULT WINAPI IAVIStream_fnReadData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG *lpread) {
|
||||
FIXME("(%p)->ReadData(0x%08lx,%p,%p)\n",iface,fcc,lp,lpread);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnWriteData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG size) {
|
||||
FIXME("(%p)->WriteData(0x%08lx,%p,%ld)\n",iface,fcc,lp,size);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen) {
|
||||
FIXME("(%p)->SetInfo(%p,%ld)\n",iface,info,infolen);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileCreateStreamA
|
||||
*/
|
||||
HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE iface,PAVISTREAM *ppavi,AVISTREAMINFOA * psi) {
|
||||
AVISTREAMINFOW psiw;
|
||||
|
||||
/* Only the szName at the end is different */
|
||||
memcpy(&psiw,psi,sizeof(*psi)-sizeof(psi->szName));
|
||||
MultiByteToWideChar( CP_ACP, 0, psi->szName, -1,
|
||||
psiw.szName, sizeof(psiw.szName) / sizeof(WCHAR) );
|
||||
return IAVIFile_CreateStream(iface,ppavi,&psiw);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileCreateStreamW
|
||||
*/
|
||||
HRESULT WINAPI AVIFileCreateStreamW(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi) {
|
||||
return IAVIFile_CreateStream(iface,avis,asi);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileGetStream
|
||||
*/
|
||||
HRESULT WINAPI AVIFileGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam) {
|
||||
return IAVIFile_GetStream(iface,avis,fccType,lParam);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileInfoA
|
||||
*/
|
||||
HRESULT WINAPI AVIFileInfoA(PAVIFILE iface,LPAVIFILEINFOA afi,LONG size) {
|
||||
AVIFILEINFOW afiw;
|
||||
HRESULT hres;
|
||||
|
||||
if (size < sizeof(AVIFILEINFOA))
|
||||
return AVIERR_BADSIZE;
|
||||
hres = IAVIFile_Info(iface,&afiw,sizeof(afiw));
|
||||
memcpy(afi,&afiw,sizeof(*afi)-sizeof(afi->szFileType));
|
||||
WideCharToMultiByte( CP_ACP, 0, afiw.szFileType, -1,
|
||||
afi->szFileType, sizeof(afi->szFileType), NULL, NULL );
|
||||
afi->szFileType[sizeof(afi->szFileType)-1] = 0;
|
||||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamInfoW
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG
|
||||
size) {
|
||||
return IAVIFile_Info(iface,asi,size);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamInfoA
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG
|
||||
size) {
|
||||
AVISTREAMINFOW asiw;
|
||||
HRESULT hres;
|
||||
|
||||
if (size<sizeof(AVISTREAMINFOA))
|
||||
return AVIERR_BADSIZE;
|
||||
hres = IAVIFile_Info(iface,&asiw,sizeof(asiw));
|
||||
memcpy(asi,&asiw,sizeof(asiw)-sizeof(asiw.szName));
|
||||
WideCharToMultiByte( CP_ACP, 0, asiw.szName, -1,
|
||||
asi->szName, sizeof(asi->szName), NULL, NULL );
|
||||
asi->szName[sizeof(asi->szName)-1] = 0;
|
||||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileInfoW
|
||||
*/
|
||||
HRESULT WINAPI AVIFileInfoW(PAVIFILE iface,LPAVIFILEINFOW afi,LONG size) {
|
||||
return IAVIFile_Info(iface,afi,size);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIMakeCompressedStream
|
||||
*/
|
||||
HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM *ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *aco,CLSID *pclsidHandler) {
|
||||
char fcc[5];
|
||||
IAVIStreamImpl *as;
|
||||
FIXME("(%p,%p,%p,%p)\n",ppsCompressed,ppsSource,aco,pclsidHandler);
|
||||
fcc[4]='\0';
|
||||
memcpy(fcc,&(aco->fccType),4);
|
||||
FIXME("\tfccType: '%s'\n",fcc);
|
||||
memcpy(fcc,&(aco->fccHandler),4);
|
||||
FIXME("\tfccHandler: '%s'\n",fcc);
|
||||
FIXME("\tdwFlags: 0x%08lx\n",aco->dwFlags);
|
||||
|
||||
/* we just create a duplicate for now */
|
||||
IAVIStream_AddRef(ppsSource);
|
||||
*ppsCompressed = ppsSource;
|
||||
as = (IAVIStreamImpl*)ppsSource;
|
||||
|
||||
/* this is where the fun begins. Open a compressor and prepare it. */
|
||||
as->hic = ICOpen(aco->fccType,aco->fccHandler,ICMODE_COMPRESS);
|
||||
|
||||
/* May happen. for instance if the codec is not able to compress */
|
||||
if (!as->hic)
|
||||
return AVIERR_UNSUPPORTED;
|
||||
|
||||
ICGetInfo(as->hic,&(as->icinfo),sizeof(ICINFO));
|
||||
FIXME("Opened compressor: '%s' '%s'\n",debugstr_w(as->icinfo.szName),debugstr_w(as->icinfo.szDescription));
|
||||
as->iscompressing = TRUE;
|
||||
memcpy(&(as->aco),aco,sizeof(*aco));
|
||||
if (as->icinfo.dwFlags & VIDCF_COMPRESSFRAMES) {
|
||||
ICCOMPRESSFRAMES icf;
|
||||
|
||||
/* now what to fill in there ... Hmm */
|
||||
memset(&icf,0,sizeof(icf));
|
||||
icf.lDataRate = aco->dwBytesPerSecond;
|
||||
icf.lQuality = aco->dwQuality;
|
||||
icf.lKeyRate = aco->dwKeyFrameEvery;
|
||||
|
||||
icf.GetData = (void *)0xdead4242;
|
||||
icf.PutData = (void *)0xdead4243;
|
||||
ICSendMessage(as->hic,ICM_COMPRESS_FRAMES_INFO,(LPARAM)&icf,sizeof(icf));
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamSetFormat
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize) {
|
||||
return IAVIStream_SetFormat(iface,pos,format,formatsize);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamReadFormat
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize) {
|
||||
return IAVIStream_ReadFormat(iface,pos,format,formatsize);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamWrite(
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten) {
|
||||
return IAVIStream_Write(iface,start,samples,buffer,buffersize,flags,sampwritten,byteswritten);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamRead
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread) {
|
||||
return IAVIStream_Read(iface,start,samples,buffer,buffersize,bytesread,samplesread);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamWriteData
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size) {
|
||||
return IAVIStream_WriteData(iface,fcc,lp,size);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamReadData
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread) {
|
||||
return IAVIStream_ReadData(iface,fcc,lp,lpread);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamStart
|
||||
*/
|
||||
LONG WINAPI AVIStreamStart(PAVISTREAM iface) {
|
||||
AVISTREAMINFOW si;
|
||||
|
||||
IAVIStream_Info(iface,&si,sizeof(si));
|
||||
return si.dwStart;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamLength
|
||||
*/
|
||||
LONG WINAPI AVIStreamLength(PAVISTREAM iface) {
|
||||
AVISTREAMINFOW si;
|
||||
HRESULT ret;
|
||||
|
||||
ret = IAVIStream_Info(iface,&si,sizeof(si));
|
||||
if (ret) /* error */
|
||||
return 1;
|
||||
return si.dwLength;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamRelease
|
||||
*/
|
||||
ULONG WINAPI AVIStreamRelease(PAVISTREAM iface) {
|
||||
return IAVIStream_Release(iface);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamGetFrameOpen
|
||||
*/
|
||||
PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM iface,LPBITMAPINFOHEADER bmi) {
|
||||
FIXME("(%p)->(%p),stub!\n",iface,bmi);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamGetFrame
|
||||
*/
|
||||
LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos) {
|
||||
return IGetFrame_GetFrame(pg,pos);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIStreamGetFrameClose
|
||||
*/
|
||||
HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg) {
|
||||
if (pg) IGetFrame_Release(pg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileRelease
|
||||
*/
|
||||
ULONG WINAPI AVIFileRelease(PAVIFILE iface) {
|
||||
return IAVIFile_Release(iface);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AVIFileExit
|
||||
*/
|
||||
void WINAPI AVIFileExit(void) {
|
||||
FIXME("(), stub.\n");
|
||||
}
|
545
tags/gpgme-1.1.8/complus/gpgcom.c
Normal file
545
tags/gpgme-1.1.8/complus/gpgcom.c
Normal file
@ -0,0 +1,545 @@
|
||||
/* gpgcom.c - COM+ component to access GnuPG
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include <ole2.h>
|
||||
|
||||
#include "argparse.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "igpgme.h"
|
||||
|
||||
static void register_server (void);
|
||||
static void unregister_server (void);
|
||||
static void enter_complus (void);
|
||||
|
||||
|
||||
enum cmd_and_opt_values { aNull = 0,
|
||||
oQuiet = 'q',
|
||||
oVerbose = 'v',
|
||||
|
||||
oNoVerbose = 500,
|
||||
oOptions,
|
||||
oDebug,
|
||||
oDebugAll,
|
||||
oNoGreeting,
|
||||
oNoOptions,
|
||||
oHomedir,
|
||||
oGPGBinary,
|
||||
oRegServer,
|
||||
oUnregServer,
|
||||
oEmbedding,
|
||||
aTest };
|
||||
|
||||
|
||||
static ARGPARSE_OPTS opts[] = {
|
||||
|
||||
{ 301, NULL, 0, N_("@Options:\n ") },
|
||||
|
||||
{ oVerbose, "verbose", 0, N_("verbose") },
|
||||
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
|
||||
{ oOptions, "options" , 2, N_("read options from file")},
|
||||
{ oDebug, "debug" ,4|16, N_("set debugging flags")},
|
||||
{ oDebugAll, "debug-all" ,0, N_("enable full debugging")},
|
||||
{ oGPGBinary, "gpg-program", 2 , "" },
|
||||
{ oRegServer, "RegServer" , 0, "" },
|
||||
{ oUnregServer, "UnregServer" , 0, "" },
|
||||
{ oEmbedding, "Embedding" , 0, "" },
|
||||
{0} };
|
||||
|
||||
|
||||
|
||||
|
||||
static const char *
|
||||
my_strusage( int level )
|
||||
{
|
||||
const char *p;
|
||||
switch( level ) {
|
||||
case 11: p = "gpgcom";
|
||||
break;
|
||||
case 13: p = VERSION; break;
|
||||
/*case 17: p = PRINTABLE_OS_NAME; break;*/
|
||||
case 19: p =
|
||||
_("Please report bugs to <gpgme-bugs@gnupg.org>.\n");
|
||||
break;
|
||||
case 1:
|
||||
case 40: p =
|
||||
_("Usage: gpgcom [options] (-h for help)");
|
||||
break;
|
||||
case 41: p =
|
||||
_("Syntax: gpgcom [options]\n"
|
||||
"GnuPG COM+ component\n");
|
||||
break;
|
||||
|
||||
default: p = NULL;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char **argv )
|
||||
{
|
||||
ARGPARSE_ARGS pargs;
|
||||
int orig_argc;
|
||||
char **orig_argv;
|
||||
FILE *configfp = NULL;
|
||||
char *configname = NULL;
|
||||
unsigned configlineno;
|
||||
int parse_debug = 0;
|
||||
int default_config =1;
|
||||
int greeting = 0;
|
||||
int nogreeting = 0;
|
||||
int action = 0;
|
||||
|
||||
set_strusage( my_strusage );
|
||||
/*log_set_name ("gpa"); not yet implemented in logging.c */
|
||||
|
||||
opt.homedir = getenv("GNUPGHOME");
|
||||
if( !opt.homedir || !*opt.homedir ) {
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
opt.homedir = "c:/gnupg";
|
||||
#else
|
||||
opt.homedir = "~/.gnupg";
|
||||
#endif
|
||||
}
|
||||
|
||||
/* check whether we have a config file on the commandline */
|
||||
orig_argc = argc;
|
||||
orig_argv = argv;
|
||||
pargs.argc = &argc;
|
||||
pargs.argv = &argv;
|
||||
pargs.flags= 1|(1<<6); /* do not remove the args, ignore version */
|
||||
while( arg_parse( &pargs, opts) ) {
|
||||
if( pargs.r_opt == oDebug || pargs.r_opt == oDebugAll )
|
||||
parse_debug++;
|
||||
else if( pargs.r_opt == oOptions ) {
|
||||
/* yes there is one, so we do not try the default one, but
|
||||
* read the option file when it is encountered at the commandline
|
||||
*/
|
||||
default_config = 0;
|
||||
}
|
||||
else if( pargs.r_opt == oNoOptions )
|
||||
default_config = 0; /* --no-options */
|
||||
else if( pargs.r_opt == oHomedir )
|
||||
opt.homedir = pargs.r.ret_str;
|
||||
}
|
||||
|
||||
if( default_config )
|
||||
configname = make_filename(opt.homedir, "gpgme.conf", NULL );
|
||||
|
||||
|
||||
argc = orig_argc;
|
||||
argv = orig_argv;
|
||||
pargs.argc = &argc;
|
||||
pargs.argv = &argv;
|
||||
pargs.flags= 1 | (1<<5); /* do not remove the args, allow one dash */
|
||||
next_pass:
|
||||
if( configname ) {
|
||||
configlineno = 0;
|
||||
configfp = fopen( configname, "r" );
|
||||
if( !configfp ) {
|
||||
if( default_config ) {
|
||||
if( parse_debug )
|
||||
log_info(_("NOTE: no default option file `%s'\n"),
|
||||
configname );
|
||||
}
|
||||
else {
|
||||
log_error(_("option file `%s': %s\n"),
|
||||
configname, strerror(errno) );
|
||||
exit(2);
|
||||
}
|
||||
free(configname); configname = NULL;
|
||||
}
|
||||
if( parse_debug && configname )
|
||||
log_info(_("reading options from `%s'\n"), configname );
|
||||
default_config = 0;
|
||||
}
|
||||
|
||||
while( optfile_parse( configfp, configname, &configlineno,
|
||||
&pargs, opts) ) {
|
||||
switch( pargs.r_opt ) {
|
||||
case oQuiet: opt.quiet = 1; break;
|
||||
case oVerbose: opt.verbose++; break;
|
||||
|
||||
case oDebug: opt.debug |= pargs.r.ret_ulong; break;
|
||||
case oDebugAll: opt.debug = ~0; break;
|
||||
|
||||
case oOptions:
|
||||
/* config files may not be nested (silently ignore them) */
|
||||
if( !configfp ) {
|
||||
free(configname);
|
||||
configname = xstrdup(pargs.r.ret_str);
|
||||
goto next_pass;
|
||||
}
|
||||
break;
|
||||
case oNoGreeting: nogreeting = 1; break;
|
||||
case oNoVerbose: opt.verbose = 0; break;
|
||||
case oNoOptions: break; /* no-options */
|
||||
case oHomedir: opt.homedir = pargs.r.ret_str; break;
|
||||
case oGPGBinary: break;
|
||||
|
||||
case oRegServer: action = 1; break;
|
||||
case oUnregServer: action = 2; break;
|
||||
case oEmbedding: action = 3; break;
|
||||
|
||||
default : pargs.err = configfp? 1:2; break;
|
||||
}
|
||||
}
|
||||
if( configfp ) {
|
||||
fclose( configfp );
|
||||
configfp = NULL;
|
||||
free(configname); configname = NULL;
|
||||
goto next_pass;
|
||||
}
|
||||
free( configname ); configname = NULL;
|
||||
if( log_get_errorcount(0) )
|
||||
exit(2);
|
||||
if( nogreeting )
|
||||
greeting = 0;
|
||||
|
||||
if( greeting ) {
|
||||
fprintf(stderr, "%s %s; %s\n",
|
||||
strusage(11), strusage(13), strusage(14) );
|
||||
fprintf(stderr, "%s\n", strusage(15) );
|
||||
}
|
||||
#ifdef IS_DEVELOPMENT_VERSION
|
||||
log_info("NOTE: this is a development version!\n");
|
||||
#endif
|
||||
|
||||
if ( action == 1 )
|
||||
register_server ();
|
||||
else if (action == 2 )
|
||||
unregister_server ();
|
||||
else if (action == 3 )
|
||||
enter_complus ();
|
||||
else {
|
||||
fprintf (stderr, "This is a COM+ component with no user interface.\n"
|
||||
"gpgme --help will give you a list of options\n" );
|
||||
exit (1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
register_progid ( const char *name )
|
||||
{
|
||||
HKEY hk = 0;
|
||||
char buf[500];
|
||||
|
||||
/* Create a ProgID entry to point to the ClassID */
|
||||
sprintf (buf, "%.400s", name);
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
sprintf (buf, "g10 Code's GnuPG made easy COMponent" );
|
||||
if (RegSetValueExA (hk, 0, 0, REG_SZ, buf, 0)) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
sprintf (buf, "%.400s\\CLSID", name);
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
sprintf (buf, "%.100s", debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegSetValueExA (hk, 0, 0, REG_SZ, buf, strlen (buf))) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
hk = 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
register_typelib (void)
|
||||
{
|
||||
ITypeLib *pTypeLib;
|
||||
HRESULT hr;
|
||||
char name[500];
|
||||
wchar_t *wname;
|
||||
size_t n;
|
||||
|
||||
if ( !GetModuleFileNameA (0, name, sizeof (name)-10) ) {
|
||||
fprintf (stderr,"GetModuleFileName() failed: %d\n",
|
||||
(int)GetLastError());
|
||||
exit (1);
|
||||
}
|
||||
n = mbstowcs (NULL, name, strlen(name)+1);
|
||||
wname = xmalloc ((n+1)*sizeof *wname);
|
||||
mbstowcs (wname, name, strlen (name)+1);
|
||||
|
||||
hr = CoInitializeEx (NULL, COINIT_APARTMENTTHREADED);
|
||||
if (hr)
|
||||
fprintf (stderr, "CoInitializeEx() failed: hr=%lu\n", hr);
|
||||
|
||||
hr = LoadTypeLibEx (wname, REGKIND_REGISTER, &pTypeLib);
|
||||
if (hr)
|
||||
fprintf (stderr, "LoadTypeLibEx() failed: hr=%lx\n", hr);
|
||||
|
||||
ITypeLib_Release (pTypeLib);
|
||||
CoUninitialize ();
|
||||
free (wname);
|
||||
}
|
||||
|
||||
static void
|
||||
unregister_typelib (void)
|
||||
{
|
||||
UnRegisterTypeLib (&TLBID_Gpgcom, 1, 0, LANG_NEUTRAL, SYS_WIN32);
|
||||
}
|
||||
|
||||
static void
|
||||
register_server ()
|
||||
{
|
||||
HKEY hk = 0;
|
||||
char buf[500];
|
||||
|
||||
|
||||
register_typelib ();
|
||||
|
||||
/* Create a key for the CLSID */
|
||||
sprintf (buf, "CLSID\\%.100s", debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
/* Store our class name as default value */
|
||||
strcpy (buf, "Gpgme");
|
||||
if (RegSetValueExA (hk, 0, 0, REG_SZ, buf, strlen (buf))) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* Set the application ID */
|
||||
sprintf (buf, "%.100s", debugstr_guid (&APPID_Gpgcom) );
|
||||
if (RegSetValueExA (hk, "AppID", 0, REG_SZ, buf, strlen (buf))) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
hk = 0;
|
||||
|
||||
/* Create the LocalServer32 subkey under the CLSID key */
|
||||
sprintf (buf, "CLSID\\%.100s\\LocalServer32",
|
||||
debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
/* retrieve the module name and add it under the key */
|
||||
if ( !GetModuleFileNameA (0, buf, sizeof (buf)-10) ) {
|
||||
fprintf (stderr,"GetModuleFileName() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
if (RegSetValueExA (hk, 0, 0, REG_SZ, buf, strlen (buf))) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
hk = 0;
|
||||
|
||||
/* Create the ProgID subkey under the CLSID key */
|
||||
sprintf (buf, "CLSID\\%.100s\\ProgID",
|
||||
debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegSetValueExA (hk, 0, 0, REG_SZ, "Gpgcom.Gpgme.1", 0)) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
hk = 0;
|
||||
/* Create the VersionIndependentProgID subkey under the CLSID key */
|
||||
sprintf (buf, "CLSID\\%.100s\\VersionIndependentProgID",
|
||||
debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegSetValueExA (hk, 0, 0, REG_SZ, "Gpgcom.Gpgme", 0)) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
hk = 0;
|
||||
|
||||
|
||||
/* Create a key to store AppID info */
|
||||
sprintf (buf, "AppID\\%.100s", debugstr_guid (&APPID_Gpgcom) );
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
/* Store the name as default value */
|
||||
strcpy (buf, "Gpgcom");
|
||||
if (RegSetValueExA (hk, 0, 0, REG_SZ, buf, strlen (buf))) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
hk = 0;
|
||||
|
||||
register_progid ("Gpgcom.Gpgme");
|
||||
register_progid ("Gpgcom.Gpgme.1");
|
||||
|
||||
/* Create a convenience cross reference to the AppID */
|
||||
sprintf (buf, "AppID\\gpgcom.exe");
|
||||
if (RegCreateKeyA (HKEY_CLASSES_ROOT, buf, &hk)) {
|
||||
fprintf (stderr,"RegCreateKey(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
sprintf (buf, "%.100s", debugstr_guid (&APPID_Gpgcom) );
|
||||
if (RegSetValueExA (hk, "AppID", 0, REG_SZ, buf, strlen (buf))) {
|
||||
fprintf (stderr,"RegSetValueEx(`%s') failed\n", buf);
|
||||
exit (1);
|
||||
}
|
||||
if (RegCloseKey (hk)) {
|
||||
fprintf (stderr,"RegCloseKey() failed\n");
|
||||
exit (1);
|
||||
}
|
||||
hk = 0;
|
||||
|
||||
fprintf (stderr,"*** Component registered\n");
|
||||
}
|
||||
|
||||
static void
|
||||
unregister_server ()
|
||||
{
|
||||
char buf[500];
|
||||
|
||||
unregister_typelib ();
|
||||
sprintf (buf, "CLSID\\%.100s\\LocalServer32",
|
||||
debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
|
||||
sprintf (buf, "CLSID\\%.100s\\ProgID", debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
|
||||
sprintf (buf, "CLSID\\%.100s", debugstr_guid (&CLSID_Gpgme) );
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
|
||||
sprintf (buf, "Gpgcom.Gpgme.1\\CLSID");
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
sprintf (buf, "Gpgcom.Gpgme.1");
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
|
||||
sprintf (buf, "Gpgcom.Gpgme\\CLSID");
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
sprintf (buf, "Gpgcom.Gpgme");
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
|
||||
|
||||
sprintf (buf, "AppID\\%.100s", debugstr_guid (&APPID_Gpgcom) );
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
|
||||
sprintf (buf, "AppID\\gpgcom.exe" );
|
||||
if (RegDeleteKey (HKEY_CLASSES_ROOT, buf))
|
||||
fprintf (stderr,"RegDeleteKey(`%s') failed\n", buf);
|
||||
|
||||
fprintf (stderr,"*** component unregistered\n");
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
enter_complus ()
|
||||
{
|
||||
HANDLE running;
|
||||
DWORD reg;
|
||||
IClassFactory *factory;
|
||||
CLSID clsid;
|
||||
HRESULT hr;
|
||||
|
||||
fprintf (stderr,"*** enter enter_complus()\n");
|
||||
CoInitializeEx (NULL, COINIT_MULTITHREADED);
|
||||
running = CreateEvent (NULL, FALSE, FALSE, NULL );
|
||||
fprintf (stderr,"*** CoInitialize() done; event=%lx\n", (unsigned long)running );
|
||||
|
||||
igpgme_register_exit_event (running);
|
||||
factory = igpgme_factory_new ( &clsid );
|
||||
fprintf (stderr,"*** igpgme_factory_new() done; got=%p\n", factory );
|
||||
hr = CoRegisterClassObject (&clsid, (IUnknown*)factory,
|
||||
CLSCTX_LOCAL_SERVER,
|
||||
REGCLS_SUSPENDED|REGCLS_MULTIPLEUSE, ® );
|
||||
if (hr) {
|
||||
fprintf (stderr, "CoRegisterClassObject() failed: hr=%lx\n", hr);
|
||||
exit (1);
|
||||
}
|
||||
hr = CoResumeClassObjects ();
|
||||
if (hr)
|
||||
fprintf (stderr, "CoRegisterClassObject() failed: hr=%lx\n", hr);
|
||||
fprintf (stderr,"*** class object registered; waiting\n" );
|
||||
|
||||
WaitForSingleObject ( running, INFINITE );
|
||||
fprintf (stderr,"*** shutting down\n" );
|
||||
igpgme_register_exit_event (NULL);
|
||||
CloseHandle (running);
|
||||
CoRevokeClassObject ( reg );
|
||||
fprintf (stderr,"*** class object revoked\n" );
|
||||
igpgme_factory_release (factory);
|
||||
fprintf (stderr,"*** factory released\n" );
|
||||
CoUninitialize ();
|
||||
fprintf (stderr,"*** leave enter_complus()\n" );
|
||||
}
|
||||
|
62
tags/gpgme-1.1.8/complus/gpgcom.idl
Normal file
62
tags/gpgme-1.1.8/complus/gpgcom.idl
Normal file
@ -0,0 +1,62 @@
|
||||
/* ignupg.idl - Interface definition for the COM+ class GnuPG
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
import "unknwn.idl";
|
||||
import "oaidl.idl";
|
||||
|
||||
|
||||
[ object, uuid(3811fd50-7f72-11d5-8c9e-0080ad190cd5), dual]
|
||||
interface IGpgme : IDispatch
|
||||
{
|
||||
HRESULT GetVersion([out] BSTR *retval);
|
||||
HRESULT GetEngineInfo([out] BSTR *retval);
|
||||
HRESULT Cancel(void);
|
||||
[propput] HRESULT Armor([in] BOOL flag);
|
||||
[propget] HRESULT Armor([out, retval] BOOL *retval);
|
||||
[propput] HRESULT Textmode([in] BOOL flag);
|
||||
[propget] HRESULT Textmode([out, retval] BOOL *retval);
|
||||
[propput] HRESULT Plaintext([in] VARIANT val);
|
||||
[propget] HRESULT Plaintext([out, retval] VARIANT *retval);
|
||||
[propput] HRESULT Ciphertext([in] VARIANT val);
|
||||
[propget] HRESULT Ciphertext([out,retval] VARIANT *retval);
|
||||
HRESULT ClearRecipients(void);
|
||||
HRESULT AddRecipient([in] BSTR name,
|
||||
[in, optional, defaultvalue(-1)] signed short trust);
|
||||
HRESULT ResetSignKeys(void);
|
||||
HRESULT AddSignKey([in] BSTR name);
|
||||
HRESULT Encrypt(void);
|
||||
HRESULT Sign([in,optional,defaultvalue(0)] signed short signmode);
|
||||
HRESULT SignEncrypt([in,optional,defaultvalue(0)] signed short signmode);
|
||||
|
||||
};
|
||||
|
||||
|
||||
[ uuid(3811fd48-7f72-11d5-8c9e-0080ad190cd5),
|
||||
helpstring("g10Code.gpgcom, type library"),
|
||||
version(1.0) ]
|
||||
library GpgcomLib
|
||||
{
|
||||
[ uuid(3811fd40-7f72-11d5-8c9e-0080ad190cd5) ]
|
||||
coclass Gpgcom
|
||||
{
|
||||
[default] interface IGpgme;
|
||||
}
|
||||
};
|
22
tags/gpgme-1.1.8/complus/gpgcom.rc
Normal file
22
tags/gpgme-1.1.8/complus/gpgcom.rc
Normal file
@ -0,0 +1,22 @@
|
||||
/* gpgcom.rc - Resource file for gpgcom
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
1 TYPELIB "gpgcom.tlb"
|
||||
|
BIN
tags/gpgme-1.1.8/complus/gpgcom.tlb
Normal file
BIN
tags/gpgme-1.1.8/complus/gpgcom.tlb
Normal file
Binary file not shown.
130
tags/gpgme-1.1.8/complus/guidgen.c
Normal file
130
tags/gpgme-1.1.8/complus/guidgen.c
Normal file
@ -0,0 +1,130 @@
|
||||
/* guidgen.c - Tool to create GUIDs
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "obj_base.h"
|
||||
|
||||
#include "argparse.h"
|
||||
|
||||
|
||||
enum cmd_and_opt_values { aNull = 0,
|
||||
oVerbose = 'v',
|
||||
|
||||
aTest };
|
||||
|
||||
|
||||
static ARGPARSE_OPTS opts[] = {
|
||||
|
||||
{ 301, NULL, 0, "@Options:\n " },
|
||||
|
||||
{ oVerbose, "verbose", 0, "verbose" },
|
||||
{0} };
|
||||
|
||||
static struct {
|
||||
int verbose;
|
||||
} opt;
|
||||
|
||||
|
||||
static void create_guid (void);
|
||||
|
||||
static const char *
|
||||
my_strusage( int level )
|
||||
{
|
||||
const char *p;
|
||||
switch( level ) {
|
||||
case 11: p = "guidgen";
|
||||
break;
|
||||
case 13: p = VERSION; break;
|
||||
/*case 17: p = PRINTABLE_OS_NAME; break;*/
|
||||
case 19: p =
|
||||
"Please report bugs to <gpgme-bugs@gnupg.org>.\n";
|
||||
break;
|
||||
case 1:
|
||||
case 40: p =
|
||||
"Usage: guidgen [options] (-h for help)";
|
||||
break;
|
||||
case 41: p =
|
||||
"Syntax: guidgen [options]\n"
|
||||
"Generate GUIDs\n";
|
||||
break;
|
||||
|
||||
default: p = NULL;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char **argv )
|
||||
{
|
||||
ARGPARSE_ARGS pargs;
|
||||
|
||||
set_strusage( my_strusage );
|
||||
/*log_set_name ("gpa"); not yet implemented in logging.c */
|
||||
|
||||
pargs.argc = &argc;
|
||||
pargs.argv = &argv;
|
||||
pargs.flags= 0;
|
||||
while( arg_parse( &pargs, opts) ) {
|
||||
switch( pargs.r_opt ) {
|
||||
case oVerbose: opt.verbose++; break;
|
||||
|
||||
default : pargs.err = 2; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!argc)
|
||||
create_guid();
|
||||
else {
|
||||
int n;
|
||||
|
||||
for (n = atoi (argv[0]); n > 0; n-- )
|
||||
create_guid ();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
create_guid ()
|
||||
{
|
||||
GUID guid, *id;
|
||||
id = &guid;
|
||||
if ( CoCreateGuid (id) ) {
|
||||
fprintf (stderr,"failed to create GUID\n");
|
||||
exit (1);
|
||||
}
|
||||
printf( "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
|
||||
id->Data1, id->Data2, id->Data3,
|
||||
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
|
||||
id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
|
||||
}
|
||||
|
||||
|
859
tags/gpgme-1.1.8/complus/igpgme.c
Normal file
859
tags/gpgme-1.1.8/complus/igpgme.c
Normal file
@ -0,0 +1,859 @@
|
||||
/* igpgme.c - COM+ class IGpgme
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "../gpgme/gpgme.h"
|
||||
|
||||
/* FIXME: Put them into an extra header */
|
||||
void *_gpgme_malloc (size_t n );
|
||||
void *_gpgme_calloc (size_t n, size_t m );
|
||||
void *_gpgme_realloc (void *p, size_t n);
|
||||
char *_gpgme_strdup (const char *p);
|
||||
void _gpgme_free ( void *a );
|
||||
|
||||
|
||||
|
||||
#define INITGUID
|
||||
#include "igpgme.h"
|
||||
|
||||
/*
|
||||
* Declare the interface implementation structures
|
||||
*/
|
||||
typedef struct IGpgmeImpl IGpgmeImpl;
|
||||
typedef struct IClassFactoryImpl IClassFactoryImpl;
|
||||
|
||||
static HANDLE my_exit_event;
|
||||
|
||||
struct IGpgmeImpl {
|
||||
/* IUnknown required stuff */
|
||||
ICOM_VFIELD (IGpgme);
|
||||
DWORD ref;
|
||||
/* Delegation to IDispatch */
|
||||
struct {
|
||||
IUnknown *disp;
|
||||
ITypeInfo *tinfo;
|
||||
} std_disp;
|
||||
/* Our stuff */
|
||||
GpgmeCtx mainctx;
|
||||
GpgmeData plaintext;
|
||||
int plaintext_given_as_bstr;
|
||||
GpgmeData ciphertext;
|
||||
int ciphertext_is_armored;
|
||||
GpgmeRecipients rset;
|
||||
};
|
||||
|
||||
|
||||
struct IClassFactoryImpl {
|
||||
/* IUnknown fields */
|
||||
ICOM_VFIELD(IClassFactory);
|
||||
DWORD ref;
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
************** helper functions ************************
|
||||
*********************************************************/
|
||||
static HRESULT
|
||||
map_gpgme_error (GpgmeError err)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (!err)
|
||||
return 0;
|
||||
if ( err < 0 || err > 0x1000 ) {
|
||||
fprintf (stderr,"*** GpgmeError `%s' mapped to GPGME_General_Error\n",
|
||||
gpgme_strerror (err) );
|
||||
err = GPGME_General_Error;
|
||||
}
|
||||
hr = MAKE_HRESULT (SEVERITY_ERROR, FACILITY_ITF, 0x1000 + err);
|
||||
fprintf (stderr,"*** GpgmeError `%s' mapped to %lx\n",
|
||||
gpgme_strerror (err), (unsigned long)hr );
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************
|
||||
************** IGpgme Implementation *******************
|
||||
*********************************************************/
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_QueryInterface (IGpgme *iface, REFIID refiid, LPVOID *obj)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
/*fprintf (stderr,"*** m_IGpgme_QueryInterface(%p,%s)",
|
||||
This, debugstr_guid(refiid));*/
|
||||
if ( IsEqualGUID (&IID_IUnknown, refiid)
|
||||
|| IsEqualGUID (&IID_IGpgme, refiid) ) {
|
||||
*obj = This;
|
||||
IGpgme_AddRef (iface);
|
||||
fprintf (stderr," -> got %p\n", *obj);
|
||||
return 0;
|
||||
}
|
||||
else if ( IsEqualGUID (&IID_IDispatch, refiid) ) {
|
||||
HRESULT hr = IDispatch_QueryInterface (This->std_disp.disp,
|
||||
refiid, obj);
|
||||
/*fprintf (stderr," -> delegated, hr=%lx, got %p\n",
|
||||
hr, hr? NULL: *obj);*/
|
||||
return hr;
|
||||
}
|
||||
/*fprintf (stderr," -> none\n");*/
|
||||
*obj = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
static ULONG WINAPI
|
||||
m_IGpgme_AddRef (IGpgme *iface)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
return ++This->ref;
|
||||
}
|
||||
|
||||
|
||||
static ULONG WINAPI
|
||||
m_IGpgme_Release (IGpgme *iface)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
if (--This->ref)
|
||||
return This->ref;
|
||||
|
||||
gpgme_release (This->mainctx); This->mainctx = NULL;
|
||||
gpgme_data_release (This->plaintext); This->plaintext = NULL;
|
||||
gpgme_data_release (This->ciphertext); This->ciphertext = NULL;
|
||||
gpgme_recipients_release (This->rset); This->rset = NULL;
|
||||
if (This->std_disp.disp)
|
||||
IDispatch_Release (This->std_disp.disp);
|
||||
if (This->std_disp.tinfo)
|
||||
ITypeInfo_Release (This->std_disp.tinfo);
|
||||
HeapFree(GetProcessHeap(),0,iface);
|
||||
{
|
||||
ULONG count = CoReleaseServerProcess ();
|
||||
if (!count && my_exit_event)
|
||||
SetEvent (my_exit_event);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_stub_IDispatch_GetTypeInfoCount (IGpgme *iface, unsigned int *pctinfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_stub_IDispatch_GetTypeInfo (IGpgme *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_stub_IDispatch_GetIDsOfNames (IGpgme *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_stub_IDispatch_Invoke (IGpgme *iface, DISPID dispIdMember,
|
||||
REFIID riid, LCID lcid, WORD wFlags,
|
||||
DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
||||
EXCEPINFO *pExepInfo, UINT *puArgErr)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetVersion (IGpgme *iface, BSTR *retvat)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetEngineInfo (IGpgme *iface, BSTR *retval)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_Cancel (IGpgme *iface)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_SetArmor (IGpgme *iface, BOOL yes)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
gpgme_set_armor (This->mainctx, yes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetArmor (IGpgme *iface, BOOL *retval)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
*retval = gpgme_get_armor (This->mainctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_SetTextmode (IGpgme *iface, BOOL yes)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
gpgme_set_textmode (This->mainctx, yes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetTextmode (IGpgme *iface, BOOL *retval)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
*retval = gpgme_get_textmode (This->mainctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Put the data from VAL into a a Gpgme data object, which is passed by
|
||||
* reference. Valid types of the Variant are: BSTR, SAFEARRAY of BYTE and
|
||||
* SAFEARRAY of VARIANTS of signed or unsigned integers.
|
||||
*/
|
||||
static HRESULT WINAPI
|
||||
set_data_from_variant (GpgmeData *data, VARIANT val, int *given_as_bstr)
|
||||
{
|
||||
GpgmeError err = 0;
|
||||
HRESULT hr;
|
||||
unsigned char *buf;
|
||||
SAFEARRAY *array;
|
||||
size_t len;
|
||||
int i;
|
||||
|
||||
if ( val.vt == VT_BSTR) {
|
||||
len = bstrtoutf8 (val.u.bstrVal, NULL, 0);
|
||||
buf = _gpgme_malloc (len);
|
||||
if (!buf)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
if (bstrtoutf8 (val.u.bstrVal, buf, len) < 0) {
|
||||
fprintf (stderr,"problem with bstrtoutf8\n");
|
||||
_gpgme_free (buf);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
fprintf (stderr,"Got a BSTR (utf8):");
|
||||
for (i=0; i < len; i++)
|
||||
fprintf (stderr, " %0X", buf[i] );
|
||||
putc ('\n', stderr);
|
||||
#endif
|
||||
gpgme_data_release (*data); *data = NULL;
|
||||
err = gpgme_data_new_from_mem (data, buf, len, 0 /*no need to copy*/ );
|
||||
if (!err && given_as_bstr)
|
||||
*given_as_bstr = 1;
|
||||
}
|
||||
else if ( val.vt == (VT_ARRAY|VT_UI1)) {
|
||||
array = val.u.parray;
|
||||
|
||||
/*fprintf (stderr,"Got an ARRAY of bytes:");*/
|
||||
hr = SafeArrayAccessData (array, (void**)&buf);
|
||||
if (hr) {
|
||||
fprintf (stderr,"*** SafeArrayAccessData failed: hr=%lx\n", hr);
|
||||
return hr;
|
||||
}
|
||||
len = array->rgsabound[0].cElements;
|
||||
/*for (i=0; i < len; i++)
|
||||
fprintf (stderr, " %0X", buf[i] );
|
||||
putc ('\n', stderr);*/
|
||||
|
||||
gpgme_data_release (*data); *data = NULL;
|
||||
err = gpgme_data_new_from_mem (data, buf, len, 1 );
|
||||
SafeArrayUnaccessData (array);
|
||||
if (given_as_bstr)
|
||||
*given_as_bstr = 0;
|
||||
}
|
||||
else if ( val.vt == (VT_ARRAY|VT_VARIANT)) {
|
||||
VARIANT *vp;
|
||||
array = val.u.parray;
|
||||
|
||||
/*fprintf (stderr,"Got an ARRAY of VARIANTS:");*/
|
||||
hr = SafeArrayAccessData (array, (void**)&vp);
|
||||
if (hr) {
|
||||
fprintf (stderr,"*** SafeArrayAccessData failed: hr=%lx\n", hr);
|
||||
return hr;
|
||||
}
|
||||
len = array->rgsabound[0].cElements;
|
||||
/* allocate the array using the gpgme allocator so that we can
|
||||
* later use a new without the copy set*/
|
||||
buf = _gpgme_malloc (len);
|
||||
if (!buf) {
|
||||
SafeArrayUnaccessData (array);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
/* coerce all array elements into rawtext */
|
||||
for (i=0; i < len; i++) {
|
||||
switch (vp[i].vt) {
|
||||
case VT_I1: buf[i] = (BYTE)vp[i].u.cVal; break;
|
||||
case VT_I2: buf[i] = ((UINT)vp[i].u.iVal) & 0xff; break;
|
||||
case VT_I4: buf[i] = ((ULONG)vp[i].u.lVal) & 0xff; break;
|
||||
case VT_INT: buf[i] = ((UINT)vp[i].u.intVal) & 0xff; break;
|
||||
case VT_UI1: buf[i] = vp[i].u.bVal; break;
|
||||
case VT_UI2: buf[i] = vp[i].u.uiVal & 0xff; break;
|
||||
case VT_UI4: buf[i] = vp[i].u.ulVal & 0xff; break;
|
||||
case VT_UINT: buf[i] = vp[i].u.uintVal & 0xff; break;
|
||||
default:
|
||||
fprintf (stderr, "Invalid value in array as pos %d\n", i);
|
||||
_gpgme_free (buf);
|
||||
SafeArrayUnaccessData (array);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
}
|
||||
|
||||
/*for (i=0; i < len; i++)
|
||||
fprintf (stderr, " %0X", buf[i] );
|
||||
putc ('\n', stderr);*/
|
||||
|
||||
gpgme_data_release (*data); *data = NULL;
|
||||
err = gpgme_data_new_from_mem (data, buf, len, 0);
|
||||
SafeArrayUnaccessData (array);
|
||||
if (given_as_bstr)
|
||||
*given_as_bstr = 0;
|
||||
}
|
||||
else {
|
||||
fprintf (stderr, "Got a variant type = %d (0x%x)\n",
|
||||
(int)val.vt, (int)val.vt );
|
||||
return E_INVALIDARG; /* not a safearray of bytes */
|
||||
}
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
set_data_to_variant (GpgmeData data, VARIANT *retval, int use_bstr)
|
||||
{
|
||||
GpgmeError err;
|
||||
HRESULT hr;
|
||||
SAFEARRAY *array;
|
||||
char *p;
|
||||
size_t nread, len;
|
||||
int i;
|
||||
|
||||
/* Get some info on the data */
|
||||
err = gpgme_data_rewind (data);
|
||||
if (err ) {
|
||||
fprintf (stderr, "*** gpgme_data_rewind failed: %d\n", err);
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
err = gpgme_data_read (data, NULL, 0, &nread);
|
||||
if (err && err != GPGME_EOF ) {
|
||||
fprintf (stderr, "*** gpgme_data_read [length] failed: %d\n", err);
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
len = nread; /*(eof returns a length of 0)*/
|
||||
/*fprintf (stderr,"*** %d bytes are availabe\n", (int)len);*/
|
||||
|
||||
/* convert it to the target data type */
|
||||
if (use_bstr) {
|
||||
BSTR bs;
|
||||
unsigned char *helpbuf;
|
||||
|
||||
/* It is easier to allocate some helper storage */
|
||||
helpbuf = _gpgme_malloc (len);
|
||||
if (!helpbuf)
|
||||
return E_OUTOFMEMORY;
|
||||
err = gpgme_data_read (data, helpbuf, len, &nread);
|
||||
if (err ) {
|
||||
_gpgme_free (helpbuf);
|
||||
fprintf (stderr, "*** gpgme_data_read [data] failed: %d\n", err);
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
|
||||
bs = SysAllocStringLen (NULL, len+1);
|
||||
if (!bs) {
|
||||
_gpgme_free (helpbuf);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
for (i=0, p=helpbuf; i < len; i++, p++)
|
||||
bs[i] = *p;
|
||||
bs[i] = 0;
|
||||
_gpgme_free (helpbuf);
|
||||
|
||||
/* Ready */
|
||||
VariantInit (retval);
|
||||
retval->vt = VT_BSTR;
|
||||
retval->u.bstrVal = bs;
|
||||
}
|
||||
#if 0
|
||||
else if (use_byte_array) {
|
||||
array = SafeArrayCreateVector (VT_UI1, 0, len);
|
||||
if (!array)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
p = NULL;
|
||||
hr = SafeArrayAccessData (array, (void**)&p);
|
||||
if (hr) {
|
||||
fprintf (stderr,"*** SafeArrayAccessData failed: hr=%lx\n", hr);
|
||||
SafeArrayDestroyData (array);
|
||||
SafeArrayDestroy (array);
|
||||
return hr;
|
||||
}
|
||||
if (len) {
|
||||
err = gpgme_data_read (data, p, len, &nread);
|
||||
if (err ) {
|
||||
SafeArrayUnaccessData (array);
|
||||
SafeArrayDestroyData (array);
|
||||
SafeArrayDestroy (array);
|
||||
fprintf (stderr, "*** gpgme_data_read [data] failed: %d\n",
|
||||
err);
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
}
|
||||
SafeArrayUnaccessData (array);
|
||||
|
||||
/* pass the data to the caller */
|
||||
VariantInit (retval);
|
||||
retval->vt = (VT_ARRAY|VT_UI1);
|
||||
retval->u.parray = array;
|
||||
}
|
||||
#endif
|
||||
else { /* Create an array of variants of bytes */
|
||||
VARIANT *v;
|
||||
unsigned char *helpbuf;
|
||||
|
||||
/* It is easier to allocate some helper storage */
|
||||
helpbuf = _gpgme_malloc (len);
|
||||
if (!helpbuf)
|
||||
return E_OUTOFMEMORY;
|
||||
err = gpgme_data_read (data, helpbuf, len, &nread);
|
||||
if (err ) {
|
||||
_gpgme_free (helpbuf);
|
||||
fprintf (stderr, "*** gpgme_data_read [data] failed: %d\n", err);
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
|
||||
/* The create the array */
|
||||
array = SafeArrayCreateVector (VT_VARIANT, 0, len);
|
||||
if (!array) {
|
||||
_gpgme_free (helpbuf);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
v = NULL;
|
||||
hr = SafeArrayAccessData (array, (void**)&v);
|
||||
if (hr) {
|
||||
fprintf (stderr,"*** SafeArrayAccessData failed: hr=%lx\n", hr);
|
||||
_gpgme_free (helpbuf);
|
||||
SafeArrayDestroyData (array);
|
||||
SafeArrayDestroy (array);
|
||||
return hr;
|
||||
}
|
||||
|
||||
for (p=helpbuf; len; len--, v++) {
|
||||
VariantInit (v);
|
||||
v->vt = VT_UI1;
|
||||
v->u.bVal = *p;
|
||||
}
|
||||
SafeArrayUnaccessData (array);
|
||||
_gpgme_free (helpbuf);
|
||||
|
||||
/* pass the data to the caller */
|
||||
VariantInit (retval);
|
||||
retval->vt = (VT_ARRAY|VT_VARIANT);
|
||||
retval->u.parray = array;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_SetPlaintext (IGpgme *iface, VARIANT val)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
return set_data_from_variant (&This->plaintext, val,
|
||||
&This->plaintext_given_as_bstr);
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetPlaintext (IGpgme *iface, VARIANT *retval)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
/*fprintf (stderr,"*** " __PRETTY_FUNCTION__ "(%p)\n", This );*/
|
||||
return set_data_to_variant (This->plaintext, retval,
|
||||
This->plaintext_given_as_bstr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_SetCiphertext (IGpgme *iface, VARIANT val)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
return set_data_from_variant (&This->ciphertext, val, NULL);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetCiphertext (IGpgme *iface, VARIANT *retval)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
return set_data_to_variant (This->ciphertext, retval,
|
||||
This->ciphertext_is_armored);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_ClearRecipients (IGpgme *iface)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
gpgme_recipients_release (This->rset); This->rset = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_AddRecipient (IGpgme *iface, BSTR name, signed short int trust)
|
||||
{
|
||||
GpgmeError err;
|
||||
int n;
|
||||
char *p;
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
/*fprintf (stderr,"*** " __PRETTY_FUNCTION__ "(%p, %d)\n",
|
||||
This, (int)trust);*/
|
||||
if (!This->rset) {
|
||||
err = gpgme_recipients_new (&This->rset);
|
||||
if (err)
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
|
||||
n = bstrtoutf8 (name, NULL, 0);
|
||||
p = HeapAlloc (GetProcessHeap(), 0, n );
|
||||
if (!p) {
|
||||
fprintf (stderr,"HeapAlloc failed: ec=%d\n", (int)GetLastError () );
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
if (bstrtoutf8 (name, p, n) < 0) {
|
||||
fprintf (stderr,"problem with bstrtoutf8\n");
|
||||
HeapFree (GetProcessHeap(), 0, p);
|
||||
return E_FAIL;
|
||||
}
|
||||
err = gpgme_recipients_add_name (This->rset, p);
|
||||
HeapFree (GetProcessHeap(), 0, p);
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_ResetSignKeys (IGpgme *iface)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_AddSignKey (IGpgme *iface, BSTR name)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_Encrypt (IGpgme *iface)
|
||||
{
|
||||
GpgmeError err;
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
gpgme_data_release (This->ciphertext);
|
||||
err = gpgme_data_new (&This->ciphertext);
|
||||
if (err)
|
||||
return map_gpgme_error (err);
|
||||
|
||||
|
||||
This->ciphertext_is_armored = gpgme_get_armor (This->mainctx);
|
||||
err = gpgme_op_encrypt (This->mainctx, This->rset,
|
||||
This->plaintext, This->ciphertext);
|
||||
#if 0
|
||||
if (!err ) {
|
||||
char buf[100];
|
||||
size_t nread;
|
||||
|
||||
err = gpgme_data_rewind ( This->ciphertext );
|
||||
if (err )
|
||||
fprintf (stderr, "*** gpgme_data_rewind failed: %d\n", err);
|
||||
while ( !(err = gpgme_data_read ( This->ciphertext,
|
||||
buf, 100, &nread )) ) {
|
||||
fwrite ( buf, nread, 1, stderr );
|
||||
}
|
||||
if (err != GPGME_EOF)
|
||||
fprintf (stderr, "*** gpgme_data_read failed: %d\n", err);
|
||||
err = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return map_gpgme_error (err);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_Sign (IGpgme *iface, short int signmode)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
fprintf (stderr,"*** " __PRETTY_FUNCTION__ "(%p)\n", This );
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_SignEncrypt (IGpgme *iface, short int signmode)
|
||||
{
|
||||
ICOM_THIS (IGpgmeImpl,iface);
|
||||
|
||||
fprintf (stderr,"*** " __PRETTY_FUNCTION__ "(%p)\n", This );
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetSigStatus(GpgmeCtx c, int idx,
|
||||
GpgmeSigStat *r_stat, time_t *r_created );
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetSigKey (GpgmeCtx c, int idx, GpgmeKey *r_key);
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_IGpgme_GetNotation(IGpgme *c, BSTR *retval)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static ICOM_VTABLE(IGpgme) igpgme_vtbl =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||
m_IGpgme_QueryInterface,
|
||||
m_IGpgme_AddRef,
|
||||
m_IGpgme_Release,
|
||||
/* IDispatch methods */
|
||||
m_stub_IDispatch_GetTypeInfoCount,
|
||||
m_stub_IDispatch_GetTypeInfo,
|
||||
m_stub_IDispatch_GetIDsOfNames,
|
||||
m_stub_IDispatch_Invoke,
|
||||
/* Our methods */
|
||||
m_IGpgme_GetVersion,
|
||||
m_IGpgme_GetEngineInfo,
|
||||
m_IGpgme_Cancel,
|
||||
m_IGpgme_SetArmor,
|
||||
m_IGpgme_GetArmor,
|
||||
m_IGpgme_SetTextmode,
|
||||
m_IGpgme_GetTextmode,
|
||||
m_IGpgme_SetPlaintext,
|
||||
m_IGpgme_GetPlaintext,
|
||||
m_IGpgme_SetCiphertext,
|
||||
m_IGpgme_GetCiphertext,
|
||||
m_IGpgme_ClearRecipients,
|
||||
m_IGpgme_AddRecipient,
|
||||
m_IGpgme_ResetSignKeys,
|
||||
m_IGpgme_AddSignKey,
|
||||
m_IGpgme_Encrypt,
|
||||
m_IGpgme_Sign,
|
||||
m_IGpgme_SignEncrypt
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***************************************************************
|
||||
****************** Gpgme Factory ****************************
|
||||
***************************************************************/
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_GpgmeFactory_QueryInterface (IClassFactory *iface,
|
||||
REFIID refiid, LPVOID *obj)
|
||||
{
|
||||
ICOM_THIS (IClassFactoryImpl,iface);
|
||||
|
||||
/*fprintf (stderr,"*** m_GpgmeFactory_QueryInterface(%p,%s)",
|
||||
This, debugstr_guid(refiid));*/
|
||||
if ( IsEqualGUID (&IID_IUnknown, refiid)
|
||||
|| IsEqualGUID (&IID_IClassFactory, refiid) ) {
|
||||
*obj = This;
|
||||
/*fprintf (stderr," -> got %p\n", obj);*/
|
||||
return 0;
|
||||
}
|
||||
*obj = NULL;
|
||||
/*fprintf (stderr," -> none\n");*/
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI
|
||||
m_GpgmeFactory_AddRef (IClassFactory *iface)
|
||||
{
|
||||
ICOM_THIS(IClassFactoryImpl,iface);
|
||||
return ++(This->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI
|
||||
m_GpgmeFactory_Release (IClassFactory *iface)
|
||||
{
|
||||
ICOM_THIS(IClassFactoryImpl,iface);
|
||||
return --(This->ref);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_GpgmeFactory_CreateInstance (IClassFactory *iface, IUnknown *outer,
|
||||
REFIID refiid, LPVOID *r_obj )
|
||||
{
|
||||
/*ICOM_THIS(IClassFactoryImpl,iface);*/
|
||||
|
||||
fprintf (stderr,"*** m_GpgmeFactory_CreateInstance(%s)",
|
||||
debugstr_guid(refiid) );
|
||||
if ( IsEqualGUID (&IID_IUnknown, refiid)
|
||||
|| IsEqualGUID (&IID_IGpgme, refiid) ) {
|
||||
IGpgmeImpl *obj;
|
||||
GpgmeCtx ctx;
|
||||
GpgmeError err;
|
||||
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
if (err) {
|
||||
fprintf (stderr," -> gpgme_new failed: %s\n", gpgme_strerror (err));
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
obj = HeapAlloc (GetProcessHeap(), 0, sizeof *obj );
|
||||
if ( !obj) {
|
||||
fprintf (stderr," -> out of core\n");
|
||||
gpgme_release (ctx);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
memset (obj, 0, sizeof *obj);
|
||||
|
||||
ICOM_VTBL(obj) = &igpgme_vtbl;
|
||||
obj->ref = 1;
|
||||
obj->mainctx = ctx;
|
||||
{ /* Fixme: need to release some stuff on error */
|
||||
HRESULT hr;
|
||||
ITypeLib *pTypeLib;
|
||||
|
||||
hr = LoadRegTypeLib (&TLBID_Gpgcom, 1, 0, LANG_NEUTRAL, &pTypeLib);
|
||||
if (hr) {
|
||||
fprintf (stderr," -> LoadRegTypeLib failed: %lx\n", hr);
|
||||
return hr;
|
||||
}
|
||||
hr = ITypeLib_GetTypeInfoOfGuid (pTypeLib, &IID_IGpgme,
|
||||
&obj->std_disp.tinfo);
|
||||
ITypeLib_Release (pTypeLib);
|
||||
if (hr) {
|
||||
fprintf (stderr," -> GetTypeInfoOfGuid failed: %lx\n", hr);
|
||||
return hr;
|
||||
}
|
||||
hr = CreateStdDispatch ((IUnknown*)obj, obj, obj->std_disp.tinfo,
|
||||
&obj->std_disp.disp);
|
||||
if (hr) {
|
||||
fprintf (stderr," -> CreateStdDispatch failed: %lx\n", hr);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
CoAddRefServerProcess ();
|
||||
*r_obj = obj;
|
||||
fprintf (stderr," -> created %p\n", obj );
|
||||
return 0;
|
||||
}
|
||||
fprintf (stderr," -> no interface\n" );
|
||||
*r_obj = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
m_GpgmeFactory_LockServer (IClassFactory *iface, BOOL dolock )
|
||||
{
|
||||
if (dolock) {
|
||||
CoAddRefServerProcess ();
|
||||
}
|
||||
else {
|
||||
ULONG count = CoReleaseServerProcess ();
|
||||
if (!count && my_exit_event)
|
||||
SetEvent (my_exit_event);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ICOM_VTABLE(IClassFactory) igpgme_factory_vtbl = {
|
||||
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||
m_GpgmeFactory_QueryInterface,
|
||||
m_GpgmeFactory_AddRef,
|
||||
m_GpgmeFactory_Release,
|
||||
m_GpgmeFactory_CreateInstance,
|
||||
m_GpgmeFactory_LockServer
|
||||
};
|
||||
static IClassFactoryImpl igpgme_CF = {&igpgme_factory_vtbl, 1 };
|
||||
|
||||
void
|
||||
igpgme_register_exit_event (HANDLE ev)
|
||||
{
|
||||
my_exit_event = ev;
|
||||
}
|
||||
|
||||
|
||||
IClassFactory *
|
||||
igpgme_factory_new ( CLSID *r_clsid )
|
||||
{
|
||||
*r_clsid = CLSID_Gpgme;
|
||||
IClassFactory_AddRef((IClassFactory*)&igpgme_CF);
|
||||
return (IClassFactory*)&igpgme_CF;
|
||||
}
|
||||
|
||||
void
|
||||
igpgme_factory_release ( IClassFactory *factory )
|
||||
{
|
||||
/* it's static - nothing to do */
|
||||
}
|
163
tags/gpgme-1.1.8/complus/igpgme.h
Normal file
163
tags/gpgme-1.1.8/complus/igpgme.h
Normal file
@ -0,0 +1,163 @@
|
||||
/* igpgme.h - COM+ class IGpgme
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifndef IGPGME_H
|
||||
#define IGPGME_H 1
|
||||
|
||||
#include <ole2.h>
|
||||
|
||||
DEFINE_GUID(CLSID_Gpgme, 0x3811fd40, 0x7f72, 0x11d5,
|
||||
0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
|
||||
#if 0
|
||||
DEFINE_GUID(CLSID_GpgmeData, 0x3811fd41, 0x7f72, 0x11d5,
|
||||
0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
|
||||
DEFINE_GUID(CLSID_GpgmeKey, 0x3811fd42, 0x7f72, 0x11d5,
|
||||
0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
|
||||
DEFINE_GUID(CLSID_GpgmeRSet, 0x3811fd43, 0x7f72, 0x11d5,
|
||||
0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
|
||||
#endif
|
||||
|
||||
DEFINE_GUID(TLBID_Gpgcom, 0x3811fd48, 0x7f72, 0x11d5,
|
||||
0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
|
||||
DEFINE_GUID(APPID_Gpgcom, 0x3811fd4f, 0x7f72, 0x11d5,
|
||||
0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
|
||||
|
||||
|
||||
DEFINE_GUID(IID_IGpgme, 0x3811fd50, 0x7f72, 0x11d5,
|
||||
0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
|
||||
|
||||
typedef struct IGpgme IGpgme;
|
||||
|
||||
void igpgme_register_exit_event (HANDLE ev);
|
||||
IClassFactory *igpgme_factory_new( CLSID *r_clsid );
|
||||
void igpgme_factory_release ( IClassFactory *factory );
|
||||
|
||||
|
||||
/********************************************
|
||||
***** The IGpgme interface *****************
|
||||
********************************************/
|
||||
|
||||
#define ICOM_INTERFACE IGpgme
|
||||
|
||||
#define IGpgme_METHODS \
|
||||
ICOM_METHOD1(HRESULT,GetVersion, BSTR*,) \
|
||||
ICOM_METHOD1(HRESULT,GetEngineInfo, BSTR*,) \
|
||||
ICOM_METHOD(HRESULT,Cancel) \
|
||||
ICOM_METHOD1(HRESULT,SetArmor,BOOL,) \
|
||||
ICOM_METHOD1(HRESULT,GetArmor,BOOL*,) \
|
||||
ICOM_METHOD1(HRESULT,SetTextmode,BOOL,) \
|
||||
ICOM_METHOD1(HRESULT,GetTextmode,BOOL*,) \
|
||||
ICOM_METHOD1(HRESULT,SetPlaintext,VARIANT,) \
|
||||
ICOM_METHOD1(HRESULT,GetPlaintext,VARIANT*,) \
|
||||
ICOM_METHOD1(HRESULT,SetCiphertext,VARIANT,) \
|
||||
ICOM_METHOD1(HRESULT,GetCiphertext,VARIANT*,) \
|
||||
ICOM_METHOD(HRESULT,ClearRecipients) \
|
||||
ICOM_METHOD2(HRESULT,AddRecipient,BSTR,,signed short int,) \
|
||||
ICOM_METHOD(HRESULT,ResetSignKeys) \
|
||||
ICOM_METHOD1(HRESULT,AddSignKey,BSTR,) \
|
||||
ICOM_METHOD(HRESULT,Encrypt) \
|
||||
ICOM_METHOD1(HRESULT,Sign,signed short int,) \
|
||||
ICOM_METHOD1(HRESULT,SignEncrypt,signed short int,)
|
||||
|
||||
#if 0
|
||||
ICOM_METHOD1(HRESULT,SetKeylistMode,)
|
||||
ICOM_METHOD1(HRESULT,SetPassphraseCB,)
|
||||
ICOM_METHOD1(HRESULT,SetProgressCB,)
|
||||
ICOM_METHOD1(HRESULT,SignersClear,)
|
||||
ICOM_METHOD1(HRESULT,SignersAdd,)
|
||||
ICOM_METHOD1(HRESULT,SignersEnum,)
|
||||
ICOM_METHOD1(HRESULT,GetSigStatus,)
|
||||
ICOM_METHOD1(HRESULT,GetNotation,)
|
||||
#endif
|
||||
|
||||
#define IGpgme_IMETHODS \
|
||||
IDispatch_IMETHODS \
|
||||
IGpgme_METHODS
|
||||
|
||||
ICOM_DEFINE(IGpgme,IDispatch)
|
||||
#undef ICOM_INTERFACE
|
||||
|
||||
|
||||
/*** IUnknown methods ***/
|
||||
#define IGpgme_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
||||
#define IGpgme_AddRef(p) ICOM_CALL (AddRef,p)
|
||||
#define IGpgme_Release(p) ICOM_CALL (Release,p)
|
||||
/*** IGpgme methods ***/
|
||||
#define IGpgme_GetVersion(p,r) ICOM_CALL1(GetVersion,p,r)
|
||||
#define IGpgme_GetEngineInfo(p,r) ICOM_CALL1(GetEngineInfo,p,r)
|
||||
#define IGpgme_Cancel(p,a) ICOM_CALL1(Cancel,p,a)
|
||||
#define IGpgme_SetArmor(p,a) ICOM_CALL1(SetArmor,p,a)
|
||||
#define IGpgme_GetArmor(p,a) ICOM_CALL1(GetArmor,p,a)
|
||||
#define IGpgme_SetTextmode(p,a) ICOM_CALL1(SetTextmode,p,a)
|
||||
#define IGpgme_GetTextmode(p,a) ICOM_CALL1(GetTextmode,p,a)
|
||||
#define IGpgme_SetPlaintext(p,a) ICOM_CALL1(SetPlaintext,p,a)
|
||||
#define IGpgme_GetPlaintext(p,a) ICOM_CALL1(GetPlaintext,p,a)
|
||||
#define IGpgme_SetCiphertext(p,a) ICOM_CALL1(SetCiphertext,p,a)
|
||||
#define IGpgme_GetCiphertext(p,a) ICOM_CALL1(GetCiphertext,p,a)
|
||||
#define IGpgme_ClearRecipients(p) ICOM_CALL (ClearRecipients,p)
|
||||
#define IGpgme_AddRecipient(p,a,b) ICOM_CALL2(AddRecipient,p,a,b)
|
||||
#define IGpgme_ResetSignKeys(p) ICOM_CALL (ResetSignKeys,p)
|
||||
#define IGpgme_AddSignKey(p,a) ICOM_CALL (AddSignKey,p,a)
|
||||
#define IGpgme_Encrypt(p) ICOM_CALL (Encrypt,p)
|
||||
#define IGpgme_Sign(p,a) ICOM_CALL (Sign,p,a)
|
||||
#define IGpgme_SignEncrypt(p,a) ICOM_CALL (SignEncrypt,p,a)
|
||||
#if 0
|
||||
#define IGpgme_SetKeylistMode(p,a) ICOM_CALL1(SetKeylistMode,p,a)
|
||||
#define IGpgme_SetPassphraseCB(p,a) ICOM_CALL1(SetPassphraseCB,p,a)
|
||||
#define IGpgme_SetProgressCB(p,a) ICOM_CALL1(SetProgressCB,p,a)
|
||||
#define IGpgme_SignersClear(p,a) ICOM_CALL1(SignersClear,p,a)
|
||||
#define IGpgme_SignersAdd(p,a) ICOM_CALL1(SignersAdd,p,a)
|
||||
#define IGpgme_SignersEnum(p,a) ICOM_CALL1(SignersEnum,p,a)
|
||||
#define IGpgme_GetSigStatus(p,a) ICOM_CALL1(GetSigStatus,p,a)
|
||||
#define IGpgme_GetSigKey(p,a) ICOM_CALL1(GetSigKey,p,a)
|
||||
#define IGpgme_GetNotation(p,a) ICOM_CALL1(GetNotation,p,a)
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
/********************************************
|
||||
***** The IGpgmeKey interface **************
|
||||
********************************************/
|
||||
|
||||
#define ICOM_INTERFACE IGpgmeKey
|
||||
|
||||
#define IGpgmeKey_METHODS \
|
||||
ICOM_METHOD1(HRESULT,GetVersion, BSTR,) \
|
||||
ICOM_METHOD1(HRESULT,GetEngineInfo, BSTR,)
|
||||
|
||||
|
||||
#define IGpgmeKey_IMETHODS \
|
||||
IUnknown_IMETHODS \
|
||||
IGpgmeKey_METHODS
|
||||
|
||||
ICOM_DEFINE(IGpgmeKey,IUnknown)
|
||||
#undef ICOM_INTERFACE
|
||||
|
||||
/*** IUnknown methods ***/
|
||||
#define IGpgmeKey_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
||||
#define IGpgmeKey_AddRef(p) ICOM_CALL (AddRef,p)
|
||||
#define IGpgmeKey_Release(p) ICOM_CALL (Release,p)
|
||||
/*** IGpgmeKey methods ***/
|
||||
#define IGpgmeKey_GetVersion(p,r) ICOM_CALL1(GetVersion,p,r)
|
||||
#define IGpgmeKey_GetEngineInfo(p,r) ICOM_CALL1(GetEngineInfo,p,r)
|
||||
#endif
|
||||
|
||||
#endif /*IGPGME_H*/
|
||||
|
49
tags/gpgme-1.1.8/complus/main.h
Normal file
49
tags/gpgme-1.1.8/complus/main.h
Normal file
@ -0,0 +1,49 @@
|
||||
/* main.h - GPGME COM+ component
|
||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifndef COMPLUS_MAIN_H
|
||||
#define COMPLUS_MAIN_H
|
||||
|
||||
#include "xmalloc.h"
|
||||
#include "stringhelp.h"
|
||||
#include "logging.h"
|
||||
|
||||
|
||||
#define _(a) (a)
|
||||
#define N_(a) (a)
|
||||
|
||||
|
||||
struct {
|
||||
int verbose;
|
||||
int quiet;
|
||||
unsigned int debug;
|
||||
char *homedir;
|
||||
} opt;
|
||||
|
||||
|
||||
|
||||
#endif /* COMPLUS_MAIN_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
70
tags/gpgme-1.1.8/complus/regtlb.c
Normal file
70
tags/gpgme-1.1.8/complus/regtlb.c
Normal file
@ -0,0 +1,70 @@
|
||||
/* regtlb.c - Register a type library
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "xmalloc.h"
|
||||
#include "oleauto.h"
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
ITypeLib *pTypeLib;
|
||||
wchar_t *fname;
|
||||
HRESULT hr;
|
||||
size_t n;
|
||||
|
||||
if ( argc != 2 ) {
|
||||
fprintf (stderr,"usage: regtlb foo.tlb\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
n = mbstowcs (NULL, argv[1], strlen(argv[1])+1);
|
||||
fprintf (stderr, "need %d bytes\n", (int)n);
|
||||
fname = xmalloc ((n+1)*sizeof *fname);
|
||||
mbstowcs (fname, argv[1], strlen (argv[1])+1);
|
||||
|
||||
hr = CoInitializeEx (NULL, COINIT_MULTITHREADED);
|
||||
if (hr)
|
||||
fprintf (stderr, "CoInitializeEx() failed: hr=%lu\n", hr);
|
||||
|
||||
hr = LoadTypeLibEx (fname, REGKIND_REGISTER, &pTypeLib);
|
||||
if (hr)
|
||||
fprintf (stderr, "LoadTypeLibEx() failed: hr=%lx\n", hr);
|
||||
|
||||
ITypeLib_Release (pTypeLib);
|
||||
|
||||
CoUninitialize ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
157
tags/gpgme-1.1.8/complus/tgpgcom.c
Normal file
157
tags/gpgme-1.1.8/complus/tgpgcom.c
Normal file
@ -0,0 +1,157 @@
|
||||
/* tgpgcom.c - Test the IGpgme classes
|
||||
* Copyright (C) 2001 g10 Code GmbH
|
||||
*
|
||||
* This file is part of GPGME.
|
||||
*
|
||||
* GPGME 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.
|
||||
*
|
||||
* GPGME 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define INITGUID
|
||||
#include "igpgme.h"
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
IUnknown *pUnknown = NULL;
|
||||
IGpgme *pGpgme;
|
||||
HRESULT hr;
|
||||
BSTR bs;
|
||||
|
||||
hr = CoInitializeEx (NULL, COINIT_APARTMENTTHREADED);
|
||||
if (hr)
|
||||
fprintf (stderr, "CoInitializeEx() failed: hr=%lu\n", hr);
|
||||
|
||||
fprintf (stderr, "system initialized\n");
|
||||
hr = CoCreateInstance (&CLSID_Gpgme, NULL, CLSCTX_LOCAL_SERVER,
|
||||
&IID_IUnknown, (void**)&pUnknown );
|
||||
if (hr)
|
||||
fprintf (stderr, "CoCreateInstance() failed: hr=%lx\n", hr);
|
||||
if (!pUnknown)
|
||||
exit (1);
|
||||
|
||||
fprintf (stderr,"got object %p - querying %s\n",
|
||||
pUnknown, debugstr_guid(&IID_IGpgme));
|
||||
hr = IGpgme_QueryInterface (pUnknown, &IID_IGpgme, (void**)&pGpgme);
|
||||
if (hr) {
|
||||
fprintf (stderr, "QueryInterface() failed: hr=%lx\n", hr);
|
||||
goto leave;
|
||||
}
|
||||
fprintf (stderr, "got interface %p\n", pGpgme);
|
||||
|
||||
hr = IGpgme_SetArmor (pGpgme, 1);
|
||||
fprintf (stderr, "SetArmor returned %lx\n", hr);
|
||||
|
||||
hr = IGpgme_SetTextmode (pGpgme, 0);
|
||||
fprintf (stderr, "SetTextmode returned %lx\n", hr);
|
||||
|
||||
hr = IGpgme_ClearRecipients (pGpgme);
|
||||
fprintf (stderr, "ClearRecipients returned %lx\n", hr);
|
||||
|
||||
bs = SysAllocString (L"alice");
|
||||
if (!bs)
|
||||
fprintf (stderr, "SysAllocString failed: ec=%d\n", (int)GetLastError());
|
||||
else {
|
||||
int i;
|
||||
|
||||
for (i=-4; i < 12; i++ )
|
||||
fprintf (stderr," %02X", ((unsigned char*)bs)[i] );
|
||||
putc ('\n', stderr);
|
||||
}
|
||||
hr = IGpgme_AddRecipient (pGpgme, bs, -1);
|
||||
fprintf (stderr, "AddRecipients returned %lx\n", hr);
|
||||
|
||||
{
|
||||
SAFEARRAY *sa;
|
||||
VARIANT v;
|
||||
char *p;
|
||||
|
||||
sa = SafeArrayCreateVector (VT_UI1, 0, 20);
|
||||
if (!sa) {
|
||||
fprintf (stderr, "SafeArrayCreateVector failed\n");
|
||||
goto leave;
|
||||
}
|
||||
|
||||
hr = SafeArrayAccessData (sa, (void**)&p);
|
||||
if (hr) {
|
||||
fprintf (stderr,"SafeArrayAccessData failed: hr=%lx\n", hr);
|
||||
goto leave;
|
||||
}
|
||||
|
||||
memcpy (p, "=> Omnis enim res <=", 20 );
|
||||
SafeArrayUnaccessData (sa);
|
||||
|
||||
VariantInit (&v);
|
||||
v.vt = (VT_ARRAY|VT_UI1);
|
||||
v.u.parray = sa;
|
||||
|
||||
hr = IGpgme_SetPlaintext (pGpgme, v );
|
||||
fprintf (stderr, "SetPlaintext returned %lx\n", hr);
|
||||
SafeArrayDestroyData (sa);
|
||||
SafeArrayDestroy (sa);
|
||||
|
||||
VariantClear (&v);
|
||||
}
|
||||
|
||||
hr = IGpgme_Encrypt (pGpgme);
|
||||
fprintf (stderr, "Encrypt returned %lx\n", hr);
|
||||
|
||||
{
|
||||
VARIANT v;
|
||||
|
||||
hr = IGpgme_GetCiphertext (pGpgme, &v);
|
||||
fprintf (stderr, "GetCiphertext returned %lx\n", hr);
|
||||
if (!hr) {
|
||||
if (v.vt != (VT_ARRAY|VT_UI1))
|
||||
fprintf (stderr, "Invalid array typed returned\n");
|
||||
else {
|
||||
unsigned char *p;
|
||||
|
||||
hr = SafeArrayAccessData (v.u.parray, (void**)&p);
|
||||
if (hr)
|
||||
fprintf (stderr,"*** SafeArrayAccessData failed: %lx\n", hr);
|
||||
else {
|
||||
size_t arraysize = v.u.parray->rgsabound[0].cElements;
|
||||
fprintf (stderr,"*** got %d bytes\n", (int)arraysize);
|
||||
for (;arraysize; arraysize--, p++ )
|
||||
putc (*p, stderr);
|
||||
SafeArrayUnaccessData (v.u.parray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
IGpgme_Release (pGpgme);
|
||||
|
||||
leave:
|
||||
CoUninitialize ();
|
||||
fprintf (stderr, "system uninitialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
236
tags/gpgme-1.1.8/complus/utf8.c
Normal file
236
tags/gpgme-1.1.8/complus/utf8.c
Normal file
@ -0,0 +1,236 @@
|
||||
/*
|
||||
* UTF-8 support routines
|
||||
*
|
||||
* Copyright 2000 Alexandre Julliard
|
||||
*
|
||||
* Taken from WINE, so the usual WINE copyright applies:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include <ole2.h>
|
||||
|
||||
/* number of following bytes in sequence based on first byte value (for bytes above 0x7f) */
|
||||
static const char utf8_length[128] =
|
||||
{
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x80-0x8f */
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x90-0x9f */
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xa0-0xaf */
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xb0-0xbf */
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0xc0-0xcf */
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0xd0-0xdf */
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, /* 0xe0-0xef */
|
||||
3,3,3,3,3,3,3,3,4,4,4,4,5,5,0,0 /* 0xf0-0xff */
|
||||
};
|
||||
|
||||
/* first byte mask depending on UTF-8 sequence length */
|
||||
static const unsigned char utf8_mask[6] = { 0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
|
||||
|
||||
/* minimum Unicode value depending on UTF-8 sequence length */
|
||||
static const unsigned int utf8_minval[6] = { 0x0, 0x80, 0x800, 0x10000, 0x200000, 0x4000000 };
|
||||
|
||||
|
||||
/* query necessary dst length for src string */
|
||||
inline static int get_length_wcs_utf8( const WCHAR *src, unsigned int srclen )
|
||||
{
|
||||
int len;
|
||||
|
||||
for (len = 0; srclen; srclen--, src++, len++)
|
||||
{
|
||||
if (*src >= 0x80)
|
||||
{
|
||||
len++;
|
||||
if (*src >= 0x800) len++;
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
/* wide char to UTF-8 string conversion */
|
||||
/* return -1 on dst buffer overflow */
|
||||
int utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen )
|
||||
{
|
||||
char *orig_dst = dst;
|
||||
|
||||
if (!dstlen) return get_length_wcs_utf8( src, srclen );
|
||||
|
||||
for (; srclen; srclen--, src++)
|
||||
{
|
||||
WCHAR ch = *src;
|
||||
|
||||
if (ch < 0x80) /* 0x00-0x7f: 1 byte */
|
||||
{
|
||||
if (!dstlen--) return -1; /* overflow */
|
||||
*dst++ = ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ch < 0x800) /* 0x80-0x7ff: 2 bytes */
|
||||
{
|
||||
if ((dstlen -= 2) < 0) return -1; /* overflow */
|
||||
dst[1] = 0x80 | (ch & 0x3f);
|
||||
ch >>= 6;
|
||||
dst[0] = 0xc0 | ch;
|
||||
dst += 2;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* 0x800-0xffff: 3 bytes */
|
||||
|
||||
if ((dstlen -= 3) < 0) return -1; /* overflow */
|
||||
dst[2] = 0x80 | (ch & 0x3f);
|
||||
ch >>= 6;
|
||||
dst[1] = 0x80 | (ch & 0x3f);
|
||||
ch >>= 6;
|
||||
dst[0] = 0xe0 | ch;
|
||||
dst += 3;
|
||||
}
|
||||
return dst - orig_dst;
|
||||
}
|
||||
|
||||
/* query necessary dst length for src string */
|
||||
inline static int get_length_mbs_utf8( const unsigned char *src, int srclen )
|
||||
{
|
||||
int ret;
|
||||
const unsigned char *srcend = src + srclen;
|
||||
|
||||
for (ret = 0; src < srcend; ret++)
|
||||
{
|
||||
unsigned char ch = *src++;
|
||||
if (ch < 0xc0) continue;
|
||||
|
||||
switch(utf8_length[ch-0x80])
|
||||
{
|
||||
case 5:
|
||||
if (src >= srcend) return ret; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) continue;
|
||||
src++;
|
||||
case 4:
|
||||
if (src >= srcend) return ret; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) continue;
|
||||
src++;
|
||||
case 3:
|
||||
if (src >= srcend) return ret; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) continue;
|
||||
src++;
|
||||
case 2:
|
||||
if (src >= srcend) return ret; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) continue;
|
||||
src++;
|
||||
case 1:
|
||||
if (src >= srcend) return ret; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) continue;
|
||||
src++;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* UTF-8 to wide char string conversion */
|
||||
/* return -1 on dst buffer overflow, -2 on invalid input char */
|
||||
int utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen )
|
||||
{
|
||||
int len, count;
|
||||
unsigned int res;
|
||||
const char *srcend = src + srclen;
|
||||
|
||||
if (!dstlen) return get_length_mbs_utf8( src, srclen );
|
||||
|
||||
for (count = dstlen; count && (src < srcend); count--, dst++)
|
||||
{
|
||||
unsigned char ch = *src++;
|
||||
if (ch < 0x80) /* special fast case for 7-bit ASCII */
|
||||
{
|
||||
*dst = ch;
|
||||
continue;
|
||||
}
|
||||
len = utf8_length[ch-0x80];
|
||||
res = ch & utf8_mask[len];
|
||||
|
||||
switch(len)
|
||||
{
|
||||
case 5:
|
||||
if (src >= srcend) goto done; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) goto bad;
|
||||
res = (res << 6) | ch;
|
||||
src++;
|
||||
case 4:
|
||||
if (src >= srcend) goto done; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) goto bad;
|
||||
res = (res << 6) | ch;
|
||||
src++;
|
||||
case 3:
|
||||
if (src >= srcend) goto done; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) goto bad;
|
||||
res = (res << 6) | ch;
|
||||
src++;
|
||||
case 2:
|
||||
if (src >= srcend) goto done; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) goto bad;
|
||||
res = (res << 6) | ch;
|
||||
src++;
|
||||
case 1:
|
||||
if (src >= srcend) goto done; /* ignore partial char */
|
||||
if ((ch = *src ^ 0x80) >= 0x40) goto bad;
|
||||
res = (res << 6) | ch;
|
||||
src++;
|
||||
if (res < utf8_minval[len]) goto bad;
|
||||
if (res >= 0x10000) goto bad; /* FIXME: maybe we should do surrogates here */
|
||||
*dst = res;
|
||||
continue;
|
||||
}
|
||||
bad:
|
||||
if (flags & MB_ERR_INVALID_CHARS) return -2; /* bad char */
|
||||
*dst = (WCHAR)'?';
|
||||
}
|
||||
if (src < srcend) return -1; /* overflow */
|
||||
done:
|
||||
return dstlen - count;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
bstrtoutf8 ( BSTR src, char *dst, size_t dstlen )
|
||||
{
|
||||
size_t srclen, needed;
|
||||
int n;
|
||||
|
||||
srclen = src? SysStringLen (src): 0;
|
||||
|
||||
needed = srclen? (utf8_wcstombs (src, srclen, NULL, 0) + 1) : 1;
|
||||
if (!dst || !dstlen)
|
||||
return needed;
|
||||
if (dstlen < needed)
|
||||
return -1;
|
||||
if (srclen) {
|
||||
n = utf8_wcstombs (src, srclen, dst, dstlen);
|
||||
if (n < 0)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
n = 0;
|
||||
dst[n] = 0;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
|
47
tags/gpgme-1.1.8/complus/vbtest.html
Normal file
47
tags/gpgme-1.1.8/complus/vbtest.html
Normal file
@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head><title>g10 code - GPGCOM test</title>
|
||||
|
||||
<object id="gpg"
|
||||
classid="CLSID:3811fd40-7f72-11d5-8c9e-0080ad190cd5">
|
||||
</object>
|
||||
|
||||
<script language="VBScript">
|
||||
Sub encrypt_text
|
||||
On error resume next
|
||||
Dim TheForm, plain
|
||||
|
||||
set TheForm = Document.forms ("MyForm")
|
||||
gpg.armor = True
|
||||
gpg.plaintext = TheForm.clear.value
|
||||
gpg.ClearRecipients
|
||||
gpg.AddRecipient TheForm.recp.value
|
||||
Err.Clear
|
||||
gpg.Encrypt
|
||||
if Err <> 0 then
|
||||
TheForm.encoded.value = "Error: " & CStr(Err.Number)
|
||||
else
|
||||
TheForm.encoded.value = gpg.ciphertext
|
||||
end if
|
||||
end sub
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Silly Gpgcom test page</h1>
|
||||
|
||||
<form id="MyForm">
|
||||
<textarea name="clear" rows = 3 cols=40>Please enter the text here</textarea>
|
||||
<p>
|
||||
Encrypt for <input name="recp" value="alice">
|
||||
<input type="button" name="MyAction" value="Encrypt"
|
||||
language="VBScript" onclick="encrypt_text()">
|
||||
<p>
|
||||
<textarea name="encoded" rows=10 cols=75></textarea>
|
||||
</form>
|
||||
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
39
tags/gpgme-1.1.8/complus/vbtest.vbs
Normal file
39
tags/gpgme-1.1.8/complus/vbtest.vbs
Normal file
@ -0,0 +1,39 @@
|
||||
' Demo script to generate a RFC2015 compliant message using Gpgcom
|
||||
Dim gpg, body, crlf
|
||||
|
||||
crlf = chr(10) & chr(13)
|
||||
|
||||
' Create out Gpgcom object
|
||||
set gpg = CreateObject("Gpgcom.Gpgme")
|
||||
' We must use the ASCII armor and switch to textmode
|
||||
gpg.armor = true
|
||||
gpg.textmode = true
|
||||
|
||||
' Set the secret message
|
||||
gpg.plaintext = "This is the secret message." 'or: InputBox('Enter message:")
|
||||
|
||||
' Set the Recipient. You may also use a keyID or an fingerprint
|
||||
gpg.AddRecipient "alice"
|
||||
|
||||
' And encrypt the stuff
|
||||
gpg.encrypt
|
||||
|
||||
' Build the MIME message
|
||||
body = "Content-Type: multipart/encrypted; boundary="
|
||||
body = body & Chr(34) & "=-=-=-=" & Chr(34) & crlf & " protocol=" & Chr(34)
|
||||
body = body & "application/pgp-encrypted" & Chr(34) & crlf & crlf
|
||||
body = body & "--=-=-=-=" & crlf
|
||||
body = body & "Content-Type: application/pgp-encrypted" & crlf & crlf
|
||||
body = body & "Version: 1" & crlf & crlf
|
||||
body = body & "--=-=-=-=" & crlf
|
||||
body = body & "Content-Type: application/octet-stream" & crlf & crlf
|
||||
body = body & gpg.ciphertext
|
||||
body = body & "--=-=-=-=--" & crlf
|
||||
|
||||
' And display it
|
||||
Print body
|
||||
|
||||
' output function for the windows scripting host
|
||||
sub Print(x)
|
||||
WScript.Echo x
|
||||
end sub
|
1516
tags/gpgme-1.1.8/config.guess
vendored
Executable file
1516
tags/gpgme-1.1.8/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
1630
tags/gpgme-1.1.8/config.sub
vendored
Executable file
1630
tags/gpgme-1.1.8/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
769
tags/gpgme-1.1.8/configure.ac
Normal file
769
tags/gpgme-1.1.8/configure.ac
Normal file
@ -0,0 +1,769 @@
|
||||
# configure.ac for GPGME
|
||||
# Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 g10 Code GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
#
|
||||
# GPGME 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.1 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# GPGME 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 program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
# (Process this file with autoconf to produce a configure script.)
|
||||
AC_PREREQ(2.59)
|
||||
min_automake_version="1.10"
|
||||
|
||||
# Version number: Remember to change it immediately *after* a release.
|
||||
# Make sure to run "svn up" and "./autogen.sh --force"
|
||||
# before a "make dist". See below for the LT versions.
|
||||
#
|
||||
# The SVN version is usually the next intended release version with
|
||||
# the string "-svnNNN" appended. The reason for this is that tests for a
|
||||
# specific feature can already be done under the assumption that the
|
||||
# SVN version is the most recent one in a branch. To disable the SVN
|
||||
# version for the real release, set the my_issvn macro to no.
|
||||
m4_define(my_version, [1.1.8])
|
||||
m4_define(my_issvn, [no])
|
||||
|
||||
m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
|
||||
|| echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
|
||||
AC_INIT([gpgme],
|
||||
[my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
|
||||
[bug-gpgme@gnupg.org])
|
||||
|
||||
|
||||
# LT Version numbers, remember to change them just *before* a release.
|
||||
# (Code changed: REVISION++)
|
||||
# (Interfaces added/removed/changed: CURRENT++, REVISION=0)
|
||||
# (Interfaces added: AGE++)
|
||||
# (Interfaces removed/changed: AGE=0)
|
||||
#
|
||||
LIBGPGME_LT_CURRENT=17
|
||||
# Subtract 2 from this value if you want to make the LFS transition an
|
||||
# ABI break. [Note to self: Remove this comment with the next regular break.]
|
||||
LIBGPGME_LT_AGE=6
|
||||
LIBGPGME_LT_REVISION=6
|
||||
|
||||
# If the API is changed in an incompatible way: increment the next counter.
|
||||
GPGME_CONFIG_API_VERSION=1
|
||||
##############################################
|
||||
|
||||
|
||||
BUILD_REVISION=svn_revision
|
||||
PACKAGE=$PACKAGE_NAME
|
||||
VERSION=$PACKAGE_VERSION
|
||||
|
||||
AC_CONFIG_SRCDIR(src/gpgme.h.in)
|
||||
dnl FIXME: Enable this with autoconf 2.59.
|
||||
dnl AC_CONFIG_MACRO_DIR(m4)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
|
||||
AM_MAINTAINER_MODE
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
# Enable GNU extensions on systems that have them.
|
||||
AC_GNU_SOURCE
|
||||
|
||||
AH_VERBATIM([_REENTRANT],
|
||||
[/* To allow the use of GPGME in multithreaded programs we have to use
|
||||
special features from the library.
|
||||
IMPORTANT: gpgme is not yet fully reentrant and you should use it
|
||||
only from one thread. */
|
||||
#ifndef _REENTRANT
|
||||
# define _REENTRANT 1
|
||||
#endif])
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
|
||||
AC_SUBST(LIBGPGME_LT_CURRENT)
|
||||
AC_SUBST(LIBGPGME_LT_AGE)
|
||||
AC_SUBST(LIBGPGME_LT_REVISION)
|
||||
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_SUBST(VERSION)
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
|
||||
|
||||
# Don't default to build static libs.
|
||||
AC_DISABLE_STATIC
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_LIBTOOL_RC
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
# For now we hardcode the use of version scripts. It would be better
|
||||
# to write a test for this or even implement this within libtool.
|
||||
have_ld_version_script=no
|
||||
case "${host}" in
|
||||
*-*-linux*)
|
||||
have_ld_version_script=yes
|
||||
;;
|
||||
*-*-gnu*)
|
||||
have_ld_version_script=yes
|
||||
;;
|
||||
*-apple-darwin*)
|
||||
AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X)
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
||||
|
||||
GPG_DEFAULT=no
|
||||
GPGSM_DEFAULT=no
|
||||
GPGCONF_DEFAULT=no
|
||||
component_system=None
|
||||
have_dosish_system=no
|
||||
have_w32_system=no
|
||||
build_w32_glib=no
|
||||
build_w32_qt=no
|
||||
case "${host}" in
|
||||
*-mingw32*)
|
||||
# special stuff for Windoze NT
|
||||
have_dosish_system=yes
|
||||
have_w32_system=yes
|
||||
GPG_DEFAULT='c:\\gnupg\\gpg.exe'
|
||||
GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
|
||||
GPGCONF_DEFAULT='c:\\gnupg\\gpgconf.exe'
|
||||
#component_system='COM+'
|
||||
|
||||
AM_PATH_GLIB_2_0
|
||||
AC_ARG_ENABLE(w32-glib,
|
||||
AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
|
||||
build_w32_glib=$enableval)
|
||||
|
||||
# Check disabled, because the qt-dev packages in gpg4win do
|
||||
# not provide any support for cross compilation.
|
||||
# PKG_CHECK_MODULES(QT4_CORE, QtCore)
|
||||
|
||||
# Use it like this:
|
||||
# ./configure --enable-w32-qt QT4_CORE_CFLAGS="..." QT4_CORE_LIBS="..."
|
||||
AC_SUBST(QT4_CORE_CFLAGS)
|
||||
AC_SUBST(QT4_CORE_LIBS)
|
||||
AC_ARG_ENABLE(w32-qt,
|
||||
AC_HELP_STRING([--enable-w32-qt], [build GPGME Qt for W32]),
|
||||
build_w32_qt=$enableval)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_PTH(1.2.0,,,no,have_pth=yes)
|
||||
if test "$have_pth" = yes; then
|
||||
AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
|
||||
fi
|
||||
AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
|
||||
if test "$have_pthread" = yes; then
|
||||
AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
|
||||
fi
|
||||
|
||||
# XXX: Probably use exec-prefix here?
|
||||
# GPG_DEFAULT='/usr/bin/gpg'
|
||||
# GPGSM_DEFAULT='/usr/bin/gpgsm'
|
||||
# GPGCONF_DEFAULT='/usr/bin/gpgconf'
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$have_dosish_system" = yes; then
|
||||
AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
|
||||
[Defined if we run on some of the PCDOS like systems
|
||||
(DOS, Windoze. OS/2) with special properties like
|
||||
no file modes])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
|
||||
|
||||
if test "$have_w32_system" = yes; then
|
||||
AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
|
||||
AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
|
||||
AM_CONDITIONAL(BUILD_W32_QT, test "$build_w32_qt" = yes)
|
||||
|
||||
AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
|
||||
AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
|
||||
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS(sys/select.h)
|
||||
|
||||
|
||||
# Type checks.
|
||||
AC_C_INLINE
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
AC_SYS_LARGEFILE
|
||||
AC_TYPE_OFF_T
|
||||
|
||||
# Checks for compiler features.
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
|
||||
if test "$have_w32_system" = yes; then
|
||||
CFLAGS="$CFLAGS -mms-bitfields"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Network library fun.
|
||||
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
|
||||
[NETLIBS="-lnsl $NETLIBS"]))
|
||||
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
|
||||
[NETLIBS="-lsocket $NETLIBS"]))
|
||||
AC_SUBST(NETLIBS)
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_FSEEKO
|
||||
|
||||
AC_REPLACE_FUNCS(vasprintf)
|
||||
if test "$ac_cv_func_vasprintf" != yes; then
|
||||
GNUPG_CHECK_VA_COPY
|
||||
fi
|
||||
|
||||
# Try to find a thread-safe version of ttyname().
|
||||
AC_REPLACE_FUNCS(ttyname_r)
|
||||
if test "$ac_cv_func_ttyname_r" != yes; then
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** ttyname() is not thread-safe and ttyname_r() does not exist
|
||||
***])
|
||||
fi
|
||||
|
||||
# Try to find a thread-safe version of getenv().
|
||||
have_thread_safe_getenv=no
|
||||
jm_GLIBC21
|
||||
if test $GLIBC21 = yes; then
|
||||
have_thread_safe_getenv=yes
|
||||
fi
|
||||
if test $have_thread_safe_getenv = yes; then
|
||||
AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
|
||||
fi
|
||||
have_getenv_r=no
|
||||
AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
|
||||
if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** getenv() is not thread-safe and getenv_r() does not exist
|
||||
***])
|
||||
fi
|
||||
|
||||
# For converting time strings to seconds since Epoch, we need the timegm
|
||||
# function.
|
||||
AC_CHECK_FUNCS(timegm)
|
||||
if test "$ac_cv_func_timegm" != yes; then
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** timegm() not available - a non-thread-safe kludge will be used
|
||||
*** and the TZ variable might be changed at runtime.
|
||||
***])
|
||||
fi
|
||||
|
||||
# Checking for libgpg-error.
|
||||
AM_PATH_GPG_ERROR(1.4,, AC_MSG_ERROR([libgpg-error was not found]))
|
||||
AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
|
||||
[The default error source for GPGME.])
|
||||
|
||||
|
||||
|
||||
# Checks for system services
|
||||
NEED_GPG_VERSION_DEFAULT=1.3.0
|
||||
NEED_GPGSM_VERSION_DEFAULT=1.9.6
|
||||
NEED_GPGCONF_VERSION_DEFAULT=2.0.4
|
||||
NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
|
||||
NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
|
||||
NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT"
|
||||
AC_ARG_WITH(gpg-version,
|
||||
AC_HELP_STRING([--with-gpg-version=VER], [require GnuPG version VER]),
|
||||
NEED_GPG_VERSION=$withval)
|
||||
if test "$NEED_GPG_VERSION" = "yes"; then
|
||||
NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
|
||||
fi
|
||||
if test "$NEED_GPG_VERSION" = "no"; then
|
||||
NEED_GPG_VERSION=0.0.0
|
||||
fi
|
||||
AC_ARG_WITH(gpgsm-version,
|
||||
AC_HELP_STRING([--with-gpgsm-version=VER], [require GPGSM version VER]),
|
||||
NEED_GPGSM_VERSION=$withval)
|
||||
if test "$NEED_GPGSM_VERSION" = "yes"; then
|
||||
NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
|
||||
fi
|
||||
if test "$NEED_GPGSM_VERSION" = "no"; then
|
||||
NEED_GPGSM_VERSION=0.0.0
|
||||
fi
|
||||
AC_ARG_WITH(gpgconf-version,
|
||||
AC_HELP_STRING([--with-gpgconf-version=VER], [require GPGCONF version VER]),
|
||||
NEED_GPGCONF_VERSION=$withval)
|
||||
if test "$NEED_GPGCONF_VERSION" = "yes"; then
|
||||
NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT"
|
||||
fi
|
||||
if test "$NEED_GPGCONF_VERSION" = "no"; then
|
||||
NEED_GPGCONF_VERSION=0.0.0
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
|
||||
[Min. needed GnuPG version.])
|
||||
AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
|
||||
[Min. needed GPGSM version.])
|
||||
AC_DEFINE_UNQUOTED(NEED_GPGCONF_VERSION, "$NEED_GPGCONF_VERSION",
|
||||
[Min. needed GPGCONF version.])
|
||||
|
||||
|
||||
NO_OVERRIDE=no
|
||||
AC_ARG_WITH(gpg,
|
||||
AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
|
||||
GPG=$withval, NO_OVERRIDE=yes)
|
||||
if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
|
||||
GPG=
|
||||
NO_OVERRIDE=yes
|
||||
if test "$cross_compiling" != "yes"; then
|
||||
AC_PATH_PROG(GPG, gpg)
|
||||
fi
|
||||
if test -z "$GPG"; then
|
||||
GPG="$GPG_DEFAULT"
|
||||
fi
|
||||
fi
|
||||
if test "$GPG" = no; then
|
||||
if test "$NO_OVERRIDE" = "yes"; then
|
||||
if test "$cross_compiling" != "yes"; then
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it
|
||||
***])
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
***
|
||||
*** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH
|
||||
***])
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.])
|
||||
AC_SUBST(GPG)
|
||||
fi
|
||||
dnl Check for GnuPG version requirement.
|
||||
GPG_VERSION=unknown
|
||||
ok=maybe
|
||||
if test -z "$GPG" -o "x$GPG" = "xno"; then
|
||||
ok=no
|
||||
else
|
||||
if test "$cross_compiling" = "yes"; then
|
||||
AC_MSG_WARN([GnuPG version can not be checked when cross compiling])
|
||||
ok=no
|
||||
else
|
||||
if test ! -x "$GPG"; then
|
||||
AC_MSG_WARN([GnuPG not executable, version check disabled])
|
||||
ok=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$ok" = "maybe"; then
|
||||
AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION)
|
||||
req_major=`echo $NEED_GPG_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
|
||||
req_minor=`echo $NEED_GPG_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
|
||||
req_micro=`echo $NEED_GPG_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
|
||||
GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
|
||||
major=`echo $GPG_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
|
||||
minor=`echo $GPG_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
|
||||
micro=`echo $GPG_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
|
||||
|
||||
if test "$major" -gt "$req_major"; then
|
||||
ok=yes
|
||||
else
|
||||
if test "$major" -eq "$req_major"; then
|
||||
if test "$minor" -gt "$req_minor"; then
|
||||
ok=yes
|
||||
else
|
||||
if test "$minor" -eq "$req_minor"; then
|
||||
if test "$micro" -ge "$req_micro"; then
|
||||
ok=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$ok" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION])
|
||||
fi
|
||||
fi
|
||||
run_gpg_test="$ok"
|
||||
AC_ARG_ENABLE(gpg-test,
|
||||
AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]),
|
||||
run_gpg_test=$enableval)
|
||||
AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
|
||||
AC_SUBST(GPG_PATH)
|
||||
|
||||
NO_OVERRIDE=no
|
||||
AC_ARG_WITH(gpgsm,
|
||||
AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
|
||||
GPGSM=$withval, NO_OVERRIDE=yes)
|
||||
if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
|
||||
GPGSM=
|
||||
NO_OVERRIDE=yes
|
||||
if test "$cross_compiling" != "yes"; then
|
||||
AC_PATH_PROG(GPGSM, gpgsm)
|
||||
fi
|
||||
if test -z "$GPGSM"; then
|
||||
GPGSM="$GPGSM_DEFAULT"
|
||||
fi
|
||||
fi
|
||||
if test "$GPGSM" = no; then
|
||||
if test "$NO_OVERRIDE" = "yes"; then
|
||||
if test "$cross_compiling" != "yes"; then
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it
|
||||
***])
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
***
|
||||
*** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH
|
||||
***])
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.])
|
||||
AC_DEFINE(ENABLE_GPGSM,1,[Whether GPGSM support is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no")
|
||||
|
||||
|
||||
dnl Check for GPGSM version requirement.
|
||||
GPGSM_VERSION=unknown
|
||||
ok=maybe
|
||||
if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then
|
||||
ok=no
|
||||
else
|
||||
if test "$cross_compiling" = "yes"; then
|
||||
AC_MSG_WARN([GPGSM version can not be checked when cross compiling])
|
||||
ok=no
|
||||
else
|
||||
if test ! -x "$GPGSM"; then
|
||||
AC_MSG_WARN([GPGSM not executable, version check disabled])
|
||||
ok=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$ok" = "maybe"; then
|
||||
AC_MSG_CHECKING(for GPGSM >= $NEED_GPGSM_VERSION)
|
||||
req_major=`echo $NEED_GPGSM_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
|
||||
req_minor=`echo $NEED_GPGSM_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
|
||||
req_micro=`echo $NEED_GPGSM_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
|
||||
GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
|
||||
major=`echo $GPGSM_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
|
||||
minor=`echo $GPGSM_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
|
||||
micro=`echo $GPGSM_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
|
||||
|
||||
if test "$major" -gt "$req_major"; then
|
||||
ok=yes
|
||||
else
|
||||
if test "$major" -eq "$req_major"; then
|
||||
if test "$minor" -gt "$req_minor"; then
|
||||
ok=yes
|
||||
else
|
||||
if test "$minor" -eq "$req_minor"; then
|
||||
if test "$micro" -ge "$req_micro"; then
|
||||
ok=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$ok" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION])
|
||||
fi
|
||||
fi
|
||||
run_gpgsm_test="$ok"
|
||||
AC_ARG_ENABLE(gpgsm-test,
|
||||
AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]),
|
||||
run_gpgsm_test=$enableval)
|
||||
AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
|
||||
|
||||
|
||||
NO_OVERRIDE=no
|
||||
AC_ARG_WITH(gpgconf,
|
||||
AC_HELP_STRING([--with-gpgconf=PATH],
|
||||
[use gpgconf binary at PATH]),
|
||||
GPGCONF=$withval, NO_OVERRIDE=yes)
|
||||
if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then
|
||||
GPGCONF=
|
||||
NO_OVERRIDE=yes
|
||||
if test "$cross_compiling" != "yes"; then
|
||||
AC_PATH_PROG(GPGCONF, gpgconf)
|
||||
fi
|
||||
if test -z "$GPGCONF"; then
|
||||
GPGCONF="$GPGCONF_DEFAULT"
|
||||
fi
|
||||
fi
|
||||
if test "$GPGCONF" = no; then
|
||||
if test "$NO_OVERRIDE" = "yes"; then
|
||||
if test "$cross_compiling" != "yes"; then
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
|
||||
***])
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
***
|
||||
*** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH
|
||||
***])
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(GPGCONF_PATH, "$GPGCONF", [Path to the GPGCONF binary.])
|
||||
AC_DEFINE(ENABLE_GPGCONF,1,[Whether GPGCONF support is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GPGCONF, test "$GPGCONF" != "no")
|
||||
|
||||
dnl Check for GPGCONF version requirement.
|
||||
GPGCONF_VERSION=unknown
|
||||
ok=maybe
|
||||
if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then
|
||||
ok=no
|
||||
else
|
||||
if test "$cross_compiling" = "yes"; then
|
||||
AC_MSG_WARN([GPGCONF version can not be checked when cross compiling])
|
||||
ok=no
|
||||
else
|
||||
if test ! -x "$GPGCONF"; then
|
||||
AC_MSG_WARN([GPGCONF not executable, version check disabled])
|
||||
ok=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$ok" = "maybe"; then
|
||||
AC_MSG_CHECKING(for GPGCONF >= $NEED_GPGCONF_VERSION)
|
||||
req_major=`echo $NEED_GPGCONF_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
|
||||
req_minor=`echo $NEED_GPGCONF_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
|
||||
req_micro=`echo $NEED_GPGCONF_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
|
||||
GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
|
||||
major=`echo $GPGCONF_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
|
||||
minor=`echo $GPGCONF_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
|
||||
micro=`echo $GPGCONF_VERSION | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
|
||||
|
||||
if test "$major" -gt "$req_major"; then
|
||||
ok=yes
|
||||
else
|
||||
if test "$major" -eq "$req_major"; then
|
||||
if test "$minor" -gt "$req_minor"; then
|
||||
ok=yes
|
||||
else
|
||||
if test "$minor" -eq "$req_minor"; then
|
||||
if test "$micro" -ge "$req_micro"; then
|
||||
ok=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$ok" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([GPGCONF must be at least version $NEED_GPGCONF_VERSION])
|
||||
fi
|
||||
fi
|
||||
run_gpgconf_test="$ok"
|
||||
AC_ARG_ENABLE(gpgconf-test,
|
||||
AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF run test]),
|
||||
run_gpgconf_test=$enableval)
|
||||
AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
|
||||
|
||||
# Only build if supported.
|
||||
AM_CONDITIONAL(BUILD_GPGCONF, test "$GPGCONF" != "no")
|
||||
if test "$GPGCONF" != "no"; then
|
||||
AC_DEFINE(HAVE_GPGCONF, 1,
|
||||
[Defined if we are building with gpgconf support.])
|
||||
fi
|
||||
|
||||
|
||||
# FIXME: Only build if supported.
|
||||
AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
|
||||
if test "$GPGSM" != "no"; then
|
||||
AC_DEFINE(HAVE_ASSUAN_H, 1,
|
||||
[Defined if we are building with assuan support.])
|
||||
fi
|
||||
|
||||
# Check for funopen
|
||||
AC_CHECK_FUNCS(funopen)
|
||||
if test $ac_cv_func_funopen != yes; then
|
||||
# No funopen but we can implement that in terms of fopencookie.
|
||||
AC_CHECK_FUNCS(fopencookie)
|
||||
if test $ac_cv_func_fopencookie = yes; then
|
||||
AC_REPLACE_FUNCS(funopen)
|
||||
else
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** No implementation of fopencookie or funopen available
|
||||
***])
|
||||
fi
|
||||
fi
|
||||
|
||||
# More assuan replacement functions.
|
||||
AC_REPLACE_FUNCS(isascii)
|
||||
AC_REPLACE_FUNCS(putc_unlocked)
|
||||
AC_REPLACE_FUNCS(memrchr)
|
||||
AC_REPLACE_FUNCS(stpcpy)
|
||||
# Check for unistd.h for setenv replacement function.
|
||||
AC_CHECK_HEADERS(unistd.h)
|
||||
AC_REPLACE_FUNCS(setenv)
|
||||
|
||||
# More assuan checks.
|
||||
AC_CHECK_HEADERS([sys/uio.h])
|
||||
|
||||
# Assuan check for descriptor passing.
|
||||
AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
|
||||
[supports_descriptor_passing=yes],
|
||||
[supports_descriptor_passing=no
|
||||
AC_MSG_WARN([
|
||||
***
|
||||
*** Data structure for sending ancillary data missing.
|
||||
*** Descriptor passing won't work.
|
||||
***])],[
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#if HAVE_SYS_UIO_H
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(fd-passing,
|
||||
AC_HELP_STRING([--enable-fd-passing], [use FD passing if supported]),
|
||||
use_descriptor_passing=$enableval)
|
||||
|
||||
if test "$supports_descriptor_passing" != "yes"; then
|
||||
use_descriptor_passing=no
|
||||
fi
|
||||
|
||||
if test "$use_descriptor_passing" = "yes"; then
|
||||
AC_DEFINE(USE_DESCRIPTOR_PASSING,1,
|
||||
[Defined if descriptor passing is enabled and supported])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
|
||||
|
||||
# Assuan check for the getsockopt SO_PEERCRED
|
||||
AC_MSG_CHECKING(for SO_PEERCRED)
|
||||
AC_CACHE_VAL(assuan_cv_sys_so_peercred,
|
||||
[AC_TRY_COMPILE([#include <sys/socket.h>],
|
||||
[struct ucred cr;
|
||||
int cl = sizeof cr;
|
||||
getsockopt (1, SOL_SOCKET, SO_PEERCRED, &cr, &cl);],
|
||||
assuan_cv_sys_so_peercred=yes,
|
||||
assuan_cv_sys_so_peercred=no)
|
||||
])
|
||||
AC_MSG_RESULT($assuan_cv_sys_so_peercred)
|
||||
if test $assuan_cv_sys_so_peercred = yes; then
|
||||
AC_DEFINE(HAVE_SO_PEERCRED, 1,
|
||||
[Defined if SO_PEERCRED is supported (Linux specific)])
|
||||
fi
|
||||
|
||||
if test "$have_w32_system" = yes; then
|
||||
NETLIBS="-lws2_32 $NETLIBS"
|
||||
fi
|
||||
|
||||
# End of assuan checks.
|
||||
|
||||
AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
|
||||
|
||||
# Generate values for the DLL version info
|
||||
if test "$have_w32_system" = yes; then
|
||||
BUILD_TIMESTAMP=`date --iso-8601=minutes`
|
||||
changequote(,)dnl
|
||||
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
|
||||
changequote([,])dnl
|
||||
BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
|
||||
fi
|
||||
AC_SUBST(BUILD_REVISION)
|
||||
AC_SUBST(BUILD_TIMESTAMP)
|
||||
AC_SUBST(BUILD_FILEVERSION)
|
||||
|
||||
# Add a few constants to help porting to W32
|
||||
AH_VERBATIM([SEPCONSTANTS],
|
||||
[
|
||||
/* Separators as used in $PATH. */
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
#define PATHSEP_C ';'
|
||||
#else
|
||||
#define PATHSEP_C ':'
|
||||
#endif
|
||||
])
|
||||
|
||||
AH_BOTTOM([
|
||||
/* Definition of GCC specific attributes. */
|
||||
#if __GNUC__ > 2
|
||||
# define GPGME_GCC_A_PURE __attribute__ ((__pure__))
|
||||
#else
|
||||
# define GPGME_GCC_A_PURE
|
||||
#endif
|
||||
])
|
||||
|
||||
|
||||
# Substitution used for gpgme-config
|
||||
GPGME_CONFIG_LIBS="-lgpgme"
|
||||
GPGME_CONFIG_CFLAGS=""
|
||||
AC_SUBST(GPGME_CONFIG_API_VERSION)
|
||||
AC_SUBST(GPGME_CONFIG_LIBS)
|
||||
AC_SUBST(GPGME_CONFIG_CFLAGS)
|
||||
|
||||
# Frob'da Variables
|
||||
LTLIBOBJS=`echo "$LIB@&t@OBJS" |
|
||||
sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
|
||||
AC_SUBST(LTLIBOBJS)
|
||||
|
||||
#
|
||||
# Create config files
|
||||
|
||||
AC_CONFIG_FILES(Makefile assuan/Makefile src/Makefile
|
||||
tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile
|
||||
doc/Makefile complus/Makefile
|
||||
src/versioninfo.rc
|
||||
src/gpgme.h)
|
||||
AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
|
||||
AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
|
||||
AC_OUTPUT
|
||||
|
||||
echo "
|
||||
GPGME v${VERSION} has been configured as follows:
|
||||
|
||||
GnuPG path: $GPG
|
||||
GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
|
||||
|
||||
GpgSM path: $GPGSM
|
||||
GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
|
||||
|
||||
GpgConf path: $GPGCONF
|
||||
GpgConf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION
|
||||
|
||||
GPGME Pthread: $have_pthread
|
||||
GPGME Pth: $have_pth
|
||||
"
|
589
tags/gpgme-1.1.8/depcomp
Executable file
589
tags/gpgme-1.1.8/depcomp
Executable file
@ -0,0 +1,589 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2007-03-29.01
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add `dependent.h:' lines.
|
||||
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
840
tags/gpgme-1.1.8/doc/ChangeLog
Normal file
840
tags/gpgme-1.1.8/doc/ChangeLog
Normal file
@ -0,0 +1,840 @@
|
||||
2008-11-28 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (Listing Keys): Change description of the return
|
||||
value to match the code. Spotted by Colin Leroy.
|
||||
|
||||
2008-10-15 Werner Koch <wk@g10code.com>
|
||||
|
||||
* uiserver.texi (Miscellaneous UI Server Commands): Add option
|
||||
--protocol to the SENDER command.
|
||||
|
||||
2008-07-17 Werner Koch <wk@g10code.com>
|
||||
|
||||
* module-overview.sk: New.
|
||||
|
||||
2008-07-04 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (Algorithms): Add a hint on symmetric only encryption.
|
||||
|
||||
2008-06-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Cancellation): Document gpgme_cancel_async.
|
||||
|
||||
2008-06-25 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (Listing Keys): Updated example to the current API.
|
||||
Noted by Nico Schottelius.
|
||||
|
||||
2008-06-05 Werner Koch <wk@g10code.com>
|
||||
|
||||
* uiserver.texi (Miscellaneous UI Server Commands): Describe
|
||||
START_CONFDIALOG.
|
||||
|
||||
2008-06-04 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi: Use @copying command. Change license to
|
||||
GPLv3. Include protocol specis from GpgOL and GPGEx. Minor
|
||||
cleanups.
|
||||
|
||||
2008-03-11 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (File Based Data Buffers): Document the need for
|
||||
blocking operations.
|
||||
(Callback Based Data Buffers): Likewise.
|
||||
|
||||
2008-03-05 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Library Version Check): Rename snippet function to
|
||||
init_gpgme.
|
||||
(I/O Callback Example): Call it here.
|
||||
|
||||
2008-01-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: Document that data encoding affects some output data
|
||||
objects now.
|
||||
|
||||
2007-09-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Protocols and Engines): Document GPGME_PROTOCOL_UNKNOWN.
|
||||
|
||||
2007-09-11 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (I/O Callback Example): Typo fix.
|
||||
|
||||
2007-08-07 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (Verify): Describe chain_model.
|
||||
|
||||
2007-07-12 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (Library Version Check): Add remark that the socket
|
||||
layer will get initialized.
|
||||
|
||||
2007-06-05 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Advanced Key Editing): New section.
|
||||
|
||||
2007-05-21 Werner Koch <wk@g10code.com>
|
||||
|
||||
* Makefile.am (online): New target.
|
||||
|
||||
2007-05-18 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Error Strings): Fix documentation of
|
||||
gpgme_strerror_r.
|
||||
|
||||
2006-11-01 Moritz Schulte <moritz@g10code.com>
|
||||
|
||||
* gpgme.texi (Data Buffer I/O Operations): Fixed entry for
|
||||
gpgme_data_seek: OFFSET is not a pointer; some s/whence/offset/.
|
||||
|
||||
2006-09-25 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Destroying Data Buffers): Clarify that
|
||||
gpgme_data_release_and_get_mem destroys DH unconditionally.
|
||||
|
||||
2005-03-24 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Library Version Check): Make example code compatible
|
||||
to W32 systems.
|
||||
|
||||
2006-06-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Passphrase Callback): Fix inverted condition in
|
||||
description.
|
||||
|
||||
2005-12-20 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (Verify): Document pka_trust.
|
||||
|
||||
2005-12-06 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgme.texi (Key Management): Updated to match the fixes for
|
||||
subkey fingerprints and theg secret flag.
|
||||
|
||||
2005-10-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Destroying Data Buffers): Document gpgme_free.
|
||||
|
||||
2005-10-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Management): Add the new member notations of
|
||||
gpgme_sig_key_t.
|
||||
(Key Listing Mode): Document GPGME_KEYLIST_MODE_SIG_NOTATIONS.
|
||||
|
||||
2005-10-01 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: Enclose all return parameters of deftypefuns in
|
||||
curly brackets.
|
||||
|
||||
* gpgme.texi (Signature Notation Data): New section.
|
||||
(Verify): Added more about the notation data structure.
|
||||
|
||||
2005-09-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Data Buffer I/O Operations, Data Buffer Meta-Data):
|
||||
New subsections.
|
||||
|
||||
* gpgme.texi: Replace plaintext_filename with file_name.
|
||||
|
||||
* gpgme.texi (Key Management): Document is_qualified.
|
||||
|
||||
2005-07-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Decrypt): Add plaintext_filename to
|
||||
gpgme_decrypt_result_t.
|
||||
(Verify): Likewise for gpgme_verify_result_t.
|
||||
|
||||
2005-06-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Add information about new fields in
|
||||
gpgme_signature_t.
|
||||
|
||||
* gpgme.texi (Decrypt): Add gpgme_recipient_t.
|
||||
|
||||
2005-05-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Listing Mode): Fix return type of
|
||||
gpgme_set_keylist_mode.
|
||||
Reported by "Sergio" <ml_sergico@virgilio.it>.
|
||||
|
||||
2005-04-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Included Certificates): Document
|
||||
GPGME_INCLUDE_CERTS_DEFAULT.
|
||||
|
||||
2005-01-12 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Engine Configuration): New section.
|
||||
(Crypto Engine): New subsection.
|
||||
|
||||
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* lesser.texi (Library Copying): Change from @appendixsec to
|
||||
@appendix.
|
||||
* gpgme.texi (Features): Change reference to GPL to one to LGPL.
|
||||
|
||||
* Makefile.am: Change license to LGPL.
|
||||
(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.
|
||||
|
||||
* gpgme.texi: Change license to LGPL (also for documentation of
|
||||
GPGME's license).
|
||||
* lesser.texi: New file.
|
||||
* gpl.texi: File removed.
|
||||
|
||||
* gpgme.texi (Creating Contexts): Fix cut&paste error. Reported
|
||||
by Noel Torres <envite@rolamasao.org>.
|
||||
|
||||
2004-09-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Makefile.am (gpgme_TEXINFOS): Remove fdl.texi.
|
||||
* gpgme.texi: Do not include fdl.texi. Change license to GPL.
|
||||
* fdl.texi: File removed.
|
||||
|
||||
2004-09-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Management): Change type of keylist_mode in
|
||||
gpgme_key_t to gpgme_keylist_mode_t.
|
||||
|
||||
2004-09-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Passphrase Callback): Fix last change.
|
||||
|
||||
2004-09-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Passphrase Callback): Document
|
||||
GPG_ERR_NOT_IMPLEMENTED.
|
||||
|
||||
* gpgme.texi: Update copyright year for tex version.
|
||||
|
||||
2004-07-29 Moritz Schulte <moritz@g10code.com>
|
||||
|
||||
* gpgme.texi (Verify): Fix gpgme_get_key example (ancient
|
||||
force_update argument was still there).
|
||||
|
||||
2004-06-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Listing Keys): Elaborate on the length restrictions
|
||||
on search patterns.
|
||||
|
||||
* gpgme.texi (Decrypt and Verify): Document the NO_DATA error
|
||||
code.
|
||||
(Verify): Document the relationship between gpgme_op_verify_result
|
||||
and the decrypt and verify operations.
|
||||
|
||||
2004-05-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.text (Verify): Document GPG_ERR_CERT_REVOKED status.
|
||||
|
||||
* gpgme.texi (Decrypt): Add note about new field wrong_key_usage
|
||||
of gpgme_decrypt_result_t.
|
||||
|
||||
* gpgme.texi (Key Management): Add note about new field
|
||||
keylist_mode of gpgme_key_t.
|
||||
|
||||
2004-04-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Correct type of member wrong_key_usage.
|
||||
|
||||
2004-03-29 Moritz Schulte <moritz@duesseldorf.ccc.de>
|
||||
|
||||
* gpgme.texi (Verify): Fix type of gpgme_op_verify_result.
|
||||
* gpgme.texi (Key Listing Mode): Typo fix.
|
||||
|
||||
2004-03-23 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Library Version Check): Fix the instruction when to
|
||||
set the locale.
|
||||
|
||||
2004-03-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (I/O Callback Example Qt): New section by Marc Mutz.
|
||||
|
||||
2004-02-24 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (cancellation): New section.
|
||||
|
||||
2004-02-17 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Key Listing Mode): Doc KEYLIST_MODE_VALIDATE.
|
||||
|
||||
2004-02-06 Moritz Schulte <mo@g10code.com>
|
||||
|
||||
* gpgme.texi: A couple of small fixes regarding the Largfile
|
||||
Support section.
|
||||
|
||||
2004-02-01 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Largefile Support): New section.
|
||||
|
||||
2004-01-13 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Management): Fix exportable field.
|
||||
|
||||
2003-12-25 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Management): Rename member class in
|
||||
gpgme_key_sig_t to sig_class.
|
||||
(Creating a Signature): Likewise for gpgme_signature_t.
|
||||
|
||||
2003-12-23 Moritz Schulte <mo@g10code.com>
|
||||
|
||||
* gpgme.texi (Listing Keys): Minor clarification for
|
||||
gpgme_get_key.
|
||||
|
||||
2003-10-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Signal Handling): New section.
|
||||
|
||||
2003-09-14 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Multi Threading): Correct documentation on memory
|
||||
synchronization requirement.
|
||||
|
||||
* gpgme.texi (Locale): New section.
|
||||
(Multi Threading): Set locale in example.
|
||||
|
||||
2003-09-13 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Error Strings): Add gpgme_strerror_r.
|
||||
|
||||
2003-09-13 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Multi Threading): Update documentation.
|
||||
|
||||
2003-09-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Header): We don't use the assuan namespace anymore.
|
||||
Document new thread options.
|
||||
|
||||
2003-08-14 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Creating a Signature): Change type of member class
|
||||
to unsigned int.
|
||||
|
||||
2003-08-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Get error code from SIG->status in the code
|
||||
for gpgme_get_sig_status.
|
||||
|
||||
2003-07-31 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Management): Add can_authenticate flag.
|
||||
|
||||
* gpgme.texi (Listing Keys): Document GPG_ERR_AMBIGUOUS_NAME for
|
||||
gpgme_get_key.
|
||||
|
||||
2003-07-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove variable.
|
||||
|
||||
* gpgme.texi (Encrypting a Plaintext): Bad passphrase is only
|
||||
possible with symmetric encryption, change the wording to reflect
|
||||
that.
|
||||
|
||||
* gpgme.texi (Creating a Signature): Document
|
||||
GPG_ERR_UNUSABLE_SECKEY.
|
||||
|
||||
* gpgme.texi (Encrypting a Plaintext): Mention encrypt and sign
|
||||
operations in result function.
|
||||
(Creating a Signature): Likewise.
|
||||
|
||||
2003-07-23 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Listing Mode): Remove word duplication.
|
||||
(Listing Keys): Remove mentioning of force argument.
|
||||
(Verify): Don't mention r_stat. Fix some typos.
|
||||
(Decrypt and Verify): Correct info how to get the result. Don't
|
||||
mention r_stat.
|
||||
(Manipulating Data Buffers): Fix documentation of return value.
|
||||
(Listing Keys): Update examples.
|
||||
(Decrypt): Result might also be available when operation failed.
|
||||
(Verify): Result might also be available when operation failed.
|
||||
All spotted by Stéphane Corthésy.
|
||||
|
||||
2003-07-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Error Sources): Fix cut and paste error.
|
||||
|
||||
2003-07-09 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Management): Clarify difference between can_sign
|
||||
and can_certify.
|
||||
(Information About Keys): Likewise for GPGME_ATTR_CAN_SIGN and
|
||||
GPGME_ATTR_CAN_CERTIFY.
|
||||
|
||||
2003-07-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Progress Meter Callback): Change return type of
|
||||
gpgme_progress_cb_t to void.
|
||||
|
||||
2003-06-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: Add 2003 to copyright notice.
|
||||
|
||||
* gpgme.texi (Header): Fix name space documentation on
|
||||
libgpg-error.
|
||||
|
||||
2003-06-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Multi Threading): Remove reference to
|
||||
gpgme_recipients_t.
|
||||
|
||||
2003-06-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Crypto Operations): Rename gpgme_invalid_user_id_t
|
||||
to gpgme_invalid_key_t.
|
||||
|
||||
2003-06-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: Change error codes to GPG_ERR_* variants.
|
||||
(Error Handling): Rewritten.
|
||||
|
||||
2003-05-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Exporting Keys): Change and document prototypes.
|
||||
Add new gpgme_op_export_ext and gpgme_op_export_ext_start
|
||||
variants.
|
||||
(Selecting Recipients): Section removed.
|
||||
(Encrypting a Plaintext): Change prototypes and document the
|
||||
changes.
|
||||
|
||||
2003-05-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Exporting Keys): Change argument type from
|
||||
gpgme_recipient_t to gpgme_user_id_t.
|
||||
(Encrypting a Plaintext): Likewise.
|
||||
(Selecting Recipients): Rewritten.
|
||||
|
||||
2003-05-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Protocol Selection): Do not use @acronym in @node
|
||||
because that breaks texi2dvi.
|
||||
|
||||
* gpgme.texi (Passphrase Callback): Document new prototype.
|
||||
|
||||
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Header): Remove Gpgme as namespace prefix. Add
|
||||
_GPGME to namespace prefix.
|
||||
* gpgme.texi (Multi Threading): Add note about link order.
|
||||
|
||||
2003-05-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Listing Keys): Document what happens if key is not
|
||||
found.
|
||||
|
||||
* gpgme.texi (Importing Keys): Fix cut and paste error.
|
||||
|
||||
2003-04-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Encrypting a Plaintext): Remove reference to
|
||||
gpgme_get_op_info.
|
||||
(Detailed Results): Subsection removed.
|
||||
|
||||
* gpgme.texi (Key Listing Mode): Add GPGME_KEYLIST_MODE_SIGS.
|
||||
(Manipulating Keys): Add obsoleteness note.
|
||||
(Key Signatures): Likewise.
|
||||
(Information About Keys): Likewise.
|
||||
(Key Management): Add new data types GpgmeSubkey, GpgmeKeySig,
|
||||
GpgmeUserID, and all the information about GpgmeKey.
|
||||
|
||||
2003-04-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Listing Keys): Remove force_update argument from
|
||||
gpgme_get_key.
|
||||
|
||||
* gpgme.texi (Trust Item Management): Add data members of
|
||||
GpgmeTrustItem type.
|
||||
(Information About Trust Items): Add note about obsoleteness.
|
||||
(Manipulating Trust Items): Add gpgme_trust_item_ref and
|
||||
gpgme_trust_item_unref.
|
||||
|
||||
2003-04-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Rewritten to take into account new and
|
||||
deprecated functions and data types.
|
||||
|
||||
* gpgme.texi (Decrypt): Descript gpgme_op_decrypt_result and
|
||||
GpgmeDecryptResult.
|
||||
|
||||
2003-04-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Encrypting a Plaintext): Add info about
|
||||
GpgmeEncryptResult and gpgme_op_encrypt_result.
|
||||
|
||||
* gpgme.texi (Creating a Signature): Add info about
|
||||
GpgmeNewSignature, GpgmeSignResult and gpgme_op_sign_result.
|
||||
(Crypto Operations): Add GpgmeInvalidUserID.
|
||||
(Algorithms): New chapter.
|
||||
|
||||
* gpgme.texi (Deleting Keys): Document
|
||||
GPGME_Ambiguous_Specification.
|
||||
(Error Values): Remove GPGME_Invalid_Type and GPGME_Invalid_Mode.
|
||||
Add GPGME_Unknown_Reason, GPGME_Not_Found,
|
||||
GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
|
||||
GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
|
||||
GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
|
||||
GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
|
||||
GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
|
||||
GPGME_Bad_Signature, GPGME_No_Public_Key.
|
||||
|
||||
2003-04-25 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Importing Keys): Change GPGME_IMPORT_PRIVATE to
|
||||
GPGME_IMPORT_SECRET.
|
||||
|
||||
* gpgme.texi (Importing Keys): Remove note about gpgme_get_op_info.
|
||||
(Detailed Results): Remove note about import.
|
||||
|
||||
* gpgme.texi (Importing Keys): Add documentation for
|
||||
GpgmeImportStatus, GpgmeImportResult and gpgme_op_import_result.
|
||||
|
||||
* gpgme.texi (Generating Keys): Fix documentation of public and
|
||||
secret arguments.
|
||||
|
||||
2003-04-24 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Generating Keys): Document changed gpgme_op_genkey
|
||||
and new gpgme_op_genkey_result function. Document
|
||||
GpgmeGenKeyResult data type.
|
||||
|
||||
* gpgme.texi (Error Values): Rename GPGME_No_Passphrase to
|
||||
GPGME_Bad_Passphrase.
|
||||
* gpgme.texi (Decrypt): Likewise.
|
||||
(Decrypt and Verify): Likewise.
|
||||
(Creating a Signature): Likewise.
|
||||
(Encrypting a Plaintext): Likewise.
|
||||
|
||||
* gpgme.texi (Error Values): Rename GPGME_No_Recipients to
|
||||
GPGME_No_UserID and GPGME_Invalid_Recipient to
|
||||
GPGME_Invalid_UserID.
|
||||
(Encrypting a Plaintext): Likewise.
|
||||
|
||||
* gpgme.texi (Error Values): Remove GPGME_Busy and GPGME_No_Request.
|
||||
(Listing Keys): Likewise.
|
||||
(Listing Trust Items): Likewise.
|
||||
|
||||
2003-02-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Cancelling an Operation): Removed.
|
||||
(Passphrase Callback): Document new type for GpgmePassphraseCb.
|
||||
|
||||
2003-01-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Engine Information): Rename member part to
|
||||
file_name.
|
||||
|
||||
* gpgme.texi (Protocols and Engines): Document
|
||||
gpgme_get_protocol_name.
|
||||
|
||||
* gpgme.texi (Engine Information): Rewritten.
|
||||
|
||||
2003-01-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (I/O Callback Interface): Document new even
|
||||
GPGME_EVENT_START.
|
||||
(Waiting For Completion): Document new possible return values.
|
||||
(I/O Callback Interface): Document return type of GpgmeIOCb.
|
||||
|
||||
2003-01-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Hooking Up Into Idle Time): Section removed.
|
||||
|
||||
2002-12-24 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Drop R_STAT argument in gpgme_op_verify.
|
||||
* gpgme.texi (Decrypt and Verify): Likewise for
|
||||
gpgme_op_decrypt_verify.
|
||||
|
||||
2002-12-23 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Information About Keys): Document that
|
||||
GPGME_ATTR_IS_SECRET is not representable as a string anymore.
|
||||
|
||||
2002-12-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Signatures): New section.
|
||||
(Listing Keys): Add gpgme_get_key.
|
||||
|
||||
2002-12-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Memory Based Data Buffers): New subsection.
|
||||
(File Based Data Buffers): Likewise.
|
||||
(Callback Based Data Buffers): Likewise.
|
||||
(Manipulating Data Buffers): Update interfaces. Add
|
||||
gpgme_data_seek.
|
||||
* gpgme.texi (Engine Version Check): Remove gpgme_check_engine.
|
||||
|
||||
2002-11-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Document the new interface.
|
||||
|
||||
2002-11-19 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Generating Keys): Document new argument to
|
||||
gpgme_op_genkey.
|
||||
|
||||
2002-11-05 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Fix prototype of gpgme_get_sig_key.
|
||||
Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
|
||||
|
||||
2002-08-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Selecting Signers): Fix reference count.
|
||||
|
||||
2002-08-21 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Header): Document name space.
|
||||
|
||||
2002-08-20 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Importing Keys): Document gpgme_op_import_ext.
|
||||
|
||||
* gpgme.texi (Importing Keys): Undocument EOF.
|
||||
|
||||
2002-08-14 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Information About Keys): Changed GPGME_ATTR_TYPE.
|
||||
|
||||
2002-07-25 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Deleting Keys): Say that secret keys might not be
|
||||
deleted.
|
||||
|
||||
2002-07-25 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Information About Keys): Document (badly) the new
|
||||
key attributes.
|
||||
|
||||
* gpgme.texi (Manipulating Data Buffers): Mention that backend
|
||||
tries to detect encoding automatically.
|
||||
|
||||
2002-07-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Run Control): Update this section.
|
||||
(Waiting For Completion): Likewise for this subsection.
|
||||
(Cancelling an Operation): Likewise for this subsection.
|
||||
(Using External Event Loops): New subsection with several
|
||||
subsubsections.
|
||||
|
||||
2002-06-28 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Multi Threading): Remove item about the need to
|
||||
synchronize anything against gpgme_wait (except gpgme_wait
|
||||
itself).
|
||||
|
||||
2002-06-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Information About Keys): Fix documentation for IDX.
|
||||
(Information About Trust Items): Likewise.
|
||||
|
||||
2002-06-26 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Importing Keys): Document the return value -1 of
|
||||
gpgme_op_import.
|
||||
|
||||
2002-06-20 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Verify): Explain the new whatidx variable.
|
||||
|
||||
2002-06-10 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Verify): Document attribute GPGME_ATTR_ERRTOK.
|
||||
|
||||
2002-06-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Multi Threading): Document new autodetection.
|
||||
|
||||
2002-06-04 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Makefile.am (DISTCLEANFILES): New variable.
|
||||
|
||||
2002-05-26 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: Some typographical correctons throughout.
|
||||
|
||||
2002-05-09 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Using Automake): New section.
|
||||
|
||||
2002-05-09 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Multi Threading): Escape { and }.
|
||||
|
||||
2002-05-09 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Overview): Replace note about thread-safeness.
|
||||
(Multi Threading): New section.
|
||||
|
||||
2002-05-03 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Manipulating Data Buffers): Changed some data types
|
||||
to void*.
|
||||
(Protocol Selection): Added gpgme_get_protocol.
|
||||
(Verify): Updated to include the new attribute fucntions and
|
||||
status codes.
|
||||
|
||||
2002-04-27 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Manipulating Data Buffers): New type GpgmeDataEncoding.
|
||||
|
||||
2002-04-23 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Passphrase Callback): Document that either return
|
||||
argument can be NULL.
|
||||
(Progress Meter Callback): Likewise.
|
||||
|
||||
2002-04-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Passphrase Callback): Fix small typo. Document the
|
||||
new function gpgme_get_passphrase_cb.
|
||||
(Progress Meter Callback): Document the new function
|
||||
gpgme_get_progress_cb.
|
||||
|
||||
2002-04-16 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Creating a Signature): Fix function name. Reported
|
||||
by Wichert Ackerman <wichert@debian.org>.
|
||||
|
||||
2002-03-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (direntry): End index entry with a full stop.
|
||||
Patch submitted by Jose Carlos Garcia Sogo <jsogo@debian.org>.
|
||||
|
||||
2002-03-17 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Detailed Results): Fix syntax error in last change.
|
||||
|
||||
2002-03-08 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgme.texi (Detailed Results): Import does also return info.
|
||||
|
||||
2002-03-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Encrypting a Plaintext): Document symmetric
|
||||
encryption.
|
||||
|
||||
2002-03-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Error Strings): Add example.
|
||||
* gpgme.texi (Listing Keys): Likewise.
|
||||
|
||||
2002-03-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Information About Keys): Document GPGME_ATTR_EXPIRE.
|
||||
|
||||
2002-03-03 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Verify): Document verification of normal and
|
||||
cleartext signatures.
|
||||
|
||||
2002-02-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Listing Keys): Document gpgme_op_keylist_ext_start.
|
||||
|
||||
2002-02-27 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Encrypting a Plaintext): Document
|
||||
GPGME_Invalid_Recipients.
|
||||
(Error Values): Likewise.
|
||||
|
||||
2002-02-26 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Encrypting a Plaintext): Document
|
||||
gpgme_op_encrypt_sign and gpgme_op_encrypt_sign_start.
|
||||
|
||||
2002-02-25 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Creating a Signature): Add a note about
|
||||
certificates to include.
|
||||
(Included Certificates): New section.
|
||||
|
||||
2002-02-09 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Detailed Results): Remove literal tags.
|
||||
(Generating Keys): Update documentation.
|
||||
|
||||
* gpgme.texi (Generating Keys): Fix syntax error.
|
||||
|
||||
2002-02-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Waiting For Completion): Adjust doc to changes in
|
||||
the code.
|
||||
|
||||
2002-02-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Key Listing Mode): Update documentation.
|
||||
|
||||
2002-01-31 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Generating Keys): Document error at creation
|
||||
failure.
|
||||
|
||||
2002-01-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Deleting Keys): Document new error values.
|
||||
|
||||
2002-01-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Importing Keys): Add reference to gpgme_get_op_info.
|
||||
|
||||
2002-01-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: Some spell checking.
|
||||
|
||||
2002-01-30 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: Add all the gpgme_op_*_start functions.
|
||||
Fill the concept index with many, many entries.
|
||||
|
||||
2002-01-29 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Run Control): New section.
|
||||
(Verify): Docuent gpgme_get_notation.
|
||||
(More Information): New section describing gpgme_get_op_info.
|
||||
|
||||
2002-01-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Passphrase callback): Change GpgmePassphraseCb's
|
||||
R_HD type from void* to void**.
|
||||
|
||||
2002-01-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Creating data buffers): Change
|
||||
gpgme_data_new_from_filepart's LENGTH type from off_t to size_t.
|
||||
|
||||
2002-01-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi (Generating keys): New subsection.
|
||||
(Exporting keys): Likewise.
|
||||
(Importing keys): Likewise.
|
||||
(Deleting keys): Likewise.
|
||||
|
||||
2002-01-16 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpgme.texi: g10Code -> g10 Code
|
||||
|
||||
* gpgme.texi (Top): Complete detailmenu.
|
||||
|
||||
* gpgme.texi: Convert embarassing cruft to the real thing.
|
||||
|
||||
2002-01-16 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* ChangeLog: New file.
|
||||
* gpgme.texi: Likewise.
|
||||
* gpl.texi: Likewise.
|
||||
* fdl.texi: Likewise.
|
||||
* Makefile.am (info_TEXINFOS): New variable.
|
||||
(gpgme_TEXINFOS): Likewise.
|
||||
|
||||
Copyright 2002, 2003, 2004 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
36
tags/gpgme-1.1.8/doc/Makefile.am
Normal file
36
tags/gpgme-1.1.8/doc/Makefile.am
Normal file
@ -0,0 +1,36 @@
|
||||
# doc - Automake template
|
||||
# Copyright (C) 2001, 2004 g10 Code GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
#
|
||||
# GPGME 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.1 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# GPGME 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 program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
DISTCLEANFILES = gpgme.tmp
|
||||
|
||||
EXTRA_DIST = module-overview.sk
|
||||
|
||||
info_TEXINFOS = gpgme.texi
|
||||
gpgme_TEXINFOS = uiserver.texi lesser.texi gpl.texi
|
||||
|
||||
online: gpgme.html gpgme.pdf
|
||||
set -e; \
|
||||
echo "Uploading current manuals to www.gnupg.org ..."; \
|
||||
user=werner ; \
|
||||
(cd gpgme.html && rsync -vr --exclude='.svn' . \
|
||||
$${user}@cvs.gnupg.org:webspace/manuals/gpgme/ ); \
|
||||
rsync -v gpgme.pdf $${user}@cvs.gnupg.org:webspace/manuals/
|
||||
|
153
tags/gpgme-1.1.8/doc/examples/show-group-options.c
Normal file
153
tags/gpgme-1.1.8/doc/examples/show-group-options.c
Normal file
@ -0,0 +1,153 @@
|
||||
/* show-group-options.c - Example code to retriev the group option.
|
||||
Copyright (C) 2008 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include <gpgme.h>
|
||||
|
||||
|
||||
#define fail_if_err(err) \
|
||||
do \
|
||||
{ \
|
||||
if (err) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
|
||||
__FILE__, __LINE__, gpgme_strerror (err)); \
|
||||
exit (1); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
print_one_alias (const char *string)
|
||||
{
|
||||
const char *value, *s;
|
||||
size_t namelen;
|
||||
int first = 1;
|
||||
int any = 0;
|
||||
|
||||
while (isascii (*string) && isspace (*string))
|
||||
string++;
|
||||
|
||||
value = strchr (string, '=');
|
||||
if (value)
|
||||
{
|
||||
for (s=value-1; s > string ; s--)
|
||||
if (!isascii (*s) || !isspace (*s))
|
||||
break;
|
||||
}
|
||||
if (!value || s == value )
|
||||
{
|
||||
printf ("# error: invalid group definition!\n");
|
||||
return;
|
||||
}
|
||||
value++;
|
||||
namelen = (s + 1 - string);
|
||||
printf ("%.*s: ", (int)namelen, string);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
while (isascii (*value) && isspace (*value))
|
||||
value++;
|
||||
if (!*value)
|
||||
break;
|
||||
for (s = value; *s && !(isascii (*s) && isspace (*s)); s++)
|
||||
;
|
||||
printf ("%s%*s%.*s",
|
||||
first? "":",\n",
|
||||
any? (int)namelen+2:0, "",
|
||||
(int)(s-value), value);
|
||||
first = 0;
|
||||
any = 1;
|
||||
value = s;
|
||||
}
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
print_gpgconf_string (const char *cname, const char *name)
|
||||
{
|
||||
gpg_error_t err;
|
||||
gpgme_ctx_t ctx;
|
||||
gpgme_conf_comp_t conf_list, conf;
|
||||
gpgme_conf_opt_t opt;
|
||||
gpgme_conf_arg_t value;
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
err = gpgme_op_conf_load (ctx, &conf_list);
|
||||
fail_if_err (err);
|
||||
|
||||
for (conf = conf_list; conf; conf = conf->next)
|
||||
{
|
||||
if ( !strcmp (conf->name, cname) )
|
||||
{
|
||||
for (opt = conf->options; opt; opt = opt->next)
|
||||
if ( !(opt->flags & GPGME_CONF_GROUP)
|
||||
&& !strcmp (opt->name, name))
|
||||
{
|
||||
for (value = opt->value; value; value = value->next)
|
||||
{
|
||||
if (opt->type == GPGME_CONF_ALIAS_LIST)
|
||||
print_one_alias (value->value.string);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gpgme_conf_release (conf_list);
|
||||
gpgme_release (ctx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char **argv )
|
||||
{
|
||||
gpgme_check_version (NULL);
|
||||
setlocale (LC_ALL, "");
|
||||
gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
|
||||
#endif
|
||||
|
||||
print_gpgconf_string ("gpg", "group");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
compile-command: "cc -o show-group-options show-group-options.c -lgpgme"
|
||||
End:
|
||||
*/
|
5557
tags/gpgme-1.1.8/doc/gpgme.texi
Normal file
5557
tags/gpgme-1.1.8/doc/gpgme.texi
Normal file
File diff suppressed because it is too large
Load Diff
724
tags/gpgme-1.1.8/doc/gpl.texi
Normal file
724
tags/gpgme-1.1.8/doc/gpl.texi
Normal file
@ -0,0 +1,724 @@
|
||||
@node Copying
|
||||
@unnumbered GNU General Public License
|
||||
@center Version 3, 29 June 2007
|
||||
|
||||
@c This file is intended to be included in another file.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
@end display
|
||||
|
||||
@section 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.
|
||||
|
||||
@iftex
|
||||
@section TERMS AND CONDITIONS
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center TERMS AND CONDITIONS
|
||||
@end ifinfo
|
||||
|
||||
@enumerate 0
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
The work must carry prominent notices stating that you modified it,
|
||||
and giving a relevant date.
|
||||
|
||||
@item
|
||||
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''.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
@end enumerate
|
||||
|
||||
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.
|
||||
|
||||
@item 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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@end enumerate
|
||||
|
||||
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.
|
||||
|
||||
@item 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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
Disclaiming warranty or limiting liability differently from the terms
|
||||
of sections 15 and 16 of this License; or
|
||||
|
||||
@item
|
||||
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
|
||||
|
||||
@item
|
||||
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
|
||||
|
||||
@item
|
||||
Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
@item
|
||||
Declining to grant rights under trademark law for use of some trade
|
||||
names, trademarks, or service marks; or
|
||||
|
||||
@item
|
||||
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.
|
||||
@end enumerate
|
||||
|
||||
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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@item 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.
|
||||
|
||||
@iftex
|
||||
@heading END OF TERMS AND CONDITIONS
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center END OF TERMS AND CONDITIONS
|
||||
@end ifinfo
|
||||
@section 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.
|
||||
@smallexample
|
||||
@var{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) @var{year} @var{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 @url{http://www.gnu.org/licenses/}.
|
||||
@end smallexample
|
||||
|
||||
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:
|
||||
|
||||
@smallexample
|
||||
@var{program} Copyright (C) @var{year} @var{name of author}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
|
||||
This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details.
|
||||
@end smallexample
|
||||
|
||||
The hypothetical commands @samp{show w} and @samp{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
|
||||
@url{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 @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
|
||||
|
||||
@end enumerate
|
565
tags/gpgme-1.1.8/doc/lesser.texi
Normal file
565
tags/gpgme-1.1.8/doc/lesser.texi
Normal file
@ -0,0 +1,565 @@
|
||||
@node Library Copying
|
||||
@unnumbered GNU Lesser General Public License
|
||||
|
||||
@cindex LGPL, Lesser General Public License
|
||||
@center Version 2.1, February 1999
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place -- Suite 330, Boston, MA 02111-1307, 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.]
|
||||
@end display
|
||||
|
||||
@section Preamble
|
||||
|
||||
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.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software---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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
We call this license the @dfn{Lesser} General Public License because it
|
||||
does @emph{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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@iftex
|
||||
@section TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center GNU LESSER GENERAL PUBLIC LICENSE
|
||||
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end ifinfo
|
||||
|
||||
@enumerate 0
|
||||
@item
|
||||
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 ``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.
|
||||
|
||||
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''.)
|
||||
|
||||
``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.
|
||||
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
The modified work must itself be a software library.
|
||||
|
||||
@item
|
||||
You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
@item
|
||||
You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
@item
|
||||
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.)
|
||||
@end enumerate
|
||||
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
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.)
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
@end enumerate
|
||||
|
||||
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.
|
||||
|
||||
@item
|
||||
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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
@end enumerate
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@iftex
|
||||
@heading NO WARRANTY
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center NO WARRANTY
|
||||
@end ifinfo
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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 enumerate
|
||||
|
||||
@iftex
|
||||
@heading END OF TERMS AND CONDITIONS
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center END OF TERMS AND CONDITIONS
|
||||
@end ifinfo
|
||||
|
||||
@page
|
||||
@section 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.
|
||||
|
||||
@smallexample
|
||||
@var{one line to give the library's name and an idea of what it does.}
|
||||
Copyright (C) @var{year} @var{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.1 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
|
||||
USA.
|
||||
@end smallexample
|
||||
|
||||
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:
|
||||
|
||||
@smallexample
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the library
|
||||
`Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
@var{signature of Ty Coon}, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
@end smallexample
|
||||
|
||||
That's all there is to it!
|
205
tags/gpgme-1.1.8/doc/mdate-sh
Executable file
205
tags/gpgme-1.1.8/doc/mdate-sh
Executable file
@ -0,0 +1,205 @@
|
||||
#!/bin/sh
|
||||
# Get modification time of a file or directory and pretty-print it.
|
||||
|
||||
scriptversion=2007-03-30.02
|
||||
|
||||
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software
|
||||
# Foundation, Inc.
|
||||
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
|
||||
#
|
||||
# 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 2, 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No file. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: mdate-sh [--help] [--version] FILE
|
||||
|
||||
Pretty-print the modification time of FILE.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "mdate-sh $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# GNU ls changes its time format in response to the TIME_STYLE
|
||||
# variable. Since we cannot assume `unset' works, revert this
|
||||
# variable to its documented default.
|
||||
if test "${TIME_STYLE+set}" = set; then
|
||||
TIME_STYLE=posix-long-iso
|
||||
export TIME_STYLE
|
||||
fi
|
||||
|
||||
save_arg1=$1
|
||||
|
||||
# Find out how to get the extended ls output of a file or directory.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command='ls -L -l -d'
|
||||
else
|
||||
ls_command='ls -l -d'
|
||||
fi
|
||||
# Avoid user/group names that might have spaces, when possible.
|
||||
if ls -n /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command="$ls_command -n"
|
||||
fi
|
||||
|
||||
# A `ls -l' line looks as follows on OS/2.
|
||||
# drwxrwx--- 0 Aug 11 2001 foo
|
||||
# This differs from Unix, which adds ownership information.
|
||||
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
|
||||
#
|
||||
# To find the date, we split the line on spaces and iterate on words
|
||||
# until we find a month. This cannot work with files whose owner is a
|
||||
# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
|
||||
# will be owned by a user whose name is a month. So we first look at
|
||||
# the extended ls output of the root directory to decide how many
|
||||
# words should be skipped to get the date.
|
||||
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
set x`$ls_command /`
|
||||
|
||||
# Find which argument is the month.
|
||||
month=
|
||||
command=
|
||||
until test $month
|
||||
do
|
||||
shift
|
||||
# Add another shift to the command.
|
||||
command="$command shift;"
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
set dummy x`eval "$ls_command \"\$save_arg1\""`
|
||||
|
||||
# Remove all preceding arguments
|
||||
eval $command
|
||||
|
||||
# Because of the dummy argument above, month is in $2.
|
||||
#
|
||||
# On a POSIX system, we should have
|
||||
#
|
||||
# $# = 5
|
||||
# $1 = file size
|
||||
# $2 = month
|
||||
# $3 = day
|
||||
# $4 = year or time
|
||||
# $5 = filename
|
||||
#
|
||||
# On Darwin 7.7.0 and 7.6.0, we have
|
||||
#
|
||||
# $# = 4
|
||||
# $1 = day
|
||||
# $2 = month
|
||||
# $3 = year or time
|
||||
# $4 = filename
|
||||
|
||||
# Get the month.
|
||||
case $2 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
|
||||
case $3 in
|
||||
???*) day=$1;;
|
||||
*) day=$3; shift;;
|
||||
esac
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six month of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
640
tags/gpgme-1.1.8/doc/module-overview.sk
Normal file
640
tags/gpgme-1.1.8/doc/module-overview.sk
Normal file
@ -0,0 +1,640 @@
|
||||
##Sketch 1 2
|
||||
document()
|
||||
layout('A4',1)
|
||||
fp((0,0,0))
|
||||
ft(1)
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
dstyle('Text')
|
||||
fp((0,1,0.498))
|
||||
ft(1)
|
||||
lp((0,0,0))
|
||||
lw(0.283465)
|
||||
lc(1)
|
||||
lj(0)
|
||||
ld(())
|
||||
la1()
|
||||
la2()
|
||||
dstyle('Application Box')
|
||||
layer('Layer 1',1,1,0,0,(0,0,0))
|
||||
lw(1)
|
||||
r(0,0,0,0,688.145,44.1554)
|
||||
lw(1)
|
||||
r(0,0,0,0,682.363,85.0359)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25197)
|
||||
b()
|
||||
bs(605.383,329.758,0)
|
||||
bs(605.383,230.546,0)
|
||||
lw(1)
|
||||
r(0,0,0,0,807.414,53.6148)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25)
|
||||
b()
|
||||
bs(480.134,240.945,0)
|
||||
bs(480.358,325.277,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(474.803,432.284,0)
|
||||
bs(475.334,360.243,0)
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(354.331,432.284,0)
|
||||
bs(352.806,361.417,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(212.598,432.284,0)
|
||||
bs(212.598,361.417,0)
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5968,0,0,-56.6929,191.608,488.976,0.0603744,0.151107)
|
||||
lw(1)
|
||||
r(0,0,0,0,88.5492,390.805)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25197)
|
||||
b()
|
||||
bs(226.772,524.409,0)
|
||||
bs(226.772,488.976,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25)
|
||||
b()
|
||||
bs(403.937,528.718,0)
|
||||
bs(403.937,488.976,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(240.945,432.284,0)
|
||||
bs(240.574,394.994,0)
|
||||
bs(595.276,396.85,0)
|
||||
bs(595.276,361.417,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(333.071,432.284,0)
|
||||
bs(333.07,425.196,0)
|
||||
bs(333.07,382.677,0)
|
||||
bs(240.945,382.677,0)
|
||||
bs(240.945,361.417,0)
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.347,318.897,354.331,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(10)
|
||||
txt('GPG',(1,0,0,0.905764,344.004,335.686))
|
||||
G_()
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.3464,446.763,354.33,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('GpgConf',(0.552654,0,0,0.500564,481.802,340.184),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.347,191.338,354.331,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('GpgSM',(0.552654,0,0,0.500574,226.376,340.185),1,1)
|
||||
G_()
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25)
|
||||
b()
|
||||
bs(347.244,325.984,0)
|
||||
bs(347.244,325.984,0)
|
||||
bs(347.244,255.118,0)
|
||||
bs(304.724,255.118,0)
|
||||
bs(304.724,226.771,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25)
|
||||
b()
|
||||
bs(233.858,325.984,0)
|
||||
bs(233.858,255.118,0)
|
||||
bs(276.378,255.118,0)
|
||||
bs(276.378,226.771,0)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Palatino-Roman')
|
||||
txt('2008-07-17',(0.608301,0,0,0.608301,708.661,65.8308))
|
||||
lw(1)
|
||||
r(0,0,0,0,750.427,153.265)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(219.685,325.984,0)
|
||||
bs(219.685,198.425,0)
|
||||
bs(219.685,162.992,0)
|
||||
G()
|
||||
fp((1,1,1))
|
||||
lw(0.283465)
|
||||
r(113.386,0,0,-42.5196,35.4333,162.992,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
lw(0.283465)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('LDAP Server',(0.552654,0,0,0.552654,92.1261,148.819),1,1)
|
||||
fp((0,0,0))
|
||||
lw(0.283465)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('(CRLs, Certificates)',(0.552654,0,0,0.552654,92.1261,134.646),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((1,1,1))
|
||||
lw(0.283465)
|
||||
r(113.386,0,0,-42.5196,35.4331,99.2125,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
lw(0.283465)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('HTTP Server',(0.552654,0,0,0.552654,92.1259,85.0394),1,1)
|
||||
fp((0,0,0))
|
||||
lw(0.283465)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('(CRLs)',(0.552654,0,0,0.552654,92.1259,70.8662),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.866,0,0,-31.2962,191.338,158.855,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('DirMngr',(0.552654,0,0,0.552654,224.02,142.978),1,1)
|
||||
G_()
|
||||
lw(2)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(219.15,126.18,0)
|
||||
bs(219.685,77.9528,0)
|
||||
bs(155.906,77.9528,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3)
|
||||
b()
|
||||
bs(233.858,127.559,0)
|
||||
bs(233.858,99.2125,0)
|
||||
bs(276.378,99.2125,0)
|
||||
bs(276.378,85.0393,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3)
|
||||
b()
|
||||
bs(248.031,127.559,0)
|
||||
bs(248.031,113.386,0)
|
||||
bs(375.59,113.386,0)
|
||||
bs(375.59,85.0393,0)
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(99.2124,0,0,-28.3464,333.07,85.0393,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Certificate Cache',(0.552654,0,0,0.552654,382.606,69.8548),1,1)
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.3464,248.031,85.0393,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('CRL Cache',(0.552654,0,0,0.552654,284.147,70.6936),1,1)
|
||||
G_()
|
||||
lw(1)
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(503.149,240.945,0)
|
||||
bs(503.149,283.464,0)
|
||||
bs(588.189,283.465,0)
|
||||
bs(588.189,325.984,0)
|
||||
lw(1)
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(503.149,283.464,0)
|
||||
bs(503.149,283.464,0)
|
||||
bs(361.417,283.464,0)
|
||||
bs(361.417,325.984,0)
|
||||
lw(1)
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(361.417,283.464,0)
|
||||
bs(205.512,283.465,0)
|
||||
bs(205.512,325.984,0)
|
||||
lw(1)
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(574.015,85.0393,0)
|
||||
bs(574.015,141.732,0)
|
||||
bs(262.204,141.732,0)
|
||||
lw(1)
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(602.361,85.0393,0)
|
||||
bs(602.361,170.079,0)
|
||||
bs(439.37,170.079,0)
|
||||
bs(439.37,311.811,0)
|
||||
bs(460.629,311.811,0)
|
||||
bs(460.629,325.984,0)
|
||||
lw(1)
|
||||
ld((5, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(389.763,240.945,0)
|
||||
bs(389.763,269.291,0)
|
||||
bs(290.551,269.291,0)
|
||||
bs(290.551,340.157,0)
|
||||
bs(262.204,340.157,0)
|
||||
lw(1)
|
||||
ld((5, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(389.763,269.291,0)
|
||||
bs(559.843,269.291,0)
|
||||
bs(559.843,333.071,0)
|
||||
bs(574.016,333.071,0)
|
||||
lw(1)
|
||||
ld((5, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(488.976,85.0393,0)
|
||||
bs(488.976,127.559,0)
|
||||
bs(389.763,127.559,0)
|
||||
bs(389.763,212.598,0)
|
||||
lw(2)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(205.512,127.559,0)
|
||||
bs(205.512,113.386,0)
|
||||
bs(170.079,113.386,0)
|
||||
bs(170.079,141.732,0)
|
||||
bs(155.906,141.732,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(622.961,356.76,0)
|
||||
bs(622.961,518.503,0)
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.3459,573.199,354.33,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('GpgAgent',(0.552654,0,0,0.500554,608.238,340.185),1,1)
|
||||
G_()
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25)
|
||||
b()
|
||||
bs(721.712,467.717,0)
|
||||
bs(721.712,297.838,0)
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.3464,686.278,297.637,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('SCdaemon',(0.552654,0,0,0.500564,721.316,283.492),1,1)
|
||||
G_()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
lj(1)
|
||||
r(86.162,0,0,-117.493,679.192,566.929,0.181818,0.333333)
|
||||
G()
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Smartcard',(0.552654,0,0,0.552654,698.127,491.036))
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-31.2962,686.279,557.593,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('Card Reader',(0.552654,0,0,0.552654,721.318,541.975),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(73.6353,0,0,-41.2944,587.066,565.703,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('PIN Entry',(0.57675,0,0,0.729211,623.632,545.097),1,1)
|
||||
G_()
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(643.758,340.157,0)
|
||||
bs(643.758,340.157,0)
|
||||
bs(707.539,340.158,0)
|
||||
bs(707.539,304.724,0)
|
||||
lw(1)
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(574.016,283.465,0)
|
||||
bs(587.066,283.464,0)
|
||||
bs(686.278,283.464,0)
|
||||
G()
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25197)
|
||||
b()
|
||||
bs(98.9053,325.985,0)
|
||||
bs(98.9053,240.945,0)
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.3464,63.7795,354.331,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('WatchGnuPG',(0.552654,0,0,0.552654,98.8185,338.713),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(70.5589,0,0,-28.1194,63.7795,240.718,0.0670228,0.168178)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('Log Socket',(0.552654,0,0,0.552654,98.8175,225.1),1,1)
|
||||
G_()
|
||||
G_()
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(85.0392,0,0,-28.3464,446.457,240.945,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Config Files',(0.552654,0,0,0.552654,485.621,226.772),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(85.0392,0,0,-28.3464,545.669,85.0394,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Config Files',(0.552654,0,0,0.552654,584.834,70.8662),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(84.6546,0,0,-27.3609,347.245,239.959,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Help Files',(0.552654,0,0,0.552654,388.252,224.705),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(84.6546,0,0,-27.3609,446.457,85.0394,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Help Files',(0.552654,0,0,0.552654,487.464,69.7854),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(85.0392,0,0,-28.3464,248.032,240.945,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Keybox Files',(0.552654,0,0,0.552654,289.59,226.322),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((1,0.647,0.31))
|
||||
lw(0.283465)
|
||||
r(70.866,0,0,-28.3464,574.016,240.945,0.0670228,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(18)
|
||||
txt('Private Keys',(0.552654,0,0,0.552654,609.449,226.772),1,1)
|
||||
G_()
|
||||
G()
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(24)
|
||||
txt('Scute',(0.552654,0,0,0.599958,224.978,465.775),1,1)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Times-Roman')
|
||||
Fs(10)
|
||||
txt('(pkcs#11)',(1,0,0,1.08559,206.081,445.011))
|
||||
G_()
|
||||
G()
|
||||
fp((0.999,1,0.4))
|
||||
lw(0.283465)
|
||||
r(198.827,0,0,-56.6929,304.322,488.976,0.0603744,0.151107)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
Fn('Helvetica-Bold')
|
||||
Fs(36)
|
||||
txt('GPGME Library',(0.552654,0,0,0.552654,404.952,457.853),1,1)
|
||||
G_()
|
||||
G()
|
||||
lw(1)
|
||||
style('Application Box')
|
||||
r(197.598,0,0,-42.5187,304.724,566.928,0.0152672,0.0677968)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
txt('GPGME aware Application',(0.98062,0,0,0.937018,334.892,540.985))
|
||||
G_()
|
||||
G()
|
||||
lw(1)
|
||||
style('Application Box')
|
||||
r(127.829,0,0,-41.7496,162.992,566.159,0.0152672,0.0677968)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
txt('Legacy Application',(174.688,540.01))
|
||||
G_()
|
||||
G()
|
||||
G()
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(4.25197)
|
||||
b()
|
||||
bs(749.296,162.296,0)
|
||||
bs(705.89,162.296,0)
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(705.89,100.083,0)
|
||||
bs(744.472,100.083,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(705.89,131.189,0)
|
||||
bs(744.472,131.189,0)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('execute/access',(0.31891,0,0,0.280771,726.951,87.3768),1,1)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('closely linked',(0.31891,0,0,0.280771,724.715,149.589),1,1)
|
||||
fp((0,0,0))
|
||||
le()
|
||||
lw(1)
|
||||
Fn('Helvetica')
|
||||
Fs(14)
|
||||
style('Text')
|
||||
txt('Assuan protocol',(0.31891,0,0,0.280771,728.535,118.483),1,1)
|
||||
G_()
|
||||
lw(1)
|
||||
r(56.6929,0,0,-92.126,701.575,170.079)
|
||||
G_()
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(248.031,325.984,0)
|
||||
bs(248.031,297.638,0)
|
||||
bs(538.583,297.638,0)
|
||||
bs(538.583,340.157,0)
|
||||
bs(566.929,340.157,0)
|
||||
lp((0.392,0.584,0.929))
|
||||
lw(3.25)
|
||||
ld((1, 1))
|
||||
la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
|
||||
b()
|
||||
bs(375.591,325.984,0)
|
||||
bs(375.591,304.724,0)
|
||||
bs(531.496,304.724,0)
|
||||
bs(531.496,347.244,0)
|
||||
bs(566.929,347.244,0)
|
||||
guidelayer('Guide Lines',1,0,0,1,(0,0,1))
|
||||
grid((0,0,7.08661,7.08661),1,(0,0,1),'Grid')
|
8962
tags/gpgme-1.1.8/doc/texinfo.tex
Normal file
8962
tags/gpgme-1.1.8/doc/texinfo.tex
Normal file
File diff suppressed because it is too large
Load Diff
605
tags/gpgme-1.1.8/doc/uiserver.texi
Normal file
605
tags/gpgme-1.1.8/doc/uiserver.texi
Normal file
@ -0,0 +1,605 @@
|
||||
@c uiserver.texi -*- mode: texinfo; coding: latin-1; -*-
|
||||
@c Specification of the UI server protocol.
|
||||
@c To be included by gpgme.texi
|
||||
|
||||
@node UI Server Protocol
|
||||
@appendix The GnuPG UI Server Protocol
|
||||
@cindex UI server
|
||||
@cindex user interface server
|
||||
|
||||
|
||||
This section specifies the protocol used between clients and a User
|
||||
Interface Server (UI server). This protocol helps to build a system
|
||||
where all cryptographic operations are done by a server and the server
|
||||
is responsible for all dialogs. Although @acronym{GPGME} has no direct
|
||||
support for this protocol it is believed that servers will utilize the
|
||||
@acronym{GPGME} library; thus having the specification included in this
|
||||
manual is an appropriate choice. This protocol should be referenced as
|
||||
`The GnuPG UI Server Protocol'.
|
||||
|
||||
@noindent
|
||||
A server needs to implement these commands:@footnote{In all examples we
|
||||
assume that the connection has already been established; see the Assuan
|
||||
manual for details.}
|
||||
|
||||
@menu
|
||||
* UI Server Encrypt:: Encrypt a message.
|
||||
* UI Server Sign:: Sign a message.
|
||||
* UI Server Decrypt:: Decrypt a message.
|
||||
* UI Server Verify:: Verify a message.
|
||||
* UI Server Set Input Files:: Specifying the input files to operate on.
|
||||
* UI Server Sign/Encrypt Files:: Encrypting and signing files.
|
||||
* UI Server Verify/Decrypt Files:: Decrypting and verifying files.
|
||||
* UI Server Import/Export Keys:: Managing certificates.
|
||||
* UI Server Checksum Files:: Create and verify checksums for files.
|
||||
* Miscellaneous UI Server Commands:: Commands not related to a specific operation.
|
||||
@end menu
|
||||
|
||||
|
||||
|
||||
@node UI Server Encrypt
|
||||
@section UI Server: Encrypt a Message
|
||||
|
||||
Before encryption can be done the recipients must be set using the
|
||||
command:
|
||||
|
||||
@deffn Command RECIPIENT @var{string}
|
||||
|
||||
Set the recipient for the encryption. @var{string} is an RFC-2822
|
||||
recipient name ("mailbox" as per section 3.4). This command may or may
|
||||
not check the recipient for validity right away; if it does not all
|
||||
recipients are expected to be checked at the time of the @code{ENCRYPT}
|
||||
command. All @code{RECIPIENT} commands are cumulative until a
|
||||
successful @code{ENCRYPT} command or until a @code{RESET} command.
|
||||
Linefeeds are obviously not allowed in @var{string} and should be folded
|
||||
into spaces (which are equivalent).
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
To tell the server the source and destination of the data, the next two
|
||||
commands are to be used:
|
||||
|
||||
@deffn Command INPUT FD=@var{n}
|
||||
Set the file descriptor for the message to be encrypted to @var{n}. The
|
||||
message send to the server is binary encoded.
|
||||
|
||||
GpgOL is a Windows only program, thus @var{n} is not a libc file
|
||||
descriptor but a regular system handle. Given that the Assuan
|
||||
connection works over a socket, it is not possible to use regular
|
||||
inheritance to make the file descriptor available to the server.
|
||||
Thus @code{DuplicateHandle} needs to be used to duplicate a handle
|
||||
to the server process. This is the reason that the server needs to
|
||||
implement the @code{GETINFO pid} command. Sending this command a second
|
||||
time replaces the file descriptor set by the last one.
|
||||
@c If @var{n} is not given, this commands uses the
|
||||
@c %last file descriptor passed to the application.
|
||||
@c %@xref{fun-assuan_sendfd, ,the assuan_sendfd function,assuan,the
|
||||
@c %Libassuan manual}, on how to do descriptor passing.
|
||||
@end deffn
|
||||
|
||||
@deffn Command OUTPUT FD=@var{n}
|
||||
Set the file descriptor to be used for the output (i.e. the encrypted
|
||||
message) to @var{n}. For OpenPGP, the output needs to be ASCII armored;
|
||||
for CMS, the output needs to be Base-64 encoded. For details on the
|
||||
file descriptor, see the @code{INPUT} command.
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
The setting of the recipients, the data source and destination may
|
||||
happen in any order, even intermixed. If this has been done the actual
|
||||
encryption operation is called using:
|
||||
|
||||
@deffn Command ENCRYPT -@w{}-protocol=@var{name}
|
||||
|
||||
This command reads the plaintext from the file descriptor set by the
|
||||
@code{INPUT} command, encrypts it and writes the ciphertext to the file
|
||||
descriptor set by the @code{OUTPUT} command. The server may (and
|
||||
should) overlap reading and writing. The recipients used for the
|
||||
encryption are all the recipients set so far. If any recipient is not
|
||||
usable the server should take appropriate measures to notify the user
|
||||
about the problem and may cancel the operation by returning an error
|
||||
code. The used file descriptors are void after this command; the
|
||||
recipient list is only cleared if the server returns success.
|
||||
|
||||
@noindent
|
||||
Because GpgOL uses a streaming mode of operation the server is not
|
||||
allowed to auto select the protocol and must obey to the mandatory
|
||||
@var{protocol} parameter:
|
||||
|
||||
@table @code
|
||||
@item OpenPGP
|
||||
Use the OpenPGP protocol (RFC-2440).
|
||||
@item CMS
|
||||
Use the CMS (PKCS#7) protocol (RFC-3852).
|
||||
@end table
|
||||
|
||||
@end deffn
|
||||
|
||||
To support automagically selection of the protocol depending on the
|
||||
selected keys, the server MAY implement the command:
|
||||
|
||||
@deffn Command PREP_ENCRYPT [-@w{}-protocol=@var{name}]
|
||||
|
||||
This commands considers all recipients set so far and decides whether it
|
||||
is able to take input and start the actual decryption. This is kind of
|
||||
a dry-run @command{ENCRYPT} without requiring or using the input and
|
||||
output file descriptors. The server shall cache the result of any user
|
||||
selection to avoid asking this again when the actual @command{ENCRYPT}
|
||||
command is send. The @option{--protocol} option is optional; if it is
|
||||
not given, the server should allow the user to select the protocol to be
|
||||
used based on the recipients given or by any other means.
|
||||
|
||||
If this command is given again before a successful @command{ENCRYPT}
|
||||
command, the second one takes effect.
|
||||
|
||||
Before sending the OK response the server shall tell the client the
|
||||
protocol to be used (either the one given by the argument or the one
|
||||
selected by the user) by means of a status line:
|
||||
@end deffn
|
||||
|
||||
@deffn {Status line} PROTOCOL @var{name}
|
||||
Advise the client to use the protocol @var{name} for the
|
||||
@command{ENCRYPT} command. The valid protocol names are listed under
|
||||
the description of the @command{ENCRYPT} command. The server shall emit
|
||||
exactly one PROTOCOL status line.
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
Here is an example of a complete encryption sequence; client lines are
|
||||
indicated by a @sc{c:}, server responses by @sc{c:}:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
@clnt RESET
|
||||
@srvr OK
|
||||
@clnt RECIPIENT foo@@example.net
|
||||
@srvr OK
|
||||
@clnt RECIPIENT bar@@example.com
|
||||
@srvr OK
|
||||
@clnt PREP_ENCRYPT
|
||||
@srvr S PROTOCOL OpenPGP
|
||||
@srvr OK
|
||||
@clnt INPUT FD=17
|
||||
@srvr OK
|
||||
@clnt OUTPUT FD=18
|
||||
@srvr OK
|
||||
@clnt ENCRYPT
|
||||
@srvr OK
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
|
||||
|
||||
@node UI Server Sign
|
||||
@section UI Server: Sign a Message
|
||||
|
||||
The server needs to implement opaque signing as well as detached
|
||||
signing. Due to the nature of OpenPGP messages it is always required to
|
||||
send the entire message to the server; sending just the hash is not
|
||||
possible. The following two commands are required to set the input and
|
||||
output file descriptors:
|
||||
|
||||
@deffn Command INPUT FD=@var{n}
|
||||
Set the file descriptor for the message to be signed to @var{n}. The
|
||||
message send to the server is binary encoded. For details on the file
|
||||
descriptor, see the description of @code{INPUT} in the @code{ENCRYPT}
|
||||
section.
|
||||
@end deffn
|
||||
|
||||
@deffn Command OUTPUT FD=@var{n}
|
||||
Set the file descriptor to be used for the output. The output is either
|
||||
the complete signed message or in case of a detached signature just that
|
||||
detached signature. For OpenPGP, the output needs to be ASCII armored;
|
||||
for CMS, the output needs to be Base-64 encoded. For details on the
|
||||
file descriptor, see the @code{INPUT} command.
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
To allow the server the selection of a non-default signing key the
|
||||
client may optionally use the @code{SENDER} command, see @ref{command
|
||||
SENDER}.
|
||||
|
||||
@noindent
|
||||
The signing operation is then initiated by:
|
||||
|
||||
@deffn Command SIGN -@w{}-protocol=@var{name} [-@w{}-detached]
|
||||
Sign the data set with the @code{INPUT} command and write it to the sink
|
||||
set by OUTPUT. @var{name} is the signing protocol used for the
|
||||
message. For a description of the allowed protocols see the
|
||||
@code{ENCRYPT} command. With option @code{--detached} given, a detached
|
||||
signature is created; this is actually the usual way the command is
|
||||
used.
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
The client expects the server to send at least this status information
|
||||
before the final OK response:
|
||||
|
||||
@deffn {Status line} MICALG @var{string}
|
||||
The @var{string} represents the hash algorithm used to create the
|
||||
signature. It is used with MOSS style signature messages and defined by
|
||||
PGP/MIME (RFC-3156) and S/MIME (RFC-3851). The GPGME library has a
|
||||
supporting function @code{gpgme_hash_algo_name} to return the algorithm
|
||||
name as a string. This string needs to be lowercased and for OpenPGP
|
||||
prefixed with "@code{pgp-}".
|
||||
@end deffn
|
||||
|
||||
|
||||
|
||||
@node UI Server Decrypt
|
||||
@section UI Server: Decrypt a Message
|
||||
|
||||
Decryption may include the verification of OpenPGP messages. This is
|
||||
due to the often used combined signing/encryption modus of OpenPGP. The
|
||||
client may pass an option to the server to inhibit the signature
|
||||
verification. The following two commands are required to set the input
|
||||
and output file descriptors:
|
||||
|
||||
@deffn Command INPUT FD=@var{n}
|
||||
Set the file descriptor for the message to be decrypted to @var{n}. The
|
||||
message send to the server is either binary encoded or --- in the case
|
||||
of OpenPGP --- ASCII armored. For details on the file descriptor, see
|
||||
the description of @code{INPUT} in the @code{ENCRYPT} section.
|
||||
@end deffn
|
||||
|
||||
@deffn Command OUTPUT FD=@var{n}
|
||||
Set the file descriptor to be used for the output. The output is binary
|
||||
encoded. For details on the file descriptor, see the description of
|
||||
@code{INPUT} in the @code{ENCRYPT} section.
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
The decryption is started with the command:
|
||||
|
||||
@deffn Command DECRYPT -@w{}-protocol=@var{name} [-@w{}-no-verify]
|
||||
@var{name} is the encryption protocol used for the message. For a
|
||||
description of the allowed protocols see the @code{ENCRYPT} command.
|
||||
This argument is mandatory. If the option @option{--no-verify} is given,
|
||||
the server should not try to verify a signature, in case the input data
|
||||
is an OpenPGP combined message.
|
||||
@end deffn
|
||||
|
||||
|
||||
@node UI Server Verify
|
||||
@section UI Server: Verify a Message
|
||||
|
||||
The server needs to support the verification of opaque signatures as
|
||||
well as detached signatures. The kind of input sources controls what
|
||||
kind message is to be verified.
|
||||
|
||||
@deffn Command MESSAGE FD=@var{n}
|
||||
This command is used with detached signatures to set the file descriptor
|
||||
for the signed data to @var{n}. The data is binary encoded (used
|
||||
verbatim). For details on the file descriptor, see the description of
|
||||
@code{INPUT} in the @code{ENCRYPT} section.
|
||||
@end deffn
|
||||
|
||||
@deffn Command INPUT FD=@var{n}
|
||||
Set the file descriptor for the opaque message or the signature part of
|
||||
a detached signature to @var{n}. The message send to the server is
|
||||
either binary encoded or -- in the case of OpenPGP -- ASCII armored.
|
||||
For details on the file descriptor, see the description of @code{INPUT}
|
||||
in the @code{ENCRYPT} section.
|
||||
@end deffn
|
||||
|
||||
@deffn Command OUTPUT FD=@var{n}
|
||||
Set the file descriptor to be used for the output. The output is binary
|
||||
encoded and only used for opaque signatures. For details on the file
|
||||
descriptor, see the description of @code{INPUT} in the @code{ENCRYPT}
|
||||
section.
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
The verification is then started using:
|
||||
|
||||
@deffn Command VERIFY -@w{}-protocol=@var{name} [-@w{}-silent]
|
||||
@var{name} is the signing protocol used for the message. For a
|
||||
description of the allowed protocols see the @code{ENCRYPT} command.
|
||||
This argument is mandatory. Depending on the combination of
|
||||
@code{MESSAGE} @code{INPUT} and @code{OUTPUT} commands, the server needs
|
||||
to select the appropriate verification mode:
|
||||
|
||||
@table @asis
|
||||
@item MESSAGE and INPUT
|
||||
This indicates a detached signature. Output data is not applicable.
|
||||
@item INPUT
|
||||
This indicates an opaque signature. As no output command has been given,
|
||||
the server is only required to check the signature.
|
||||
@item INPUT and OUTPUT
|
||||
This indicates an opaque signature. The server shall write the signed
|
||||
data to the file descriptor set by the output command. This data shall
|
||||
even be written if the signatures can't be verified.
|
||||
@end table
|
||||
@end deffn
|
||||
|
||||
With @option{--silent} the server shall not display any dialog; this is
|
||||
for example used by the client to get the content of opaque signed
|
||||
messages. The client expects the server to send at least this status
|
||||
information before the final OK response:
|
||||
|
||||
@deffn {Status line} SIGSTATUS @var{flag} @var{displaystring}
|
||||
Returns the status for the signature and a short string explaining the
|
||||
status. Valid values for @var{flag} are:
|
||||
|
||||
@table @code
|
||||
@item none
|
||||
The message has a signature but it could not not be verified due to a
|
||||
missing key.
|
||||
@item green
|
||||
The signature is fully valid.
|
||||
@item yellow
|
||||
The signature is valid but additional information was shown regarding the
|
||||
validity of the key.
|
||||
@item red
|
||||
The signature is not valid.
|
||||
@end table
|
||||
|
||||
@var{displaystring} is a percent-and-plus-encoded string with a short
|
||||
human readable description of the status. For example
|
||||
|
||||
@smallexample
|
||||
S SIGSTATUS green Good+signature+from+Keith+Moon+<keith@@example.net>
|
||||
@end smallexample
|
||||
|
||||
Note that this string needs to fit into an Assuan line and should be
|
||||
short enough to be displayed as short one-liner on the clients window.
|
||||
As usual the encoding of this string is UTF-8 and it should be send in
|
||||
its translated form.
|
||||
|
||||
The server shall send one status line for every signature found on the
|
||||
message.
|
||||
|
||||
|
||||
@end deffn
|
||||
|
||||
|
||||
@node UI Server Set Input Files
|
||||
@section UI Server: Specifying the input files to operate on.
|
||||
|
||||
All file related UI server commands operate on a number of input files
|
||||
or directories, specified by one or more @code{FILE} commands:
|
||||
|
||||
@deffn Command FILE @var{name} [--continued]
|
||||
Add the file or directory @var{name} to the list of pathnames to be
|
||||
processed by the server. The parameter @var{name} must be an absolute
|
||||
path name (including the drive letter) and is percent espaced (in
|
||||
particular, the characters %, = and white space characters are always
|
||||
escaped). The option @code{--continued} is present for all but the
|
||||
last @code{FILE} command.
|
||||
@end deffn
|
||||
|
||||
|
||||
@node UI Server Sign/Encrypt Files
|
||||
@section UI Server: Encrypting and signing files.
|
||||
|
||||
First, the input files need to be specified by one or more
|
||||
@code{FILE} commands. Afterwards, the actual operation is requested:
|
||||
|
||||
@deffn Command ENCRYPT_FILES --nohup
|
||||
@deffnx Command SIGN_FILES --nohup
|
||||
@deffnx Command ENCRYPT_SIGN_FILES --nohup
|
||||
Request that the files specified by @code{FILE} are encrypted and/or
|
||||
signed. The command selects the default action. The UI server may
|
||||
allow the user to change this default afterwards interactively, and
|
||||
even abort the operation or complete it only on some of the selected
|
||||
files and directories.
|
||||
|
||||
What it means to encrypt or sign a file or directory is specific to
|
||||
the preferences of the user, the functionality the UI server provides,
|
||||
and the selected protocol. Typically, for each input file a new file
|
||||
is created under the original filename plus a protocol specific
|
||||
extension (like @code{.gpg} or @code{.sig}), which contain the
|
||||
encrypted/signed file or a detached signature. For directories, the
|
||||
server may offer multiple options to the user (for example ignore or
|
||||
process recursively).
|
||||
|
||||
The @code{ENCRYPT_SIGN_FILES} command requests a combined sign and
|
||||
encrypt operation. It may not be available for all protocols (for
|
||||
example, it is available for OpenPGP but not for CMS).
|
||||
|
||||
The option @code{--nohup} is mandatory. It is currently unspecified
|
||||
what should happen if @code{--nohup} is not present. Because
|
||||
@code{--nohup} is present, the server always returns @code{OK}
|
||||
promptly, and completes the operation asynchronously.
|
||||
@end deffn
|
||||
|
||||
|
||||
@node UI Server Verify/Decrypt Files
|
||||
@section UI Server: Decrypting and verifying files.
|
||||
|
||||
First, the input files need to be specified by one or more
|
||||
@code{FILE} commands. Afterwards, the actual operation is requested:
|
||||
|
||||
@deffn Command DECRYPT_FILES --nohup
|
||||
@deffnx Command VERIFY_FILES --nohup
|
||||
@deffnx Command DECRYPT_VERIFY_FILES --nohup
|
||||
Request that the files specified by @code{FILE} are decrypted and/or
|
||||
verified. The command selects the default action. The UI server may
|
||||
allow the user to change this default afterwards interactively, and
|
||||
even abort the operation or complete it only on some of the selected
|
||||
files and directories.
|
||||
|
||||
What it means to decrypt or verify a file or directory is specific to
|
||||
the preferences of the user, the functionality the UI server provides,
|
||||
and the selected protocol. Typically, for decryption, a new file is
|
||||
created for each input file under the original filename minus a
|
||||
protocol specific extension (like @code{.gpg}) which contains the
|
||||
original plaintext. For verification a status is displayed for each
|
||||
signed input file, indicating if it is signed, and if yes, if the
|
||||
signature is valid. For files that are signed and encrypted, the
|
||||
@code{VERIFY} command transiently decrypts the file to verify the
|
||||
enclosed signature. For directories, the server may offer multiple
|
||||
options to the user (for example ignore or process recursively).
|
||||
|
||||
The option @code{--nohup} is mandatory. It is currently unspecified
|
||||
what should happen if @code{--nohup} is not present. Because
|
||||
@code{--nohup} is present, the server always returns @code{OK}
|
||||
promptly, and completes the operation asynchronously.
|
||||
@end deffn
|
||||
|
||||
|
||||
@node UI Server Import/Export Keys
|
||||
@section UI Server: Managing certificates.
|
||||
|
||||
First, the input files need to be specified by one or more
|
||||
@code{FILE} commands. Afterwards, the actual operation is requested:
|
||||
|
||||
@deffn Command IMPORT_FILES --nohup
|
||||
Request that the certificates contained in the files specified by
|
||||
@code{FILE} are imported into the local certificate databases.
|
||||
|
||||
For directories, the server may offer multiple options to the user
|
||||
(for example ignore or process recursively).
|
||||
|
||||
The option @code{--nohup} is mandatory. It is currently unspecified
|
||||
what should happen if @code{--nohup} is not present. Because
|
||||
@code{--nohup} is present, the server always returns @code{OK}
|
||||
promptly, and completes the operation asynchronously.
|
||||
@end deffn
|
||||
|
||||
FIXME: It may be nice to support an @code{EXPORT} command as well,
|
||||
which is enabled by the context menu of the background of a directory.
|
||||
|
||||
|
||||
@node UI Server Checksum Files
|
||||
@section UI Server: Create and verify checksums for files.
|
||||
|
||||
First, the input files need to be specified by one or more
|
||||
@code{FILE} commands. Afterwards, the actual operation is requested:
|
||||
|
||||
@deffn Command CHECKSUM_CREATE_FILES --nohup
|
||||
Request that checksums are created for the files specifed by
|
||||
@code{FILE}. The choice of checksum algorithm and the destination
|
||||
storage and format for the created checksums depend on the preferences
|
||||
of the user and the functionality provided by the UI server. For
|
||||
directories, the server may offer multiple options to the user (for
|
||||
example ignore or process recursively).
|
||||
|
||||
The option @code{--nohup} is mandatory. It is currently unspecified
|
||||
what should happen if @code{--nohup} is not present. Because
|
||||
@code{--nohup} is present, the server always returns @code{OK}
|
||||
promptly, and completes the operation asynchronously.
|
||||
@end deffn
|
||||
|
||||
|
||||
@deffn Command CHECKSUM_VERIFY_FILES --nohup
|
||||
Request that checksums are created for the files specifed by
|
||||
@code{FILE} and verified against previously created and stored
|
||||
checksums. The choice of checksum algorithm and the source storage
|
||||
and format for previously created checksums depend on the preferences
|
||||
of the user and the functionality provided by the UI server. For
|
||||
directories, the server may offer multiple options to the user (for
|
||||
example ignore or process recursively).
|
||||
|
||||
If the source storage of previously created checksums is available to
|
||||
the user through the Windows shell, this command may also accept such
|
||||
checksum files as @code{FILE} arguments. In this case, the UI server
|
||||
should instead verify the checksum of the referenced files as if they
|
||||
were given as INPUT files.
|
||||
|
||||
The option @code{--nohup} is mandatory. It is currently unspecified
|
||||
what should happen if @code{--nohup} is not present. Because
|
||||
@code{--nohup} is present, the server always returns @code{OK}
|
||||
promptly, and completes the operation asynchronously.
|
||||
@end deffn
|
||||
|
||||
|
||||
|
||||
|
||||
@c
|
||||
@c M I S C E L L A N E O U S C O M M A N D S
|
||||
@c
|
||||
@node Miscellaneous UI Server Commands
|
||||
@section Miscellaneous UI Server Commands
|
||||
|
||||
The server needs to implement the following commands which are not
|
||||
related to a specific command:
|
||||
|
||||
@deffn Command GETINFO @var{what}
|
||||
This is a multi purpose command, commonly used to return a variety of
|
||||
information. The required subcommands as described by the @var{what}
|
||||
parameter are:
|
||||
|
||||
@table @code
|
||||
@item pid
|
||||
Return the process id of the server in decimal notation using an Assuan
|
||||
data line.
|
||||
@end table
|
||||
@end deffn
|
||||
|
||||
|
||||
@noindent
|
||||
To allow the server to pop up the windows in the correct relation to the
|
||||
client, the client is advised to tell the server by sending the option:
|
||||
|
||||
@deffn {Command option} window-id @var{number}
|
||||
The @var{number} represents the native window ID of the clients current
|
||||
window. On Windows systems this is a windows handle (@code{HWND}) and
|
||||
on X11 systems it is the @code{X Window ID}. The number needs to be
|
||||
given as a hexadecimal value so that it is easier to convey pointer
|
||||
values (e.g. @code{HWND}).
|
||||
@end deffn
|
||||
|
||||
|
||||
@noindent
|
||||
A client may want to fire up the certificate manager of the server. To
|
||||
do this it uses the Assuan command:
|
||||
|
||||
@deffn Command START_KEYMANAGER
|
||||
The server shall pop up the main window of the key manager (aka
|
||||
certificate manager). The client expects that the key manager is brought
|
||||
into the foregound and that this command immediatley returns (does not
|
||||
wait until the key manager has been fully brought up).
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
A client may want to fire up the configuration dialog of the server. To
|
||||
do this it uses the Assuan command:
|
||||
|
||||
@deffn Command START_CONFDIALOG
|
||||
The server shall pop up its configuration dialog. The client expects
|
||||
that this dialog is brought into the foregound and that this command
|
||||
immediatley returns (i.e. it does not wait until the dialog has been
|
||||
fully brought up).
|
||||
@end deffn
|
||||
|
||||
@anchor{command SENDER}
|
||||
@noindent
|
||||
When doing an operation on a mail, it is useful to let the server know
|
||||
the address of the sender:
|
||||
|
||||
@deffn Command SENDER [-@w{}-info] [-@w{}-protocol=@var{name}] @var{email}
|
||||
@var{email} is the plain ASCII encoded address ("addr-spec" as per
|
||||
RFC-2822) enclosed in angle brackets. The address set with this command
|
||||
is valid until a successful completion of the operation or until a
|
||||
@code{RESET} command. A second command overrides the effect of the
|
||||
first one; if @var{email} is not given and @option{--info} is not used,
|
||||
the server shall use the default signing key.
|
||||
|
||||
If option @option{--info} is not given, the server shall also suggest a
|
||||
protocol to use for signing. The client may use this suggested protocol
|
||||
on its own discretion. The same status line as with PREP_ENCRYPT is
|
||||
used for this.
|
||||
|
||||
The option @option{--protocol} may be used to give the server a hint on
|
||||
which signing protocol should be preferred.
|
||||
@end deffn
|
||||
|
||||
@noindent
|
||||
To allow the UI-server to visually identify a running operation or to
|
||||
associate operations the server MAY support the command:
|
||||
|
||||
@deffn Command SESSION @var{number} [@var{string}]
|
||||
The @var{number} is an arbitrary value, a server may use to associate
|
||||
simultaneous running sessions. It is a 32 bit unsigned integer with
|
||||
@code{0} as a special value indicating that no session association shall
|
||||
be done.
|
||||
|
||||
If @var{string} is given, the server may use this as the title of a
|
||||
window or, in the case of an email operation, to extract the sender's
|
||||
address. The string may contain spaces; thus no plus-escaping is used.
|
||||
|
||||
This command may be used at any time and overrides the effect of the
|
||||
last command. A @code{RESET} undoes the effect of this command.
|
||||
|
||||
@end deffn
|
67
tags/gpgme-1.1.8/gpgme.spec.in
Normal file
67
tags/gpgme-1.1.8/gpgme.spec.in
Normal file
@ -0,0 +1,67 @@
|
||||
# This is a template. The dist target uses it to create the real file.
|
||||
Summary: GPGME - GnuPG Made Easy
|
||||
Name: gpgme
|
||||
Version: @pkg_version@
|
||||
Release: 1
|
||||
URL: http://www.gnupg.org/gpgme.html
|
||||
Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz
|
||||
Group: Development/Libraries
|
||||
Copyright: GPL
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}
|
||||
BuildRequires: make
|
||||
Prereq: /sbin/ldconfig /sbin/install-info
|
||||
Requires: gnupg
|
||||
|
||||
%description
|
||||
GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier
|
||||
for applications. It provides a High-Level Crypto API for encryption,
|
||||
decryption, signing, signature verification and key management.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
%install
|
||||
rm -fr $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT
|
||||
make install prefix=$RPM_BUILD_ROOT/usr infodir=$RPM_BUILD_ROOT%{_infodir}
|
||||
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
|
||||
%clean
|
||||
rm -fr $RPM_BUILD_ROOT
|
||||
make distclean
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
/sbin/install-info %{_infodir}/gpgme.info.gz %{_infodir}/dir
|
||||
|
||||
%preun
|
||||
if [ "$1" = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/gpgme.info.gz %{_infodir}/dir
|
||||
fi
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING COPYING.LESSER AUTHORS README INSTALL NEWS ChangeLog TODO THANKS
|
||||
%attr(0755,root,root) %{_bindir}/gpgme-config
|
||||
%attr(0755,root,root) %{_libdir}/*gpgme.so*
|
||||
%attr(0755,root,root) %{_libdir}/*gpgme.la
|
||||
%attr(0644,root,root) %{_libdir}/*gpgme.a
|
||||
%{_includedir}/gpgme.h
|
||||
%{_datadir}/aclocal/gpgme.m4
|
||||
%{_infodir}/gpgme.info*
|
||||
|
||||
%changelog
|
||||
* Sat Aug 30 2003 Robert Schiele <rschiele@uni-mannheim.de>
|
||||
- %{_infodir}/dir is not packaged, remove to prevent checking failure
|
||||
* Mon Jul 01 2002 Wojciech Polak <polak@lodz.pdi.net>
|
||||
- initial specfile release for GPGME.
|
||||
|
||||
# EOF
|
90
tags/gpgme-1.1.8/gpgme.txt
Normal file
90
tags/gpgme-1.1.8/gpgme.txt
Normal file
@ -0,0 +1,90 @@
|
||||
%%comments:
|
||||
Copyright (C) 2001, 2004 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the file COPYING.
|
||||
|
||||
%%name: GPGME
|
||||
|
||||
%%short-description: GnuPG Made Easy
|
||||
|
||||
%%full-description: GPGME is a library designed to make access to
|
||||
GnuPG easier for applications. It provides a high-level crypto API
|
||||
for encryption, decryption, signing, signature verification and key
|
||||
management. Currently it uses GnuPG and GpgSM as its backends to
|
||||
support OpenPGP and the Cryptographic Message Syntax.
|
||||
|
||||
%%category: security, libraries
|
||||
|
||||
%%license: GPL
|
||||
%%license verified by:
|
||||
%%license verified on:
|
||||
|
||||
%%maintainer: g10 Code GmbH <gpgme@g10code.com>
|
||||
|
||||
%%updated: 2004-09-30
|
||||
|
||||
%%keywords: encryption, public key, digital signature, GnuPG
|
||||
|
||||
%%interface:
|
||||
|
||||
%%programs:
|
||||
|
||||
%%GNU: no
|
||||
|
||||
%%web-page: http://www.gnupg.org/gpgme.html
|
||||
|
||||
%%support: paid extension/consulting from http://www.g10code.com
|
||||
|
||||
%%doc: English programmer reference in Texinfo, Postscript, HTML included
|
||||
|
||||
%%developers: Werner Koch <wk@gnupg.org>.
|
||||
|
||||
%%contributors:
|
||||
|
||||
%%sponsors:
|
||||
|
||||
%%source: ftp://ftp.gnupg.org/gcrypt/gpgme/
|
||||
|
||||
%%debian:
|
||||
|
||||
%%redhat:
|
||||
|
||||
%%repository: See http://www.gnupg.org/cvs-access.html
|
||||
|
||||
%%related:
|
||||
|
||||
%%source-language: C
|
||||
|
||||
%%supported-languages: C, C++
|
||||
|
||||
%%use-requirements: GnuPG 1.2.2, GpgSM 1.9.6
|
||||
|
||||
%%build-prerequisites: libgpg-error 0.5
|
||||
|
||||
%%weak-prerequisites: Pth 1.2.0
|
||||
|
||||
%%source-prerequisites:
|
||||
|
||||
%%version: 1.0.0 released on 2004-09-30
|
||||
|
||||
%%announce-list: announce@gnupg.org announce-request@gnupg.org
|
||||
|
||||
%%announce-news:
|
||||
|
||||
%%help-list:
|
||||
|
||||
%%help-news:
|
||||
|
||||
%%dev-list: gnupg-devel@gnupg.org gnupg-devel-request@gnupg.org
|
||||
|
||||
%%dev-news:
|
||||
|
||||
%%bug-list:
|
||||
|
||||
%%bug-database:
|
||||
|
||||
%%entry written by: Werner Koch <wk@gnupg.org>
|
519
tags/gpgme-1.1.8/install-sh
Executable file
519
tags/gpgme-1.1.8/install-sh
Executable file
@ -0,0 +1,519 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-12-25.00
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dst_arg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
22
tags/gpgme-1.1.8/lang/Makefile.am
Normal file
22
tags/gpgme-1.1.8/lang/Makefile.am
Normal file
@ -0,0 +1,22 @@
|
||||
# Makefile.am for gpgme/lang.
|
||||
# Copyright (C) 2003, 2006 g10 Code GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
#
|
||||
# GPGME 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.1 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# GPGME 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 program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
SUBDIRS = cl
|
||||
|
||||
EXTRA_DIST = README
|
12
tags/gpgme-1.1.8/lang/README
Normal file
12
tags/gpgme-1.1.8/lang/README
Normal file
@ -0,0 +1,12 @@
|
||||
Language Support for GPGME
|
||||
--------------------------
|
||||
|
||||
This directory contains support for other languages than C.
|
||||
|
||||
Please note that language support components may be under a different
|
||||
license than GPGME itself. You can find more information in each
|
||||
sub-directory.
|
||||
|
||||
Directory Language
|
||||
|
||||
cl Common Lisp
|
34
tags/gpgme-1.1.8/lang/cl/ChangeLog
Normal file
34
tags/gpgme-1.1.8/lang/cl/ChangeLog
Normal file
@ -0,0 +1,34 @@
|
||||
2008-11-08 Moritz <moritz@gnu.org>
|
||||
|
||||
* gpgme.lisp (size-t): Wrong call to defctype: function accepts
|
||||
optional, not keyword argument.
|
||||
(ssize-t): Likewise.
|
||||
(off-t): Likewise.
|
||||
(gpgme-data-t, gpgme-ctx-t): Likewise.
|
||||
(gpgme-error-t): Likewise.
|
||||
(gpgme-error-no-signal-t): Likewise.
|
||||
(gpgme-err-code-t): Likewise.
|
||||
(gpgme-err-source-t): Likewise.
|
||||
(gpgme-sig-notation-t, gpgme-engine-info-t): Likewise.
|
||||
(gpgme-subkey-t): Likewise.
|
||||
(gpgme-key-sig-t): Likewise.
|
||||
(gpgme-user-id-t): Likewise.
|
||||
(gpgme-key-t): Likewise.
|
||||
(gpgme-data-cbs-t): Likewise.
|
||||
(gpgme-invalid-key-t): Likewise.
|
||||
(gpgme-op-encrypt-result-t): Likewise.
|
||||
(gpgme-recipient-t): Likewise.
|
||||
(gpgme-op-decrypt-result-t): Likewise.
|
||||
(gpgme-new-signature-t): Likewise.
|
||||
(gpgme-op-sign-result-t): Likewise.
|
||||
(gpgme-signature-t): Likewise.
|
||||
(gpgme-op-verify-result-t): Likewise.
|
||||
(gpgme-import-status-t): Likewise.
|
||||
(gpgme-op-import-result-t): Likewise.
|
||||
(gpgme-op-genkey-result-t): Likewise.
|
||||
(gpgme-op-keylist-result-t): Likewise.
|
||||
|
||||
2006-07-06 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* Initial release.
|
||||
|
29
tags/gpgme-1.1.8/lang/cl/Makefile.am
Normal file
29
tags/gpgme-1.1.8/lang/cl/Makefile.am
Normal file
@ -0,0 +1,29 @@
|
||||
# Makefile.am for GPGME-CL.
|
||||
# Copyright (C) 2003, 2006 g10 Code GmbH
|
||||
#
|
||||
# This file is part of GPGME-CL.
|
||||
#
|
||||
# GPGME-CL 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.
|
||||
#
|
||||
# GPGME-CL 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 General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA
|
||||
|
||||
clfiles = gpgme.asd gpgme-package.lisp gpgme.lisp
|
||||
|
||||
# FIXME: Should be configurable.
|
||||
clfilesdir = $(datadir)/common-lisp/source/gpgme
|
||||
dist_clfiles_DATA = $(clfiles)
|
||||
|
||||
EXTRA_DIST = README
|
||||
|
||||
|
40
tags/gpgme-1.1.8/lang/cl/README
Normal file
40
tags/gpgme-1.1.8/lang/cl/README
Normal file
@ -0,0 +1,40 @@
|
||||
Common Lisp Support for GPGME
|
||||
-----------------------------
|
||||
|
||||
Requirements:
|
||||
|
||||
ASDF Packaging Support
|
||||
CFFI Foreign Function Interface
|
||||
gpg-error GPG Error Codes
|
||||
|
||||
Use with:
|
||||
|
||||
> (asdf:operate 'asdf:load-op ':gpgme)
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
(with-open-file (stream "/tmp/myout" :direction :output
|
||||
:if-exists :supersede :element-type '(unsigned-byte 8))
|
||||
(with-context (ctx)
|
||||
(setf (armor-p ctx) t)
|
||||
(op-export ctx "DEADBEEF" out)))
|
||||
|
||||
(with-context (ctx)
|
||||
(with-output-to-string (out)
|
||||
(setf (armor-p ctx) t)
|
||||
(op-export ctx "McTester" out)))
|
||||
|
||||
(gpgme:with-context (ctx :armor t)
|
||||
(with-output-to-string (out)
|
||||
(gpgme:op-export ctx "McTester" out)))
|
||||
|
||||
|
||||
TODO
|
||||
----
|
||||
|
||||
* When GPGME defines macros for include cert values -2, -1, 0 and 1,
|
||||
define lisp macros for them as well.
|
||||
|
||||
*
|
49
tags/gpgme-1.1.8/lang/cl/gpgme-package.lisp
Normal file
49
tags/gpgme-1.1.8/lang/cl/gpgme-package.lisp
Normal file
@ -0,0 +1,49 @@
|
||||
;;;; gpgme-package.lisp
|
||||
|
||||
;;; Copyright (C) 2006 g10 Code GmbH
|
||||
;;;
|
||||
;;; This file is part of GPGME-CL.
|
||||
;;;
|
||||
;;; GPGME-CL 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.
|
||||
;;;
|
||||
;;; GPGME-CL 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 General Public License
|
||||
;;; along with GPGME; if not, write to the Free Software Foundation,
|
||||
;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
;;; Conventions:
|
||||
;;;
|
||||
;;; gpg-error is used for error handling.
|
||||
;;;
|
||||
;;; Standard I/O streams are used for input and output.
|
||||
|
||||
(defpackage #:gpgme
|
||||
(:use #:common-lisp #:cffi #:gpg-error)
|
||||
|
||||
(:export #:check-version
|
||||
#:*version*
|
||||
#:context
|
||||
#:protocol
|
||||
#:armorp
|
||||
#:textmodep
|
||||
#:+include-certs-default+
|
||||
#:include-certs
|
||||
#:keylist-mode
|
||||
#:signers
|
||||
#:sig-notations
|
||||
#:with-context
|
||||
#:key-data
|
||||
#:get-key
|
||||
#:op-encrypt
|
||||
#:op-decrypt
|
||||
#:op-sign
|
||||
#:op-verify
|
||||
#:op-import
|
||||
#:op-export))
|
35
tags/gpgme-1.1.8/lang/cl/gpgme.asd.in
Normal file
35
tags/gpgme-1.1.8/lang/cl/gpgme.asd.in
Normal file
@ -0,0 +1,35 @@
|
||||
;;; -*- Mode: lisp -*-
|
||||
|
||||
;;; Copyright (C) 2006 g10 Code GmbH
|
||||
;;;
|
||||
;;; This file is part of GPGME.
|
||||
;;;
|
||||
;;; GPGME 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.1 of
|
||||
;;; the License, or (at your option) any later version.
|
||||
;;;
|
||||
;;; GPGME 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 GPGME; if not, write to the Free
|
||||
;;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
;;; 02111-1307, USA.
|
||||
|
||||
(defpackage #:gpgme-system
|
||||
(:use #:common-lisp #:asdf))
|
||||
|
||||
(in-package #:gpgme-system)
|
||||
|
||||
(defsystem gpgme
|
||||
:description "GnuPG Made Easy."
|
||||
:author "g10 Code GmbH"
|
||||
:version "@VERSION@"
|
||||
:licence "GPL"
|
||||
:depends-on ("cffi" "gpg-error")
|
||||
:components ((:file "gpgme-package")
|
||||
(:file "gpgme"
|
||||
:depends-on ("gpgme-package"))))
|
2069
tags/gpgme-1.1.8/lang/cl/gpgme.lisp
Normal file
2069
tags/gpgme-1.1.8/lang/cl/gpgme.lisp
Normal file
File diff suppressed because it is too large
Load Diff
6425
tags/gpgme-1.1.8/ltmain.sh
Normal file
6425
tags/gpgme-1.1.8/ltmain.sh
Normal file
File diff suppressed because it is too large
Load Diff
35
tags/gpgme-1.1.8/m4/ChangeLog
Normal file
35
tags/gpgme-1.1.8/m4/ChangeLog
Normal file
@ -0,0 +1,35 @@
|
||||
2006-06-08 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* pth.m4: Add --all to pth-config invocation.
|
||||
|
||||
2006-02-22 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* pth.m4: Fix code generation (required for Max OS X).
|
||||
Submitted by Emanuele Giaquinta <exg@gentoo.org>.
|
||||
|
||||
2005-11-17 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* glib-2.0.m4: New file.
|
||||
|
||||
2004-12-28 Werner Koch <wk@g10code.com>
|
||||
|
||||
* pth.m4: Changed quoting for use with automake 1.9.
|
||||
|
||||
2004-09-14 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* pth.m4: Disable _ac_pth_line, and don't fail if Pth is not
|
||||
found.
|
||||
|
||||
* glibc21.m4: New file.
|
||||
* gpg-error.m4: New file.
|
||||
* pth.m4: New file.
|
||||
|
||||
Copyright 2004 g10 Code GmbH
|
||||
|
||||
This file is free software; as a special exception the author gives
|
||||
unlimited permission to copy and/or distribute it, with or without
|
||||
modifications, as long as this notice is preserved.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
215
tags/gpgme-1.1.8/m4/glib-2.0.m4
Normal file
215
tags/gpgme-1.1.8/m4/glib-2.0.m4
Normal file
@ -0,0 +1,215 @@
|
||||
# Configure paths for GLIB
|
||||
# Owen Taylor 1997-2001
|
||||
|
||||
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
|
||||
dnl gthread is specified in MODULES, pass to pkg-config
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_GLIB_2_0],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from pkg-config
|
||||
dnl
|
||||
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
|
||||
, enable_glibtest=yes)
|
||||
|
||||
pkg_config_args=glib-2.0
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gmodule)
|
||||
pkg_config_args="$pkg_config_args gmodule-2.0"
|
||||
;;
|
||||
gmodule-no-export)
|
||||
pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
|
||||
;;
|
||||
gobject)
|
||||
pkg_config_args="$pkg_config_args gobject-2.0"
|
||||
;;
|
||||
gthread)
|
||||
pkg_config_args="$pkg_config_args gthread-2.0"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
no_glib=""
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
|
||||
:
|
||||
else
|
||||
echo *** pkg-config too old; version 0.7 or better required.
|
||||
no_glib=yes
|
||||
PKG_CONFIG=no
|
||||
fi
|
||||
else
|
||||
no_glib=yes
|
||||
fi
|
||||
|
||||
min_glib_version=ifelse([$1], ,2.0.0,$1)
|
||||
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
## don't try to run the test against uninstalled libtool libs
|
||||
if $PKG_CONFIG --uninstalled $pkg_config_args; then
|
||||
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
|
||||
enable_glibtest=no
|
||||
fi
|
||||
|
||||
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
|
||||
:
|
||||
else
|
||||
no_glib=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$no_glib" = x ; then
|
||||
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
|
||||
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
|
||||
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
|
||||
|
||||
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
|
||||
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
|
||||
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_glibtest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$GLIB_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
|
||||
dnl checks the results of pkg-config to some extent)
|
||||
dnl
|
||||
rm -f conf.glibtest
|
||||
AC_TRY_RUN([
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.glibtest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_glib_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_glib_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((glib_major_version != $glib_config_major_version) ||
|
||||
(glib_minor_version != $glib_config_minor_version) ||
|
||||
(glib_micro_version != $glib_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
|
||||
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf ("*** was found! If pkg-config was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
|
||||
printf("*** to point to the correct configuration files\n");
|
||||
}
|
||||
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
|
||||
(glib_minor_version != GLIB_MINOR_VERSION) ||
|
||||
(glib_micro_version != GLIB_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
|
||||
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((glib_major_version > major) ||
|
||||
((glib_major_version == major) && (glib_minor_version > minor)) ||
|
||||
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
|
||||
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_glib" = x ; then
|
||||
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** A new enough version of pkg-config was not found."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
|
||||
else
|
||||
if test -f conf.glibtest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GLIB test program, checking why..."
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$LIBS $GLIB_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
|
||||
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GLIB_CFLAGS=""
|
||||
GLIB_LIBS=""
|
||||
GLIB_GENMARSHAL=""
|
||||
GOBJECT_QUERY=""
|
||||
GLIB_MKENUMS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
AC_SUBST(GLIB_GENMARSHAL)
|
||||
AC_SUBST(GOBJECT_QUERY)
|
||||
AC_SUBST(GLIB_MKENUMS)
|
||||
rm -f conf.glibtest
|
||||
])
|
32
tags/gpgme-1.1.8/m4/glibc21.m4
Normal file
32
tags/gpgme-1.1.8/m4/glibc21.m4
Normal file
@ -0,0 +1,32 @@
|
||||
# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
|
||||
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
|
||||
dnl This file is free software, distributed under the terms of the GNU
|
||||
dnl General Public License. As a special exception to the GNU General
|
||||
dnl Public License, this file may be distributed as part of a program
|
||||
dnl that contains a configuration script generated by Autoconf, under
|
||||
dnl the same distribution terms as the rest of that program.
|
||||
|
||||
# Test for the GNU C Library, version 2.1 or newer.
|
||||
# From Bruno Haible.
|
||||
|
||||
AC_DEFUN([jm_GLIBC21],
|
||||
[
|
||||
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
|
||||
ac_cv_gnu_library_2_1,
|
||||
[AC_EGREP_CPP([Lucky GNU user],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
|
||||
Lucky GNU user
|
||||
#endif
|
||||
#endif
|
||||
],
|
||||
ac_cv_gnu_library_2_1=yes,
|
||||
ac_cv_gnu_library_2_1=no)
|
||||
]
|
||||
)
|
||||
AC_SUBST(GLIBC21)
|
||||
GLIBC21="$ac_cv_gnu_library_2_1"
|
||||
]
|
||||
)
|
65
tags/gpgme-1.1.8/m4/gpg-error.m4
Normal file
65
tags/gpgme-1.1.8/m4/gpg-error.m4
Normal file
@ -0,0 +1,65 @@
|
||||
# gpg-error.m4 - autoconf macro to detect libgpg-error.
|
||||
# Copyright (C) 2002, 2003, 2004 g10 Code GmbH
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
|
||||
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
|
||||
dnl Test for libgpg-error and define GPG_ERROR_CFLAGS and GPG_ERROR_LIBS
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_GPG_ERROR],
|
||||
[ AC_ARG_WITH(gpg-error-prefix,
|
||||
AC_HELP_STRING([--with-gpg-error-prefix=PFX],
|
||||
[prefix where GPG Error is installed (optional)]),
|
||||
gpg_error_config_prefix="$withval", gpg_error_config_prefix="")
|
||||
if test x$gpg_error_config_prefix != x ; then
|
||||
if test x${GPG_ERROR_CONFIG+set} != xset ; then
|
||||
GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
|
||||
min_gpg_error_version=ifelse([$1], ,0.0,$1)
|
||||
AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
|
||||
ok=no
|
||||
if test "$GPG_ERROR_CONFIG" != "no" ; then
|
||||
req_major=`echo $min_gpg_error_version | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
|
||||
req_minor=`echo $min_gpg_error_version | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
|
||||
gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
|
||||
major=`echo $gpg_error_config_version | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
|
||||
minor=`echo $gpg_error_config_version | \
|
||||
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
|
||||
if test "$major" -gt "$req_major"; then
|
||||
ok=yes
|
||||
else
|
||||
if test "$major" -eq "$req_major"; then
|
||||
if test "$minor" -ge "$req_minor"; then
|
||||
ok=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test $ok = yes; then
|
||||
GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
|
||||
GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
GPG_ERROR_CFLAGS=""
|
||||
GPG_ERROR_LIBS=""
|
||||
AC_MSG_RESULT(no)
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GPG_ERROR_CFLAGS)
|
||||
AC_SUBST(GPG_ERROR_LIBS)
|
||||
])
|
||||
|
5939
tags/gpgme-1.1.8/m4/libtool.m4
vendored
Normal file
5939
tags/gpgme-1.1.8/m4/libtool.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
157
tags/gpgme-1.1.8/m4/pkg.m4
Normal file
157
tags/gpgme-1.1.8/m4/pkg.m4
Normal file
@ -0,0 +1,157 @@
|
||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
#
|
||||
# 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 2 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
# ----------------------------------
|
||||
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
fi[]dnl
|
||||
])# PKG_PROG_PKG_CONFIG
|
||||
|
||||
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
# Check to see whether a particular set of modules exists. Similar
|
||||
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
#
|
||||
#
|
||||
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
|
||||
# this or PKG_CHECK_MODULES is called, or make sure to call
|
||||
# PKG_CHECK_EXISTS manually
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
m4_ifval([$2], [$2], [:])
|
||||
m4_ifvaln([$3], [else
|
||||
$3])dnl
|
||||
fi])
|
||||
|
||||
|
||||
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
# ---------------------------------------------
|
||||
m4_define([_PKG_CONFIG],
|
||||
[if test -n "$PKG_CONFIG"; then
|
||||
if test -n "$$1"; then
|
||||
pkg_cv_[]$1="$$1"
|
||||
else
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
[pkg_failed=yes])
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
])# _PKG_CONFIG
|
||||
|
||||
# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
# -----------------------------
|
||||
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi[]dnl
|
||||
])# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
|
||||
|
||||
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
# [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
#
|
||||
# Note that if there is a possibility the first call to
|
||||
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
#
|
||||
#
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_MODULES],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
|
||||
pkg_failed=no
|
||||
AC_MSG_CHECKING([for $1])
|
||||
|
||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
|
||||
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.])
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
|
||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT
|
||||
])],
|
||||
[AC_MSG_RESULT([no])
|
||||
$4])
|
||||
elif test $pkg_failed = untried; then
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
|
||||
[$4])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
ifelse([$3], , :, [$3])
|
||||
fi[]dnl
|
||||
])# PKG_CHECK_MODULES
|
402
tags/gpgme-1.1.8/m4/pth.m4
Normal file
402
tags/gpgme-1.1.8/m4/pth.m4
Normal file
@ -0,0 +1,402 @@
|
||||
dnl ##
|
||||
dnl ## GNU Pth - The GNU Portable Threads
|
||||
dnl ## Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
|
||||
dnl ##
|
||||
dnl ## This file is part of GNU Pth, a non-preemptive thread scheduling
|
||||
dnl ## library which can be found at http://www.gnu.org/software/pth/.
|
||||
dnl ##
|
||||
dnl ## This library is free software; you can redistribute it and/or
|
||||
dnl ## modify it under the terms of the GNU Lesser General Public
|
||||
dnl ## License as published by the Free Software Foundation; either
|
||||
dnl ## version 2.1 of the License, or (at your option) any later version.
|
||||
dnl ##
|
||||
dnl ## This library is distributed in the hope that it will be useful,
|
||||
dnl ## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl ## Lesser General Public License for more details.
|
||||
dnl ##
|
||||
dnl ## You should have received a copy of the GNU Lesser General Public
|
||||
dnl ## License along with this library; if not, write to the Free Software
|
||||
dnl ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
dnl ## USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
|
||||
dnl ##
|
||||
dnl ## pth.m4: Autoconf macro for locating GNU Pth from within
|
||||
dnl ## configure.in of third-party software packages
|
||||
dnl ##
|
||||
|
||||
dnl ##
|
||||
dnl ## Synopsis:
|
||||
dnl ## AC_CHECK_PTH([MIN-VERSION [, # minimum Pth version, e.g. 1.2.0
|
||||
dnl ## DEFAULT-WITH-PTH [, # default value for --with-pth option
|
||||
dnl ## DEFAULT-WITH-PTH-TEST [,# default value for --with-pth-test option
|
||||
dnl ## EXTEND-VARS [, # whether CFLAGS/LDFLAGS/etc are extended
|
||||
dnl ## ACTION-IF-FOUND [, # action to perform if Pth was found
|
||||
dnl ## ACTION-IF-NOT-FOUND # action to perform if Pth was not found
|
||||
dnl ## ]]]]]])
|
||||
dnl ## Examples:
|
||||
dnl ## AC_CHECK_PTH(1.2.0)
|
||||
dnl ## AC_CHECK_PTH(1.2.0,,,no,CFLAGS="$CFLAGS -DHAVE_PTH $PTH_CFLAGS")
|
||||
dnl ## AC_CHECK_PTH(1.2.0,yes,yes,yes,CFLAGS="$CFLAGS -DHAVE_PTH")
|
||||
dnl ##
|
||||
dnl
|
||||
dnl # auxilliary macros
|
||||
AC_DEFUN([_AC_PTH_ERROR], [dnl
|
||||
AC_MSG_RESULT([*FAILED*])
|
||||
dnl define(_ac_pth_line,dnl
|
||||
dnl "+------------------------------------------------------------------------+")
|
||||
dnl echo " _ac_pth_line" 1>&2
|
||||
cat <<EOT | sed -e 's/^[[ ]]*/ | /' -e 's/>>/ /' 1>&2
|
||||
$1
|
||||
EOT
|
||||
dnl echo " _ac_pth_line" 1>&2
|
||||
dnl undefine(_ac_pth_line)
|
||||
exit 1
|
||||
])
|
||||
AC_DEFUN([_AC_PTH_VERBOSE], [dnl
|
||||
if test ".$verbose" = .yes; then
|
||||
AC_MSG_RESULT([ $1])
|
||||
fi
|
||||
])
|
||||
dnl # the user macro
|
||||
AC_DEFUN([AC_CHECK_PTH], [dnl
|
||||
dnl
|
||||
dnl # prerequisites
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_CPP])dnl
|
||||
dnl
|
||||
PTH_CPPFLAGS=''
|
||||
PTH_CFLAGS=''
|
||||
PTH_LDFLAGS=''
|
||||
PTH_LIBS=''
|
||||
AC_SUBST(PTH_CPPFLAGS)
|
||||
AC_SUBST(PTH_CFLAGS)
|
||||
AC_SUBST(PTH_LDFLAGS)
|
||||
AC_SUBST(PTH_LIBS)
|
||||
dnl # command line options
|
||||
AC_MSG_CHECKING(for GNU Pth)
|
||||
_AC_PTH_VERBOSE([])
|
||||
AC_ARG_WITH(pth,dnl
|
||||
[ --with-pth[=ARG] Build with GNU Pth Library (default=]ifelse([$2],,yes,$2)[)],dnl
|
||||
,dnl
|
||||
with_pth="ifelse([$2],,yes,$2)"
|
||||
)dnl
|
||||
AC_ARG_WITH(pth-test,dnl
|
||||
[ --with-pth-test Perform GNU Pth Sanity Test (default=]ifelse([$3],,yes,$3)[)],dnl
|
||||
,dnl
|
||||
with_pth_test="ifelse([$3],,yes,$3)"
|
||||
)dnl
|
||||
_AC_PTH_VERBOSE([+ Command Line Options:])
|
||||
_AC_PTH_VERBOSE([ o --with-pth=$with_pth])
|
||||
_AC_PTH_VERBOSE([ o --with-pth-test=$with_pth_test])
|
||||
dnl
|
||||
dnl # configuration
|
||||
if test ".$with_pth" != .no; then
|
||||
_pth_subdir=no
|
||||
_pth_subdir_opts=''
|
||||
case "$with_pth" in
|
||||
subdir:* )
|
||||
_pth_subdir=yes
|
||||
changequote(, )dnl
|
||||
_pth_subdir_opts=`echo $with_pth | sed -e 's/^subdir:[^ ]*[ ]*//'`
|
||||
with_pth=`echo $with_pth | sed -e 's/^subdir:\([^ ]*\).*$/\1/'`
|
||||
changequote([, ])dnl
|
||||
;;
|
||||
esac
|
||||
_pth_version=""
|
||||
_pth_location=""
|
||||
_pth_type=""
|
||||
_pth_cppflags=""
|
||||
_pth_cflags=""
|
||||
_pth_ldflags=""
|
||||
_pth_libs=""
|
||||
if test ".$with_pth" = .yes; then
|
||||
# via config script in $PATH
|
||||
changequote(, )dnl
|
||||
_pth_version=`(pth-config --version) 2>/dev/null |\
|
||||
sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'`
|
||||
changequote([, ])dnl
|
||||
if test ".$_pth_version" != .; then
|
||||
_pth_location=`pth-config --prefix`
|
||||
_pth_type='installed'
|
||||
_pth_cppflags=`pth-config --cflags`
|
||||
_pth_cflags=`pth-config --cflags`
|
||||
_pth_ldflags=`pth-config --ldflags`
|
||||
_pth_libs=`pth-config --libs --all`
|
||||
fi
|
||||
elif test -d "$with_pth"; then
|
||||
with_pth=`echo $with_pth | sed -e 's;/*$;;'`
|
||||
_pth_found=no
|
||||
# via locally included source tree
|
||||
if test ".$_pth_subdir" = .yes; then
|
||||
_pth_location="$with_pth"
|
||||
_pth_type='local'
|
||||
_pth_cppflags="-I$with_pth"
|
||||
_pth_cflags="-I$with_pth"
|
||||
if test -f "$with_pth/ltconfig"; then
|
||||
_pth_ldflags="-L$with_pth/.libs"
|
||||
else
|
||||
_pth_ldflags="-L$with_pth"
|
||||
fi
|
||||
_pth_libs="-lpth"
|
||||
changequote(, )dnl
|
||||
_pth_version=`grep '^const char PTH_Hello' $with_pth/pth_vers.c |\
|
||||
sed -e 's;^.*Version[ ]*\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'`
|
||||
changequote([, ])dnl
|
||||
_pth_found=yes
|
||||
ac_configure_args="$ac_configure_args --enable-subdir $_pth_subdir_opts"
|
||||
with_pth_test=no
|
||||
fi
|
||||
# via config script under a specified directory
|
||||
# (a standard installation, but not a source tree)
|
||||
if test ".$_pth_found" = .no; then
|
||||
for _dir in $with_pth/bin $with_pth; do
|
||||
if test -f "$_dir/pth-config"; then
|
||||
test -f "$_dir/pth-config.in" && continue # pth-config in source tree!
|
||||
changequote(, )dnl
|
||||
_pth_version=`($_dir/pth-config --version) 2>/dev/null |\
|
||||
sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'`
|
||||
changequote([, ])dnl
|
||||
if test ".$_pth_version" != .; then
|
||||
_pth_location=`$_dir/pth-config --prefix`
|
||||
_pth_type="installed"
|
||||
_pth_cppflags=`$_dir/pth-config --cflags`
|
||||
_pth_cflags=`$_dir/pth-config --cflags`
|
||||
_pth_ldflags=`$_dir/pth-config --ldflags`
|
||||
_pth_libs=`$_dir/pth-config --libs --all`
|
||||
_pth_found=yes
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# in any subarea under a specified directory
|
||||
# (either a special installation or a Pth source tree)
|
||||
if test ".$_pth_found" = .no; then
|
||||
changequote(, )dnl
|
||||
_pth_found=0
|
||||
for _file in x `find $with_pth -name "pth.h" -type f -print`; do
|
||||
test .$_file = .x && continue
|
||||
_dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
|
||||
_pth_version=`($_dir/pth-config --version) 2>/dev/null |\
|
||||
sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'`
|
||||
if test ".$_pth_version" = .; then
|
||||
_pth_version=`grep '^#define PTH_VERSION_STR' $_file |\
|
||||
sed -e 's;^#define[ ]*PTH_VERSION_STR[ ]*"\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'`
|
||||
fi
|
||||
_pth_cppflags="-I$_dir"
|
||||
_pth_cflags="-I$_dir"
|
||||
_pth_found=`expr $_pth_found + 1`
|
||||
done
|
||||
for _file in x `find $with_pth -name "libpth.[aso]" -type f -print`; do
|
||||
test .$_file = .x && continue
|
||||
_dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
|
||||
_pth_ldflags="-L$_dir"
|
||||
_pth_libs="-lpth"
|
||||
_pth_found=`expr $_pth_found + 1`
|
||||
done
|
||||
changequote([, ])dnl
|
||||
if test ".$_pth_found" = .2; then
|
||||
_pth_location="$with_pth"
|
||||
_pth_type="uninstalled"
|
||||
else
|
||||
_pth_version=''
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
_AC_PTH_VERBOSE([+ Determined Location:])
|
||||
_AC_PTH_VERBOSE([ o path: $_pth_location])
|
||||
_AC_PTH_VERBOSE([ o type: $_pth_type])
|
||||
if test ".$_pth_version" = .; then
|
||||
with_pth=no
|
||||
else
|
||||
dnl if test ".$with_pth" != .yes; then
|
||||
dnl _AC_PTH_ERROR([dnl
|
||||
dnl Unable to locate GNU Pth under $with_pth.
|
||||
dnl Please specify the correct path to either a GNU Pth installation tree
|
||||
dnl (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in
|
||||
dnl the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a
|
||||
dnl path to a pth-X.Y.Z/ directory; but make sure the package is already
|
||||
dnl built, i.e., the "configure; make" step was already performed there).])
|
||||
dnl else
|
||||
dnl _AC_PTH_ERROR([dnl
|
||||
dnl Unable to locate GNU Pth in any system-wide location (see \$PATH).
|
||||
dnl Please specify the correct path to either a GNU Pth installation tree
|
||||
dnl (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in
|
||||
dnl the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a
|
||||
dnl path to a pth-X.Y.Z/ directory; but make sure the package is already
|
||||
dnl built, i.e., the "configure; make" step was already performed there).])
|
||||
dnl fi
|
||||
dnl fi
|
||||
dnl #
|
||||
dnl # Check whether the found version is sufficiently new
|
||||
dnl #
|
||||
_req_version="ifelse([$1],,1.0.0,$1)"
|
||||
for _var in _pth_version _req_version; do
|
||||
eval "_val=\"\$${_var}\""
|
||||
_major=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\1/'`
|
||||
_minor=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\2/'`
|
||||
_rtype=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\3/'`
|
||||
_micro=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\4/'`
|
||||
case $_rtype in
|
||||
"a" ) _rtype=0 ;;
|
||||
"b" ) _rtype=1 ;;
|
||||
"." ) _rtype=2 ;;
|
||||
esac
|
||||
_hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \
|
||||
"major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"`
|
||||
eval "${_var}_hex=\"\$_hex\""
|
||||
done
|
||||
_AC_PTH_VERBOSE([+ Determined Versions:])
|
||||
_AC_PTH_VERBOSE([ o existing: $_pth_version -> 0x$_pth_version_hex])
|
||||
_AC_PTH_VERBOSE([ o required: $_req_version -> 0x$_req_version_hex])
|
||||
_ok=0
|
||||
if test ".$_pth_version_hex" != .; then
|
||||
if test ".$_req_version_hex" != .; then
|
||||
if test $_pth_version_hex -ge $_req_version_hex; then
|
||||
_ok=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test ".$_ok" = .0; then
|
||||
_AC_PTH_ERROR([dnl
|
||||
Found Pth version $_pth_version, but required at least version $_req_version.
|
||||
Upgrade Pth under $_pth_location to $_req_version or higher first, please.])
|
||||
fi
|
||||
dnl #
|
||||
dnl # Perform Pth Sanity Compile Check
|
||||
dnl #
|
||||
if test ".$with_pth_test" = .yes; then
|
||||
_ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
_ac_save_CFLAGS="$CFLAGS"
|
||||
_ac_save_LDFLAGS="$LDFLAGS"
|
||||
_ac_save_LIBS="$LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $_pth_cppflags"
|
||||
CFLAGS="$CFLAGS $_pth_cflags"
|
||||
LDFLAGS="$LDFLAGS $_pth_ldflags"
|
||||
LIBS="$LIBS $_pth_libs"
|
||||
_AC_PTH_VERBOSE([+ Test Build Environment:])
|
||||
_AC_PTH_VERBOSE([ o CPPFLAGS=\"$CPPFLAGS\"])
|
||||
_AC_PTH_VERBOSE([ o CFLAGS=\"$CFLAGS\"])
|
||||
_AC_PTH_VERBOSE([ o LDFLAGS=\"$LDFLAGS\"])
|
||||
_AC_PTH_VERBOSE([ o LIBS=\"$LIBS\"])
|
||||
cross_compile=no
|
||||
define(_code1, [dnl
|
||||
#include <stdio.h>
|
||||
#include <pth.h>
|
||||
])
|
||||
define(_code2, [dnl
|
||||
FILE *fp;
|
||||
if (!(fp = fopen("conftestval", "w")))
|
||||
exit(1);
|
||||
fprintf(fp, "hmm");
|
||||
fclose(fp);
|
||||
pth_init();
|
||||
pth_kill();
|
||||
if (!(fp = fopen("conftestval", "w")))
|
||||
exit(1);
|
||||
fprintf(fp, "yes");
|
||||
fclose(fp);
|
||||
exit(0);
|
||||
])
|
||||
_AC_PTH_VERBOSE([+ Performing Sanity Checks:])
|
||||
_AC_PTH_VERBOSE([ o pre-processor test])
|
||||
AC_TRY_CPP(_code1, _ok=yes, _ok=no)
|
||||
if test ".$_ok" != .yes; then
|
||||
_AC_PTH_ERROR([dnl
|
||||
Found GNU Pth $_pth_version under $_pth_location, but
|
||||
was unable to perform a sanity pre-processor check. This means
|
||||
the GNU Pth header pth.h was not found.
|
||||
We used the following build environment:
|
||||
>> CPP="$CPP"
|
||||
>> CPPFLAGS="$CPPFLAGS"
|
||||
See config.log for possibly more details.])
|
||||
fi
|
||||
_AC_PTH_VERBOSE([ o link check])
|
||||
AC_TRY_LINK(_code1, _code2, _ok=yes, _ok=no)
|
||||
if test ".$_ok" != .yes; then
|
||||
_AC_PTH_ERROR([dnl
|
||||
Found GNU Pth $_pth_version under $_pth_location, but
|
||||
was unable to perform a sanity linker check. This means
|
||||
the GNU Pth library libpth.a was not found.
|
||||
We used the following build environment:
|
||||
>> CC="$CC"
|
||||
>> CFLAGS="$CFLAGS"
|
||||
>> LDFLAGS="$LDFLAGS"
|
||||
>> LIBS="$LIBS"
|
||||
See config.log for possibly more details.])
|
||||
fi
|
||||
_AC_PTH_VERBOSE([ o run-time check])
|
||||
AC_TRY_RUN(AC_LANG_PROGRAM(_code1, _code2), _ok=`cat conftestval`, _ok=no, _ok=no)
|
||||
if test ".$_ok" != .yes; then
|
||||
if test ".$_ok" = .no; then
|
||||
_AC_PTH_ERROR([dnl
|
||||
Found GNU Pth $_pth_version under $_pth_location, but
|
||||
was unable to perform a sanity execution check. This usually
|
||||
means that the GNU Pth shared library libpth.so is present
|
||||
but \$LD_LIBRARY_PATH is incomplete to execute a Pth test.
|
||||
In this case either disable this test via --without-pth-test,
|
||||
or extend \$LD_LIBRARY_PATH, or build GNU Pth as a static
|
||||
library only via its --disable-shared Autoconf option.
|
||||
We used the following build environment:
|
||||
>> CC="$CC"
|
||||
>> CFLAGS="$CFLAGS"
|
||||
>> LDFLAGS="$LDFLAGS"
|
||||
>> LIBS="$LIBS"
|
||||
See config.log for possibly more details.])
|
||||
else
|
||||
_AC_PTH_ERROR([dnl
|
||||
Found GNU Pth $_pth_version under $_pth_location, but
|
||||
was unable to perform a sanity run-time check. This usually
|
||||
means that the GNU Pth library failed to work and possibly
|
||||
caused a core dump in the test program. In this case it
|
||||
is strongly recommended that you re-install GNU Pth and this
|
||||
time make sure that it really passes its "make test" procedure.
|
||||
We used the following build environment:
|
||||
>> CC="$CC"
|
||||
>> CFLAGS="$CFLAGS"
|
||||
>> LDFLAGS="$LDFLAGS"
|
||||
>> LIBS="$LIBS"
|
||||
See config.log for possibly more details.])
|
||||
fi
|
||||
fi
|
||||
_extendvars="ifelse([$4],,yes,$4)"
|
||||
if test ".$_extendvars" != .yes; then
|
||||
CPPFLAGS="$_ac_save_CPPFLAGS"
|
||||
CFLAGS="$_ac_save_CFLAGS"
|
||||
LDFLAGS="$_ac_save_LDFLAGS"
|
||||
LIBS="$_ac_save_LIBS"
|
||||
fi
|
||||
else
|
||||
_extendvars="ifelse([$4],,yes,$4)"
|
||||
if test ".$_extendvars" = .yes; then
|
||||
if test ".$_pth_subdir" = .yes; then
|
||||
CPPFLAGS="$CPPFLAGS $_pth_cppflags"
|
||||
CFLAGS="$CFLAGS $_pth_cflags"
|
||||
LDFLAGS="$LDFLAGS $_pth_ldflags"
|
||||
LIBS="$LIBS $_pth_libs"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
PTH_CPPFLAGS="$_pth_cppflags"
|
||||
PTH_CFLAGS="$_pth_cflags"
|
||||
PTH_LDFLAGS="$_pth_ldflags"
|
||||
PTH_LIBS="$_pth_libs"
|
||||
AC_SUBST(PTH_CPPFLAGS)
|
||||
AC_SUBST(PTH_CFLAGS)
|
||||
AC_SUBST(PTH_LDFLAGS)
|
||||
AC_SUBST(PTH_LIBS)
|
||||
_AC_PTH_VERBOSE([+ Final Results:])
|
||||
_AC_PTH_VERBOSE([ o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"])
|
||||
_AC_PTH_VERBOSE([ o PTH_CFLAGS=\"$PTH_CFLAGS\"])
|
||||
_AC_PTH_VERBOSE([ o PTH_LDFLAGS=\"$PTH_LDFLAGS\"])
|
||||
_AC_PTH_VERBOSE([ o PTH_LIBS=\"$PTH_LIBS\"])
|
||||
fi
|
||||
fi
|
||||
if test ".$with_pth" != .no; then
|
||||
AC_MSG_RESULT([version $_pth_version, $_pth_type under $_pth_location])
|
||||
ifelse([$5], , :, [$5])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
ifelse([$6], , :, [$6])
|
||||
fi
|
||||
])
|
367
tags/gpgme-1.1.8/missing
Executable file
367
tags/gpgme-1.1.8/missing
Executable file
@ -0,0 +1,367 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
161
tags/gpgme-1.1.8/mkinstalldirs
Executable file
161
tags/gpgme-1.1.8/mkinstalldirs
Executable file
@ -0,0 +1,161 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
|
||||
scriptversion=2006-05-11.19
|
||||
|
||||
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain.
|
||||
#
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
errstatus=0
|
||||
dirmode=
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
|
||||
|
||||
Create each directory DIR (with mode MODE, if specified), including all
|
||||
leading file name components.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-h | --help | --h*) # -h for help
|
||||
echo "$usage"
|
||||
exit $?
|
||||
;;
|
||||
-m) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
|
||||
dirmode=$1
|
||||
shift
|
||||
;;
|
||||
--version)
|
||||
echo "$0 $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
--) # stop option processing
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*) # unknown option
|
||||
echo "$usage" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*) # first non-opt arg
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
|
||||
# mkdir -p a/c at the same time, both will detect that a is missing,
|
||||
# one will create a, then the other will try to create a and die with
|
||||
# a "File exists" error. This is a problem when calling mkinstalldirs
|
||||
# from a parallel make. We use --version in the probe to restrict
|
||||
# ourselves to GNU mkdir, which is thread-safe.
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
test -d ./-p && rmdir ./-p
|
||||
test -d ./--version && rmdir ./--version
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
|
||||
test ! -d ./--version; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
else
|
||||
# Clean up after NextStep and OpenStep mkdir.
|
||||
for d in ./-m ./-p ./--version "./$dirmode";
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for file
|
||||
do
|
||||
case $file in
|
||||
/*) pathcomp=/ ;;
|
||||
*) pathcomp= ;;
|
||||
esac
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set fnord $file
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
for d
|
||||
do
|
||||
test "x$d" = x && continue
|
||||
|
||||
pathcomp=$pathcomp$d
|
||||
case $pathcomp in
|
||||
-*) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
lasterr=
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
5904
tags/gpgme-1.1.8/src/ChangeLog
Normal file
5904
tags/gpgme-1.1.8/src/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
233
tags/gpgme-1.1.8/src/Makefile.am
Normal file
233
tags/gpgme-1.1.8/src/Makefile.am
Normal file
@ -0,0 +1,233 @@
|
||||
# Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
#
|
||||
# GPGME 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.1 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# GPGME 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 program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
# Note: moc_kdpipeiodevice should actually be a dependcy below.
|
||||
EXTRA_DIST = gpgme-config.in gpgme.m4 mkstatus libgpgme.vers \
|
||||
gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp
|
||||
BUILT_SOURCES = status-table.h
|
||||
MOSTLYCLEANFILES = status-table.h
|
||||
bin_SCRIPTS = gpgme-config
|
||||
m4datadir = $(datadir)/aclocal
|
||||
m4data_DATA = gpgme.m4
|
||||
include_HEADERS = gpgme.h
|
||||
|
||||
if HAVE_PTHREAD
|
||||
ltlib_gpgme_pthread = libgpgme-pthread.la
|
||||
else
|
||||
ltlib_gpgme_pthread =
|
||||
endif
|
||||
if HAVE_PTH
|
||||
ltlib_gpgme_pth = libgpgme-pth.la
|
||||
else
|
||||
ltlib_gpgme_pth =
|
||||
endif
|
||||
|
||||
if BUILD_W32_GLIB
|
||||
ltlib_gpgme_glib = libgpgme-glib.la
|
||||
else
|
||||
ltlib_gpgme_glib =
|
||||
endif
|
||||
|
||||
if BUILD_W32_QT
|
||||
ltlib_gpgme_qt = libgpgme-qt.la
|
||||
else
|
||||
ltlib_gpgme_qt =
|
||||
endif
|
||||
|
||||
lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \
|
||||
$(ltlib_gpgme_pthread) $(ltlib_gpgme_pth)
|
||||
|
||||
if HAVE_LD_VERSION_SCRIPT
|
||||
libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
|
||||
else
|
||||
libgpgme_version_script_cmd =
|
||||
endif
|
||||
|
||||
if BUILD_ASSUAN
|
||||
assuan_cppflags = -I$(top_srcdir)/assuan
|
||||
assuan_libobjs = ../assuan/libassuan.la
|
||||
else
|
||||
assuan_cppflags =
|
||||
assuan_libobjs =
|
||||
endif
|
||||
|
||||
if HAVE_DOSISH_SYSTEM
|
||||
system_components = w32-util.c w32-sema.c
|
||||
system_components_not_extra = w32-io.c
|
||||
else
|
||||
system_components = ath.h posix-util.c posix-sema.c posix-io.c
|
||||
system_components_not_extra =
|
||||
endif
|
||||
|
||||
if HAVE_GPGSM
|
||||
gpgsm_components = engine-gpgsm.c
|
||||
else
|
||||
gpgsm_components =
|
||||
endif
|
||||
|
||||
if HAVE_GPGCONF
|
||||
gpgconf_components = engine-gpgconf.c
|
||||
else
|
||||
gpgconf_components =
|
||||
endif
|
||||
|
||||
# These are the source files common to all library versions. We used
|
||||
# to build a non-installed library for that, but that does not work
|
||||
# correctly on all platforms (in particular, one can not specify the
|
||||
# right linking order with libtool, as the non-installed version has
|
||||
# unresolved symbols to the thread module.
|
||||
main_sources = \
|
||||
gpgme.h util.h conversion.c get-env.c context.h ops.h \
|
||||
data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \
|
||||
data-compat.c \
|
||||
signers.c sig-notation.c \
|
||||
wait.c wait-global.c wait-private.c wait-user.c wait.h \
|
||||
op-support.c \
|
||||
encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c \
|
||||
sign.c passphrase.c progress.c \
|
||||
key.c keylist.c trust-item.c trustlist.c \
|
||||
import.c export.c genkey.c delete.c edit.c getauditlog.c \
|
||||
engine.h engine-backend.h engine.c rungpg.c status-table.h \
|
||||
$(gpgsm_components) $(gpgconf_components) gpgconf.c \
|
||||
sema.h priv-io.h $(system_components) \
|
||||
debug.c debug.h gpgme.c version.c error.c
|
||||
|
||||
libgpgme_la_SOURCES = $(main_sources) \
|
||||
ath.h ath.c $(system_components_not_extra)
|
||||
libgpgme_pthread_la_SOURCES = $(main_sources) \
|
||||
ath.h ath-pthread.c $(system_components_not_extra)
|
||||
libgpgme_pth_la_SOURCES = $(main_sources) \
|
||||
ath.h ath-pth.c $(system_components_not_extra)
|
||||
|
||||
if BUILD_W32_GLIB
|
||||
libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
|
||||
endif
|
||||
|
||||
if BUILD_W32_QT
|
||||
libgpgme_qt_la_SOURCES = $(main_sources) ath.h ath.c w32-qt-io.cpp \
|
||||
kdpipeiodevice.h kdpipeiodevice.cpp kdpipeiodevice.moc
|
||||
# FIXME: Add extra depedency: moc_kdpipeiodevice.cpp
|
||||
|
||||
# These are built sources (normally).
|
||||
# moc_kdpipeiodevice.cpp: kdpipeiodevice.h
|
||||
# $(MOC4) -o $@ $<
|
||||
#
|
||||
# kdpipeiodevice.moc: kdpipeiodevice.cpp
|
||||
# $(MOC4) -o $@ $<
|
||||
endif
|
||||
|
||||
# We use a global CFLAGS and CPPFLAGS setting for all library
|
||||
# versions, because then every object file is only compiled once.
|
||||
AM_CPPFLAGS = $(assuan_cppflags) @GPG_ERROR_CFLAGS@ @PTH_CPPFLAGS@ \
|
||||
@QT4_CORE_CFLAGS@
|
||||
AM_CFLAGS = @PTH_CFLAGS@ @GLIB_CFLAGS@ @QT4_CORE_CFLAGS@
|
||||
|
||||
if HAVE_W32_SYSTEM
|
||||
|
||||
# Windows provides us with an endless stream of Tough Love. To spawn
|
||||
# processes with a controlled set of inherited handles, we need a
|
||||
# wrapper process.
|
||||
libexec_PROGRAMS = gpgme-w32spawn
|
||||
|
||||
|
||||
LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
|
||||
`echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
|
||||
sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
|
||||
|
||||
SUFFIXES: .rc .lo
|
||||
|
||||
.rc.lo:
|
||||
$(LTRCCOMPILE) -i $< -o $@
|
||||
|
||||
gpgme_res = versioninfo.lo
|
||||
gpgme_res_ldflag = -Wl,.libs/versioninfo.o
|
||||
|
||||
no_undefined = -no-undefined
|
||||
export_symbols = -export-symbols $(srcdir)/gpgme.def
|
||||
|
||||
install-def-file:
|
||||
$(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
|
||||
|
||||
uninstall-def-file:
|
||||
-rm $(DESTDIR)$(libdir)/gpgme.def
|
||||
|
||||
gpgme_deps = $(gpgme_res) gpgme.def
|
||||
|
||||
else
|
||||
gpgme_res =
|
||||
gpgme_res_ldflag =
|
||||
no_undefined =
|
||||
export_symbols =
|
||||
install-def-file:
|
||||
uninstall-def-file:
|
||||
|
||||
gpgme_deps =
|
||||
endif
|
||||
|
||||
libgpgme_la_LDFLAGS = $(gpgme_res_ldflag) $(no_undefined) $(export_symbols) \
|
||||
$(libgpgme_version_script_cmd) -version-info \
|
||||
@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
|
||||
libgpgme_la_DEPENDENCIES = $(assuan_libobjs) \
|
||||
@LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
|
||||
libgpgme_la_LIBADD = $(assuan_libobjs) @LTLIBOBJS@ \
|
||||
@GPG_ERROR_LIBS@ @NETLIBS@
|
||||
|
||||
libgpgme_pthread_la_LDFLAGS = $(libgpgme_version_script_cmd) -version-info \
|
||||
@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
|
||||
libgpgme_pthread_la_DEPENDENCIES = $(assuan_libobjs) \
|
||||
@LTLIBOBJS@ $(srcdir)/libgpgme.vers
|
||||
libgpgme_pthread_la_LIBADD = $(assuan_libobjs) @LTLIBOBJS@ \
|
||||
-lpthread @GPG_ERROR_LIBS@ @NETLIBS@
|
||||
|
||||
libgpgme_pth_la_LDFLAGS = @PTH_LDFLAGS@ \
|
||||
$(libgpgme_version_script_cmd) -version-info \
|
||||
@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
|
||||
libgpgme_pth_la_DEPENDENCIES = $(assuan_libobjs) \
|
||||
@LTLIBOBJS@ $(srcdir)/libgpgme.vers
|
||||
libgpgme_pth_la_LIBADD = $(assuan_libobjs) @LTLIBOBJS@ \
|
||||
@PTH_LIBS@ @GPG_ERROR_LIBS@ @NETLIBS@
|
||||
|
||||
if BUILD_W32_GLIB
|
||||
libgpgme_glib_la_LDFLAGS = $(gpgme_res_ldflag) $(no_undefined) \
|
||||
$(export_symbols) $(libgpgme_version_script_cmd) -version-info \
|
||||
@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
|
||||
libgpgme_glib_la_DEPENDENCIES = $(assuan_libobjs) \
|
||||
@LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
|
||||
libgpgme_glib_la_LIBADD = $(assuan_libobjs) @LTLIBOBJS@ \
|
||||
@GPG_ERROR_LIBS@ @GLIB_LIBS@ @NETLIBS@
|
||||
endif
|
||||
|
||||
if BUILD_W32_QT
|
||||
libgpgme_qt_la_LDFLAGS = $(gpgme_res_ldflag) $(no_undefined) \
|
||||
$(export_symbols) $(libgpgme_version_script_cmd) -version-info \
|
||||
@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
|
||||
libgpgme_qt_la_DEPENDENCIES = $(assuan_libobjs) \
|
||||
@LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
|
||||
libgpgme_qt_la_LIBADD = $(assuan_libobjs) @LTLIBOBJS@ \
|
||||
@GPG_ERROR_LIBS@ @QT4_CORE_LIBS@ @NETLIBS@
|
||||
endif
|
||||
|
||||
status-table.h : gpgme.h
|
||||
$(srcdir)/mkstatus < $(builddir)/gpgme.h > status-table.h
|
||||
|
||||
install-data-local: install-def-file
|
||||
|
||||
uninstall-local: uninstall-def-file
|
178
tags/gpgme-1.1.8/src/ath-pth.c
Normal file
178
tags/gpgme-1.1.8/src/ath-pth.c
Normal file
@ -0,0 +1,178 @@
|
||||
/* ath-pth.c - Pth module for self-adapting thread-safeness library
|
||||
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <pth.h>
|
||||
|
||||
#include "ath.h"
|
||||
|
||||
|
||||
/* The lock we take while checking for lazy lock initialization. */
|
||||
static pth_mutex_t check_init_lock = PTH_MUTEX_INIT;
|
||||
|
||||
/* Initialize the mutex *PRIV. If JUST_CHECK is true, only do this if
|
||||
it is not already initialized. */
|
||||
static int
|
||||
mutex_pth_init (ath_mutex_t *priv, int just_check)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (just_check)
|
||||
pth_mutex_acquire (&check_init_lock, 0, NULL);
|
||||
if (!*priv || !just_check)
|
||||
{
|
||||
pth_mutex_t *lock = malloc (sizeof (pth_mutex_t));
|
||||
if (!lock)
|
||||
err = ENOMEM;
|
||||
if (!err)
|
||||
{
|
||||
err = pth_mutex_init (lock);
|
||||
if (err == FALSE)
|
||||
err = errno;
|
||||
else
|
||||
err = 0;
|
||||
|
||||
if (err)
|
||||
free (lock);
|
||||
else
|
||||
*priv = (ath_mutex_t) lock;
|
||||
}
|
||||
}
|
||||
if (just_check)
|
||||
pth_mutex_release (&check_init_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ath_init (void)
|
||||
{
|
||||
/* Nothing to do. */
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_init (ath_mutex_t *lock)
|
||||
{
|
||||
return mutex_pth_init (lock, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_destroy (ath_mutex_t *lock)
|
||||
{
|
||||
int err = mutex_pth_init (lock, 1);
|
||||
if (!err)
|
||||
{
|
||||
/* GNU Pth has no destructor function. */
|
||||
free (*lock);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_lock (ath_mutex_t *lock)
|
||||
{
|
||||
int ret = mutex_pth_init (lock, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = pth_mutex_acquire ((pth_mutex_t *) *lock, 0, NULL);
|
||||
return ret == FALSE ? errno : 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_unlock (ath_mutex_t *lock)
|
||||
{
|
||||
int ret = mutex_pth_init (lock, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = pth_mutex_release ((pth_mutex_t *) *lock);
|
||||
return ret == FALSE ? errno : 0;
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_read (int fd, void *buf, size_t nbytes)
|
||||
{
|
||||
return pth_read (fd, buf, nbytes);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_write (int fd, const void *buf, size_t nbytes)
|
||||
{
|
||||
return pth_write (fd, buf, nbytes);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
|
||||
struct timeval *timeout)
|
||||
{
|
||||
return pth_select (nfd, rset, wset, eset, timeout);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_waitpid (pid_t pid, int *status, int options)
|
||||
{
|
||||
return pth_waitpid (pid, status, options);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr)
|
||||
{
|
||||
return pth_accept (s, addr, length_ptr);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_connect (int s, const struct sockaddr *addr, socklen_t length)
|
||||
{
|
||||
return pth_connect (s, addr, length);
|
||||
}
|
||||
|
||||
int
|
||||
ath_sendmsg (int s, const struct msghdr *msg, int flags)
|
||||
{
|
||||
/* FIXME: GNU Pth is missing pth_sendmsg. */
|
||||
return sendmsg (s, msg, flags);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_recvmsg (int s, struct msghdr *msg, int flags)
|
||||
{
|
||||
/* FIXME: GNU Pth is missing pth_recvmsg. */
|
||||
return recvmsg (s, msg, flags);
|
||||
}
|
||||
|
175
tags/gpgme-1.1.8/src/ath-pthread.c
Normal file
175
tags/gpgme-1.1.8/src/ath-pthread.c
Normal file
@ -0,0 +1,175 @@
|
||||
/* ath-pthread.c - pthread module for self-adapting thread-safeness library
|
||||
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "ath.h"
|
||||
|
||||
|
||||
/* The lock we take while checking for lazy lock initialization. */
|
||||
static pthread_mutex_t check_init_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
/* Initialize the mutex *PRIV. If JUST_CHECK is true, only do this if
|
||||
it is not already initialized. */
|
||||
static int
|
||||
mutex_pthread_init (ath_mutex_t *priv, int just_check)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (just_check)
|
||||
pthread_mutex_lock (&check_init_lock);
|
||||
if (!*priv || !just_check)
|
||||
{
|
||||
pthread_mutex_t *lock = malloc (sizeof (pthread_mutex_t));
|
||||
if (!lock)
|
||||
err = ENOMEM;
|
||||
if (!err)
|
||||
{
|
||||
err = pthread_mutex_init (lock, NULL);
|
||||
if (err)
|
||||
free (lock);
|
||||
else
|
||||
*priv = (ath_mutex_t) lock;
|
||||
}
|
||||
}
|
||||
if (just_check)
|
||||
pthread_mutex_unlock (&check_init_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ath_init (void)
|
||||
{
|
||||
/* Nothing to do. */
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_init (ath_mutex_t *lock)
|
||||
{
|
||||
return mutex_pthread_init (lock, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_destroy (ath_mutex_t *lock)
|
||||
{
|
||||
int err = mutex_pthread_init (lock, 1);
|
||||
if (!err)
|
||||
{
|
||||
err = pthread_mutex_destroy ((pthread_mutex_t *) *lock);
|
||||
free (*lock);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_lock (ath_mutex_t *lock)
|
||||
{
|
||||
int ret = mutex_pthread_init (lock, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return pthread_mutex_lock ((pthread_mutex_t *) *lock);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_unlock (ath_mutex_t *lock)
|
||||
{
|
||||
int ret = mutex_pthread_init (lock, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return pthread_mutex_unlock ((pthread_mutex_t *) *lock);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_read (int fd, void *buf, size_t nbytes)
|
||||
{
|
||||
return read (fd, buf, nbytes);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_write (int fd, const void *buf, size_t nbytes)
|
||||
{
|
||||
return write (fd, buf, nbytes);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
|
||||
struct timeval *timeout)
|
||||
{
|
||||
return select (nfd, rset, wset, eset, timeout);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_waitpid (pid_t pid, int *status, int options)
|
||||
{
|
||||
return waitpid (pid, status, options);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr)
|
||||
{
|
||||
return accept (s, addr, length_ptr);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_connect (int s, const struct sockaddr *addr, socklen_t length)
|
||||
{
|
||||
return connect (s, addr, length);
|
||||
}
|
||||
|
||||
int
|
||||
ath_sendmsg (int s, const struct msghdr *msg, int flags)
|
||||
{
|
||||
return sendmsg (s, msg, flags);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_recvmsg (int s, struct msghdr *msg, int flags)
|
||||
{
|
||||
return recvmsg (s, msg, flags);
|
||||
}
|
169
tags/gpgme-1.1.8/src/ath.c
Normal file
169
tags/gpgme-1.1.8/src/ath.c
Normal file
@ -0,0 +1,169 @@
|
||||
/* ath.c - Thread-safeness library.
|
||||
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#include "ath.h"
|
||||
|
||||
|
||||
#define MUTEX_UNLOCKED ((ath_mutex_t) 0)
|
||||
#define MUTEX_LOCKED ((ath_mutex_t) 1)
|
||||
#define MUTEX_DESTROYED ((ath_mutex_t) 2)
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_init (ath_mutex_t *lock)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
*lock = MUTEX_UNLOCKED;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_destroy (ath_mutex_t *lock)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
assert (*lock == MUTEX_UNLOCKED);
|
||||
|
||||
*lock = MUTEX_DESTROYED;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_lock (ath_mutex_t *lock)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
assert (*lock == MUTEX_UNLOCKED);
|
||||
|
||||
*lock = MUTEX_LOCKED;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_mutex_unlock (ath_mutex_t *lock)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
assert (*lock == MUTEX_LOCKED);
|
||||
|
||||
*lock = MUTEX_UNLOCKED;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_read (int fd, void *buf, size_t nbytes)
|
||||
{
|
||||
return read (fd, buf, nbytes);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_write (int fd, const void *buf, size_t nbytes)
|
||||
{
|
||||
return write (fd, buf, nbytes);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
|
||||
struct timeval *timeout)
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return -1; /* Not supported. */
|
||||
#else
|
||||
return select (nfd, rset, wset, eset, timeout);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
ath_waitpid (pid_t pid, int *status, int options)
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return -1; /* Not supported. */
|
||||
#else
|
||||
return waitpid (pid, status, options);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr)
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return -1; /* Not supported. */
|
||||
#else
|
||||
return accept (s, addr, length_ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_connect (int s, const struct sockaddr *addr, socklen_t length)
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return -1; /* Not supported. */
|
||||
#else
|
||||
return connect (s, addr, length);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_sendmsg (int s, const struct msghdr *msg, int flags)
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return -1; /* Not supported. */
|
||||
#else
|
||||
return sendmsg (s, msg, flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ath_recvmsg (int s, struct msghdr *msg, int flags)
|
||||
{
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
return -1; /* Not supported. */
|
||||
#else
|
||||
return recvmsg (s, msg, flags);
|
||||
#endif
|
||||
}
|
89
tags/gpgme-1.1.8/src/ath.h
Normal file
89
tags/gpgme-1.1.8/src/ath.h
Normal file
@ -0,0 +1,89 @@
|
||||
/* ath.h - Interfaces for thread-safeness library.
|
||||
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#ifndef ATH_H
|
||||
#define ATH_H
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
/* fixme: Check how we did it in libgcrypt. */
|
||||
struct msghdr { int dummy; };
|
||||
typedef int socklen_t;
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
|
||||
#else /*!HAVE_W32_SYSTEM*/
|
||||
|
||||
# ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
# else
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
# include <sys/types.h>
|
||||
# include <sys/socket.h>
|
||||
|
||||
#endif /*!HAVE_W32_SYSTEM*/
|
||||
|
||||
|
||||
|
||||
/* Define _ATH_EXT_SYM_PREFIX if you want to give all external symbols
|
||||
a prefix. */
|
||||
#define _ATH_EXT_SYM_PREFIX _gpgme_
|
||||
|
||||
#ifdef _ATH_EXT_SYM_PREFIX
|
||||
#define _ATH_PREFIX1(x,y) x ## y
|
||||
#define _ATH_PREFIX2(x,y) _ATH_PREFIX1(x,y)
|
||||
#define _ATH_PREFIX(x) _ATH_PREFIX2(_ATH_EXT_SYM_PREFIX,x)
|
||||
#define ath_mutex_init _ATH_PREFIX(ath_mutex_init)
|
||||
#define ath_mutex_destroy _ATH_PREFIX(ath_mutex_destroy)
|
||||
#define ath_mutex_lock _ATH_PREFIX(ath_mutex_lock)
|
||||
#define ath_mutex_unlock _ATH_PREFIX(ath_mutex_unlock)
|
||||
#define ath_read _ATH_PREFIX(ath_read)
|
||||
#define ath_write _ATH_PREFIX(ath_write)
|
||||
#define ath_select _ATH_PREFIX(ath_select)
|
||||
#define ath_waitpid _ATH_PREFIX(ath_waitpid)
|
||||
#define ath_connect _ATH_PREFIX(ath_connect)
|
||||
#define ath_accept _ATH_PREFIX(ath_accept)
|
||||
#define ath_sendmsg _ATH_PREFIX(ath_sendmsg)
|
||||
#define ath_recvmsg _ATH_PREFIX(ath_recvmsg)
|
||||
#endif
|
||||
|
||||
|
||||
typedef void *ath_mutex_t;
|
||||
#define ATH_MUTEX_INITIALIZER 0;
|
||||
|
||||
/* Functions for mutual exclusion. */
|
||||
int ath_mutex_init (ath_mutex_t *mutex);
|
||||
int ath_mutex_destroy (ath_mutex_t *mutex);
|
||||
int ath_mutex_lock (ath_mutex_t *mutex);
|
||||
int ath_mutex_unlock (ath_mutex_t *mutex);
|
||||
|
||||
/* Replacement for the POSIX functions, which can be used to allow
|
||||
other (user-level) threads to run. */
|
||||
ssize_t ath_read (int fd, void *buf, size_t nbytes);
|
||||
ssize_t ath_write (int fd, const void *buf, size_t nbytes);
|
||||
ssize_t ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
|
||||
struct timeval *timeout);
|
||||
ssize_t ath_waitpid (pid_t pid, int *status, int options);
|
||||
int ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr);
|
||||
int ath_connect (int s, const struct sockaddr *addr, socklen_t length);
|
||||
int ath_sendmsg (int s, const struct msghdr *msg, int flags);
|
||||
int ath_recvmsg (int s, struct msghdr *msg, int flags);
|
||||
|
||||
#endif /* ATH_H */
|
124
tags/gpgme-1.1.8/src/context.h
Normal file
124
tags/gpgme-1.1.8/src/context.h
Normal file
@ -0,0 +1,124 @@
|
||||
/* context.h - Definitions for a GPGME context.
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#ifndef CONTEXT_H
|
||||
#define CONTEXT_H
|
||||
|
||||
#include "gpgme.h"
|
||||
#include "engine.h"
|
||||
#include "wait.h"
|
||||
#include "sema.h"
|
||||
|
||||
|
||||
/* Operations might require to remember arbitrary information and data
|
||||
objects during invocations of the status handler. The
|
||||
ctx_op_data structure provides a generic framework to hook in
|
||||
such additional data. */
|
||||
typedef enum
|
||||
{
|
||||
OPDATA_DECRYPT, OPDATA_SIGN, OPDATA_ENCRYPT, OPDATA_PASSPHRASE,
|
||||
OPDATA_IMPORT, OPDATA_GENKEY, OPDATA_KEYLIST, OPDATA_EDIT,
|
||||
OPDATA_VERIFY, OPDATA_TRUSTLIST
|
||||
} ctx_op_data_id_t;
|
||||
|
||||
|
||||
struct ctx_op_data
|
||||
{
|
||||
/* The next element in the linked list, or NULL if this is the last
|
||||
element. */
|
||||
struct ctx_op_data *next;
|
||||
|
||||
/* The type of the hook data, which can be used by a routine to
|
||||
lookup the hook data. */
|
||||
ctx_op_data_id_t type;
|
||||
|
||||
/* The function to release HOOK and all its associated resources.
|
||||
Can be NULL if no special dealllocation routine is necessary. */
|
||||
void (*cleanup) (void *hook);
|
||||
|
||||
/* The hook that points to the operation data. */
|
||||
void *hook;
|
||||
};
|
||||
typedef struct ctx_op_data *ctx_op_data_t;
|
||||
|
||||
|
||||
/* The context defines an environment in which crypto operations can
|
||||
be performed (sequentially). */
|
||||
struct gpgme_context
|
||||
{
|
||||
DECLARE_LOCK (lock);
|
||||
|
||||
/* True if the context was canceled asynchronously. */
|
||||
int canceled;
|
||||
|
||||
/* The engine info for this context. */
|
||||
gpgme_engine_info_t engine_info;
|
||||
|
||||
/* The protocol used by this context. */
|
||||
gpgme_protocol_t protocol;
|
||||
|
||||
/* The running engine process. */
|
||||
engine_t engine;
|
||||
|
||||
/* True if armor mode should be used. */
|
||||
unsigned int use_armor : 1;
|
||||
|
||||
/* True if text mode should be used. */
|
||||
unsigned int use_textmode : 1;
|
||||
|
||||
/* Flags for keylist mode. */
|
||||
gpgme_keylist_mode_t keylist_mode;
|
||||
|
||||
/* Number of certs to be included. */
|
||||
unsigned int include_certs;
|
||||
|
||||
/* The number of keys in signers. */
|
||||
unsigned int signers_len;
|
||||
|
||||
/* Size of the following array. */
|
||||
unsigned int signers_size;
|
||||
gpgme_key_t *signers;
|
||||
|
||||
/* The signature notations for this context. */
|
||||
gpgme_sig_notation_t sig_notations;
|
||||
|
||||
/* The locale for the pinentry. */
|
||||
char *lc_ctype;
|
||||
char *lc_messages;
|
||||
|
||||
/* The operation data hooked into the context. */
|
||||
ctx_op_data_t op_data;
|
||||
|
||||
/* The user provided passphrase callback and its hook value. */
|
||||
gpgme_passphrase_cb_t passphrase_cb;
|
||||
void *passphrase_cb_value;
|
||||
|
||||
/* The user provided progress callback and its hook value. */
|
||||
gpgme_progress_cb_t progress_cb;
|
||||
void *progress_cb_value;
|
||||
|
||||
/* A list of file descriptors in active use by the current
|
||||
operation. */
|
||||
struct fd_table fdt;
|
||||
struct gpgme_io_cbs io_cbs;
|
||||
};
|
||||
|
||||
#endif /* CONTEXT_H */
|
420
tags/gpgme-1.1.8/src/conversion.c
Normal file
420
tags/gpgme-1.1.8/src/conversion.c
Normal file
@ -0,0 +1,420 @@
|
||||
/* conversion.c - String conversion helper functions.
|
||||
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
/* Solaris 8 needs sys/types.h before time.h. */
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "gpgme.h"
|
||||
#include "util.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define atoi_1(p) (*(p) - '0' )
|
||||
#define atoi_2(p) ((atoi_1(p) * 10) + atoi_1((p)+1))
|
||||
#define atoi_4(p) ((atoi_2(p) * 100) + atoi_2((p)+2))
|
||||
|
||||
|
||||
|
||||
/* Convert two hexadecimal digits from STR to the value they
|
||||
represent. Returns -1 if one of the characters is not a
|
||||
hexadecimal digit. */
|
||||
int
|
||||
_gpgme_hextobyte (const char *str)
|
||||
{
|
||||
int val = 0;
|
||||
int i;
|
||||
|
||||
#define NROFHEXDIGITS 2
|
||||
for (i = 0; i < NROFHEXDIGITS; i++)
|
||||
{
|
||||
if (*str >= '0' && *str <= '9')
|
||||
val += *str - '0';
|
||||
else if (*str >= 'A' && *str <= 'F')
|
||||
val += 10 + *str - 'A';
|
||||
else if (*str >= 'a' && *str <= 'f')
|
||||
val += 10 + *str - 'a';
|
||||
else
|
||||
return -1;
|
||||
if (i < NROFHEXDIGITS - 1)
|
||||
val *= 16;
|
||||
str++;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
/* Decode the C formatted string SRC and store the result in the
|
||||
buffer *DESTP which is LEN bytes long. If LEN is zero, then a
|
||||
large enough buffer is allocated with malloc and *DESTP is set to
|
||||
the result. Currently, LEN is only used to specify if allocation
|
||||
is desired or not, the caller is expected to make sure that *DESTP
|
||||
is large enough if LEN is not zero. */
|
||||
gpgme_error_t
|
||||
_gpgme_decode_c_string (const char *src, char **destp, size_t len)
|
||||
{
|
||||
char *dest;
|
||||
|
||||
/* Set up the destination buffer. */
|
||||
if (len)
|
||||
{
|
||||
if (len < strlen (src) + 1)
|
||||
return gpg_error (GPG_ERR_INTERNAL);
|
||||
|
||||
dest = *destp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The converted string will never be larger than the original
|
||||
string. */
|
||||
dest = malloc (strlen (src) + 1);
|
||||
if (!dest)
|
||||
return gpg_error_from_errno (errno);
|
||||
|
||||
*destp = dest;
|
||||
}
|
||||
|
||||
/* Convert the string. */
|
||||
while (*src)
|
||||
{
|
||||
if (*src != '\\')
|
||||
{
|
||||
*(dest++) = *(src++);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (src[1])
|
||||
{
|
||||
#define DECODE_ONE(match,result) \
|
||||
case match: \
|
||||
src += 2; \
|
||||
*(dest++) = result; \
|
||||
break;
|
||||
|
||||
DECODE_ONE ('\'', '\'');
|
||||
DECODE_ONE ('\"', '\"');
|
||||
DECODE_ONE ('\?', '\?');
|
||||
DECODE_ONE ('\\', '\\');
|
||||
DECODE_ONE ('a', '\a');
|
||||
DECODE_ONE ('b', '\b');
|
||||
DECODE_ONE ('f', '\f');
|
||||
DECODE_ONE ('n', '\n');
|
||||
DECODE_ONE ('r', '\r');
|
||||
DECODE_ONE ('t', '\t');
|
||||
DECODE_ONE ('v', '\v');
|
||||
|
||||
case 'x':
|
||||
{
|
||||
int val = _gpgme_hextobyte (&src[2]);
|
||||
|
||||
if (val == -1)
|
||||
{
|
||||
/* Should not happen. */
|
||||
*(dest++) = *(src++);
|
||||
*(dest++) = *(src++);
|
||||
if (*src)
|
||||
*(dest++) = *(src++);
|
||||
if (*src)
|
||||
*(dest++) = *(src++);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!val)
|
||||
{
|
||||
/* A binary zero is not representable in a C
|
||||
string. */
|
||||
*(dest++) = '\\';
|
||||
*(dest++) = '0';
|
||||
}
|
||||
else
|
||||
*((unsigned char *) dest++) = val;
|
||||
src += 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
/* Should not happen. */
|
||||
*(dest++) = *(src++);
|
||||
*(dest++) = *(src++);
|
||||
}
|
||||
}
|
||||
}
|
||||
*(dest++) = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Decode the percent escaped string SRC and store the result in the
|
||||
buffer *DESTP which is LEN bytes long. If LEN is zero, then a
|
||||
large enough buffer is allocated with malloc and *DESTP is set to
|
||||
the result. Currently, LEN is only used to specify if allocation
|
||||
is desired or not, the caller is expected to make sure that *DESTP
|
||||
is large enough if LEN is not zero. If BINARY is 1, then '\0'
|
||||
characters are allowed in the output. */
|
||||
gpgme_error_t
|
||||
_gpgme_decode_percent_string (const char *src, char **destp, size_t len,
|
||||
int binary)
|
||||
{
|
||||
char *dest;
|
||||
|
||||
/* Set up the destination buffer. */
|
||||
if (len)
|
||||
{
|
||||
if (len < strlen (src) + 1)
|
||||
return gpg_error (GPG_ERR_INTERNAL);
|
||||
|
||||
dest = *destp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The converted string will never be larger than the original
|
||||
string. */
|
||||
dest = malloc (strlen (src) + 1);
|
||||
if (!dest)
|
||||
return gpg_error_from_errno (errno);
|
||||
|
||||
*destp = dest;
|
||||
}
|
||||
|
||||
/* Convert the string. */
|
||||
while (*src)
|
||||
{
|
||||
if (*src != '%')
|
||||
{
|
||||
*(dest++) = *(src++);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
int val = _gpgme_hextobyte (&src[1]);
|
||||
|
||||
if (val == -1)
|
||||
{
|
||||
/* Should not happen. */
|
||||
*(dest++) = *(src++);
|
||||
if (*src)
|
||||
*(dest++) = *(src++);
|
||||
if (*src)
|
||||
*(dest++) = *(src++);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!val && !binary)
|
||||
{
|
||||
/* A binary zero is not representable in a C
|
||||
string. */
|
||||
*(dest++) = '\\';
|
||||
*(dest++) = '0';
|
||||
}
|
||||
else
|
||||
*((unsigned char *) dest++) = val;
|
||||
src += 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
*(dest++) = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Parse the string TIMESTAMP into a time_t. The string may either be
|
||||
seconds since Epoch or in the ISO 8601 format like
|
||||
"20390815T143012". Returns 0 for an empty string or seconds since
|
||||
Epoch. Leading spaces are skipped. If ENDP is not NULL, it will
|
||||
point to the next non-parsed character in TIMESTRING. */
|
||||
time_t
|
||||
_gpgme_parse_timestamp (const char *timestamp, char **endp)
|
||||
{
|
||||
/* Need to skip leading spaces, because that is what strtoul does
|
||||
but not our ISO 8601 checking code. */
|
||||
while (*timestamp && *timestamp== ' ')
|
||||
timestamp++;
|
||||
if (!*timestamp)
|
||||
return 0;
|
||||
|
||||
if (strlen (timestamp) >= 15 && timestamp[8] == 'T')
|
||||
{
|
||||
struct tm buf;
|
||||
int year;
|
||||
|
||||
year = atoi_4 (timestamp);
|
||||
if (year < 1900)
|
||||
return (time_t)(-1);
|
||||
|
||||
/* Fixme: We would better use a configure test to see whether
|
||||
mktime can handle dates beyond 2038. */
|
||||
if (sizeof (time_t) <= 4 && year >= 2038)
|
||||
return (time_t)2145914603; /* 2037-12-31 23:23:23 */
|
||||
|
||||
memset (&buf, 0, sizeof buf);
|
||||
buf.tm_year = year - 1900;
|
||||
buf.tm_mon = atoi_2 (timestamp+4) - 1;
|
||||
buf.tm_mday = atoi_2 (timestamp+6);
|
||||
buf.tm_hour = atoi_2 (timestamp+9);
|
||||
buf.tm_min = atoi_2 (timestamp+11);
|
||||
buf.tm_sec = atoi_2 (timestamp+13);
|
||||
|
||||
if (endp)
|
||||
*endp = (char*)(timestamp + 15);
|
||||
#ifdef HAVE_TIMEGM
|
||||
return timegm (&buf);
|
||||
#else
|
||||
{
|
||||
time_t tim;
|
||||
|
||||
putenv ("TZ=UTC");
|
||||
tim = mktime (&buf);
|
||||
#ifdef __GNUC__
|
||||
#warning fixme: we must somehow reset TZ here. It is not threadsafe anyway.
|
||||
#endif
|
||||
return tim;
|
||||
}
|
||||
#endif /* !HAVE_TIMEGM */
|
||||
}
|
||||
else
|
||||
return (time_t)strtoul (timestamp, endp, 10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static struct
|
||||
{
|
||||
char *name;
|
||||
gpgme_error_t err;
|
||||
} gnupg_errors[] =
|
||||
{
|
||||
{ "EOF", GPG_ERR_EOF },
|
||||
{ "No_Error", GPG_ERR_NO_ERROR },
|
||||
{ "General_Error", GPG_ERR_GENERAL },
|
||||
{ "Out_Of_Core", GPG_ERR_ENOMEM },
|
||||
{ "Invalid_Value", GPG_ERR_INV_VALUE },
|
||||
{ "IO_Error", GPG_ERR_GENERAL },
|
||||
{ "Resource_Limit", GPG_ERR_RESOURCE_LIMIT },
|
||||
{ "Internal_Error", GPG_ERR_INTERNAL },
|
||||
{ "Bad_Certificate", GPG_ERR_BAD_CERT },
|
||||
{ "Bad_Certificate_Chain", GPG_ERR_BAD_CERT_CHAIN},
|
||||
{ "Missing_Certificate", GPG_ERR_MISSING_CERT },
|
||||
{ "No_Data", GPG_ERR_NO_DATA },
|
||||
{ "Bad_Signature", GPG_ERR_BAD_SIGNATURE },
|
||||
{ "Not_Implemented", GPG_ERR_NOT_IMPLEMENTED },
|
||||
{ "Conflict", GPG_ERR_CONFLICT },
|
||||
{ "Bug", GPG_ERR_BUG },
|
||||
{ "Read_Error", GPG_ERR_GENERAL },
|
||||
{ "Write_Error", GPG_ERR_GENERAL },
|
||||
{ "Invalid_Line", GPG_ERR_GENERAL },
|
||||
{ "Incomplete_Line", GPG_ERR_INCOMPLETE_LINE },
|
||||
{ "Invalid_Response", GPG_ERR_INV_RESPONSE },
|
||||
{ "Agent_Error", GPG_ERR_AGENT },
|
||||
{ "No_Public_Key", GPG_ERR_NO_PUBKEY },
|
||||
{ "No_Secret_Key", GPG_ERR_NO_SECKEY },
|
||||
{ "File_Open_Error", GPG_ERR_GENERAL },
|
||||
{ "File_Create_Error", GPG_ERR_GENERAL },
|
||||
{ "File_Error", GPG_ERR_GENERAL },
|
||||
{ "Not_Supported", GPG_ERR_NOT_SUPPORTED },
|
||||
{ "Invalid_Data", GPG_ERR_INV_DATA },
|
||||
{ "Assuan_Server_Fault", GPG_ERR_ASSUAN_SERVER_FAULT },
|
||||
{ "Assuan_Error", GPG_ERR_ASSUAN },
|
||||
{ "Invalid_Session_Key", GPG_ERR_INV_SESSION_KEY },
|
||||
{ "Invalid_Sexp", GPG_ERR_INV_SEXP },
|
||||
{ "Unsupported_Algorithm", GPG_ERR_UNSUPPORTED_ALGORITHM },
|
||||
{ "No_PIN_Entry", GPG_ERR_NO_PIN_ENTRY },
|
||||
{ "PIN_Entry_Error", GPG_ERR_NO_PIN_ENTRY },
|
||||
{ "Bad_PIN", GPG_ERR_BAD_PIN },
|
||||
{ "Bad_Passphrase", GPG_ERR_BAD_PASSPHRASE },
|
||||
{ "Invalid_Name", GPG_ERR_INV_NAME },
|
||||
{ "Bad_Public_Key", GPG_ERR_BAD_PUBKEY },
|
||||
{ "Bad_Secret_Key", GPG_ERR_BAD_SECKEY },
|
||||
{ "Bad_Data", GPG_ERR_BAD_DATA },
|
||||
{ "Invalid_Parameter", GPG_ERR_INV_PARAMETER },
|
||||
{ "Tribute_to_D_A", GPG_ERR_TRIBUTE_TO_D_A },
|
||||
{ "No_Dirmngr", GPG_ERR_NO_DIRMNGR },
|
||||
{ "Dirmngr_Error", GPG_ERR_DIRMNGR },
|
||||
{ "Certificate_Revoked", GPG_ERR_CERT_REVOKED },
|
||||
{ "No_CRL_Known", GPG_ERR_NO_CRL_KNOWN },
|
||||
{ "CRL_Too_Old", GPG_ERR_CRL_TOO_OLD },
|
||||
{ "Line_Too_Long", GPG_ERR_LINE_TOO_LONG },
|
||||
{ "Not_Trusted", GPG_ERR_NOT_TRUSTED },
|
||||
{ "Canceled", GPG_ERR_CANCELED },
|
||||
{ "Bad_CA_Certificate", GPG_ERR_BAD_CA_CERT },
|
||||
{ "Certificate_Expired", GPG_ERR_CERT_EXPIRED },
|
||||
{ "Certificate_Too_Young", GPG_ERR_CERT_TOO_YOUNG },
|
||||
{ "Unsupported_Certificate", GPG_ERR_UNSUPPORTED_CERT },
|
||||
{ "Unknown_Sexp", GPG_ERR_UNKNOWN_SEXP },
|
||||
{ "Unsupported_Protection", GPG_ERR_UNSUPPORTED_PROTECTION },
|
||||
{ "Corrupted_Protection", GPG_ERR_CORRUPTED_PROTECTION },
|
||||
{ "Ambiguous_Name", GPG_ERR_AMBIGUOUS_NAME },
|
||||
{ "Card_Error", GPG_ERR_CARD },
|
||||
{ "Card_Reset", GPG_ERR_CARD_RESET },
|
||||
{ "Card_Removed", GPG_ERR_CARD_REMOVED },
|
||||
{ "Invalid_Card", GPG_ERR_INV_CARD },
|
||||
{ "Card_Not_Present", GPG_ERR_CARD_NOT_PRESENT },
|
||||
{ "No_PKCS15_App", GPG_ERR_NO_PKCS15_APP },
|
||||
{ "Not_Confirmed", GPG_ERR_NOT_CONFIRMED },
|
||||
{ "Configuration_Error", GPG_ERR_CONFIGURATION },
|
||||
{ "No_Policy_Match", GPG_ERR_NO_POLICY_MATCH },
|
||||
{ "Invalid_Index", GPG_ERR_INV_INDEX },
|
||||
{ "Invalid_Id", GPG_ERR_INV_ID },
|
||||
{ "No_Scdaemon", GPG_ERR_NO_SCDAEMON },
|
||||
{ "Scdaemon_Error", GPG_ERR_SCDAEMON },
|
||||
{ "Unsupported_Protocol", GPG_ERR_UNSUPPORTED_PROTOCOL },
|
||||
{ "Bad_PIN_Method", GPG_ERR_BAD_PIN_METHOD },
|
||||
{ "Card_Not_Initialized", GPG_ERR_CARD_NOT_INITIALIZED },
|
||||
{ "Unsupported_Operation", GPG_ERR_UNSUPPORTED_OPERATION },
|
||||
{ "Wrong_Key_Usage", GPG_ERR_WRONG_KEY_USAGE }
|
||||
};
|
||||
|
||||
|
||||
gpgme_error_t
|
||||
_gpgme_map_gnupg_error (char *errstr)
|
||||
{
|
||||
unsigned int i;
|
||||
gpgme_error_t err = gpg_err_make (GPG_ERR_SOURCE_GPG, GPG_ERR_GENERAL);
|
||||
|
||||
/* Future version of GnuPG might return the error code directly, so
|
||||
we first test for a a numerical value and use that verbatim.
|
||||
Note that this numerical value might be followed by an
|
||||
underschore and the textual representation of the error code. */
|
||||
if (*errstr >= '0' && *errstr <= '9')
|
||||
return strtoul (errstr, NULL, 10);
|
||||
|
||||
/* Well, this is a token, use the mapping table to get the error.
|
||||
The drawback is that we won't receive an error source and have to
|
||||
use GPG as source. */
|
||||
for (i = 0; i < DIM (gnupg_errors); i++)
|
||||
if (!strcmp (gnupg_errors[i].name, errstr))
|
||||
err = gpg_err_make (GPG_ERR_SOURCE_GPG, gnupg_errors[i].err);
|
||||
|
||||
TRACE3 (DEBUG_CTX, "_gpgme_map_gnupg_error", 0,
|
||||
"mapped %s to %s <%s>", errstr, gpgme_strerror (err),
|
||||
gpgme_strsource (err));
|
||||
return err;
|
||||
}
|
242
tags/gpgme-1.1.8/src/data-compat.c
Normal file
242
tags/gpgme-1.1.8/src/data-compat.c
Normal file
@ -0,0 +1,242 @@
|
||||
/* data-compat.c - Compatibility interfaces for data objects.
|
||||
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "data.h"
|
||||
#include "util.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
/* Create a new data buffer filled with LENGTH bytes starting from
|
||||
OFFSET within the file FNAME or stream STREAM (exactly one must be
|
||||
non-zero). */
|
||||
gpgme_error_t
|
||||
gpgme_data_new_from_filepart (gpgme_data_t *r_dh, const char *fname,
|
||||
FILE *stream, off_t offset, size_t length)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
char *buf = NULL;
|
||||
int res;
|
||||
|
||||
TRACE_BEG4 (DEBUG_DATA, "gpgme_data_new_from_filepart", r_dh,
|
||||
"file_name=%s, stream=%p, offset=%lli, length=%u",
|
||||
fname, stream, offset, length);
|
||||
|
||||
if (stream && fname)
|
||||
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
|
||||
|
||||
if (fname)
|
||||
stream = fopen (fname, "rb");
|
||||
if (!stream)
|
||||
return TRACE_ERR (gpg_error_from_errno (errno));
|
||||
|
||||
#ifdef HAVE_FSEEKO
|
||||
res = fseeko (stream, offset, SEEK_SET);
|
||||
#else
|
||||
/* FIXME: Check for overflow, or at least bail at compilation. */
|
||||
res = fseek (stream, offset, SEEK_SET);
|
||||
#endif
|
||||
|
||||
if (res)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
if (fname)
|
||||
fclose (stream);
|
||||
return TRACE_ERR (gpg_error_from_errno (saved_errno));
|
||||
}
|
||||
|
||||
buf = malloc (length);
|
||||
if (!buf)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
if (fname)
|
||||
fclose (stream);
|
||||
return TRACE_ERR (gpg_error_from_errno (saved_errno));
|
||||
}
|
||||
|
||||
while (fread (buf, length, 1, stream) < 1
|
||||
&& ferror (stream) && errno == EINTR);
|
||||
if (ferror (stream))
|
||||
{
|
||||
int saved_errno = errno;
|
||||
if (buf)
|
||||
free (buf);
|
||||
if (fname)
|
||||
fclose (stream);
|
||||
return TRACE_ERR (gpg_error_from_errno (saved_errno));
|
||||
}
|
||||
|
||||
if (fname)
|
||||
fclose (stream);
|
||||
|
||||
err = gpgme_data_new (r_dh);
|
||||
if (err)
|
||||
{
|
||||
if (buf)
|
||||
free (buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
(*r_dh)->data.mem.buffer = buf;
|
||||
(*r_dh)->data.mem.size = length;
|
||||
(*r_dh)->data.mem.length = length;
|
||||
|
||||
return TRACE_SUC1 ("r_dh=%p", *r_dh);
|
||||
}
|
||||
|
||||
|
||||
/* Create a new data buffer filled with the content of file FNAME.
|
||||
COPY must be non-zero (delayed reads are not supported yet). */
|
||||
gpgme_error_t
|
||||
gpgme_data_new_from_file (gpgme_data_t *r_dh, const char *fname, int copy)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
struct stat statbuf;
|
||||
TRACE_BEG3 (DEBUG_DATA, "gpgme_data_new_from_filepart", r_dh,
|
||||
"file_name=%s, copy=%i (%s)", fname, copy, copy ? "yes" : "no");
|
||||
|
||||
if (!fname || !copy)
|
||||
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
|
||||
|
||||
if (stat (fname, &statbuf) < 0)
|
||||
return TRACE_ERR (gpg_error_from_errno (errno));
|
||||
|
||||
err = gpgme_data_new_from_filepart (r_dh, fname, NULL, 0, statbuf.st_size);
|
||||
return TRACE_ERR (err);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
gpgme_error_to_errno (gpgme_error_t err)
|
||||
{
|
||||
int res = gpg_err_code_to_errno (err);
|
||||
|
||||
if (!err)
|
||||
{
|
||||
switch (gpg_err_code (err))
|
||||
{
|
||||
case GPG_ERR_EOF:
|
||||
res = 0;
|
||||
break;
|
||||
case GPG_ERR_INV_VALUE:
|
||||
res = EINVAL;
|
||||
break;
|
||||
case GPG_ERR_NOT_SUPPORTED:
|
||||
res = ENOSYS;
|
||||
break;
|
||||
default:
|
||||
/* FIXME: Yeah, well. */
|
||||
res = EINVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
TRACE3 (DEBUG_DATA, "gpgme:gpgme_error_to_errno", 0,
|
||||
"mapping %s <%s> to: %s", gpgme_strerror (err),
|
||||
gpgme_strsource (err), strerror (res));
|
||||
errno = res;
|
||||
return res ? -1 : 0;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t
|
||||
old_user_read (gpgme_data_t dh, void *buffer, size_t size)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
size_t amt;
|
||||
TRACE_BEG2 (DEBUG_DATA, "gpgme:old_user_read", dh,
|
||||
"buffer=%p, size=%u", buffer, size);
|
||||
|
||||
err = (*dh->data.old_user.cb) (dh->data.old_user.handle,
|
||||
buffer, size, &amt);
|
||||
if (err)
|
||||
return TRACE_SYSRES (gpgme_error_to_errno (err));
|
||||
return TRACE_SYSRES (amt);
|
||||
}
|
||||
|
||||
|
||||
static off_t
|
||||
old_user_seek (gpgme_data_t dh, off_t offset, int whence)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
TRACE_BEG2 (DEBUG_DATA, "gpgme:old_user_seek", dh,
|
||||
"offset=%llu, whence=%i", offset, whence);
|
||||
|
||||
if (whence != SEEK_SET || offset)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return TRACE_SYSRES (-1);
|
||||
}
|
||||
err = (*dh->data.old_user.cb) (dh->data.old_user.handle, NULL, 0, NULL);
|
||||
if (err)
|
||||
return TRACE_SYSRES (gpgme_error_to_errno (err));
|
||||
return TRACE_SYSRES (0);
|
||||
}
|
||||
|
||||
|
||||
static struct _gpgme_data_cbs old_user_cbs =
|
||||
{
|
||||
old_user_read,
|
||||
NULL,
|
||||
old_user_seek,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/* Create a new data buffer which retrieves the data from the callback
|
||||
function READ_CB. */
|
||||
gpgme_error_t
|
||||
gpgme_data_new_with_read_cb (gpgme_data_t *r_dh,
|
||||
int (*read_cb) (void *, char *, size_t, size_t *),
|
||||
void *read_cb_value)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
TRACE_BEG2 (DEBUG_DATA, "gpgme_data_new_with_read_cb", r_dh,
|
||||
"read_cb=%p/%p", read_cb, read_cb_value);
|
||||
|
||||
err = _gpgme_data_new (r_dh, &old_user_cbs);
|
||||
|
||||
if (err)
|
||||
return TRACE_ERR (err);
|
||||
|
||||
(*r_dh)->data.old_user.cb = read_cb;
|
||||
(*r_dh)->data.old_user.handle = read_cb_value;
|
||||
return TRACE_ERR (0);
|
||||
}
|
||||
|
||||
|
||||
gpgme_error_t
|
||||
gpgme_data_rewind (gpgme_data_t dh)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
TRACE_BEG (DEBUG_DATA, "gpgme_data_rewind", dh);
|
||||
|
||||
err = (gpgme_data_seek (dh, 0, SEEK_SET) == -1)
|
||||
? gpg_error_from_errno (errno) : 0;
|
||||
|
||||
return TRACE_ERR (err);
|
||||
}
|
78
tags/gpgme-1.1.8/src/data-fd.c
Normal file
78
tags/gpgme-1.1.8/src/data-fd.c
Normal file
@ -0,0 +1,78 @@
|
||||
/* data-fd.c - A file descripor based data object.
|
||||
Copyright (C) 2002, 2004 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "data.h"
|
||||
|
||||
|
||||
static ssize_t
|
||||
fd_read (gpgme_data_t dh, void *buffer, size_t size)
|
||||
{
|
||||
return read (dh->data.fd, buffer, size);
|
||||
}
|
||||
|
||||
|
||||
static ssize_t
|
||||
fd_write (gpgme_data_t dh, const void *buffer, size_t size)
|
||||
{
|
||||
return write (dh->data.fd, buffer, size);
|
||||
}
|
||||
|
||||
|
||||
static off_t
|
||||
fd_seek (gpgme_data_t dh, off_t offset, int whence)
|
||||
{
|
||||
return lseek (dh->data.fd, offset, whence);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
fd_get_fd (gpgme_data_t dh)
|
||||
{
|
||||
return (dh->data.fd);
|
||||
}
|
||||
|
||||
|
||||
static struct _gpgme_data_cbs fd_cbs =
|
||||
{
|
||||
fd_read,
|
||||
fd_write,
|
||||
fd_seek,
|
||||
NULL,
|
||||
fd_get_fd
|
||||
};
|
||||
|
||||
|
||||
gpgme_error_t
|
||||
gpgme_data_new_from_fd (gpgme_data_t *dh, int fd)
|
||||
{
|
||||
gpgme_error_t err = _gpgme_data_new (dh, &fd_cbs);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
(*dh)->data.fd = fd;
|
||||
return 0;
|
||||
}
|
280
tags/gpgme-1.1.8/src/data-mem.c
Normal file
280
tags/gpgme-1.1.8/src/data-mem.c
Normal file
@ -0,0 +1,280 @@
|
||||
/* data-mem.c - A memory based data object.
|
||||
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "data.h"
|
||||
#include "util.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
static ssize_t
|
||||
mem_read (gpgme_data_t dh, void *buffer, size_t size)
|
||||
{
|
||||
size_t amt = dh->data.mem.length - dh->data.mem.offset;
|
||||
const char *src;
|
||||
|
||||
if (!amt)
|
||||
return 0;
|
||||
|
||||
if (size < amt)
|
||||
amt = size;
|
||||
|
||||
src = dh->data.mem.buffer ? dh->data.mem.buffer : dh->data.mem.orig_buffer;
|
||||
memcpy (buffer, src + dh->data.mem.offset, amt);
|
||||
dh->data.mem.offset += amt;
|
||||
return amt;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t
|
||||
mem_write (gpgme_data_t dh, const void *buffer, size_t size)
|
||||
{
|
||||
size_t unused;
|
||||
|
||||
if (!dh->data.mem.buffer && dh->data.mem.orig_buffer)
|
||||
{
|
||||
size_t new_size = dh->data.mem.size;
|
||||
char *new_buffer;
|
||||
|
||||
if (new_size < dh->data.mem.offset + size)
|
||||
new_size = dh->data.mem.offset + size;
|
||||
|
||||
new_buffer = malloc (new_size);
|
||||
if (!new_buffer)
|
||||
return -1;
|
||||
memcpy (new_buffer, dh->data.mem.orig_buffer, dh->data.mem.length);
|
||||
|
||||
dh->data.mem.buffer = new_buffer;
|
||||
dh->data.mem.size = new_size;
|
||||
}
|
||||
|
||||
unused = dh->data.mem.size - dh->data.mem.offset;
|
||||
if (unused < size)
|
||||
{
|
||||
/* Allocate a large enough buffer with exponential backoff. */
|
||||
#define INITIAL_ALLOC 512
|
||||
size_t new_size = dh->data.mem.size
|
||||
? (2 * dh->data.mem.size) : INITIAL_ALLOC;
|
||||
char *new_buffer;
|
||||
|
||||
if (new_size < dh->data.mem.offset + size)
|
||||
new_size = dh->data.mem.offset + size;
|
||||
|
||||
new_buffer = realloc (dh->data.mem.buffer, new_size);
|
||||
if (!new_buffer && new_size > dh->data.mem.offset + size)
|
||||
{
|
||||
/* Maybe we were too greedy, try again. */
|
||||
new_size = dh->data.mem.offset + size;
|
||||
new_buffer = realloc (dh->data.mem.buffer, new_size);
|
||||
}
|
||||
if (!new_buffer)
|
||||
return -1;
|
||||
dh->data.mem.buffer = new_buffer;
|
||||
dh->data.mem.size = new_size;
|
||||
}
|
||||
|
||||
memcpy (dh->data.mem.buffer + dh->data.mem.offset, buffer, size);
|
||||
dh->data.mem.offset += size;
|
||||
if (dh->data.mem.length < dh->data.mem.offset)
|
||||
dh->data.mem.length = dh->data.mem.offset;
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
static off_t
|
||||
mem_seek (gpgme_data_t dh, off_t offset, int whence)
|
||||
{
|
||||
switch (whence)
|
||||
{
|
||||
case SEEK_SET:
|
||||
if (offset < 0 || offset > dh->data.mem.length)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
dh->data.mem.offset = offset;
|
||||
break;
|
||||
case SEEK_CUR:
|
||||
if ((offset > 0 && dh->data.mem.length - dh->data.mem.offset < offset)
|
||||
|| (offset < 0 && dh->data.mem.offset < -offset))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
dh->data.mem.offset += offset;
|
||||
break;
|
||||
case SEEK_END:
|
||||
if (offset > 0 || -offset > dh->data.mem.length)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
dh->data.mem.offset = dh->data.mem.length - offset;
|
||||
break;
|
||||
default:
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
return dh->data.mem.offset;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mem_release (gpgme_data_t dh)
|
||||
{
|
||||
if (dh->data.mem.buffer)
|
||||
free (dh->data.mem.buffer);
|
||||
}
|
||||
|
||||
|
||||
static struct _gpgme_data_cbs mem_cbs =
|
||||
{
|
||||
mem_read,
|
||||
mem_write,
|
||||
mem_seek,
|
||||
mem_release,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/* Create a new data buffer and return it in R_DH. */
|
||||
gpgme_error_t
|
||||
gpgme_data_new (gpgme_data_t *r_dh)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
TRACE_BEG (DEBUG_DATA, "gpgme_data_new", r_dh);
|
||||
|
||||
err = _gpgme_data_new (r_dh, &mem_cbs);
|
||||
|
||||
if (err)
|
||||
return TRACE_ERR (err);
|
||||
|
||||
return TRACE_SUC1 ("r_dh=%p", *r_dh);
|
||||
}
|
||||
|
||||
|
||||
/* Create a new data buffer filled with SIZE bytes starting from
|
||||
BUFFER. If COPY is zero, copying is delayed until necessary, and
|
||||
the data is taken from the original location when needed. */
|
||||
gpgme_error_t
|
||||
gpgme_data_new_from_mem (gpgme_data_t *r_dh, const char *buffer,
|
||||
size_t size, int copy)
|
||||
{
|
||||
gpgme_error_t err;
|
||||
TRACE_BEG4 (DEBUG_DATA, "gpgme_data_new_from_mem", r_dh,
|
||||
"buffer=%p, size=%u, copy=%i (%s)", buffer, size,
|
||||
copy, copy ? "yes" : "no");
|
||||
|
||||
err = _gpgme_data_new (r_dh, &mem_cbs);
|
||||
if (err)
|
||||
return TRACE_ERR (err);
|
||||
|
||||
if (copy)
|
||||
{
|
||||
char *bufcpy = malloc (size);
|
||||
if (!bufcpy)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
_gpgme_data_release (*r_dh);
|
||||
return TRACE_ERR (gpg_error_from_errno (saved_errno));
|
||||
}
|
||||
memcpy (bufcpy, buffer, size);
|
||||
(*r_dh)->data.mem.buffer = bufcpy;
|
||||
}
|
||||
else
|
||||
(*r_dh)->data.mem.orig_buffer = buffer;
|
||||
|
||||
(*r_dh)->data.mem.size = size;
|
||||
(*r_dh)->data.mem.length = size;
|
||||
return TRACE_SUC1 ("dh=%p", *r_dh);
|
||||
}
|
||||
|
||||
|
||||
/* Destroy the data buffer DH and return a pointer to its content.
|
||||
The memory has be to released with gpgme_free() by the user. It's
|
||||
size is returned in R_LEN. */
|
||||
char *
|
||||
gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len)
|
||||
{
|
||||
char *str = NULL;
|
||||
|
||||
TRACE_BEG1 (DEBUG_DATA, "gpgme_data_release_and_get_mem", dh,
|
||||
"r_len=%p", r_len);
|
||||
|
||||
if (!dh || dh->cbs != &mem_cbs)
|
||||
{
|
||||
gpgme_data_release (dh);
|
||||
TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
str = dh->data.mem.buffer;
|
||||
if (!str && dh->data.mem.orig_buffer)
|
||||
{
|
||||
str = malloc (dh->data.mem.length);
|
||||
if (!str)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
gpgme_data_release (dh);
|
||||
TRACE_ERR (gpg_error_from_errno (saved_errno));
|
||||
return NULL;
|
||||
}
|
||||
memcpy (str, dh->data.mem.orig_buffer, dh->data.mem.length);
|
||||
}
|
||||
else
|
||||
/* Prevent mem_release from releasing the buffer memory. We must
|
||||
not fail from this point. */
|
||||
dh->data.mem.buffer = NULL;
|
||||
|
||||
if (r_len)
|
||||
*r_len = dh->data.mem.length;
|
||||
|
||||
gpgme_data_release (dh);
|
||||
|
||||
if (r_len)
|
||||
{
|
||||
TRACE_SUC2 ("buffer=%p, len=%u", str, *r_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_SUC1 ("buffer=%p", str);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/* Release the memory returned by gpgme_data_release_and_get_mem(). */
|
||||
void
|
||||
gpgme_free (void *buffer)
|
||||
{
|
||||
TRACE (DEBUG_DATA, "gpgme_free", buffer);
|
||||
|
||||
if (buffer)
|
||||
free (buffer);
|
||||
}
|
101
tags/gpgme-1.1.8/src/data-stream.c
Normal file
101
tags/gpgme-1.1.8/src/data-stream.c
Normal file
@ -0,0 +1,101 @@
|
||||
/* data-stream.c - A stream based data object.
|
||||
Copyright (C) 2002, 2004 g10 Code GmbH
|
||||
|
||||
This file is part of GPGME.
|
||||
|
||||
GPGME 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.1 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GPGME 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "data.h"
|
||||
|
||||
|
||||
static ssize_t
|
||||
stream_read (gpgme_data_t dh, void *buffer, size_t size)
|
||||
{
|
||||
size_t amt = fread (buffer, 1, size, dh->data.stream);
|
||||
if (amt > 0)
|
||||
return amt;
|
||||
return ferror (dh->data.stream) ? -1 : 0;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t
|
||||
stream_write (gpgme_data_t dh, const void *buffer, size_t size)
|
||||
{
|
||||
size_t amt = fwrite (buffer, 1, size, dh->data.stream);
|
||||
if (amt > 0)
|
||||
return amt;
|
||||
return ferror (dh->data.stream) ? -1 : 0;
|
||||
}
|
||||
|
||||
|
||||
static off_t
|
||||
stream_seek (gpgme_data_t dh, off_t offset, int whence)
|
||||
{
|
||||
int err;
|
||||
|
||||
#ifdef HAVE_FSEEKO
|
||||
err = fseeko (dh->data.stream, offset, whence);
|
||||
#else
|
||||
/* FIXME: Check for overflow, or at least bail at compilation. */
|
||||
err = fseek (dh->data.stream, offset, whence);
|
||||
#endif
|
||||
|
||||
if (err)
|
||||
return -1;
|
||||
|
||||
#ifdef HAVE_FSEEKO
|
||||
return ftello (dh->data.stream);
|
||||
#else
|
||||
return ftell (dh->data.stream);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
stream_get_fd (gpgme_data_t dh)
|
||||
{
|
||||
fflush (dh->data.stream);
|
||||
return fileno (dh->data.stream);
|
||||
}
|
||||
|
||||
|
||||
static struct _gpgme_data_cbs stream_cbs =
|
||||
{
|
||||
stream_read,
|
||||
stream_write,
|
||||
stream_seek,
|
||||
NULL,
|
||||
stream_get_fd
|
||||
};
|
||||
|
||||
|
||||
gpgme_error_t
|
||||
gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream)
|
||||
{
|
||||
gpgme_error_t err = _gpgme_data_new (dh, &stream_cbs);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
(*dh)->data.stream = stream;
|
||||
return 0;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user