Subversion Repositories SvarDOS

Rev

Rev 501 | Rev 538 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 501 Rev 533
Line 132... Line 132...
132
  *ho = -1;
132
  *ho = -1;
133
  return(-1);
133
  return(-1);
134
}
134
}
135
 
135
 
136
 
136
 
137
static int cmd_time(struct cmd_funcparam *p) {
137
static enum cmd_result cmd_time(struct cmd_funcparam *p) {
138
  struct nls_patterns *nls = (void *)(p->BUFFER);
138
  struct nls_patterns *nls = (void *)(p->BUFFER);
139
  char *buff = p->BUFFER + sizeof(*nls);
139
  char *buff = p->BUFFER + sizeof(*nls);
140
  unsigned short i;
140
  unsigned short i;
141
  signed char ho = -1, mi = -1, se = -1;
141
  signed char ho = -1, mi = -1, se = -1;
142
 
142
 
Line 145... Line 145...
145
    outputnl("");
145
    outputnl("");
146
    outputnl("TIME [time]");
146
    outputnl("TIME [time]");
147
    outputnl("");
147
    outputnl("");
148
    outputnl("Type TIME with no parameters to display the current time and a prompt for a");
148
    outputnl("Type TIME with no parameters to display the current time and a prompt for a");
149
    outputnl("new one. Press ENTER to keep the same time.");
149
    outputnl("new one. Press ENTER to keep the same time.");
150
    return(-1);
150
    return(CMD_OK);
151
  }
151
  }
152
 
152
 
153
  i = nls_getpatterns(nls);
153
  i = nls_getpatterns(nls);
154
  if (i != 0) {
154
  if (i != 0) {
155
    outputnl(doserr(i));
155
    outputnl(doserr(i));
156
    return(-1);
156
    return(CMD_FAIL);
157
  }
157
  }
158
 
158
 
159
  /* display current time if no args */
159
  /* display current time if no args */
160
  if (p->argc == 0) {
160
  if (p->argc == 0) {
161
    /* get cur time */
161
    /* get cur time */
Line 223... Line 223...
223
      pop ax
223
      pop ax
224
    }
224
    }
225
    if (buff[1] == 0) break; /* empty string = do not change time */
225
    if (buff[1] == 0) break; /* empty string = do not change time */
226
    if (cmd_time_parse(buff + 2, &ho, &mi, &se, nls) == 0) break;
226
    if (cmd_time_parse(buff + 2, &ho, &mi, &se, nls) == 0) break;
227
    outputnl("Invalid time");
227
    outputnl("Invalid time");
-
 
228
    return(CMD_FAIL);
228
  }
229
  }
229
 
230
 
230
  if (ho >= 0) {
231
  if (ho >= 0) {
231
    /* set time */
232
    /* set time */
232
    _asm {
233
    _asm {
Line 247... Line 248...
247
      pop bx
248
      pop bx
248
      pop ax
249
      pop ax
249
    }
250
    }
250
  }
251
  }
251
 
252
 
252
  return(-1);
253
  return(CMD_OK);
253
}
254
}