** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: sdf-1.c,v 1.4 2000/05/09 14:52:27 kevin Exp $
+** $Id: sdf-1.c,v 1.6 2000/05/24 22:50:04 kevin Exp $
** $Log: sdf-1.c,v $
+** Revision 1.6 2000/05/24 22:50:04 kevin
+** Added support for new SGP library
+**
+** Revision 1.5 2000/05/16 04:33:59 kevin
+** Improved option processing
+**
** Revision 1.4 2000/05/09 14:52:27 kevin
** added sqr and sqrt functions
**
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
******************************************************************************/
+
/* FILE
* sdf-1.c Filter a single SDF file
*/
};
void
-usage (const char *program)
+sdf1_usage (const char *program)
{
- fprintf(stdout, "usage: %s infile outfile [OPTIONS]\n", kbasename(program));
+ fprintf(stdout, "sdf1_usage: %s infile outfile [OPTIONS]\n", kbasename(program));
fprintf(stdout, "Generate a SDF2D file from a SDF2D file\n");
fprintf(stdout, "\n");
fprintf(stdout, " --invert Invert image\n");
fprintf(stdout, " --verbose Verbose modem\n");
fprintf(stdout, " --version Print version\n");
fprintf(stdout, " --help Print this help message\n");
- exit(1);
}
int
-main (int argc, char *const argv[])
+sdf1_main (int argc, char *const argv[])
{
IMAGE *im_in;
IMAGE *im_out;
exit(0);
case O_HELP:
case '?':
- usage(argv[0]);
- exit(0);
+ sdf1_usage(argv[0]);
+ return (0);
default:
- usage(argv[0]);
- exit(1);
+ sdf1_usage(argv[0]);
+ return (1);
}
}
if (optind + 2 != argc)
{
- usage(argv[0]);
- exit(1);
+ sdf1_usage(argv[0]);
+ return (1);
}
in_file = argv[optind];
out_file = argv[optind + 1];
- if (opt_invert || opt_log || opt_exp) {
+ if (opt_invert || opt_log || opt_exp || opt_sqr || opt_sqrt) {
int ix, iy;
im_in = image_load (in_file);
return (0);
}
+
+#ifndef NO_MAIN
+int
+main (int argc, char *const argv[])
+{
+ return (sdf1_main(argc, argv));
+}
+#endif
+