Skip to content
Snippets Groups Projects
Commit 81c383d2 authored by Benedikt Meurer's avatar Benedikt Meurer
Browse files

Header files are now only included if found by configure.

(Old svn revision: 675)
parent 714701e8
No related branches found
No related tags found
No related merge requests found
......@@ -28,11 +28,18 @@
#include <config.h>
#endif /* !HAVE_CONFIG_H */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/wait.h>
#include <errno.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "filter.h"
......
......@@ -28,8 +28,12 @@
#include <config.h>
#endif /* !HAVE_CONFIG_H */
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <glib.h>
......
/*
*/
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include "filter.h"
gchar *args[] = {
"cat",
NULL
};
int
main(int argc, char **argv)
{
XfceFilterList *list;
XfceFilter *f;
int in, out;
int r;
if (argc != 3) {
printf("Usage: in out\n");
return(1);
}
if ((in = open(argv[1], O_RDONLY)) < 0)
err(1, "open()");
if ((out = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY)) < 0)
err(1, "open()");
list = xfce_filterlist_new();
f = xfce_filter_new("cat", args);
xfce_filterlist_append(list, f);
if ((r = xfce_filterlist_execute(list, in, out)) <0)
perror("xfce_filterlist_execute()");
else
printf("exit code: %d\n", r);
}
......@@ -33,7 +33,9 @@
#endif
#include <errno.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <glib.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment