if(param[parcnt])
if(*param[parcnt]) parcnt++;
}
+ if(des->mode&CDESM_SPACE_SEP){
+ while (*param[parcnt-1] && parcnt > (var ? 2 : 1) && parcnt < 9) {
+ p = param[parcnt-1];
+ while (*p && !isspace(*p)) p++;
+ if (*p) {
+ *p = '\0';
+ p = skip_white(p+1);
+ if (*p) {
+ parcnt++;
+ param[parcnt-1] = p;
+ continue;
+ }
+ }
+ break; /* No more parameters */
+ }
+ }
param[parcnt]=0;
if(!des->fnc) return -CMDERR_BADCMD;
res=des->fnc(cmd_io,des,param);
#define CDESM_RD 0x01 /* Value read is possible */
#define CDESM_WR 0x02 /* Value write is possible */
#define CDESM_RW (CDESM_RD|CDESM_WR) /* Both */
+#define CDESM_SPACE_SEP 0x20 /* Whitespace separated params - replaces space with '\0' */
/**
* Command descriptor.
* points to the beginning of those parameters (after skipping
* whitespace)
*
+ * If CDESM_SPACE_SEP is specified in the command descriptor, then
+ * the command arguments are split at whitespace by '\0'
+ * characters and stored in the next unused param elements. Param
+ * array can contain up to 9 elements.
+ *
* The param elements are always terminated by NULL element.
*/
typedef struct cmd_des{