diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2021-02-16 18:25:42 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2021-02-16 18:25:42 +0100 |
commit | 64ddd1a4dfcefd11f662f5cf4bb05b590d901a97 (patch) | |
tree | 4303648095deff998ae20c2393b56db527742ac9 /backend/dell1600n_net.c | |
parent | 5793a221e112fa49073de0137d6bfa750a61b0a1 (diff) | |
parent | ecaaf250cb33ff61f37a7b441f2337584a655350 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/dell1600n_net.c')
-rw-r--r-- | backend/dell1600n_net.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/backend/dell1600n_net.c b/backend/dell1600n_net.c index c8717d4..2436dd4 100644 --- a/backend/dell1600n_net.c +++ b/backend/dell1600n_net.c @@ -15,9 +15,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + along with this program. If not, see <https://www.gnu.org/licenses/>. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -122,7 +120,7 @@ struct ScannerState int m_numPages; /* number of complete pages (host byte order) */ struct ComBuf m_pageInfo; /* "array" of numPages PageInfo structs */ int m_bFinish; /* set non-0 to signal that we are finished */ - int m_bCancelled; /* set non-0 that bFinish state arose from cancelation */ + int m_bCancelled; /* set non-0 that bFinish state arose from cancellation */ char m_regName[REG_NAME_SIZE]; /* name with which to register */ unsigned short m_xres; /* x resolution (network byte order) */ unsigned short m_yres; /* y resolution (network byte order) */ @@ -233,6 +231,9 @@ static void JpegDecompTermSource (j_decompress_ptr cinfo); /* Results of last call to sane_get_devices */ static struct DeviceRecord *gKnownDevices[MAX_SCANNERS]; +/* Empty list for when network devices are not wanted */ +static const SANE_Device *gEmptyDeviceList[1]; + /* Array of open scanner device states. :NOTE: (int)SANE_Handle is an offset into this array */ static struct ScannerState *gOpenScanners[MAX_SCANNERS]; @@ -288,8 +289,7 @@ sane_exit (void) /***********************************************************/ SANE_Status -sane_get_devices (const SANE_Device *** device_list, - SANE_Bool __sane_unused__ local_only) +sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { int ret; @@ -307,11 +307,17 @@ sane_get_devices (const SANE_Device *** device_list, const char *pVal; int valLen; + if (local_only) { + *device_list = gEmptyDeviceList; + return SANE_STATUS_GOOD; + } + /* init variables */ ret = SANE_STATUS_GOOD; sock = 0; pDevice = NULL; optYes = 1; + InitComBuf (&queryPacket); /* clear previous results */ @@ -694,7 +700,7 @@ sane_start (SANE_Handle handle) if (!ValidScannerNumber (iHandle)) return SANE_STATUS_INVAL; - /* check if we still have oustanding pages of data on this handle */ + /* check if we still have outstanding pages of data on this handle */ if (gOpenScanners[iHandle]->m_imageData.m_used){ /* remove empty page */ @@ -1748,7 +1754,7 @@ cleanup: /***********************************************************/ /* remove data from the front of a ComBuf struct - \return 0 if sucessful, >0 otherwise + \return 0 if successful, >0 otherwise */ int PopFromComBuf (struct ComBuf *pBuf, size_t datSize) |