Include "t-support.h".

This commit is contained in:
Marcus Brinkmann 2003-09-14 01:05:06 +00:00
parent 0291c00091
commit 38a0357afb
3 changed files with 5 additions and 59 deletions

View File

@ -25,40 +25,7 @@
#include <gpgme.h> #include <gpgme.h>
#include "t-support.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 char *
make_filename (const char *fname)
{
const char *srcdir = getenv ("srcdir");
char *buf;
if (!srcdir)
srcdir = ".";
buf = malloc (strlen(srcdir) + strlen(fname) + 2);
if (!buf)
{
fprintf (stderr, "%s:%d: could not allocate string: %s\n",
__FILE__, __LINE__, strerror (errno));
exit (1);
}
strcpy (buf, srcdir);
strcat (buf, "/");
strcat (buf, fname);
return buf;
}
void void

View File

@ -24,20 +24,9 @@
#include <gpgme.h> #include <gpgme.h>
#include "t-support.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)
struct struct
{ {
char *fpr; char *fpr;
@ -73,6 +62,7 @@ keys[] =
{ NULL } { NULL }
}; };
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {

View File

@ -24,18 +24,7 @@
#include <gpgme.h> #include <gpgme.h>
#include "t-support.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 const char test_text1[] = "Hallo Leute!\n"; static const char test_text1[] = "Hallo Leute!\n";