| 423 | } |
| 424 | |
| 425 | void list_cmd(int typ, const char* what, const char *prefix,BOOLEAN iterate, BOOLEAN fullname) |
| 426 | { |
| 427 | package savePack=currPack; |
| 428 | idhdl h,start; |
| 429 | BOOLEAN all = typ<0; |
| 430 | BOOLEAN really_all=FALSE; |
| 431 | |
| 432 | if ( typ==0 ) |
| 433 | { |
| 434 | if (strcmp(what,"all")==0) |
| 435 | { |
| 436 | if (currPack!=basePack) |
| 437 | list_cmd(-1,NULL,prefix,iterate,fullname); // list current package |
| 438 | really_all=TRUE; |
| 439 | h=basePack->idroot; |
| 440 | } |
| 441 | else |
| 442 | { |
| 443 | h = ggetid(what); |
| 444 | if (h!=NULL) |
| 445 | { |
| 446 | if (iterate) list1(prefix,h,TRUE,fullname); |
| 447 | if (IDTYP(h)==ALIAS_CMD) PrintS("A"); |
| 448 | if (IDTYP(h)==RING_CMD) |
| 449 | { |
| 450 | h=IDRING(h)->idroot; |
| 451 | } |
| 452 | else if(IDTYP(h)==PACKAGE_CMD) |
| 453 | { |
| 454 | currPack=IDPACKAGE(h); |
| 455 | //Print("list_cmd:package\n"); |
| 456 | all=TRUE;typ=PROC_CMD;fullname=TRUE;really_all=TRUE; |
| 457 | h=IDPACKAGE(h)->idroot; |
| 458 | } |
| 459 | else |
| 460 | { |
| 461 | currPack=savePack; |
| 462 | return; |
| 463 | } |
| 464 | } |
| 465 | else |
| 466 | { |
| 467 | Werror("%s is undefined",what); |
| 468 | currPack=savePack; |
| 469 | return; |
| 470 | } |
| 471 | } |
| 472 | all=TRUE; |
| 473 | } |
| 474 | else if (RingDependend(typ)) |
| 475 | { |
| 476 | h = currRing->idroot; |
| 477 | } |
| 478 | else |
| 479 | h = IDROOT; |
| 480 | start=h; |
| 481 | while (h!=NULL) |
| 482 | { |
no test coverage detected