Skip to content

Commit

Permalink
winsane-dbg: Added support for custom port parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mback2k committed Jul 26, 2014
1 parent 40d12a6 commit b0fd767
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions winsane-dbg/winsane-dbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions winsane-dbg/winsane-dbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion winsane-dbg/winsane-dbg.vcxproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<PropertyGroup>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerEnvironment>PATH=$(SolutionDir)winsane\$(OutDir);%PATH%</LocalDebuggerEnvironment>
<LocalDebuggerCommandArguments>$(SANED)</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>$(SANED) 6566</LocalDebuggerCommandArguments>
</PropertyGroup>
</Project>

0 comments on commit b0fd767

Please sign in to comment.