-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
winsane-dbg: Added support for custom port parameter
- Loading branch information
Showing
3 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | |/ |/ / / /_/ /___/ / /_/ / / / / __/ | ||
* |__/|__/_/\__,_//____/\__,_/_/ /_/\___/ | ||
* | ||
* Copyright (C) 2012 - 2013, Marc Hoersken, <[email protected]> | ||
* Copyright (C) 2012 - 2014, Marc Hoersken, <[email protected]> | ||
* | ||
* This software is licensed as described in the file COPYING, which | ||
* you should have received as part of this software distribution. | ||
|
@@ -23,21 +23,27 @@ | |
int WINAPIV _tmain(int argc, TCHAR *argv[]) | ||
{ | ||
PTSTR hostname; | ||
USHORT port; | ||
|
||
if (argc > 1) { | ||
hostname = argv[1]; | ||
Debug(hostname); | ||
if (argc > 2) { | ||
port = (USHORT) _tstoi(argv[2]); | ||
} else { | ||
port = WINSANE_DEFAULT_PORT; | ||
} | ||
Debug(hostname, port); | ||
exit(0); | ||
} else { | ||
exit(1); | ||
} | ||
} | ||
|
||
VOID Debug(PTSTR hostname) | ||
VOID Debug(PTSTR hostname, USHORT port) | ||
{ | ||
WINSANE_Session *session; | ||
|
||
session = WINSANE_Session::Remote(hostname); | ||
session = WINSANE_Session::Remote(hostname, port); | ||
if (session) { | ||
DebugSession(session); | ||
delete session; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | |/ |/ / / /_/ /___/ / /_/ / / / / __/ | ||
* |__/|__/_/\__,_//____/\__,_/_/ /_/\___/ | ||
* | ||
* Copyright (C) 2012 - 2013, Marc Hoersken, <[email protected]> | ||
* Copyright (C) 2012 - 2014, Marc Hoersken, <[email protected]> | ||
* | ||
* This software is licensed as described in the file COPYING, which | ||
* you should have received as part of this software distribution. | ||
|
@@ -35,7 +35,7 @@ __user_code | |
|
||
#include "winsane.h" | ||
|
||
VOID Debug(PTSTR hostname); | ||
VOID Debug(PTSTR hostname, USHORT port); | ||
VOID DebugSession(WINSANE_Session *session); | ||
VOID DebugSessionDevice(WINSANE_Session *session, WINSANE_Device *device); | ||
VOID DebugSessionDeviceOption(WINSANE_Session *session, WINSANE_Device *device, WINSANE_Option *option); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters