Skip to content

Commit

Permalink
Strip all whitespace from PshellReadline.cc returned command
Browse files Browse the repository at this point in the history
  • Loading branch information
RonIovine committed Mar 20, 2019
1 parent 4316b70 commit 22ada15
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 205 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
/.config
*.cproject
*.project
/.~lock.PSHELL-Framework.ppt#
Binary file modified c/bin/pshell
Binary file not shown.
Binary file modified c/bin/pshellAggregator
Binary file not shown.
Binary file modified c/bin/pshellReadlineDemo
Binary file not shown.
45 changes: 22 additions & 23 deletions c/demo/pshellReadlineDemo.cc
@@ -1,27 +1,27 @@
/*******************************************************************************
*
* Copyright (c) 2009, Ron Iovine, All rights reserved.
* Copyright (c) 2009, Ron Iovine, All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ron Iovine nor the names of its contributors
* may be used to endorse or promote products derived from this software
* * Neither the name of Ron Iovine nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Ron Iovine ''AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL Ron Iovine BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* THIS SOFTWARE IS PROVIDED BY Ron Iovine ''AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL Ron Iovine BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
Expand All @@ -41,7 +41,7 @@
* This demo program shows the usage of the PshellReadline module. This module
* provides functionality similar to the readline library. This will work with
* any character based input stream, i.e. terminal, serial, TCP etc.
*
*
*******************************************************************************/

/******************************************************************************/
Expand Down Expand Up @@ -106,10 +106,10 @@ int main(int argc, char *argv[])
{
for (unsigned j = 0; j < strlen(argv[i]); j++)
{
if (!isdigit(argv[i][j]))
{
showUsage();
}
if (!isdigit(argv[i][j]))
{
showUsage();
}
}
idleTimeout = PSHELL_RL_ONE_MINUTE*atoi(argv[i]);;
}
Expand Down Expand Up @@ -148,15 +148,14 @@ int main(int argc, char *argv[])

shutdown(socketFd, SHUT_RDWR);
}

pshell_rl_setIdleTimeout(idleTimeout);

while (((idleSession = pshell_rl_getInput("prompt> ", input)) == false) &&
!pshell_rl_isSubString(input, "quit", 1))
while (((idleSession = pshell_rl_getInput("prompt> ", input)) == false) && !pshell_rl_isSubString(input, "quit"))
{
pshell_rl_writeOutput("input: '%s'\n", input);
}

return (0);

}
Binary file modified c/lib/libpshell-control.a
Binary file not shown.
Binary file modified c/lib/libpshell-readline.a
Binary file not shown.
Binary file modified c/lib/libpshell-readline.so
Binary file not shown.
Binary file modified c/lib/libpshell-server-full.a
Binary file not shown.
Binary file modified c/lib/libpshell-server-full.so
Binary file not shown.
Binary file modified c/lib/libpshell-server-stub.a
Binary file not shown.

0 comments on commit 22ada15

Please sign in to comment.