home *** CD-ROM | disk | FTP | other *** search
- /*
- * Overview: Tool Merger: The size of the libraries used by tools
- * is large. Substantial memory size saving can be
- * realized by merging together a group of tools.
- * The text for every instance of each of the merged tools
- * is shared. Each merged tool should be a symbolic
- * link to the shared object file.
- */
-
- #include "declarations.h"
-
- truct map {
- char cmd[32];
- int (*routine)();
- };
- truct map cmd_routine_map[] = {
- #include "tools.h"
- };
-
- ain(argc, argv, envp)
- int argc;
- char **argv;
- char **envp;
- {
- extern char *rindex();
- char *filename = rindex(argv[0], '/');
- int i;
- int num_of_cmds;
-
- if (!filename)
- filename = argv[0];
- else
- filename++;
- num_of_cmds = sizeof(cmd_routine_map)/sizeof(struct map);
- for (i = 0; i < sizeof(cmd_routine_map)/sizeof(struct map); i++) {
- if (strcmp(filename,cmd_routine_map[i].cmd) == 0) {
- cmd_routine_map[i].routine(argc,argv,envp);
- exit(0);
- }
- }
- printf("Couldn't run %s in toolmerge.main report to author\n", argv[0]);
-
- exit(0);
- }
-