search for: rosh_parse_sp_1

Displaying 3 results from an estimated 3 matches for "rosh_parse_sp_1".

2009 Mar 05
0
[PATCH 5/5] COM32/rosh: Improvements
...if a character is whitespace * inc input character * returns 0 if not whitespace @@ -61,7 +54,7 @@ void rosh_help(int type) int rosh_issp(char inc) { int rv; - switch (inc){ + switch (inc) { case ' ': case '\t': rv = 1; break; default: rv = 0; @@ -129,6 +122,34 @@ int rosh_parse_sp_1(char *dest, const char *src, const int ipos) return epos; } +/* Display help + * type Help type + * cmdstr Command string + */ +void rosh_help(int type, const char *cmdstr) +{ + char *istr; + istr = cmdstr; + switch (type) { + case 2: + istr += rosh_search_nonsp(cmdstr, rosh_search_sp(cmdstr,...
2009 Feb 15
2
COM32 module: Read-Only shell
...while (!(rosh_issp(c)) && c != 0) + c = istr[++curpos]; + return curpos; +} + +/* Parse a string for the first non-space string, returning the end position + * from src + * dest string to contain the first non-space string + * src string to parse + * ipos Position to start in src + */ +int rosh_parse_sp_1(char *dest, const char *src, const int ipos) +{ + int bpos, epos; /* beginning and ending position of source string + to copy to destination string */ + + bpos = 0; + epos = 0; +/* //HERE-error condition checking */ + bpos = rosh_search_nonsp(src, ipos); + epos = rosh_search_sp(src, bpos); + if (e...
2010 Jun 27
1
[PATCH] ROSH: Upgraded
...s]; return curpos; } @@ -102,7 +80,7 @@ int rosh_search_sp(const char *istr, const int ipos) curpos = ipos; c = istr[curpos]; - while (!(rosh_issp(c)) && c != 0) + while (c && !(isspace(c))) c = istr[++curpos]; return curpos; } @@ -134,6 +112,37 @@ int rosh_parse_sp_1(char *dest, const char *src, const int ipos) return epos; } +/* Display help + * type Help type + * cmdstr Command string + */ +void rosh_help(int type, const char *cmdstr) +{ + const char *istr; + istr = cmdstr; + switch (type) { + case 2: + istr += rosh_search_nonsp(cmdstr, ros...