Intented according GNU coding standards.

DEVEL_2_0_BRANCH-1
Henning Geinitz 2002-12-04 20:30:48 +00:00
rodzic 9e0f5f2a58
commit f2cce09238
2 zmienionych plików z 291 dodań i 287 usunięć

Wyświetl plik

@ -19,7 +19,7 @@
* po/Makefile.in: Added autoconf comment, removed MSGCAT variable. * po/Makefile.in: Added autoconf comment, removed MSGCAT variable.
* backend/dll.c doc/sane-dll.man doc/descriptions/dll.desc: Ignore * backend/dll.c doc/sane-dll.man doc/descriptions/dll.desc: Ignore
comments that are in the same line as the backend entries. Minor comments that are in the same line as the backend entries. Minor
manpage fixes. manpage fixes. Intented according GNU coding standards.
2002-12-04 Matthew Duggan <stauff1@users.sourceforge.net> 2002-12-04 Matthew Duggan <stauff1@users.sourceforge.net>
* backend/canon_pp-dev.c: Don't compare firmware version numbers - * backend/canon_pp-dev.c: Don't compare firmware version numbers -

Wyświetl plik

@ -104,7 +104,7 @@
#define DLL_ALIASES_FILE "dll.aliases" #define DLL_ALIASES_FILE "dll.aliases"
enum SANE_Ops enum SANE_Ops
{ {
OP_INIT = 0, OP_INIT = 0,
OP_EXIT, OP_EXIT,
OP_GET_DEVS, OP_GET_DEVS,
@ -119,18 +119,18 @@ enum SANE_Ops
OP_SET_IO_MODE, OP_SET_IO_MODE,
OP_GET_SELECT_FD, OP_GET_SELECT_FD,
NUM_OPS NUM_OPS
}; };
struct backend struct backend
{ {
struct backend *next; struct backend *next;
const char *name; const char *name;
u_int permanent : 1; /* is the backend preloaded? */ u_int permanent:1; /* is the backend preloaded? */
u_int loaded : 1; /* are the functions available? */ u_int loaded:1; /* are the functions available? */
u_int inited : 1; /* has the backend been initialized? */ u_int inited:1; /* has the backend been initialized? */
void *handle; /* handle returned by dlopen() */ void *handle; /* handle returned by dlopen() */
void *(*op[NUM_OPS]) (); void *(*op[NUM_OPS]) ();
}; };
#define BE_ENTRY(be,func) sane_##be##_##func #define BE_ENTRY(be,func) sane_##be##_##func
@ -176,17 +176,17 @@ struct backend
#include "dll-preload.c" #include "dll-preload.c"
struct meta_scanner struct meta_scanner
{ {
struct backend *be; struct backend *be;
SANE_Handle handle; SANE_Handle handle;
}; };
struct alias struct alias
{ {
struct alias *next; struct alias *next;
char *oldname; char *oldname;
char *newname; char *newname;
}; };
/* /*
* List of available devices, allocated by sane_get_devices, released * List of available devices, allocated by sane_get_devices, released
@ -198,8 +198,7 @@ static int devlist_size = 0, devlist_len = 0;
static struct alias *first_alias; static struct alias *first_alias;
static SANE_Auth_Callback auth_callback; static SANE_Auth_Callback auth_callback;
static struct backend *first_backend; static struct backend *first_backend;
static const char *op_name[] = static const char *op_name[] = {
{
"init", "exit", "get_devices", "open", "close", "get_option_descriptor", "init", "exit", "get_devices", "open", "close", "get_option_descriptor",
"control_option", "get_parameters", "start", "read", "cancel", "control_option", "get_parameters", "start", "read", "cancel",
"set_io_mode", "get_select_fd" "set_io_mode", "get_select_fd"
@ -208,7 +207,7 @@ static const char *op_name[] =
static void * static void *
op_unsupported (void) op_unsupported (void)
{ {
DBG(1, "op_unsupported: call to unsupported backend operation\n"); DBG (1, "op_unsupported: call to unsupported backend operation\n");
return (void *) (long) SANE_STATUS_UNSUPPORTED; return (void *) (long) SANE_STATUS_UNSUPPORTED;
} }
@ -218,18 +217,18 @@ add_backend (const char *name, struct backend **bep)
{ {
struct backend *be, *prev; struct backend *be, *prev;
DBG(3, "add_backend: adding backend `%s'\n", name); DBG (3, "add_backend: adding backend `%s'\n", name);
if (strcmp(name,"dll") == 0) if (strcmp (name, "dll") == 0)
{ {
DBG(0, "add_backend: remove the dll-backend from your dll.conf!\n"); DBG (0, "add_backend: remove the dll-backend from your dll.conf!\n");
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
} }
for (prev = 0, be = first_backend; be; prev = be, be = be->next) for (prev = 0, be = first_backend; be; prev = be, be = be->next)
if (strcmp (be->name, name) == 0) if (strcmp (be->name, name) == 0)
{ {
DBG(1, "add_backend: `%s' is already there\n", name); DBG (1, "add_backend: `%s' is already there\n", name);
/* move to front so we preserve order that we'd get with /* move to front so we preserve order that we'd get with
dynamic loading: */ dynamic loading: */
if (prev) if (prev)
@ -260,8 +259,8 @@ add_backend (const char *name, struct backend **bep)
#if defined(HAVE_NSLINKMODULE) #if defined(HAVE_NSLINKMODULE)
static const char *dyld_get_error_str (); static const char *dyld_get_error_str ();
static const char static const char *
*dyld_get_error_str () dyld_get_error_str ()
{ {
NSLinkEditErrors c; NSLinkEditErrors c;
int errorNumber; int errorNumber;
@ -299,8 +298,7 @@ load (struct backend *be)
#elif defined(HAVE_NSLINKMODULE) #elif defined(HAVE_NSLINKMODULE)
# define PREFIX "libsane-" # define PREFIX "libsane-"
# define POSTFIX ".%u.so" # define POSTFIX ".%u.so"
mode = NSLINKMODULE_OPTION_RETURN_ON_ERROR + mode = NSLINKMODULE_OPTION_RETURN_ON_ERROR + NSLINKMODULE_OPTION_PRIVATE;
NSLINKMODULE_OPTION_PRIVATE;
#else #else
# error "Tried to compile unsupported DLL." # error "Tried to compile unsupported DLL."
#endif /* HAVE_DLOPEN */ #endif /* HAVE_DLOPEN */
@ -320,39 +318,39 @@ load (struct backend *be)
if (path) if (path)
{ {
src_len = strlen (path) + strlen (STRINGIFY(LIBDIR)) + 1 + 1; src_len = strlen (path) + strlen (STRINGIFY (LIBDIR)) + 1 + 1;
src = malloc (src_len); src = malloc (src_len);
if (!src) if (!src)
{ {
DBG(1, "load: malloc failed: %s\n", strerror(errno)); DBG (1, "load: malloc failed: %s\n", strerror (errno));
return SANE_STATUS_NO_MEM; return SANE_STATUS_NO_MEM;
} }
orig_src = src; orig_src = src;
snprintf (src, src_len, "%s:%s", path, STRINGIFY(LIBDIR)); snprintf (src, src_len, "%s:%s", path, STRINGIFY (LIBDIR));
} }
else else
{ {
src = STRINGIFY(LIBDIR); src = STRINGIFY (LIBDIR);
src = strdup (src); src = strdup (src);
if (!src) if (!src)
{ {
DBG(1, "load: strdup failed: %s\n", strerror(errno)); DBG (1, "load: strdup failed: %s\n", strerror (errno));
return SANE_STATUS_NO_MEM; return SANE_STATUS_NO_MEM;
} }
} }
DBG(3, "load: searching backend `%s' in `%s'\n", be->name, src); DBG (3, "load: searching backend `%s' in `%s'\n", be->name, src);
dir = strsep (&src, ":"); dir = strsep (&src, ":");
while (dir) while (dir)
{ {
snprintf (libname, sizeof (libname), "%s/"PREFIX"%s"POSTFIX, snprintf (libname, sizeof (libname), "%s/" PREFIX "%s" POSTFIX,
dir, be->name, V_MAJOR); dir, be->name, V_MAJOR);
DBG(4, "load: trying to load `%s'\n", libname); DBG (4, "load: trying to load `%s'\n", libname);
fp = fopen (libname, "r"); fp = fopen (libname, "r");
if (fp) if (fp)
break; break;
DBG(4, "load: couldn't open `%s' (%s)\n", libname, strerror (errno)); DBG (4, "load: couldn't open `%s' (%s)\n", libname, strerror (errno));
dir = strsep (&src, ":"); dir = strsep (&src, ":");
} }
@ -360,17 +358,17 @@ load (struct backend *be)
free (orig_src); free (orig_src);
if (!fp) if (!fp)
{ {
DBG(1, "load: couldn't find backend `%s' (%s)\n", DBG (1, "load: couldn't find backend `%s' (%s)\n",
be->name, strerror (errno)); be->name, strerror (errno));
return SANE_STATUS_INVAL; return SANE_STATUS_INVAL;
} }
fclose (fp); fclose (fp);
DBG(3, "load: dlopen()ing `%s'\n", libname); DBG (3, "load: dlopen()ing `%s'\n", libname);
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
be->handle = dlopen (libname, mode); be->handle = dlopen (libname, mode);
#elif defined(HAVE_SHL_LOAD) #elif defined(HAVE_SHL_LOAD)
be->handle = (shl_t)shl_load (libname, mode, 0L); be->handle = (shl_t) shl_load (libname, mode, 0L);
#elif defined(HAVE_NSLINKMODULE) #elif defined(HAVE_NSLINKMODULE)
{ {
NSObjectFileImage objectfile_img = NULL; NSObjectFileImage objectfile_img = NULL;
@ -387,11 +385,11 @@ load (struct backend *be)
if (!be->handle) if (!be->handle)
{ {
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
DBG(1, "load: dlopen() failed (%s)\n", dlerror()); DBG (1, "load: dlopen() failed (%s)\n", dlerror ());
#elif defined(HAVE_NSLINKMODULE) #elif defined(HAVE_NSLINKMODULE)
DBG(1, "load: dyld error (%s)\n", dyld_get_error_str()); DBG (1, "load: dyld error (%s)\n", dyld_get_error_str ());
#else #else
DBG(1, "load: dlopen() failed (%s)\n", strerror (errno)); DBG (1, "load: dlopen() failed (%s)\n", strerror (errno));
#endif #endif
return SANE_STATUS_INVAL; return SANE_STATUS_INVAL;
} }
@ -408,13 +406,14 @@ load (struct backend *be)
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
op = (void *(*)(void)) dlsym (be->handle, funcname + 1); op = (void *(*)(void)) dlsym (be->handle, funcname + 1);
#elif defined(HAVE_SHL_LOAD) #elif defined(HAVE_SHL_LOAD)
shl_findsym ((shl_t*)&(be->handle), funcname + 1, TYPE_UNDEFINED, &op); shl_findsym ((shl_t *) & (be->handle), funcname + 1, TYPE_UNDEFINED,
&op);
#elif defined(HAVE_NSLINKMODULE) #elif defined(HAVE_NSLINKMODULE)
{ {
NSSymbol *nssym = NSLookupSymbolInModule (be->handle, funcname); NSSymbol *nssym = NSLookupSymbolInModule (be->handle, funcname);
if (!nssym) if (!nssym)
{ {
DBG(15, "dyld error: %s\n", dyld_get_error_str()); DBG (15, "dyld error: %s\n", dyld_get_error_str ());
} }
else else
{ {
@ -438,7 +437,7 @@ load (struct backend *be)
NSSymbol *nssym = NSLookupSymbolInModule (be->handle, funcname); NSSymbol *nssym = NSLookupSymbolInModule (be->handle, funcname);
if (!nssym) if (!nssym)
{ {
DBG(15, "dyld error: %s\n", dyld_get_error_str()); DBG (15, "dyld error: %s\n", dyld_get_error_str ());
} }
else else
{ {
@ -452,7 +451,7 @@ load (struct backend *be)
be->op[i] = op; be->op[i] = op;
} }
if (NULL == op) if (NULL == op)
DBG(1, "load: unable to find %s\n", funcname); DBG (1, "load: unable to find %s\n", funcname);
} }
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
@ -460,7 +459,8 @@ load (struct backend *be)
# undef PREFIX # undef PREFIX
# undef POSTFIX # undef POSTFIX
#else /* HAVE_DLL */ #else /* HAVE_DLL */
DBG(1, "load: ignoring attempt to load `%s'; compiled without dl support\n", DBG (1,
"load: ignoring attempt to load `%s'; compiled without dl support\n",
be->name); be->name);
return SANE_STATUS_UNSUPPORTED; return SANE_STATUS_UNSUPPORTED;
#endif /* HAVE_DLL */ #endif /* HAVE_DLL */
@ -479,7 +479,7 @@ init (struct backend *be)
return status; return status;
} }
DBG(3, "init: initializing backend `%s'\n", be->name); DBG (3, "init: initializing backend `%s'\n", be->name);
status = (long) (*be->op[OP_INIT]) (&version, auth_callback); status = (long) (*be->op[OP_INIT]) (&version, auth_callback);
if (status != SANE_STATUS_GOOD) if (status != SANE_STATUS_GOOD)
@ -487,13 +487,14 @@ init (struct backend *be)
if (SANE_VERSION_MAJOR (version) != V_MAJOR) if (SANE_VERSION_MAJOR (version) != V_MAJOR)
{ {
DBG(1, "init: backend `%s' has a wrong major version (%d instead of %d)\n", DBG (1,
"init: backend `%s' has a wrong major version (%d instead of %d)\n",
be->name, SANE_VERSION_MAJOR (version), V_MAJOR); be->name, SANE_VERSION_MAJOR (version), V_MAJOR);
return SANE_STATUS_INVAL; return SANE_STATUS_INVAL;
} }
DBG(4, "init: backend `%s' is version %d.%d.%d\n", be->name, DBG (4, "init: backend `%s' is version %d.%d.%d\n", be->name,
SANE_VERSION_MAJOR(version), SANE_VERSION_MINOR(version), SANE_VERSION_MAJOR (version), SANE_VERSION_MINOR (version),
SANE_VERSION_BUILD(version)); SANE_VERSION_BUILD (version));
be->inited = 1; be->inited = 1;
@ -505,75 +506,76 @@ static void
add_alias (const char *line_param) add_alias (const char *line_param)
{ {
const char *command; const char *command;
enum { CMD_ALIAS, CMD_HIDE } cmd; enum
{ CMD_ALIAS, CMD_HIDE }
cmd;
const char *oldname, *oldend, *newname; const char *oldname, *oldend, *newname;
size_t oldlen, newlen; size_t oldlen, newlen;
struct alias *alias; struct alias *alias;
char *line; char *line;
command = sanei_config_skip_whitespace(line_param); command = sanei_config_skip_whitespace (line_param);
if( !*command ) if (!*command)
return; return;
line = strchr (command, '#'); line = strchr (command, '#');
if (line) if (line)
*line = '\0'; *line = '\0';
line = strpbrk(command, " \t"); line = strpbrk (command, " \t");
if( !line ) if (!line)
return; return;
*line++ = '\0'; *line++ = '\0';
if( strcmp(command, "alias") == 0 ) if (strcmp (command, "alias") == 0)
cmd = CMD_ALIAS; cmd = CMD_ALIAS;
else else if (strcmp (command, "hide") == 0)
if( strcmp(command, "hide") == 0 )
cmd = CMD_HIDE; cmd = CMD_HIDE;
else else
return; return;
newlen = 0; newlen = 0;
newname = NULL; newname = NULL;
if( cmd == CMD_ALIAS ) if (cmd == CMD_ALIAS)
{ {
char *newend; char *newend;
newname = sanei_config_skip_whitespace(line); newname = sanei_config_skip_whitespace (line);
if( !*newname ) if (!*newname)
return; return;
if( *newname == '\"' ) if (*newname == '\"')
{ {
++newname; ++newname;
newend = strchr(newname, '\"'); newend = strchr (newname, '\"');
} }
else else
newend = strpbrk(newname, " \t"); newend = strpbrk (newname, " \t");
if( !newend ) if (!newend)
return; return;
newlen = newend - newname; newlen = newend - newname;
line = (char*)(newend+1); line = (char *) (newend + 1);
} }
oldname = sanei_config_skip_whitespace(line); oldname = sanei_config_skip_whitespace (line);
if( !*oldname ) if (!*oldname)
return; return;
oldend = oldname + strcspn(oldname, " \t"); oldend = oldname + strcspn (oldname, " \t");
oldlen = oldend - oldname; oldlen = oldend - oldname;
alias = malloc(sizeof(struct alias)); alias = malloc (sizeof (struct alias));
if( alias ) if (alias)
{ {
alias->oldname = malloc(oldlen + newlen + 2); alias->oldname = malloc (oldlen + newlen + 2);
if( alias->oldname ) if (alias->oldname)
{ {
strncpy(alias->oldname, oldname, oldlen); strncpy (alias->oldname, oldname, oldlen);
alias->oldname[oldlen] = '\0'; alias->oldname[oldlen] = '\0';
if( cmd == CMD_ALIAS ) if (cmd == CMD_ALIAS)
{ {
alias->newname = alias->oldname + oldlen + 1; alias->newname = alias->oldname + oldlen + 1;
strncpy(alias->newname, newname, newlen); strncpy (alias->newname, newname, newlen);
alias->newname[newlen] = '\0'; alias->newname[newlen] = '\0';
} }
else else
@ -583,7 +585,7 @@ add_alias (const char *line_param)
first_alias = alias; first_alias = alias;
return; return;
} }
free(alias); free (alias);
} }
return; return;
} }
@ -598,15 +600,15 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
FILE *fp; FILE *fp;
int i; int i;
DBG_INIT(); DBG_INIT ();
auth_callback = authorize; auth_callback = authorize;
DBG(1, "sane_init: SANE dll backend version %s from %s\n", DLL_VERSION, DBG (1, "sane_init: SANE dll backend version %s from %s\n", DLL_VERSION,
PACKAGE_STRING); PACKAGE_STRING);
/* chain preloaded backends together: */ /* chain preloaded backends together: */
for (i = 0; i < NELEMS(preloaded_backends); ++i) for (i = 0; i < NELEMS (preloaded_backends); ++i)
{ {
if (!preloaded_backends[i].name) if (!preloaded_backends[i].name)
continue; continue;
@ -624,14 +626,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
fp = sanei_config_open (DLL_CONFIG_FILE); fp = sanei_config_open (DLL_CONFIG_FILE);
if (!fp) if (!fp)
{ {
DBG(1, "sane_init: Couldn't open config file (%s): %s\n", DBG (1, "sane_init: Couldn't open config file (%s): %s\n",
DLL_CONFIG_FILE, strerror (errno)); DLL_CONFIG_FILE, strerror (errno));
return SANE_STATUS_GOOD; /* don't insist on config file */ return SANE_STATUS_GOOD; /* don't insist on config file */
} }
while (sanei_config_read (config_line, sizeof (config_line), fp)) while (sanei_config_read (config_line, sizeof (config_line), fp))
{ {
char * cp, * comment; char *cp, *comment;
cp = sanei_config_get_string (config_line, &backend_name); cp = sanei_config_get_string (config_line, &backend_name);
/* ignore empty lines */ /* ignore empty lines */
@ -681,7 +683,7 @@ sane_exit (void)
struct backend *be, *next; struct backend *be, *next;
struct alias *alias; struct alias *alias;
DBG(2, "sane_exit: exiting\n"); DBG (2, "sane_exit: exiting\n");
for (be = first_backend; be; be = next) for (be = first_backend; be; be = next)
{ {
@ -690,7 +692,7 @@ sane_exit (void)
{ {
if (be->inited) if (be->inited)
{ {
DBG(3, "sane_exit: calling backend `%s's exit function\n", DBG (3, "sane_exit: calling backend `%s's exit function\n",
be->name); be->name);
(*be->op[OP_EXIT]) (); (*be->op[OP_EXIT]) ();
} }
@ -701,11 +703,10 @@ sane_exit (void)
dlclose (be->handle); dlclose (be->handle);
#elif defined(HAVE_SHL_LOAD) #elif defined(HAVE_SHL_LOAD)
if (be->handle) if (be->handle)
shl_unload(be->handle); shl_unload (be->handle);
#elif defined(HAVE_NSLINKMODULE) #elif defined(HAVE_NSLINKMODULE)
if (be->handle) if (be->handle)
NSUnLinkModule(be->handle, NSUnLinkModule (be->handle, NSUNLINKMODULE_OPTION_NONE
NSUNLINKMODULE_OPTION_NONE
# ifdef __ppc__ # ifdef __ppc__
| NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES | NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES
# endif # endif
@ -729,25 +730,25 @@ sane_exit (void)
} }
first_backend = 0; first_backend = 0;
while( (alias = first_alias) != NULL ) while ((alias = first_alias) != NULL)
{ {
first_alias = first_alias->next; first_alias = first_alias->next;
free(alias->oldname); free (alias->oldname);
free(alias); free (alias);
} }
if (NULL != devlist) if (NULL != devlist)
{ /* Release memory allocated by sane_get_devices(). */ { /* Release memory allocated by sane_get_devices(). */
int i = 0; int i = 0;
while (devlist[i]) while (devlist[i])
free(devlist[i++]); free (devlist[i++]);
free(devlist); free (devlist);
devlist = NULL; devlist = NULL;
devlist_size = 0; devlist_size = 0;
devlist_len = 0; devlist_len = 0;
} }
DBG(3, "sane_exit: finished\n"); DBG (3, "sane_exit: finished\n");
} }
/* Note that a call to get_devices() implies that we'll have to load /* Note that a call to get_devices() implies that we'll have to load
@ -804,29 +805,29 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
char *mem; char *mem;
struct alias *alias; struct alias *alias;
for(alias = first_alias; alias != NULL; alias = alias->next) for (alias = first_alias; alias != NULL; alias = alias->next)
{ {
len = strlen(be->name); len = strlen (be->name);
if( strlen(alias->oldname) <= len ) if (strlen (alias->oldname) <= len)
continue; continue;
if( strncmp(alias->oldname, be->name, len) == 0 if (strncmp (alias->oldname, be->name, len) == 0
&& alias->oldname[len] == ':' && alias->oldname[len] == ':'
&& strcmp(&alias->oldname[len+1], be_list[i]->name) == 0 ) && strcmp (&alias->oldname[len + 1], be_list[i]->name) == 0)
break; break;
} }
if( alias ) if (alias)
{ {
if( !alias->newname ) /* hidden device */ if (!alias->newname) /* hidden device */
continue; continue;
len = strlen(alias->newname); len = strlen (alias->newname);
mem = malloc(sizeof(*dev) + len + 1); mem = malloc (sizeof (*dev) + len + 1);
if( !mem ) if (!mem)
return SANE_STATUS_NO_MEM; return SANE_STATUS_NO_MEM;
full_name = mem + sizeof(*dev); full_name = mem + sizeof (*dev);
strcpy(full_name, alias->newname); strcpy (full_name, alias->newname);
} }
else else
{ {
@ -872,11 +873,11 @@ sane_open (SANE_String_Const full_name, SANE_Handle * meta_handle)
SANE_Status status; SANE_Status status;
struct alias *alias; struct alias *alias;
for( alias = first_alias; alias != NULL; alias = alias->next ) for (alias = first_alias; alias != NULL; alias = alias->next)
{ {
if( !alias->newname ) if (!alias->newname)
continue; continue;
if( strcmp(alias->newname, full_name) == 0 ) if (strcmp (alias->newname, full_name) == 0)
{ {
full_name = alias->oldname; full_name = alias->oldname;
break; break;
@ -948,7 +949,7 @@ sane_close (SANE_Handle handle)
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_close(handle=%p)\n", handle); DBG (3, "sane_close(handle=%p)\n", handle);
(*s->be->op[OP_CLOSE]) (s->handle); (*s->be->op[OP_CLOSE]) (s->handle);
free (s); free (s);
} }
@ -958,7 +959,8 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_get_option_descriptor(handle=%p,option=%d)\n", handle, option); DBG (3, "sane_get_option_descriptor(handle=%p,option=%d)\n", handle,
option);
return (*s->be->op[OP_GET_OPTION_DESC]) (s->handle, option); return (*s->be->op[OP_GET_OPTION_DESC]) (s->handle, option);
} }
@ -968,10 +970,11 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_control_option(handle=%p,option=%d,action=%d,value=%p,info=%p)\n", DBG (3,
"sane_control_option(handle=%p,option=%d,action=%d,value=%p,info=%p)\n",
handle, option, action, value, info); handle, option, action, value, info);
return (long) (*s->be->op[OP_CTL_OPTION]) (s->handle, option, action, return (long) (*s->be->op[OP_CTL_OPTION]) (s->handle, option, action, value,
value, info); info);
} }
SANE_Status SANE_Status
@ -979,7 +982,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params)
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_get_parameters(handle=%p,params=%p)\n", handle, params); DBG (3, "sane_get_parameters(handle=%p,params=%p)\n", handle, params);
return (long) (*s->be->op[OP_GET_PARAMS]) (s->handle, params); return (long) (*s->be->op[OP_GET_PARAMS]) (s->handle, params);
} }
@ -988,7 +991,7 @@ sane_start (SANE_Handle handle)
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_start(handle=%p)\n", handle); DBG (3, "sane_start(handle=%p)\n", handle);
return (long) (*s->be->op[OP_START]) (s->handle); return (long) (*s->be->op[OP_START]) (s->handle);
} }
@ -998,7 +1001,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length,
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_read(handle=%p,data=%p,maxlen=%d,lenp=%p)\n", DBG (3, "sane_read(handle=%p,data=%p,maxlen=%d,lenp=%p)\n",
handle, data, max_length, length); handle, data, max_length, length);
return (long) (*s->be->op[OP_READ]) (s->handle, data, max_length, length); return (long) (*s->be->op[OP_READ]) (s->handle, data, max_length, length);
} }
@ -1008,7 +1011,7 @@ sane_cancel (SANE_Handle handle)
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_cancel(handle=%p)\n", handle); DBG (3, "sane_cancel(handle=%p)\n", handle);
(*s->be->op[OP_CANCEL]) (s->handle); (*s->be->op[OP_CANCEL]) (s->handle);
} }
@ -1017,7 +1020,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_set_io_mode(handle=%p,nonblocking=%d)\n", handle, non_blocking); DBG (3, "sane_set_io_mode(handle=%p,nonblocking=%d)\n", handle,
non_blocking);
return (long) (*s->be->op[OP_SET_IO_MODE]) (s->handle, non_blocking); return (long) (*s->be->op[OP_SET_IO_MODE]) (s->handle, non_blocking);
} }
@ -1026,6 +1030,6 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{ {
struct meta_scanner *s = handle; struct meta_scanner *s = handle;
DBG(3, "sane_get_select_fd(handle=%p,fdp=%p)\n", handle, fd); DBG (3, "sane_get_select_fd(handle=%p,fdp=%p)\n", handle, fd);
return (long) (*s->be->op[OP_GET_SELECT_FD]) (s->handle, fd); return (long) (*s->be->op[OP_GET_SELECT_FD]) (s->handle, fd);
} }