Merci Antalgeek pour ta recherche, j’étais déjà tombé sur ces pages mais vu mon niveau sous Linux, je n’ai pas tout compris. J’ai téléchargé le premier ficher, c’est une archive gz dans laquelle il y a un fichier mais je ne sais pas quoi en faire…
On dirait un fichier résultant d’un comparaison entre deux fichiers, il ya des paragraphes du type :
diff -Nuar sane-backends-1.0.7-beta2/backend/Makefile.in sane-backends-1.0.7-beta2.mod/backend/Makefile.in
— sane-backends-1.0.7-beta2/backend/Makefile.in Mon Jan 21 15:24:35 2002
+++ sane-backends-1.0.7-beta2.mod/backend/Makefile.in Fri Feb 15 17:13:46 2002
et des paragraphes de code :
une présentation :
+/*
- © 2001,2002 Nathan Rutman nathan@gordian.com 10/17/01
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details
…etc
et du code :
+#include <errno.h>
+#include <fcntl.h> /* open /
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h> / usleep /
+#include <time.h>
+#include <linux/usb.h> / for USB_ defs /
+#include “lm9830.h”
+
+
+/ Assign status and verify a good return code */
+#define CHK(A) {if( (status = A) != SANE_STATUS_GOOD ) { \
+typedef SANE_Byte byte;
+
+
+/*****************************************************
+/* Register codes for the bridge. These are NOT the registers for the
- scanner chip on the other side of the bridge. */
+typedef enum
+{
- GL640_BULK_SETUP = 0x82,
- GL640_EPP_ADDR = 0x83,
- GL640_EPP_DATA_READ = 0x84,
- GL640_EPP_DATA_WRITE = 0x85,
- GL640_SPP_STATUS = 0x86,
- GL640_SPP_CONTROL = 0x87,
- GL640_SPP_DATA = 0x88,
- GL640_GPIO_OE = 0x89,
- GL640_GPIO_READ = 0x8a,
- GL640_GPIO_WRITE = 0x8b
+}
+GL640_Request;
-
+/* Write to the usb-parallel port bridge. */
+static SANE_Status
+gl640WriteControl (int fd, GL640_Request req, byte * data, unsigned int size)
+{
- SANE_Status status;
- status = sanei_usb_control_msg (fd,
-
/* rqttype */ USB_TYPE_VENDOR |
-
USB_RECIP_DEVICE | USB_DIR_OUT /*0x40? */ ,
-
/* rqt */ (size > 1) ? 0x04 : 0x0C,
-
/* val */ (SANE_Int) req,
-
/* ind */ 0,
-
/* len */ size,
-
/* dat */ data);
- if (status != SANE_STATUS_GOOD)
- DBG (1, “gl640WriteControl error\n”);
- return status;
+}
-
…etc
voili, voila, j’en fais quoi de cette chose ??