1 diff -ur sane-1.0.1/ChangeLog sane-1.0.1-pere/ChangeLog
2 --- sane-1.0.1/ChangeLog Mon Apr 19 18:21:33 1999
3 +++ sane-1.0.1-pere/ChangeLog Wed Apr 28 00:43:22 1999
5 +1999-04-28 Petter Reinholdtsen <pere@td.org.uit.no>
7 + * doc/sane.tex frontend/scanimage.c frontend/xcam.c
8 + frontend/xscanimage.c: Specified valid return values for
9 + sane_init(), and made sure all our frontends checks for the
10 + correct return value before using other methods in the backend.
12 1999-04-19 David Mosberger-Tang <David.Mosberger@acm.org>
14 * Version 1.0.1 released.
15 diff -ur sane-1.0.1/doc/sane.tex sane-1.0.1-pere/doc/sane.tex
16 --- sane-1.0.1/doc/sane.tex Sat Apr 3 23:16:07 1999
17 +++ sane-1.0.1-pere/doc/sane.tex Wed Apr 28 00:17:31 1999
18 @@ -1052,9 +1052,11 @@
20 This function must be called before any other SANE function can be
21 called. The behavior of a SANE backend is undefined if this function
22 -is not called first. The version code of the backend is returned in
23 -the value pointed to by \code{version\_code}. If that pointer is
24 -\code{NULL}, no version code is returned.
25 +is not called first. The behavior of a backend is also undefined if
26 +this function returns anything other then \code{SANE\_STATUS\_GOOD}.
27 +The version code of the backend is returned in the value pointed to by
28 +\code{version\_code}. If that pointer is \code{NULL}, no version code
30 Argument \code{authorize} is either a pointer to a function that is
31 invoked when the backend requires authentication for a specific
32 resource or \code{NULL} if the frontend does not support
33 @@ -1064,6 +1066,16 @@
34 SANE_Status sane_init (SANE_Int * version_code,
35 SANE_Authorization_Callback authorize);
39 +This function may fail with one of the following status codes.
42 +\item[\code{SANE\_STATUS\_UNSUPPORTED}:] The backend is not supported on
43 + this machines current configuration.
44 +\item[\code{SANE\_STATUS\_NO\_MEM}:] An insufficent amount of memory
45 + is available to complete. Try later when more memory is available.
49 The authorization function may be called by a backend in response to
50 diff -ur sane-1.0.1/frontend/scanimage.c sane-1.0.1-pere/frontend/scanimage.c
51 --- sane-1.0.1/frontend/scanimage.c Fri Mar 5 07:13:49 1999
52 +++ sane-1.0.1-pere/frontend/scanimage.c Wed Apr 28 00:28:44 1999
54 static SANE_Handle device;
59 static const char * prog_name;
60 static SANE_Option_Descriptor window_option[2];
61 @@ -1041,6 +1042,29 @@
68 + const SANE_Device ** device_list;
72 + status = sane_get_devices (&device_list, SANE_FALSE);
73 + if (status != SANE_STATUS_GOOD)
75 + fprintf (stderr, "%s: sane_get_devices() failed: %s\n",
76 + prog_name, sane_strstatus (status));
80 + for (i = 0; device_list[i]; ++i)
82 + printf ("device `%s' is a %s %s %s\n",
83 + device_list[i]->name, device_list[i]->vendor,
84 + device_list[i]->model, device_list[i]->type);
89 main (int argc, char **argv)
97 /* make a first pass through the options with error printing and argument
98 permutation disabled: */
100 @@ -1079,27 +1101,7 @@
101 case 'h': help = 1; break;
102 case 'v': ++verbose; break;
103 case 'T': test= 1; break;
108 - status = sane_get_devices (&device_list, SANE_FALSE);
109 - if (status != SANE_STATUS_GOOD)
111 - fprintf (stderr, "%s: sane_get_devices() failed: %s\n",
112 - prog_name, sane_strstatus (status));
116 - for (i = 0; device_list[i]; ++i)
118 - printf ("device `%s' is a %s %s %s\n",
119 - device_list[i]->name, device_list[i]->vendor,
120 - device_list[i]->model, device_list[i]->type);
125 + case 'L': list = 1; break;
127 printf ("scanimage (%s) %s\n", PACKAGE, VERSION);
129 @@ -1122,6 +1124,18 @@
130 -v, --verbose give even more status messages\n\
131 -V, --version print version information\n",
134 + if (SANE_STATUS_GOOD != sane_init (NULL, NULL))
136 + fprintf(stderr,"sane_init() failed. Unable to do anything. Exiting\n");
148 diff -ur sane-1.0.1/frontend/xcam.c sane-1.0.1-pere/frontend/xcam.c
149 --- sane-1.0.1/frontend/xcam.c Sat Apr 4 06:39:20 1998
150 +++ sane-1.0.1-pere/frontend/xcam.c Tue Apr 27 23:54:56 1999
152 /* turn on by default as we don't support graphical geometry selection */
153 preferences.advanced = 1;
155 - sane_init (NULL, 0);
156 + if (SANE_STATUS_GOOD != sane_init (NULL, NULL))
158 + fprintf(stderr,"sane_init() failed. Unable to do anything. Exiting\n");
162 gdk_set_show_events (0);
163 gtk_init (&argc, &argv);
164 diff -ur sane-1.0.1/frontend/xscanimage.c sane-1.0.1-pere/frontend/xscanimage.c
165 --- sane-1.0.1/frontend/xscanimage.c Sat Apr 3 06:07:57 1999
166 +++ sane-1.0.1-pere/frontend/xscanimage.c Tue Apr 27 23:56:42 1999
172 + if (SANE_STATUS_GOOD != sane_init (NULL, NULL))
174 + fprintf(stderr,"sane_init() failed. Unable to do anything. Exiting\n");
178 sane_get_devices (&devlist, SANE_FALSE);
180 for (i = 0; devlist[i]; ++i)