2000-04-27 11:28:19 +00:00
|
|
|
--- pbmplus.h.orig Tue Apr 4 02:34:36 2000
|
|
|
|
+++ pbmplus.h Sat Apr 15 08:00:00 2000
|
2000-04-01 23:57:38 +00:00
|
|
|
@@ -24,6 +24,9 @@
|
1999-01-07 11:12:30 +00:00
|
|
|
#include <errno.h>
|
|
|
|
#endif
|
2000-04-01 23:57:38 +00:00
|
|
|
#endif
|
1999-01-07 11:12:30 +00:00
|
|
|
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
|
|
|
|
+#include <sys/param.h>
|
|
|
|
+#endif
|
|
|
|
|
2000-04-01 23:57:38 +00:00
|
|
|
#if defined(USG) || defined(SVR4) || defined(VMS) || defined(__SVR4)
|
1999-01-07 11:12:30 +00:00
|
|
|
#define SYSV
|
2000-04-01 23:57:38 +00:00
|
|
|
@@ -34,7 +37,7 @@
|
1999-01-07 11:12:30 +00:00
|
|
|
** and if you run on an Amiga, set AMIGA. If your compiler is ANSI C, you're
|
|
|
|
** probably better off setting SYSV - all it affects is string handling.
|
|
|
|
*/
|
|
|
|
-#define BSD
|
2000-04-01 23:57:38 +00:00
|
|
|
+/* #define BSD */
|
1999-01-07 11:12:30 +00:00
|
|
|
/* #define SYSV */
|
|
|
|
/* #define MSDOS */
|
|
|
|
/* #define AMIGA */
|
2000-04-01 23:57:38 +00:00
|
|
|
@@ -46,7 +49,7 @@
|
|
|
|
** hex and decimal forms to specify colors (see ppm/pgmtoppm.1 for details).
|
|
|
|
*/
|
|
|
|
#ifndef RGB_DB
|
|
|
|
-#define RGB_DB "/usr/lib/X11/rgb"
|
|
|
|
+#define RGB_DB "%%X11BASE%%/lib/X11/rgb"
|
|
|
|
/*#define RGB_DB "/usr/openwin/lib/rgb.txt"*/
|
|
|
|
#ifdef VMS
|
|
|
|
#define RGB_DB "PBMplus_Dir:RGB.TXT"
|
2000-04-27 11:28:19 +00:00
|
|
|
@@ -117,6 +120,7 @@
|
1999-01-07 11:12:30 +00:00
|
|
|
#ifndef VMS
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
+#if !(defined(BSD) && (BSD >= 199306))
|
|
|
|
extern int atoi();
|
|
|
|
extern void exit();
|
2000-04-01 23:57:38 +00:00
|
|
|
#ifndef __osf__
|
2000-04-27 11:28:19 +00:00
|
|
|
@@ -124,6 +128,7 @@
|
1999-01-07 11:12:30 +00:00
|
|
|
extern int write();
|
|
|
|
#endif
|
2000-04-01 23:57:38 +00:00
|
|
|
#endif
|
2000-04-27 11:28:19 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
/* CONFIGURE: On most BSD systems, malloc() gets declared in stdlib.h, on
|
|
|
|
** system V, it gets declared in malloc.h. On some systems, malloc.h
|
|
|
|
@@ -264,40 +269,6 @@
|
|
|
|
int pm_readlittlelong ARGS(( FILE* in, long* lP ));
|
|
|
|
int pm_writelittlelong ARGS(( FILE* out, long l ));
|
|
|
|
|
|
|
|
-
|
|
|
|
-/* Command line option parsing */
|
|
|
|
-#include "pbmplus.h"
|
|
|
|
-/* Shhopt is Sverre Huseby's command line parsing package, which makes
|
|
|
|
- writing command parsing code quick and error free. Some of the Netpbm
|
|
|
|
- programs use it.
|
|
|
|
-*/
|
|
|
|
-#include "shhopt.h"
|
|
|
|
-
|
|
|
|
-void pm_optParseOptions(int *argc, char *argv[],
|
|
|
|
- optStruct opt[], int allowNegNum);
|
|
|
|
-/* Use pm_optParseOptions instead of optParseOptions in order to use the
|
|
|
|
- shared Netpbm libraries
|
|
|
|
-*/
|
|
|
|
-
|
|
|
|
-/* You can use OPTENTRY to assign a value to a dynamically or automatically
|
|
|
|
- allocated optStruct structure with minimal typing and easy readability.
|
|
|
|
-
|
|
|
|
- Here is an example:
|
|
|
|
-
|
|
|
|
- unsigned int option_def_index = 0;
|
|
|
|
- optStruct *option_def = malloc(100*sizeof(optStruct));
|
|
|
|
- OPTENTRY('h', "help", OPT_FLAG, &help_flag, 0);
|
|
|
|
- OPTENTRY(0, "alphaout", OPT_STRING, &alpha_filename, 0);
|
|
|
|
-*/
|
|
|
|
-
|
|
|
|
-#define OPTENTRY(shortvalue,longvalue,typevalue,outputvalue,flagvalue) {\
|
|
|
|
- option_def[option_def_index].shortName = (shortvalue); \
|
|
|
|
- option_def[option_def_index].longName = (longvalue); \
|
|
|
|
- option_def[option_def_index].type = (typevalue); \
|
|
|
|
- option_def[option_def_index].arg = (outputvalue); \
|
|
|
|
- option_def[option_def_index].flags = (flagvalue); \
|
|
|
|
- option_def[++option_def_index].type = OPT_END; \
|
|
|
|
- }
|
|
|
|
|
|
|
|
/* Compatibility stuff */
|
1999-01-07 11:12:30 +00:00
|
|
|
|