* apt-pkg/contrib/gpgv.cc:
[ntk/apt.git] / apt-pkg / contrib / gpgv.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 /* ######################################################################
4
5 Helpers to deal with gpgv better and more easily
6
7 ##################################################################### */
8 /*}}}*/
9 #ifndef CONTRIB_GPGV_H
10 #define CONTRIB_GPGV_H
11
12 #include <string>
13
14 #if __GNUC__ >= 4
15 #define APT_noreturn __attribute__ ((noreturn))
16 #else
17 #define APT_noreturn /* no support */
18 #endif
19
20 /** \brief generates and run the command to verify a file with gpgv
21 *
22 * If File and FileSig specify the same file it is assumed that we
23 * deal with a clear-signed message.
24 *
25 * @param File is the message (unsigned or clear-signed)
26 * @param FileSig is the signature (detached or clear-signed)
27 */
28 void ExecGPGV(std::string const &File, std::string const &FileSig,
29 int const &statusfd, int fd[2]) APT_noreturn;
30 inline void ExecGPGV(std::string const &File, std::string const &FileSig,
31 int const &statusfd = -1) {
32 int fd[2];
33 ExecGPGV(File, FileSig, statusfd, fd);
34 };
35
36 #undef APT_noreturn
37
38 #endif