File: t-load.patch

package info (click to toggle)
imlib 1.9.14-17.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,136 kB
  • ctags: 1,092
  • sloc: ansic: 49,353; sh: 7,392; makefile: 200; python: 5
file content (107 lines) | stat: -rw-r--r-- 2,707 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Index: Imlib/Makefile.am
===================================================================
RCS file: /home/steve/lib/cvs/debian/imlib/Imlib/Makefile.am,v
retrieving revision 1.1.1.4
diff -u -b -B -r1.1.1.4 Makefile.am
--- Imlib/Makefile.am	22 Mar 2002 14:43:04 -0000	1.1.1.4
+++ Imlib/Makefile.am	7 Jul 2002 16:12:56 -0000
@@ -39,3 +38,8 @@
 	-DSYSCONFDIR=\"$(sysconfdir)\"
 
 INCLUDES = -I. -I$(srcdir) -I.. -I$(srcdir)/.. $(X_CFLAGS)
+
+
+noinst_PROGRAMS = t-load
+
+t_load_LDADD = libImlib.la
Index: Imlib/t-load.c
===================================================================
RCS file: Imlib/t-load.c
diff -N Imlib/t-load.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Imlib/t-load.c	25 Mar 2002 03:58:42 -0000	1.1
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#include "Imlib.h"
+
+
+int
+main( int ac, char* av[] )
+{
+    Display *disp;
+    ImlibData *id;
+    XSetWindowAttributes attr;
+    Window win;
+    ImlibImage *img;
+    Pixmap p,m;
+    int w,h;
+     
+    /* Be nice and tell the user if they don't, to provide a file as an arg */
+    if (ac != 2) {
+	fprintf( stderr, "usage: %s filename\n", av[0] );
+	return 33;
+    }
+
+    /* Connect to the default Xserver */
+    disp = XOpenDisplay(NULL);
+
+    /* Immediately afterwards Intitialise Imlib */
+    id = Imlib_init(disp);
+
+    /* Load the image specified as the first argument */
+    img = Imlib_load_image(id,av[1]);
+
+
+    if ( img == NULL ) {
+	fprintf( stderr, "failed to load file '%s'.\n", av[1] );
+	return 1;
+    }
+
+    return 0;
+}
Index: gdk_imlib/Makefile.am
===================================================================
RCS file: /home/steve/lib/cvs/debian/imlib/gdk_imlib/Makefile.am,v
retrieving revision 1.1.1.4
retrieving revision 1.5
diff -u -b -B -r1.1.1.4 -r1.5
--- gdk_imlib/Makefile.am	25 Mar 2002 16:45:24 -0000	1.1.1.4
+++ gdk_imlib/Makefile.am	7 Jul 2002 00:59:29 -0000	1.5
@@ -82,1 +88,7 @@
 
+# These programs are built only to check that the plugin
+# libs have correct library information.
+
+check_PROGRAMS = t-load
+
+t_load_LDADD = libgdk_imlib.la
Index: gdk_imlib/t-load.c
===================================================================
RCS file: gdk_imlib/t-load.c
diff -N gdk_imlib/t-load.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gdk_imlib/t-load.c	25 Mar 2002 03:58:42 -0000	1.2
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include "gdk_imlib.h"
+
+
+int
+main( int ac, char* av[] )
+{
+    GdkImlibImage* img;
+
+    if (ac != 2) {
+	fprintf( stderr, "usage: %s filename\n", av[0] );
+	return 33;
+    }
+
+    img = gdk_imlib_load_image( av[1] );
+
+    if ( img == NULL ) {
+	fprintf( stderr, "failed to load file '%s'.\n", av[1] );
+	return 1;
+    }
+
+    return 0;
+}