kopia lustrzana https://gitlab.com/sane-project/backends
Adding hal FDI output mode, from David Zeuthen <davidz@redhat.com>
rodzic
5b38d6f1d6
commit
17ca143dc2
|
@ -1,3 +1,8 @@
|
||||||
|
2007-03-18 Julien Blache <jb@jblache.org>
|
||||||
|
* tools/hal: New directory.
|
||||||
|
* tools/Makefile.in: Add rules to build hal/10-libsane.fdi.
|
||||||
|
* tools/sane-desc.c: Add output mode 'hal', from David Zeuthen <davidz@redhat.com>.
|
||||||
|
|
||||||
2007-03-17 Oliver Rauch <oliver.rauch@xsane.org>
|
2007-03-17 Oliver Rauch <oliver.rauch@xsane.org>
|
||||||
* Bug #303752: Maybe faulty icc-profile-file length detection:
|
* Bug #303752: Maybe faulty icc-profile-file length detection:
|
||||||
corrected icc profile length calculation
|
corrected icc profile length calculation
|
||||||
|
|
|
@ -54,7 +54,7 @@ DISTCLEAN_FILES = @DISTCLEAN_FILES@
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
|
|
||||||
DESTINATIONS = sane-find-scanner sane-config umax_pp gamma4scanimage sane-desc \
|
DESTINATIONS = sane-find-scanner sane-config umax_pp gamma4scanimage sane-desc \
|
||||||
hotplug/libsane.usermap hotplug-ng/libsane.db udev/libsane.rules
|
hotplug/libsane.usermap hotplug-ng/libsane.db udev/libsane.rules hal/libsane.fdi
|
||||||
|
|
||||||
EXTRA = sane_strstatus.lo ../sanei/sanei_init_debug.lo \
|
EXTRA = sane_strstatus.lo ../sanei/sanei_init_debug.lo \
|
||||||
../sanei/sanei_config.lo ../sanei/sanei_config2.lo \
|
../sanei/sanei_config.lo ../sanei/sanei_config2.lo \
|
||||||
|
@ -68,7 +68,7 @@ DISTFILES = Makefile.in RenSaneDlls.cmd README libtool-get-dll-ext \
|
||||||
mustek600iin-off.c sane-config.in sane-desc.c check-usb-chip.c \
|
mustek600iin-off.c sane-config.in sane-desc.c check-usb-chip.c \
|
||||||
sane-find-scanner.c umax_pp.c xerox gamma4scanimage.c check-po.awk
|
sane-find-scanner.c umax_pp.c xerox gamma4scanimage.c check-po.awk
|
||||||
|
|
||||||
SUBDIRS = hotplug hotplug-ng udev
|
SUBDIRS = hotplug hotplug-ng udev hal
|
||||||
|
|
||||||
.PHONY: all clean depend dist distclean install uninstall
|
.PHONY: all clean depend dist distclean install uninstall
|
||||||
|
|
||||||
|
@ -92,7 +92,8 @@ sane-config: sane-config.in $(top_builddir)/config.status
|
||||||
cd $(top_builddir) \
|
cd $(top_builddir) \
|
||||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||||
|
|
||||||
sane-find-scanner: sane-find-scanner.o check-usb-chip.o ../backend/sane_strstatus.lo \
|
sane-find-scanner: supported_scanners.h external_scanners.h \
|
||||||
|
sane-find-scanner.o check-usb-chip.o ../backend/sane_strstatus.lo \
|
||||||
../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo ../sanei/sanei_init_debug.lo \
|
../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo ../sanei/sanei_init_debug.lo \
|
||||||
../sanei/sanei_config.lo
|
../sanei/sanei_config.lo
|
||||||
@$(LIBTOOL) $(MLINK) $(LINK) sane-find-scanner.o check-usb-chip.o \
|
@$(LIBTOOL) $(MLINK) $(LINK) sane-find-scanner.o check-usb-chip.o \
|
||||||
|
@ -111,6 +112,12 @@ umax_pp: umax_pp.o ../backend/umax_pp_low.o
|
||||||
sane-desc: sane-desc.o
|
sane-desc: sane-desc.o
|
||||||
@$(LIBTOOL) $(MLINK) $(LINK) sane-desc.o $(LIBSANEI) $(LIBLIB)
|
@$(LIBTOOL) $(MLINK) $(LINK) sane-desc.o $(LIBSANEI) $(LIBLIB)
|
||||||
|
|
||||||
|
supported_scanners.h: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) sane-desc
|
||||||
|
./sane-desc -m clist -s ../doc/descriptions > supported_scanners.h
|
||||||
|
|
||||||
|
external_scanners.h: $(wildcard ${top_srcdir}/doc/descriptions-external/*.desc) sane-desc
|
||||||
|
./sane-desc -m clist -s ../doc/descriptions-external | tail -n +8 | sed -e s/supported_usb/external_usb/ > external_scanners.h
|
||||||
|
|
||||||
hotplug/libsane.usermap: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard ${top_srcdir}/doc/descriptions-external/*.desc) sane-desc
|
hotplug/libsane.usermap: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard ${top_srcdir}/doc/descriptions-external/*.desc) sane-desc
|
||||||
@./sane-desc -m usermap -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
|
@./sane-desc -m usermap -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
|
||||||
-d 1 > $@
|
-d 1 > $@
|
||||||
|
@ -123,6 +130,10 @@ udev/libsane.rules: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard
|
||||||
@./sane-desc -m udev -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
|
@./sane-desc -m udev -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
|
||||||
-d 0 > $@
|
-d 0 > $@
|
||||||
|
|
||||||
|
hal/libsane.fdi: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard ${top_srcdir}/doc/descriptions-external/*.desc) sane-desc
|
||||||
|
@./sane-desc -m hal -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
|
||||||
|
-d 0 > $@
|
||||||
|
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
makedepend $(INCLUDES) *.c 2>/dev/null
|
makedepend $(INCLUDES) *.c 2>/dev/null
|
||||||
|
@ -131,6 +142,7 @@ clean:
|
||||||
rm -f *.lo *.o *.la
|
rm -f *.lo *.o *.la
|
||||||
find . -type l -name \*-s.c | xargs rm -f
|
find . -type l -name \*-s.c | xargs rm -f
|
||||||
rm -rf .libs
|
rm -rf .libs
|
||||||
|
rm -f supported_scanners.h external_scanners.h
|
||||||
rm -f hotplug/libsane.usermap hotplug-ng/libsane.db hotplug/libsane.rules
|
rm -f hotplug/libsane.usermap hotplug-ng/libsane.db hotplug/libsane.rules
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|
|
@ -76,7 +76,8 @@ typedef enum output_mode
|
||||||
output_mode_usermap,
|
output_mode_usermap,
|
||||||
output_mode_db,
|
output_mode_db,
|
||||||
output_mode_udev,
|
output_mode_udev,
|
||||||
output_mode_plist
|
output_mode_plist,
|
||||||
|
output_mode_hal
|
||||||
}
|
}
|
||||||
output_mode;
|
output_mode;
|
||||||
|
|
||||||
|
@ -292,7 +293,7 @@ print_usage (char *program_name)
|
||||||
"(multiple directories can be concatenated by \":\")\n");
|
"(multiple directories can be concatenated by \":\")\n");
|
||||||
printf (" -m|--mode mode "
|
printf (" -m|--mode mode "
|
||||||
"Output mode (ascii, html-backends-split, html-mfgs,\n"
|
"Output mode (ascii, html-backends-split, html-mfgs,\n"
|
||||||
" xml, statistics, usermap, db, udev, plist)\n");
|
" xml, statistics, usermap, db, udev, plist, hal)\n");
|
||||||
printf (" -t|--title \"title\" The title used for HTML pages\n");
|
printf (" -t|--title \"title\" The title used for HTML pages\n");
|
||||||
printf (" -i|--intro \"intro\" A short description of the "
|
printf (" -i|--intro \"intro\" A short description of the "
|
||||||
"contents of the page\n");
|
"contents of the page\n");
|
||||||
|
@ -394,6 +395,11 @@ get_options (int argc, char **argv)
|
||||||
DBG_INFO ("Output mode: %s\n", optarg);
|
DBG_INFO ("Output mode: %s\n", optarg);
|
||||||
mode = output_mode_plist;
|
mode = output_mode_plist;
|
||||||
}
|
}
|
||||||
|
else if (strcmp (optarg, "hal") == 0)
|
||||||
|
{
|
||||||
|
DBG_INFO ("Output mode: %s\n", optarg);
|
||||||
|
mode = output_mode_hal;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG_ERR ("Unknown output mode: %s\n", optarg);
|
DBG_ERR ("Unknown output mode: %s\n", optarg);
|
||||||
|
@ -3242,6 +3248,46 @@ print_plist (void)
|
||||||
printf ("</plist>\n");
|
printf ("</plist>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_hal (void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
usbid_type *usbid = create_usbids_table ();
|
||||||
|
printf ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||||||
|
printf ("<deviceinfo version=\"0.2\">\n");
|
||||||
|
printf (" <device>\n");
|
||||||
|
printf (" <match key=\"info.bus\" string=\"usb\">\n");
|
||||||
|
while (usbid)
|
||||||
|
{
|
||||||
|
manufacturer_model_type * name = usbid->name;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
printf (" <!-- ");
|
||||||
|
while (name)
|
||||||
|
{
|
||||||
|
if ((name != usbid->name) && (i > 0))
|
||||||
|
printf (" | ");
|
||||||
|
printf ("%s", name->name);
|
||||||
|
name = name->next;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
printf (" -->\n");
|
||||||
|
printf (" <match key=\"usb.vendor_id\" int=\"%s\">\n", usbid->usb_vendor_id);
|
||||||
|
printf (" <match key=\"usb.product_id\" int=\"%s\">\n", usbid->usb_product_id);
|
||||||
|
printf (" <append key=\"info.capabilities\" type=\"strlist\">scanner</append>\n");
|
||||||
|
printf (" <merge key=\"scanner.access_method\" type=\"string\">proprietary</merge>\n");
|
||||||
|
printf (" </match>\n");
|
||||||
|
printf (" </match>\n");
|
||||||
|
usbid = usbid->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
printf (" </match>\n");
|
||||||
|
printf (" </device>\n");
|
||||||
|
printf ("</deviceinfo>\n");
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -3284,6 +3330,9 @@ main (int argc, char **argv)
|
||||||
case output_mode_plist:
|
case output_mode_plist:
|
||||||
print_plist ();
|
print_plist ();
|
||||||
break;
|
break;
|
||||||
|
case output_mode_hal:
|
||||||
|
print_hal ();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
DBG_ERR ("Unknown output mode\n");
|
DBG_ERR ("Unknown output mode\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Ładowanie…
Reference in New Issue