2019-08-26 12:43:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								2019-08-26
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Here are a few rules and tips that should help writing a
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								SANE-conforming backend and including it into the SANE package:
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								GETTING STARTED
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								---------------
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* You will need information about the protocol the scanner (or other image
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  application device) is using. The easiest way is to ask the manufacturer
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  about it. You should mention that the code will be open-source, however.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Read the SANE standard.
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-05 12:14:34 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  See https://sane-project.gitlab.io/standard/
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* One approach is to write a stand-alone scanning program first. Debugging
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  this program is usually easier than using the SANE libraries. However, keep
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  in mind what you learned from the SANE standard.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Once your program works basically, insert its functions into a basically
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  empty SANE backend. You can get one by removing everything but the SANE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  includes and SANE API function definitions from an existing backend (e.g.
							 | 
						
					
						
							
								
									
										
										
										
											2002-04-22 16:54:38 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  test.c).
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2003-02-24 21:16:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* If you have any information about the scanner you want to support that
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  is not already mentioned in one of the .desc files, please contact the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  sane-devel mailing list. Especially if you have written code (e.g. a test
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  program) or started writing a backend, contact us.
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Keep other users informed about what you did and want to do. This way no
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  work is done twice and you may get volunteers for coding or testing.
							 | 
						
					
						
							
								
									
										
										
										
											2005-05-16 13:03:18 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  Set up a website or at least write to sane-devel. If you have a website,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  a link to it can be included in the .desc file and users looking for that
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  scanner will find it on the SANE website.
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* When you have a working backend but you don't want to have it included
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  in the SANE distribution yet, at least the .desc file can be included
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  (see below for details). So people will find a link to your backend at
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  the SANE webpage.
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								CONFIGURATION AND BUILD SYSTEM
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								------------------------------
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Sane-backends uses the autoconf and automake tools. The configure script is
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								generated from configure.ac and aclocal.m4 by running "autoreconf".
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Simple checks (e.g. for headers) should be placed into configure.ac while
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								for more complex stuff acinclude.m4 is the right file. After changes in one
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								of these files, "autoreconf" should be called.  This will then call a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								chain of autotools, such as autoconf to generate configure, autoheader
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								to generate include/sane/config.h.in, and automake to generate various
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-07 11:48:40 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Makefile.in's from Makefile.am's.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								When running configure, the Makefiles in the main and sub-directories are
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								created from their respective Makefile.in files. Also include/sane/config.h
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								which is included into to every c file is created from its .in file.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Running "make" runs the respective targets in the sub directories recursively.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The Makefile.am in each directory contains lists of files which are part of the
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								distribution and which are therefore copied to the tar.gz archive, when a
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								release is made. It's important that newly added files are also added to
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								a variable that will cause them to be distributed (EXTRA_DIST at a minimum).
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								For creating binaries and libraries libtool is used. The ltmain.sh script
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								contains special modifications for SANE. These modifications ensure that
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								the soname of each SANE backend library is "libsane.so". Without this
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								change, backend libraries (like "libsane-epson.so") could not used as
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								on-the-fly replacement for the dll backend.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								DIRECTORY OVERVIEW
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								------------------
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								This chapter explains some details about the files and directories used in the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends distribution.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * acinclude.m4 aclocal.m4 compile config.guess config.sub configure
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    configure.ac depcomp install-sh ltmain.sh Makefile.am Makefile.in missing
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    mkinstalldirs: Part of the build system as explained above.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * ChangeLog:
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-26 12:43:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The ChangeLog contains all the changes made since sane-backends-1.0.28
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    or a stub explaining how to create an up-to-date list of changes.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ChangeLogs for all releases up to and including 1.0.28 can be found in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the ChangeLogs/ directory.  Please note that we skipped 1.0.26.
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * AUTHORS COPYING INSTALL LICENSE:
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    General documentation + license.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * NEWS:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    This is some kind of executive summary of the ChangeLog. It will be created
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    before a release.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * PROBLEMS:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    General (severe) problems that all SANE users should be
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    aware. Backend-specific trouble should normally not mentioned there.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * PROJECTS:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Planned SANE-related development (e.g. ports, frontends). New backends won't
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    be listed here but a new .desc file will be created for them (see below).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * README:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    General building instructions.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * README.aix README.beos (...):
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Platform-dependent building and usage instructions.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/backend/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  This is where the actual backend code is placed. As an example the file
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  structure for a backend named "newbackend" is listed below. Backend names must
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  be unique and should not contain any special characters. Lower case letters,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  numbers and underscores "_" are ok.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  Backend documentation of any kind should not be placed here but in the doc/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  directory. Code which is useful for more than one backend should be placed in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  sanei/ instead.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * newbackend.c:
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The main backend file, usually contains the SANE API code. Mandatory.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * newbackend.h:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Header file, containing includes and so on.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * newbackend.conf.in:
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Configuration file for the backend, newbackend.conf will be created by
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    running "make" from this file. Some variables are substituted, e.g. for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    installation directories. This is especially useful for firmware
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    directories. See Makefile.am for a list.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * newbackend-low.c:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Contains low level code for the "newbackend" backend. Depending on the
							 | 
						
					
						
							
								
									
										
										
										
											2007-09-27 09:30:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    complexity of the backend, splitting it to several files can be appropriate,
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    the total number of files shouldn't exceed approx. 10, however.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  Other files:
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * Makefile.am, Makefile.in:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Makefile.am contains rather complex rules for building the backends. For
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    adding backends, special care should be taken concerning the FIRMWARE_DIRS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (add your backend name here, if your scanner needs firmware files) and
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    other variables (see build system description). There is some
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    documentation inside of Makefile.am on what needs to be added and where.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    At a minimum, a convenience library of form lib${backend}.la and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    a installed library libsane-${backend}.la must be defined.  Any
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    sanei objects referenced should be listed in a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libsane_${backend}_la_LIBADD line.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * sane_strstatus.c:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Contains the code for the sane_strstatus() function to avoid code
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    duplication in every backend.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/doc/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   Documentation for SANE. For some more details, see chapter DOCUMENTATION
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   below. Again an example for "newbackend":
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   * sane-newbackend.man:
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     The manual page of the backend. From this file, "sane-newbackend.5" is
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     generated by running "make".
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   * newbackend/ (directory)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Contains additional information about newbackend, e.g. READMEs or TODO
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     files.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   General files:
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   * Makefile.am:
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     "sane-newbackend.5" must be added to variable BACKEND_5MANS and
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      "sane-newbackend.man" to EXTRA_DIST. A backend documentation directory
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      (if used) must be added to the BEDOCS variable.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   * backend-writing.txt:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     This file.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   * descriptions.txt:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Describes the format of .desc files.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   * doxygen-sanei.conf.in:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Used by doxygen to create the documentation of the sanei code.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   * releases.txt:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Explains how to make releases of sane-backends.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   * descriptions/ (directory)
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     Contains the .desc files for every backend that is included into
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     sane-backends.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   * descriptions-external/ (directory)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Contains the .desc files for backend that are not included into
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     sane-backends yet (external backends). These files should only be created
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     if the code it points to is really a SANE backend (and not just a command
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     line program).
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/frontend/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Contains the frontends scanimage, saned, and tstbackend.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/include/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Header files used by the SANE backends. The main directory contains the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     headers used for general librar functions like getopt, while the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     SANE-specific headers are located in include/sane/:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * config.h.in:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								       Main header file needed for portablility. config.h is created from this
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								       file and must be included by every backend.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * sane.h:
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								       Official SANE API header file. Don't change this without discussion on
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								       the sane-devel mailing list.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * saneopts.h:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								       Defines several option NAMEs, TITLEs and DESCs that are (or should be)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								       used by several backends.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * sanei_*:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								       Sanei (SANE internal) headers. Needed for code used in several backends
							 | 
						
					
						
							
								
									
										
										
										
											2020-08-29 06:46:45 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								       like USB access. For more details, see the documentation on the SANE website.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/japi/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Contains Java interface for SANE. See README.JAVA for details.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/lib/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Contains various library functions that may miss in the standard C library
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     of some platforms.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/po/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Translations of SANEbackend options. See README for details.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/sanei/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Sanei (SANE internal) code. Needed for code used in several backends
							 | 
						
					
						
							
								
									
										
										
										
											2020-08-29 06:46:45 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     like USB access. For more details, see the documentation on the SANE
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								     website.
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/testsuite/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Testsuite for SANE. See README for details.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sane-backends/tools/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     Contains several tools for SANE. There are backend-specific and general command line
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     tools as well as the hotplug support and .desc file generation code. See
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     README for details.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								PROGRAMMING
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								-----------
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2005-09-18 10:53:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* A backend library is always only one file (libsane-backendname.so). Please do
							 | 
						
					
						
							
								
									
										
										
										
											2007-09-27 09:30:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  not use multiple libraries e.g. for lower and higher level code.
							 | 
						
					
						
							
								
									
										
										
										
											2005-09-18 10:53:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2005-12-27 13:24:10 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* To add the backend to the existing SANE code, the following must be done at
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  least:
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    - add the backend name to ALL_BACKENDS in configure.ac (and run autoreconf)
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    - Add new backend to BACKEND_CONFS, be_convenience_libs, be_dlopen_libs,
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      and define _lib${backend}_la_SOURCES and
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      nodist_libsane_${backend}_la_SOURCES; using an existing backend as
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      a template.  Any sanei reference code should be listed in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      libsane_${backend}_la_LIBADD as well as any external libraries
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      required to resolve all symbols.
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    - Add the source code files to the backend/ directories. All file names
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      must start with the backend name (e.g. newbackend.c, newbackend.h and
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      newbackend-usb.c).
							 | 
						
					
						
							
								
									
										
										
										
											2005-12-27 13:24:10 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Please follow the GNU coding standards.  It's clear that the style
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  outlined there is nobody's favorite, but it's much easier to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  maintain SANE if everybody follows more or less the same coding
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  style.  It also looks more professional.  The GNU standards can be
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  found at:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									http://www.gnu.org/prep/standards_toc.html
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									ftp://ftp.gnu.org/pub/gnu/standards/standards.text
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  Note that GNU emacs supports automatic indentation according to this
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  standard.  The command "indent -gnu" can be used to reformat
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  existing sources according to this standard.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please be courteous to programmer's with terminals that are 80
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  characters wide.  It's not difficult to avoid long lines, so please
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  do so.  Note that in standard C you can split long strings into pieces
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  separated by white space.  For example,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  "this is an awfully long string" can be written as "this is an "
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  "awfully long string".
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Use only standard C for your backend.  ISO C99 support will be enabled
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  if supported by the compiler detected by configure.
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please do not depend on compiler specific features or, if you do, make
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  the dependency conditional so other compilers will still be able to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  compile the files.  In particular:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    - do not declare dynamically sized automatic arrays; instead,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      use alloca() after including "../include/lalloca.h".  For example:
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										void
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										func (int n)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										  char buf[n];
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      should be re-written as:
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										#ifdef _AIX
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										# include "../include/lalloca.h" /* MUST come first for AIX! */
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										#include "../include/sane/config.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										#include "../include/lalloca.h"
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										void
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										func (int n)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										  char *buf = alloca (n);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    - Don't use any #pragma directives---they're completely
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      compiler-dependent.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* If you use headers or libraries that may not be available on all systems,
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  write a check for configure.ac and include it conditionally. If your backend
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  depends on these libraries or headers, compile the backend only if they are
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  available (see pint for an example).
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Use #include ".../include/sane/..." to include the sane header files
							 | 
						
					
						
							
								
									
										
										
										
											2000-11-25 17:51:20 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  instead of #include <sane/...>. Otherwise problems with different installed
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  SANE versions may occur. Also this makes clear that the local files are used.
							 | 
						
					
						
							
								
									
										
										
										
											2000-08-12 15:11:46 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2000-11-25 17:51:20 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Don't forget to #include ".../include/sane/config.h" in your backend before
							 | 
						
					
						
							
								
									
										
										
										
											2005-05-16 13:03:18 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  any other includes. This must be done for any .c file that generates its own
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  object file. If you use lalloca.h see above for the correct includes.
							 | 
						
					
						
							
								
									
										
										
										
											2000-08-12 15:11:46 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2000-12-23 16:06:22 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Include sanei_backend.h after the other includes.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* It's no longer necessary to #define PATH_MAX (now in sanei_backend.h).
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  If you define it, do so *after* the system includes.
							 | 
						
					
						
							
								
									
										
										
										
											2000-12-23 16:06:22 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please use sanei functions whenever possible (e.g.
							 | 
						
					
						
							
								
									
										
										
										
											2000-08-12 15:11:46 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  sanei_config_read()). This makes porting to other os/platforms much
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  easier. Most of these functions are documented in their respective
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-30 14:02:58 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  header files in include/sane/sanei_*.h. For most of them there is also
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  documentation in doxygen format: http://www.sane-project.org/sanei/. These
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-24 20:32:38 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  HTML pages can be generated by calling "doxygen sanei-doxygen.conf" in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  the doc/ directory.
							 | 
						
					
						
							
								
									
										
										
										
											2000-08-12 15:11:46 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Initialize global variables explicitly in sane_init. Keep in mind that
							 | 
						
					
						
							
								
									
										
										
										
											2020-08-29 06:46:45 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  sane_init can be called more than once (if sane_exit is called every time
							 | 
						
					
						
							
								
									
										
										
										
											2003-02-24 21:16:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  after sane_init). Therefore don't depend on automatic initialization to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  0 / NULL.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2000-08-12 15:11:46 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Do make sure that your code is byte-order independent.  This is
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  particularly important for networking-related code and when dealing
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  with non-textual data files.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Don't use printf, fprintf or perror to output debug or error messages.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  Use the DBG macro instead. If your backend can't detect a scanner for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  whatever reason it shouldn't output anything as long as
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  SANE_DEBUG_BACKENDNAME isn't set. So don't use DBG(0, ...) in this case.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Please do not assume that `size_t' is `unsigned int'.  On some
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  systems, it's `unsigned long' and the size of this type may be
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  bigger than that of an int (this is true for practically any of the
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  64-bit systems).  To print a variable of type size_t portably, cast
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  the variable to u_long and print it with the %lu specifier.  E.g.:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									size_t len;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									DBG(3, "len=%lu\n", (u_long) len);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2003-02-24 21:16:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please do not assume that `void *' has the same size as `int'.  On some
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  systems, it's `long' and the size of this type may be bigger than that of
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  an int (this is true for practically any of the 64-bit systems). Where this
							 | 
						
					
						
							
								
									
										
										
										
											2003-02-24 21:16:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  comes up is with opaque handles. For example:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  int OpaqueHandle;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  MyScanner *s = (MyScanner *)OpaqueHandle;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  will FAIL on most 64 bit systems. Please use `void *' or better
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  `SANE_Handle'.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Don't use exit() in your backend. You will exit the whole program, not only
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  your backend.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-05-05 22:07:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* If you use wait() or waitpid() in your backend, check its return value. This
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  is important, if the status value is checked for e.g. WIFEXITED after the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  call of wait() or waitpid(). Both functions may fail if the frontend already
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  did a wait for the children.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please try to avoid compilation warnings. At least with "--disable-warnings"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  there shouldn't be warnings when compiling backends. It's not necessary to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  fix every "unused parameter" warning but take care that no warnings pointing
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  to really existing problems or ambiguities are missed. Some programming
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  techniques generating warnings on gcc may lead to errors on other systems.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* To support translation of SANE options, please mark the descriptions (desc)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-31 19:43:15 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  and title of options with SANE_I18N() and add all files using SANE_I18N() to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  po/POTFILES. See po/README for details.
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-10-01 16:19:11 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please check for TL_X < BR_X and TL_Y < BR_Y to avoid segfaults or even
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  scanner damage. This should NOT be done in sane_control_option, it should
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  be possible to temporary set TL_X > BR_X or TL_ > BR, otherwise it is hard
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  for a frontend to set the correct values.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								TESTING
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								-------
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Please test a backend with "scanimage -T" (plus other options,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  as appropriate/necessary) as this will make sure that sane_read()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  always returns the correct amount of data etc.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-04-19 23:16:16 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* You can also test a backend with tstbackend. tstbackend is not
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  compiled nor installed by default. To do that, cd into frontend and
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  run "make tstbackend".
							 | 
						
					
						
							
								
									
										
										
										
											2002-04-19 23:16:16 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please test a backend not just with scanimage and xscanimage
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  (+ other frontends), but also with saned.  Based on past experience,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  it is often the case that remote scanning can uncover subtle bugs.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  Note that you don't  have to use two different machines to test "remote"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  scanning---you can use one and the same machine to test a backend via saned
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  (just be sure to enable the "net" backend in dll.conf and follow the
							 | 
						
					
						
							
								
									
										
										
										
											2004-06-13 15:25:13 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  steps described in saned(8)).
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please test on every available platform/os. Even if no scanner is attached
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  to this system, test compilation and running scanimage. If you don't have
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  access to other platforms, ask sane-devel.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-04-22 16:54:38 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please make sure that all global symbols exported from a SANE backend start
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  with the prefix "sane" or "sanei" to avoid clashes with exported symbols
							 | 
						
					
						
							
								
									
										
										
										
											2006-01-05 17:36:54 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  of other backends. Only symbols mentioned in the SANE standard should start
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  with "sane_*". Make sure, the sanei_* symbols are unique, e.g. by using
							 | 
						
					
						
							
								
									
										
										
										
											2002-04-22 16:54:38 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  sanei_backendname_*.  Only export symbols that are absolutely necessary.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  You can verify this by running GNU "nm" on the static library.  For example:
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									nm -g  backend/.libs/libsane-hp.a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  would list all global symbols in the HP backend.
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  "./configure; make; make libcheck" in the sane-backends root directory
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  will name all backend libraries, that contain "illegal" symbols.
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								DOCUMENTATION
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								-------------
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-03-21 18:43:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Even if you haven't written a man-page for your backend yet, you *must*
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  create a .desc file which describes it. Anytime you submit source code for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  your backend, you should include an update to the .desc file which reflects
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  the new state of the backend. The .desc files are used to create the HTML
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  lists of supported devices. These lists are updated automatically when you
							 | 
						
					
						
							
								
									
										
										
										
											2009-05-05 08:53:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  change a .desc file in git. See e.g.
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  http://www.sane-project.org/lists/sane-mfgs-cvs.html for the results.
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-03-21 18:43:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* The .desc files are located in the directories "doc/descriptions" and
							 | 
						
					
						
							
								
									
										
										
										
											2002-04-22 16:54:38 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  "doc/descriptions-external" (for included and external backends).
							 | 
						
					
						
							
								
									
										
										
										
											1999-08-09 18:06:01 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-06-09 10:03:27 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* "doc/descriptions.txt" describes the format of the ".desc" files. There is
							 | 
						
					
						
							
								
									
										
										
										
											2022-03-27 21:11:56 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  also a template for new .desc files: "template.desc". The format of the
							 | 
						
					
						
							
								
									
										
										
										
											2002-06-09 10:03:27 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  files in the two directories is very similar.  If you'd like to try parsing
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-17 15:17:06 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  your creation to recreate the sane-backends webpages, cd into "tools/" and
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  enter "make sane-desc". You can either use sane-desc directly (try
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  "./sane-desc -h") or use "make html-pages" in "doc/".
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-17 15:17:06 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* For external backends, you don't need to supply :manpage and :version. The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  manpage link won't work anyway and version will be outdated soon.
							 | 
						
					
						
							
								
									
										
										
										
											2002-03-21 18:43:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* When your backend is included in the SANE distribution, add an entry to
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-30 12:58:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  doc/sane.man and AUTHORS. The sane.man entry should point
							 | 
						
					
						
							
								
									
										
										
										
											2002-03-21 18:43:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  to your documentation (man-page, website, readme).  Also move your .desc
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-17 15:17:06 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  file from "doc/descriptions-external" to "doc/descriptions" and update
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  them.
							 | 
						
					
						
							
								
									
										
										
										
											2001-04-13 17:04:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2001-06-10 18:03:49 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* In your manual page (backend.man), use @LIBDIR@ and the other macros for
							 | 
						
					
						
							
								
									
										
										
										
											2002-03-21 18:43:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  path names to the libraries, config files and documentation. Don't use fixed
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  paths as they will be wrong if SANE is installed with a different prefix
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  (e.g. /usr instead of /usr/local).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* If you want to include READMEs, HTML files or other documentation, please
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  create your own directory (doc/backendname) and store your files in this
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  directory. If you only have a manual page a subdirectory isn't necessary.
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-04 16:33:40 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-01-10 17:13:30 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Please keep your manpages and .desc files up-to-date especially regarding
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  version numbers.
							 | 
						
					
						
							
								
									
										
										
										
											2001-04-13 17:04:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-25 00:58:23 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								CHECKLIST: SUBMITTING A NEW BACKEND
							 | 
						
					
						
							
								
									
										
										
										
											2003-02-24 21:16:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								-----------------------------------
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-24 02:30:49 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-26 04:26:21 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								In sane-backends/
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-24 02:30:49 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Add the author(s) name(s) to AUTHORS
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Correct any related entries in the bug-tracking system
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-25 00:58:23 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-26 04:26:21 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								In sane-backends/backend/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Use the command "indent -gnu" to reformat your code according to the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  standard.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Add the backend name to dll.conf
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Check that the SANE license is in the backend source files.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Add the source file names and the .conf file
							 | 
						
					
						
							
								
									
										
										
										
											2009-02-24 02:47:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  to BACKEND_CONFS in Makefile.am
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-26 04:26:21 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								In sane-backends/doc/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Add an entry for the man page in sane.man
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-15 11:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Add the man page file in doc/Makefile.am
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-26 04:26:21 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Move the description file from descriptions-external/ to doc/descriptions/
							 | 
						
					
						
							
								
									
										
										
										
											2005-05-16 13:03:18 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Check that the description file is correct: "cd doc; make html-pages" and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  check the html pages result with a browser.
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-26 04:26:21 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* Check that the backend version is the same in the source and in the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  description file.
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-27 05:27:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-31 19:43:15 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								In sane-backends/po/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* Add all files using SANE_I18N() to po/POTFILES
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-25 00:58:23 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2002-07-24 02:30:49 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-05-05 08:53:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								INCLUDING INTO git
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								------------------
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-04 16:33:40 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-05-05 08:53:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* If you want to include your backend into SANE's git tree use the latest git
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  to make patches. Check the mailing list and the bug-tracking system for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  information about bugs to avoid.
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-04 16:33:40 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-05-05 08:53:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* If your backend isn't included yet in the SANE's git tree, write an email to
							 | 
						
					
						
							
								
									
										
										
										
											2001-05-17 21:41:42 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  the SANE mailing list (sane-devel) and ask for inclusion. Usually one
							 | 
						
					
						
							
								
									
										
										
										
											2003-09-24 14:00:00 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  of the developers will check the backend for common mistakes and test
							 | 
						
					
						
							
								
									
										
										
										
											2009-05-05 08:53:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  compilation. If everything is ok the backend will be added to the git tree.
							 |