kopia lustrzana https://gitlab.com/sane-project/backends
Added support for OS/2 (from Franz Bakan <fbakan@gmx.net>).
rodzic
57b2b2f62c
commit
04dd7d101f
|
@ -1,3 +1,7 @@
|
||||||
|
2003-04-10 Henning Meier-Geinitz <henning@meier-geinitz.de>
|
||||||
|
|
||||||
|
* backend/test.c backend/test.h doc/descriptions/test.desc: Added
|
||||||
|
support for OS/2 (from Franz Bakan <fbakan@gmx.net>).
|
||||||
|
|
||||||
2003-04-05 Nathan Rutman <nthn1@yahoo.com>
|
2003-04-05 Nathan Rutman <nthn1@yahoo.com>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* sane - Scanner Access Now Easy.
|
/* sane - Scanner Access Now Easy.
|
||||||
Copyright (C) 2002 Henning Meier-Geinitz <henning@meier-geinitz.de>
|
Copyright (C) 2002, 2003 Henning Meier-Geinitz <henning@meier-geinitz.de>
|
||||||
This file is part of the SANE package.
|
This file is part of the SANE package.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
This backend is for testing frontends.
|
This backend is for testing frontends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BUILD 20
|
#define BUILD 21
|
||||||
|
|
||||||
#include "../include/sane/config.h"
|
#include "../include/sane/config.h"
|
||||||
|
|
||||||
|
@ -60,6 +60,9 @@
|
||||||
#include "../include/sane/sanei.h"
|
#include "../include/sane/sanei.h"
|
||||||
#include "../include/sane/saneopts.h"
|
#include "../include/sane/saneopts.h"
|
||||||
#include "../include/sane/sanei_config.h"
|
#include "../include/sane/sanei_config.h"
|
||||||
|
#ifdef HAVE_OS2_H
|
||||||
|
#include "../include/sane/sanei_thread.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BACKEND_NAME test
|
#define BACKEND_NAME test
|
||||||
#include "../include/sane/sanei_backend.h"
|
#include "../include/sane/sanei_backend.h"
|
||||||
|
@ -1202,6 +1205,21 @@ read_option (SANE_String line, SANE_String option_string,
|
||||||
return SANE_STATUS_GOOD;
|
return SANE_STATUS_GOOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_OS2_H
|
||||||
|
/*
|
||||||
|
* reader thread for OS/2: need a wrapper, because threads can have
|
||||||
|
* only one parameter.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
os2_reader_process (void *data)
|
||||||
|
{
|
||||||
|
struct Test_Device *test_device = (struct Test_Device *) data;
|
||||||
|
|
||||||
|
DBG (1, "reader_process thread started\n");
|
||||||
|
reader_process (test_device, test_device->reader_fds);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static SANE_Status
|
static SANE_Status
|
||||||
reader_process (Test_Device * test_device, SANE_Int fd)
|
reader_process (Test_Device * test_device, SANE_Int fd)
|
||||||
{
|
{
|
||||||
|
@ -2437,7 +2455,13 @@ sane_start (SANE_Handle handle)
|
||||||
return SANE_STATUS_IO_ERROR;
|
return SANE_STATUS_IO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_OS2_H
|
||||||
test_device->reader_pid = fork ();
|
test_device->reader_pid = fork ();
|
||||||
|
#else
|
||||||
|
/* create reader routine as new process or thread */
|
||||||
|
test_device->reader_fds = pipe_descriptor[1];
|
||||||
|
test_device->reader_pid = sanei_thread_begin (os2_reader_process, (void *) test_device);
|
||||||
|
#endif
|
||||||
if (test_device->reader_pid == 0) /* child */
|
if (test_device->reader_pid == 0) /* child */
|
||||||
{
|
{
|
||||||
SANE_Status status;
|
SANE_Status status;
|
||||||
|
@ -2462,7 +2486,9 @@ sane_start (SANE_Handle handle)
|
||||||
return SANE_STATUS_NO_MEM;
|
return SANE_STATUS_NO_MEM;
|
||||||
}
|
}
|
||||||
/* parent */
|
/* parent */
|
||||||
|
#ifndef HAVE_OS2_H
|
||||||
close (pipe_descriptor[1]);
|
close (pipe_descriptor[1]);
|
||||||
|
#endif
|
||||||
test_device->pipe = pipe_descriptor[0];
|
test_device->pipe = pipe_descriptor[0];
|
||||||
|
|
||||||
return SANE_STATUS_GOOD;
|
return SANE_STATUS_GOOD;
|
||||||
|
|
|
@ -89,6 +89,9 @@ typedef struct Test_Device
|
||||||
SANE_Parameters params;
|
SANE_Parameters params;
|
||||||
SANE_String name;
|
SANE_String name;
|
||||||
SANE_Int reader_pid;
|
SANE_Int reader_pid;
|
||||||
|
#ifdef HAVE_OS2_H
|
||||||
|
SANE_Int reader_fds; /* OS/2: pipe write handler for reader */
|
||||||
|
#endif
|
||||||
SANE_Int pipe;
|
SANE_Int pipe;
|
||||||
FILE *pipe_handle;
|
FILE *pipe_handle;
|
||||||
SANE_Word pass;
|
SANE_Word pass;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
;
|
;
|
||||||
|
|
||||||
:backend "test" ; name of backend
|
:backend "test" ; name of backend
|
||||||
:version "1.0-20" ; version of backend
|
:version "1.0-21" ; version of backend
|
||||||
:status :stable ; :alpha, :beta, :stable, :new
|
:status :stable ; :alpha, :beta, :stable, :new
|
||||||
:manpage "sane-test" ; name of manpage (if it exists)
|
:manpage "sane-test" ; name of manpage (if it exists)
|
||||||
:url "http://www.meier-geinitz.de/sane/test-backend/" ; backend's web page
|
:url "http://www.meier-geinitz.de/sane/test-backend/" ; backend's web page
|
||||||
|
|
Ładowanie…
Reference in New Issue