Reformat of source code to get rid of different coding styles used by different

authors over the years.
merge-requests/1/head
Karl Heinz Kremer 2004-02-08 18:32:33 +00:00
rodzic db44edb31c
commit 5a3f789018
7 zmienionych plików z 4702 dodań i 4513 usunięć

Wyświetl plik

@ -1,3 +1,7 @@
2004-02-08 Karl Heinz Kremer <khk@khk.net>
* backend/epson*.[ch]: Reformat source code to get rid of different coding styles
used over the years (and by different authors).
2004-02-08 Frank Zago <fzago at austin dot rr dot com>
* README.windows: added info about USB scanners.

Plik diff jest za duży Load Diff

Wyświetl plik

@ -80,7 +80,8 @@
#define SANE_EPSON_MAX_RETRIES (120) /* how often do we retry during warmup ? */
typedef struct {
typedef struct
{
char *level;
unsigned char request_identity;
@ -121,60 +122,22 @@ typedef struct {
} EpsonCmdRec, *EpsonCmd;
enum
{ OPT_NUM_OPTS = 0
, OPT_MODE_GROUP
, OPT_MODE
, OPT_BIT_DEPTH
, OPT_HALFTONE
, OPT_DROPOUT
, OPT_BRIGHTNESS
, OPT_SHARPNESS
, OPT_GAMMA_CORRECTION
, OPT_COLOR_CORRECTION
, OPT_RESOLUTION
, OPT_THRESHOLD
, OPT_ADVANCED_GROUP
, OPT_MIRROR
, OPT_SPEED
, OPT_AAS
, OPT_LIMIT_RESOLUTION
, OPT_ZOOM
/* , OPT_GAMMA_VECTOR */
, OPT_GAMMA_VECTOR_R
, OPT_GAMMA_VECTOR_G
, OPT_GAMMA_VECTOR_B
, OPT_WAIT_FOR_BUTTON
, OPT_CCT_GROUP
, OPT_CCT_1
, OPT_CCT_2
, OPT_CCT_3
, OPT_CCT_4
, OPT_CCT_5
, OPT_CCT_6
, OPT_CCT_7
, OPT_CCT_8
, OPT_CCT_9
, OPT_PREVIEW_GROUP
, OPT_PREVIEW
, OPT_PREVIEW_SPEED
, OPT_GEOMETRY_GROUP
, OPT_TL_X
, OPT_TL_Y
, OPT_BR_X
, OPT_BR_Y
, OPT_QUICK_FORMAT
, OPT_EQU_GROUP
, OPT_SOURCE
, OPT_AUTO_EJECT
, OPT_FILM_TYPE
, OPT_FOCUS
, OPT_BAY
, OPT_EJECT
, OPT_ADF_MODE
, NUM_OPTIONS
{ OPT_NUM_OPTS =
0, OPT_MODE_GROUP, OPT_MODE, OPT_BIT_DEPTH, OPT_HALFTONE, OPT_DROPOUT,
OPT_BRIGHTNESS, OPT_SHARPNESS, OPT_GAMMA_CORRECTION, OPT_COLOR_CORRECTION,
OPT_RESOLUTION, OPT_THRESHOLD, OPT_ADVANCED_GROUP, OPT_MIRROR, OPT_SPEED,
OPT_AAS, OPT_LIMIT_RESOLUTION, OPT_ZOOM, /* OPT_GAMMA_VECTOR */
OPT_GAMMA_VECTOR_R, OPT_GAMMA_VECTOR_G, OPT_GAMMA_VECTOR_B,
OPT_WAIT_FOR_BUTTON, OPT_CCT_GROUP, OPT_CCT_1, OPT_CCT_2, OPT_CCT_3,
OPT_CCT_4, OPT_CCT_5, OPT_CCT_6, OPT_CCT_7, OPT_CCT_8, OPT_CCT_9,
OPT_PREVIEW_GROUP, OPT_PREVIEW, OPT_PREVIEW_SPEED, OPT_GEOMETRY_GROUP,
OPT_TL_X, OPT_TL_Y, OPT_BR_X, OPT_BR_Y, OPT_QUICK_FORMAT, OPT_EQU_GROUP,
OPT_SOURCE, OPT_AUTO_EJECT, OPT_FILM_TYPE, OPT_FOCUS, OPT_BAY,
OPT_EJECT, OPT_ADF_MODE, NUM_OPTIONS
};
typedef enum { /* hardware connection to the scanner */
typedef enum
{ /* hardware connection to the scanner */
SANE_EPSON_NODEV, /* default, no HW specified yet */
SANE_EPSON_SCSI, /* SCSI interface */
SANE_EPSON_PIO, /* parallel interface */
@ -207,7 +170,8 @@ typedef struct
} Epson_Identity2;
struct Epson_Device {
struct Epson_Device
{
struct Epson_Device *next;
SANE_Device sane;
SANE_Int level;
@ -266,7 +230,8 @@ typedef struct Epson_Device Epson_Device;
struct Epson_Scanner {
struct Epson_Scanner
{
struct Epson_Scanner *next;
int fd;
Epson_Device *hw;

Wyświetl plik

@ -68,7 +68,8 @@ sanei_epson_scsi_inquiry(int fd, int page_code, void * buf, size_t * buf_size)
*
*/
int
sanei_epson_scsi_read(int fd, void * buf, size_t buf_size, SANE_Status * status)
sanei_epson_scsi_read (int fd, void *buf, size_t buf_size,
SANE_Status * status)
{
u_char cmd[6];
@ -78,7 +79,8 @@ sanei_epson_scsi_read(int fd, void * buf, size_t buf_size, SANE_Status * status)
cmd[3] = buf_size >> 8;
cmd[4] = buf_size;
if( SANE_STATUS_GOOD == ( *status = sanei_scsi_cmd( fd, cmd, sizeof( cmd), buf, &buf_size)))
if (SANE_STATUS_GOOD ==
(*status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, &buf_size)))
return buf_size;
return 0;
@ -89,7 +91,8 @@ sanei_epson_scsi_read(int fd, void * buf, size_t buf_size, SANE_Status * status)
*
*/
int
sanei_epson_scsi_write(int fd, const void * buf, size_t buf_size, SANE_Status * status)
sanei_epson_scsi_write (int fd, const void *buf, size_t buf_size,
SANE_Status * status)
{
u_char *cmd;
@ -101,9 +104,9 @@ sanei_epson_scsi_write(int fd, const void * buf, size_t buf_size, SANE_Status *
cmd[4] = buf_size;
memcpy (cmd + 8, buf, buf_size);
if( SANE_STATUS_GOOD == ( *status = sanei_scsi_cmd2( fd, cmd, 6, cmd + 8, buf_size, NULL, NULL)))
if (SANE_STATUS_GOOD ==
(*status = sanei_scsi_cmd2 (fd, cmd, 6, cmd + 8, buf_size, NULL, NULL)))
return buf_size;
return 0;
}

Wyświetl plik

@ -12,9 +12,13 @@
#define INQUIRY_BUF_SIZE (36)
SANE_Status sanei_epson_scsi_sense_handler(int scsi_fd, u_char *result, void *arg);
SANE_Status sanei_epson_scsi_inquiry(int fd, int page_code, void * buf, size_t * buf_size);
int sanei_epson_scsi_read(int fd, void * buf, size_t buf_size, SANE_Status * status);
int sanei_epson_scsi_write(int fd, const void * buf, size_t buf_size, SANE_Status * status);
SANE_Status sanei_epson_scsi_sense_handler (int scsi_fd, u_char * result,
void *arg);
SANE_Status sanei_epson_scsi_inquiry (int fd, int page_code, void *buf,
size_t * buf_size);
int sanei_epson_scsi_read (int fd, void *buf, size_t buf_size,
SANE_Status * status);
int sanei_epson_scsi_write (int fd, const void *buf, size_t buf_size,
SANE_Status * status);
#endif

Wyświetl plik

@ -3,8 +3,7 @@
#include "epson_usb.h"
SANE_Word sanei_epson_usb_product_ids [] =
{
SANE_Word sanei_epson_usb_product_ids[] = {
0x101, /* Perfection 636 */
0x103, /* Perfection 610 */
0x10c, /* Perfection 640 */
@ -30,7 +29,8 @@ SANE_Word sanei_epson_usb_product_ids [] =
int sanei_epson_getNumberOfUSBProductIds(void)
int
sanei_epson_getNumberOfUSBProductIds (void)
{
return sizeof (sanei_epson_usb_product_ids) / sizeof (SANE_Word);
}