Changeset 06b785f in mainline for kernel/generic/src/console/kconsole.c
- Timestamp:
- 2009-04-01T19:11:07Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d09f84e6
- Parents:
- 1b0b48e0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
r1b0b48e0 r06b785f 138 138 spinlock_lock(&hlp->lock); 139 139 } 140 if ((strncmp(hlp->name, cmd->name, max(str len(cmd->name),141 str len(hlp->name))) == 0)) {140 if ((strncmp(hlp->name, cmd->name, max(str_size(cmd->name), 141 str_size(hlp->name))) == 0)) { 142 142 /* The command is already there. */ 143 143 spinlock_unlock(&hlp->lock); … … 173 173 int i; 174 174 175 for (i = str len(str); i > pos; i--)175 for (i = str_size(str); i > pos; i--) 176 176 str[i] = str[i - 1]; 177 177 str[pos] = ch; … … 181 181 static const char *cmdtab_search_one(const char *name,link_t **startpos) 182 182 { 183 size_t namelen = str len(name);183 size_t namelen = str_size(name); 184 184 const char *curname; 185 185 … … 194 194 195 195 curname = hlp->name; 196 if (str len(curname) < namelen)196 if (str_size(curname) < namelen) 197 197 continue; 198 198 if (strncmp(curname, name, namelen) == 0) { … … 223 223 startpos = startpos->next; 224 224 if (!found) 225 strncpy(output, foundtxt, str len(foundtxt) + 1);225 strncpy(output, foundtxt, str_size(foundtxt) + 1); 226 226 else { 227 227 for (i = 0; output[i] && foundtxt[i] && … … 235 235 return 0; 236 236 237 if (found > 1 && !str len(output)) {237 if (found > 1 && !str_size(output)) { 238 238 printf("\n"); 239 239 startpos = NULL; … … 310 310 insert_char(current, tmp[i], i + position); 311 311 312 if (str len(tmp) || found == 1) { /* If we have a hint */312 if (str_size(tmp) || found == 1) { /* If we have a hint */ 313 313 for (i = position; i < curlen; i++) 314 314 putchar(current[i]); 315 position += str len(tmp);315 position += str_size(tmp); 316 316 /* Add space to end */ 317 317 if (found == 1 && position == curlen && … … 326 326 for (i = 0; i < curlen; i++) 327 327 putchar(current[i]); 328 position += str len(tmp);328 position += str_size(tmp); 329 329 } 330 330 rdln_print_c('\b', curlen - position); … … 385 385 current = history[histposition]; 386 386 printf("%s", current); 387 curlen = str len(current);387 curlen = str_size(current); 388 388 position = curlen; 389 389 continue; … … 444 444 while (true) { 445 445 cmdline = clever_readline((char *) prompt, stdin); 446 len = str len(cmdline);446 len = str_size(cmdline); 447 447 if (!len) 448 448 continue; … … 545 545 spinlock_lock(&hlp->lock); 546 546 547 if (strncmp(hlp->name, &cmdline[start], max(str len(hlp->name),547 if (strncmp(hlp->name, &cmdline[start], max(str_size(hlp->name), 548 548 end - start + 1)) == 0) { 549 549 cmd = hlp;
Note:
See TracChangeset
for help on using the changeset viewer.