home *** CD-ROM | disk | FTP | other *** search
- /* Test shpush(), shpop() */
-
- #include <stdio.h>
- main(argc,argv)
- int argc;
- char *argv[];
- {
- if(argc < 2) {
- printf("What would you have me do?\n");
- exit(0);
- }
- if(strcmp(argv[1],"/P")== 0) {
- if(shempty())
- printf("Shell stack empty!");
- else
- printf("Shell stack pop %s\n",shpop()?"OK":"Failed");
- exit(0);
- }
- if(shfull())
- printf("Shell stack full!\n");
- else {
- if(shpush(argv[1]))
- printf("Pushing command on shell stack => %s\n",argv[1]);
- else
- printf("Shell push failed!\n");
- }
- }