home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netpbma.zip / pgm / pgmmerge.c < prev    next >
C/C++ Source or Header  |  1994-01-28  |  2KB  |  64 lines

  1. /* pgmmerge.c - wrapper program for PGM
  2. **
  3. ** Copyright (C) 1991 by Jef Poskanzer.
  4. **
  5. ** Permission to use, copy, modify, and distribute this software and its
  6. ** documentation for any purpose and without fee is hereby granted, provided
  7. ** that the above copyright notice appear in all copies and that both that
  8. ** copyright notice and this permission notice appear in supporting
  9. ** documentation.  This software is provided "as is" without express or
  10. ** implied warranty.
  11. */
  12.  
  13. #include <stdio.h>
  14. #include "pgm.h"
  15.  
  16. int
  17. main( argc, argv )
  18. int argc;
  19. char *argv[];
  20.     {
  21.     register char *cp;
  22.  
  23. again:
  24.     if ( ( cp = rindex( argv[0], '/' ) ) != (char*) 0 )
  25.     ++cp;
  26.     else
  27.     cp = argv[0];
  28.     if ( strcmp( cp, "pgmmerge" ) == 0 )
  29.     {
  30.     ++argv;
  31.     --argc;
  32.     goto again;
  33.     }
  34.  
  35. #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); }
  36.  
  37.     TRY("bioradtopgm", bioradtopgm_main);
  38.     TRY("fstopgm", fstopgm_main);
  39.     TRY("hipstopgm", hipstopgm_main);
  40.     TRY("lispmtopgm", lispmtopgm_main);
  41.     TRY("pbmtopgm", pbmtopgm_main);
  42.     TRY("pgmbentley", pgmbentley_main);
  43.     TRY("pgmcrater", pgmcrater_main);
  44.     TRY("pgmedge", pgmedge_main);
  45.     TRY("pgmenhance", pgmenhance_main);
  46.     TRY("pgmhist", pgmhist_main);
  47.     TRY("pgmkernel", pgmkernel_main);
  48.     TRY("pgmnoise", pgmnoise_main);
  49.     TRY("pgmnorm", pgmnorm_main);
  50.     TRY("pgmoil", pgmoil_main);
  51.     TRY("pgmramp", pgmramp_main);
  52.     TRY("pgmtexture", pgmtexture_main);
  53.     TRY("pgmtopbm", pgmtopbm_main);
  54.     TRY("pgmtofs", pgmtofs_main);
  55.     TRY("pgmtolispm", pgmtolispm_main);
  56.     TRY("psidtopgm", psidtopgm_main);
  57.     TRY("rawtopgm", rawtopgm_main);
  58.     TRY("spottopgm", spottopgm_main);
  59.  
  60.     (void) fprintf(
  61.     stderr, "pgmmerge: \"%s\" is an unknown PGM program!\n", cp );
  62.     exit( 1 );
  63.     }
  64.