diff -bBcr pbmplus10dec91/pbm/atktopbm.c pbmamiga/pbm/atktopbm.c *** pbmplus10dec91/pbm/atktopbm.c Wed Dec 11 01:53:16 1991 --- pbmamiga/pbm/atktopbm.c Tue Feb 18 04:47:08 1992 *************** *** 14,20 **** --- 14,27 ---- #include #include "pbm.h" + #ifndef A_FORCEPROTO void ReadATKRaster(); + #else /* A_FORCEPROTO */ + void ReadATKRaster( FILE *file, int *rwidth, int *rheight, + unsigned char **destaddr ); + static long ReadRow( register FILE *file, register unsigned char *row, + register long length ); + #endif /* A_FORCEPROTO */ void main( argc, argv ) diff -bBcr pbmplus10dec91/pbm/g3topbm.c pbmamiga/pbm/g3topbm.c *** pbmplus10dec91/pbm/g3topbm.c Wed Dec 11 01:52:10 1991 --- pbmamiga/pbm/g3topbm.c Tue Jan 28 18:33:48 1992 *************** *** 41,46 **** --- 41,50 ---- static void skiptoeol ARGS(( FILE* file )); static int rawgetbit ARGS(( FILE* file )); + #ifdef A_SMALLSTACK + static bit* bits[MAXROWS]; + #endif /* A_SMALLSTACK */ + void main( argc, argv ) int argc; *************** *** 48,54 **** --- 52,60 ---- { FILE* ifp; int argn, rows, cols, row, col, i; + #ifndef A_SMALLSTACK bit* bits[MAXROWS]; + #endif /* A_SMALLSTACK */ char* usage = "[-kludge][-reversebits][-stretch] [g3file]"; pbm_init( &argc, argv ); diff -bBcr pbmplus10dec91/pbm/libpbm1.c pbmamiga/pbm/libpbm1.c *** pbmplus10dec91/pbm/libpbm1.c Wed Dec 11 01:52:44 1991 --- pbmamiga/pbm/libpbm1.c Thu Mar 26 10:29:18 1992 *************** *** 50,55 **** --- 50,56 ---- } + #ifndef A_FRAGARRAY char** pm_allocarray( cols, rows, size ) int cols, rows; *************** *** 77,82 **** --- 78,121 ---- free( its[0] ); free( its ); } + #else /* A_FRAGARRAY */ + char** + pm_allocarray( cols, rows, size ) + int cols, rows; + int size; + { + char** its; + int i; + + its = (char**) malloc( (rows + 1) * sizeof(char*) ); + if ( its == (char**) 0 ) + pm_error( "out of memory allocating an array" ); + + its[rows] = its[0] = (char*) malloc( rows * cols * size ); + if ( its[0] != (char*) 0 ) + for ( i = 1; i < rows; ++i ) + its[i] = &(its[0][i * cols * size]); + else + for( i = 0; i < rows; ++i ) + its[i] = pm_allocrow( cols, size ); + return its; + } + + void + pm_freearray( its, rows ) + char** its; + int rows; + { + int i; + + if( its[rows] != (char*) 0 ) + free( its[rows] ); + else + for( i = 0; i < rows; ++i ) + pm_freerow( its[i] ); + free( its ); + } + #endif /* A_FRAGARRAY */ /* Case-insensitive keyword matcher. */ *************** *** 172,177 **** --- 211,219 ---- char* argv[]; { int argn, i; + #ifdef A_RGBENV + char *rgbdef; + #endif /* A_RGBENV */ /* Extract program name. */ progname = rindex( argv[0], '/'); *************** *** 200,205 **** --- 242,250 ---- #ifdef MSDOS pm_message( "MSDOS defined" ); #endif /*MSDOS*/ + #ifdef AMIGA + pm_message( "AMIGA defined" ); + #endif /* AMIGA */ #ifdef PBMPLUS_RAWBITS pm_message( "PBMPLUS_RAWBITS defined" ); #endif /*PBMPLUS_RAWBITS*/ *************** *** 225,231 **** --- 270,283 ---- pm_message( "NEED_VFPRINTF2 defined" ); #endif /*NEED_VFPRINTF2*/ #ifdef RGB_DB + #ifndef A_RGBENV pm_message( "RGB_DB=\"%s\"", RGB_DB ); + #else /* A_RGBENV */ + if( rgbdef = getenv(RGB_DB) ) + pm_message( "RGB_DB= Env-var %s (set to \"%s\")", RGB_DB, rgbdef ); + else + pm_message( "RGB_DB= Env-var %s (unset)", RGB_DB ); + #endif /* A_RGBENV */ #endif /*RGB_DB*/ #ifdef LIBTIFF pm_message( "LIBTIFF defined" ); *************** *** 263,273 **** --- 315,331 ---- pm_perror( reason ) char* reason; { + #ifndef A_STRERROR extern char* sys_errlist[]; + #endif /* A_STRERROR */ extern int errno; char* e; + #ifdef A_STRERROR + e = strerror(errno); + #else /* A_STRERROR */ e = sys_errlist[errno]; + #endif /* A_STRERROR */ if ( reason != 0 && reason[0] != '\0' ) pm_error( "%s - %s", reason, e ); diff -bBcr pbmplus10dec91/pbm/libpbm2.c pbmamiga/pbm/libpbm2.c *** pbmplus10dec91/pbm/libpbm2.c Wed Dec 11 01:52:46 1991 --- pbmamiga/pbm/libpbm2.c Tue Feb 18 04:05:12 1992 *************** *** 13,18 **** --- 13,22 ---- #include "pbm.h" #include "libpbm.h" + #ifdef A_FORCEPROTO + static bit pbm_getbit( FILE * ); + #endif /* A_FORCEPROTO */ + static bit pbm_getbit( file ) FILE* file; diff -bBcr pbmplus10dec91/pbm/libpbm3.c pbmamiga/pbm/libpbm3.c *** pbmplus10dec91/pbm/libpbm3.c Wed Dec 11 01:52:46 1991 --- pbmamiga/pbm/libpbm3.c Tue Feb 18 04:10:04 1992 *************** *** 13,18 **** --- 13,25 ---- #include "pbm.h" #include "libpbm.h" + #ifdef A_FORCEPROTO + static void pbm_writepbmrowplain( FILE* file, bit* bitrow, int cols ); + #ifdef PBMPLUS_RAWBITS + static void pbm_writepbmrowraw( FILE* file, bit* bitrow, int cols ); + #endif /* PBMPLUS_RAWBITS */ + #endif /* A_FORCEPROTO */ + void pbm_writepbminit( file, cols, rows, forceplain ) FILE* file; diff -bBcr pbmplus10dec91/pbm/macptopbm.c pbmamiga/pbm/macptopbm.c *** pbmplus10dec91/pbm/macptopbm.c Wed Dec 11 01:52:00 1991 --- pbmamiga/pbm/macptopbm.c Tue Jan 28 18:33:44 1992 *************** *** 15,20 **** --- 15,24 ---- static void ReadMacPaintFile ARGS(( FILE* file, int extraskip, int* scanLineP, unsigned char Pic[MAX_LINES][BYTES_WIDE] )); + #ifdef A_SMALLSTACK + static unsigned char Pic[MAX_LINES][BYTES_WIDE]; + #endif /* A_SMALLSTACK */ + void main( argc, argv ) int argc; *************** *** 21,27 **** --- 25,33 ---- char* argv[]; { FILE* ifp; + #ifndef A_SMALLSTACK unsigned char Pic[MAX_LINES][BYTES_WIDE]; + #endif /* A_SMALLSTACK */ bit* bitrow; int argn, extraskip, scanLine, rows, cols, row, bcol, i; char* usage = "[-extraskip N] [macpfile]"; diff -bBcr pbmplus10dec91/pbm/pbmtoatk.c pbmamiga/pbm/pbmtoatk.c *** pbmplus10dec91/pbm/pbmtoatk.c Wed Dec 11 01:53:14 1991 --- pbmamiga/pbm/pbmtoatk.c Tue Feb 18 04:28:52 1992 *************** *** 13,18 **** --- 13,24 ---- #include #include "pbm.h" + #ifdef A_FORCEPROTO + int process_atk_byte( int *pcurcount, unsigned char *pcurbyte, FILE *file, + unsigned char newbyte, int eolflag ); + int write_atk_bytes( FILE *file, unsigned char curbyte, unsigned int curcount ); + #endif /* A_FORCEPROTO */ + #define DEFAULTSCALE (1<<16) #define RASTERVERSION 2 #define TRUE 1 diff -bBcr pbmplus10dec91/pbm/pbmtoplot.c pbmamiga/pbm/pbmtoplot.c *** pbmplus10dec91/pbm/pbmtoplot.c Wed Dec 11 01:52:24 1991 --- pbmamiga/pbm/pbmtoplot.c Tue Feb 18 04:30:34 1992 *************** *** 13,18 **** --- 13,22 ---- #include #include "pbm.h" + #ifdef A_FORCEPROTO + static void puttwo( int i ); + #endif /* A_FORCEPROTO */ + static void puttwo( i ) int i; diff -bBcr pbmplus10dec91/pbm/pbmupc.c pbmamiga/pbm/pbmupc.c *** pbmplus10dec91/pbm/pbmupc.c Wed Dec 11 01:52:42 1991 --- pbmamiga/pbm/pbmupc.c Tue Feb 18 04:31:14 1992 *************** *** 40,46 **** --- 40,48 ---- char* manufcode; char* prodcode; int sum, p, lc0, lc1, lc2, lc3, lc4, rc0, rc1, rc2, rc3, rc4; + #ifndef A_FORCEPROTO void putdigit( ); + #endif /* A_FORCEPROTO */ char* usage = "[-s1|-s2] "; pbm_init( &argc, argv ); diff -bBcr pbmplus10dec91/pbmplus.h pbmamiga/pbmplus.h *** pbmplus10dec91/pbmplus.h Wed Dec 11 01:53:28 1991 --- pbmamiga/pbmplus.h Thu Mar 26 10:34:42 1992 *************** *** 20,34 **** #if defined(USG) || defined(SVR4) #define SYSV #endif ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS) ) /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a ** System V site, set the SYSV option; and if you're IBM-compatible, set ** MSDOS. If your compiler is ANSI C, you're probably better off setting ** SYSV - all it affects is string handling. */ ! #define BSD /* #define SYSV */ /* #define MSDOS */ #endif /* CONFIGURE: If you want to enable writing "raw" files, set this option. --- 20,35 ---- #if defined(USG) || defined(SVR4) #define SYSV #endif ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS) || defined(AMIGA) ) /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a ** System V site, set the SYSV option; and if you're IBM-compatible, set ** MSDOS. If your compiler is ANSI C, you're probably better off setting ** SYSV - all it affects is string handling. */ ! /* #define BSD */ /* #define SYSV */ /* #define MSDOS */ + #define AMIGA #endif /* CONFIGURE: If you want to enable writing "raw" files, set this option. *************** *** 67,73 **** /* CONFIGURE: uncomment this to enable debugging checks. */ /* #define DEBUG */ ! #ifdef SYSV #include #define index(s,c) strchr(s,c) --- 68,81 ---- /* CONFIGURE: uncomment this to enable debugging checks. */ /* #define DEBUG */ ! /* CONFIGURE: For some compiler tricks it's necessary to prototype ALL ! ** function calls. Make sure your includes provide prototypes for write() ! ** and other non-standard functions, or define them below. ! */ ! #define A_FORCEPROTO ! ! ! #if ( defined(SYSV) || defined(AMIGA) ) #include #define index(s,c) strchr(s,c) *************** *** 74,84 **** --- 82,94 ---- #define rindex(s,c) strrchr(s,c) #define srandom(s) srand(s) #define random rand + #ifndef _DCC /* Amiga DICE Compiler */ #define bzero(dst,len) memset(dst,0,len) #define bcopy(src,dst,len) memcpy(dst,src,len) #define bcmp memcmp extern void srand(); extern int rand(); + #endif /* _DCC */ #else /*SYSV*/ *************** *** 88,97 **** --- 98,113 ---- #endif /*SYSV*/ + #ifndef A_FORCEPROTO extern int atoi(); extern void exit(); extern long time(); extern int write(); + #else /* A_FORCEPROTO */ + #include + #include + #include + #endif /* A_FORCEPROTO */ /* CONFIGURE: On some systems, malloc.h doesn't declare these, so we have ** to do it. On other systems, for example HP/UX, it declares them *************** *** 99,108 **** ** malloc.h at all. A sad situation. If you have compilation problems ** that point here, feel free to tweak or remove these declarations. */ ! #include ! extern char* malloc(); ! extern char* realloc(); ! extern char* calloc(); /* CONFIGURE: Some systems don't have vfprintf(), which we need for the ** error-reporting routines. If you compile and get a link error about --- 115,124 ---- ** malloc.h at all. A sad situation. If you have compilation problems ** that point here, feel free to tweak or remove these declarations. */ ! /* #include */ ! /* extern char* malloc(); */ ! /* extern char* realloc(); */ ! /* extern char* calloc(); */ /* CONFIGURE: Some systems don't have vfprintf(), which we need for the ** error-reporting routines. If you compile and get a link error about *************** *** 115,120 **** --- 131,176 ---- /* #define NEED_VFPRINTF1 */ /* #define NEED_VFPRINTF2 */ + /* CONFIGURE: If you don't want a fixed path to a X11 color name file + ** compiled into PBMPlus, set this option. Now RGB_DB (see Makefile) + ** defines the name of an environment-variable that holds the complete + ** path and name of this file. + */ + #define A_RGBENV + + /* CONFIGURE: On some smaller systems it's not a good idea to put large + ** arrays on the stack. With this option all large arrays are moved off + ** the stack into globals. + */ + #define A_SMALLSTACK + + /* CONFIGURE: Set this option if your compiler uses strerror(errno) + ** instead of sys_errlist[errno] for error messages. + */ + #define A_STRERROR + + /* CONFIGURE: On small systems without VM it is possible that there is + ** enough memory for a large array, but it is fragmented. So the usual + ** malloc( all-in-one-big-chunk ) fails. With this option, if the first + ** method fails, pm_allocarray() tries to allocate the array row by row. + */ + #define A_FRAGARRAY + + /* + ** Some special things for the Amiga. + */ + #ifdef AMIGA + #ifdef A_FORCEPROTO + #include + #endif /* A_FORCEPROTO */ + #define getpid(x) ((long)FindTask(NULL)) + #ifdef _DCC /* Amiga DICE Compiler, dynamic stack variables */ + long _stack_fudge = 16384; + long _stack_chunk = 32768; + #endif /* _DCC */ + #endif /* AMIGA */ + + /* End of configurable definitions. */ diff -bBcr pbmplus10dec91/pgm/libpgm2.c pbmamiga/pgm/libpgm2.c *** pbmplus10dec91/pgm/libpgm2.c Wed Dec 11 01:53:36 1991 --- pbmamiga/pgm/libpgm2.c Tue Feb 18 05:04:08 1992 *************** *** 13,18 **** --- 13,28 ---- #include "pgm.h" #include "libpgm.h" + #ifdef A_FORCEPROTO + static void putus( unsigned short n, FILE* file ); + static void pgm_writepgmrowplain( FILE* file, gray* grayrow, + int cols, gray maxval ); + #ifdef PBMPLUS_RAWBITS + static void pgm_writepgmrowraw( FILE* file, gray* grayrow, + int cols, gray maxval ); + #endif /* PBMPLUS_RAWBITS */ + #endif /* A_FORCEPROTO */ + #if __STDC__ void pgm_writepgminit( FILE* file, int cols, int rows, gray maxval, int forceplain ) diff -bBcr pbmplus10dec91/pgm/pgmcrater.c pbmamiga/pgm/pgmcrater.c *** pbmplus10dec91/pgm/pgmcrater.c Wed Dec 11 01:54:00 1991 --- pbmamiga/pgm/pgmcrater.c Tue Feb 18 05:09:46 1992 *************** *** 48,53 **** --- 48,58 ---- #include "pgm.h" #include + #ifdef A_FORCEPROTO + static void gencraters(void); + static void initseed(void); + #endif /* A_FORCEPROTO */ + /* Definitions for obtaining random numbers. */ #define Cast(low, high) ((low)+((high)-(low)) * ((random() & 0x7FFF) / arand)) diff -bBcr pbmplus10dec91/pgm/pgmtexture.c pbmamiga/pgm/pgmtexture.c *** pbmplus10dec91/pgm/pgmtexture.c Wed Dec 11 01:54:14 1991 --- pbmamiga/pgm/pgmtexture.c Tue Feb 18 05:22:52 1992 *************** *** 65,77 **** #define DOT fprintf(stderr,".") #define SWAP(a,b) {y=(a);(a)=(b);(b)=y;} void results (), hessenberg (), mkbalanced (), reduction (), simplesrt (); float f1_asm (), f2_contrast (), f3_corr (), f4_var (), f5_idm (), f6_savg (), f7_svar (), f8_sentropy (), f9_entropy (), f10_dvar (), f11_dentropy (), f12_icorr (), f13_icorr (), f14_maxcorr (), *vector (), **matrix (); - void main (argc, argv) int argc; char *argv[]; --- 65,100 ---- #define DOT fprintf(stderr,".") #define SWAP(a,b) {y=(a);(a)=(b);(b)=y;} + #ifndef A_FORCEPROTO void results (), hessenberg (), mkbalanced (), reduction (), simplesrt (); float f1_asm (), f2_contrast (), f3_corr (), f4_var (), f5_idm (), f6_savg (), f7_svar (), f8_sentropy (), f9_entropy (), f10_dvar (), f11_dentropy (), f12_icorr (), f13_icorr (), f14_maxcorr (), *vector (), **matrix (); + #else /* A_FORCEPROTO */ + float f1_asm( float **P, int Ng ); + float f2_contrast( float **P, int Ng ); + float f3_corr( float **P, int Ng ); + float f4_var( float **P, int Ng ); + float f5_idm( float **P, int Ng ); + float f6_savg( float **P, int Ng ); + float f7_svar( float **P, int Ng, float S ); + float f8_sentropy( float **P, int Ng ); + float f9_entropy( float **P, int Ng ); + float f10_dvar( float **P, int Ng ); + float f11_dentropy( float **P, int Ng ); + float f12_icorr( float **P, int Ng ); + float f13_icorr( float **P, int Ng ); + float f14_maxcorr( float **P, int Ng ); + float *vector( int nl, int nh ); + float **matrix( int nrl, int nrh, int ncl, int nch ); + void results( char *c, float *a ); + void simplesrt( int n, float arr[] ); + void mkbalanced( float **a, int n ); + void reduction( float **a, int n ); + void hessenberg( float **a, int n, float wr[], float wi[] ); + #endif /* A_FORCEPROTO */ void main (argc, argv) int argc; char *argv[]; diff -bBcr pbmplus10dec91/pgm/rawtopgm.c pbmamiga/pgm/rawtopgm.c *** pbmplus10dec91/pgm/rawtopgm.c Wed Dec 11 01:53:46 1991 --- pbmamiga/pgm/rawtopgm.c Tue Feb 18 05:08:16 1992 *************** *** 25,31 **** --- 25,33 ---- register int col, val; int rows, cols; char* usage = "[-headerskip N] [-rowskip N] [rawfile]"; + #ifndef A_FORCEPROTO double atof(); + #endif /* A_FORCEPROTO */ pgm_init( &argc, argv ); diff -bBcr pbmplus10dec91/pnm/pnmflip.c pbmamiga/pnm/pnmflip.c *** pbmplus10dec91/pnm/pnmflip.c Wed Dec 11 01:54:28 1991 --- pbmamiga/pnm/pnmflip.c Tue Feb 18 20:04:08 1992 *************** *** 26,32 **** --- 26,34 ---- int a, b, c, d, e, f; register int row, col, newrow, newcol; xelval maxval; + #ifndef A_FORCEPROTO void leftright(), topbottom(), transpose(); + #endif /* A_FORCEPROTO */ char* usage = "[-leftright|-lr] [-topbottom|-tb] [-transpose|-xy]\n [-rotate90|-r90|-ccw] [-rotate270|r270|-cw]\n [-rotate180|-r180] [pnmfile]"; pnm_init( &argc, argv ); diff -bBcr pbmplus10dec91/ppm/libppm2.c pbmamiga/ppm/libppm2.c *** pbmplus10dec91/ppm/libppm2.c Wed Dec 11 01:55:22 1991 --- pbmamiga/ppm/libppm2.c Tue Feb 18 06:16:18 1992 *************** *** 13,18 **** --- 13,28 ---- #include "ppm.h" #include "libppm.h" + #ifdef A_FORCEPROTO + static void putus( unsigned short n, FILE* file ); + static void ppm_writeppmrowplain( FILE* file, pixel* pixelrow, int cols, + pixval maxval ); + #ifdef PBMPLUS_RAWBITS + static void ppm_writeppmrowraw( FILE* file, pixel* pixelrow, int cols, + pixval maxval ); + #endif /* PBMPLUS_RAWBITS */ + #endif /* A_FORCEPROTO */ + #if __STDC__ void ppm_writeppminit( FILE* file, int cols, int rows, pixval maxval, int forceplain ) diff -bBcr pbmplus10dec91/ppm/libppm4.c pbmamiga/ppm/libppm4.c *** pbmplus10dec91/ppm/libppm4.c Wed Dec 11 01:55:24 1991 --- pbmamiga/ppm/libppm4.c Tue Feb 18 06:18:34 1992 *************** *** 12,17 **** --- 12,22 ---- #include "ppm.h" + #ifdef A_FORCEPROTO + static void canonstr( char* str ); + static long rgbnorm( long rgb, long lmaxval, int n, char* colorname ); + #endif /* A_FORCEPROTO */ + static void canonstr( str ) char* str; *************** *** 202,210 **** --- 207,225 ---- FILE* f; char buf1[200], buf2[200]; + #ifndef A_RGBENV (void) sprintf( buf1, "%s.txt", RGB_DB ); if ( ( f = fopen( buf1, "r" ) ) == NULL ) pm_error( "can't open color names database - reconfigure with correct RGBDEF" ); + #else /* A_RGBENV */ + char *rgbdef; + if( (rgbdef = getenv(RGB_DB))==NULL ) + pm_error( "can't get path to color names database - %s not set", RGB_DB ); + + if ( ( f = fopen( rgbdef, "r" ) ) == NULL ) + pm_error( "can't open color names database - set %s to correct path", RGB_DB ); + #endif /* A_RGBDEF */ + canonstr( colorname ); while ( fgets( buf1, sizeof(buf1), f ) != NULL ) { *************** *** 257,262 **** --- 272,280 ---- int this_r, this_g, this_b; int best_diff, this_diff; char this_colorname[200]; + #ifdef A_RGBENV + char *rgbdef; + #endif /* A_RGBENV */ #endif /*RGB_DB*/ if ( maxval == 255 ) *************** *** 273,281 **** --- 291,308 ---- } #ifdef RGB_DB + #ifndef A_RGBENV (void) sprintf( buf, "%s.txt", RGB_DB ); if ( ( f = fopen( buf, "r" ) ) == NULL ) pm_error( "can't open color names database - reconfigure with correct RGBDEF" ); + #else /* A_RGBENV */ + if( (rgbdef = getenv(RGB_DB))==NULL ) + pm_error( "can't get path to color names database - %s not set", RGB_DB ); + + if ( ( f = fopen( rgbdef, "r" ) ) == NULL ) + pm_error( "can't open color names database - set %s to correct path", RGB_DB ); + #endif /* A_RGBDEF */ + best_diff = 32767; while ( fgets( buf, sizeof(buf), f ) != NULL ) { diff -bBcr pbmplus10dec91/ppm/libppm5.c pbmamiga/ppm/libppm5.c *** pbmplus10dec91/ppm/libppm5.c Wed Dec 11 01:55:26 1991 --- pbmamiga/ppm/libppm5.c Tue Feb 18 06:31:38 1992 *************** *** 17,22 **** --- 17,26 ---- #define DDA_SCALE 8192 + #ifdef A_FORCEPROTO + int ppmd_setlineclip( int clip ); + #endif /* A_FORCEPROTO */ + #if __STDC__ void ppmd_point_drawproc( pixel** pixels, int cols, int rows, pixval maxval, int x, int y, char* clientdata ) *************** *** 546,551 **** --- 550,559 ---- ++(fh->n); } + #ifdef A_FORCEPROTO + static int yx_compare( coord* c1, coord* c2 ); + #endif /* A_FORCEPROTO */ + static int yx_compare( c1, c2 ) coord* c1; diff -bBcr pbmplus10dec91/ppm/pi1toppm.c pbmamiga/ppm/pi1toppm.c *** pbmplus10dec91/ppm/pi1toppm.c Wed Dec 11 01:56:14 1991 --- pbmamiga/ppm/pi1toppm.c Tue Jan 28 18:32:52 1992 *************** *** 16,21 **** --- 16,25 ---- #define COLS 320 #define MAXVAL 7 + #ifdef A_SMALLSTACK + static short screen[ROWS*COLS/4]; /* simulates the Atari's video RAM */ + #endif /* A_SMALLSTACK */ + void main( argc, argv ) int argc; *************** *** 23,29 **** --- 27,35 ---- { FILE* ifp; pixel pal[16]; /* Degas palette */ + #ifndef A_SMALLSTACK short screen[ROWS*COLS/4]; /* simulates the Atari's video RAM */ + #endif /* A_SMALLSTACK */ short i; long j; pixel* pixelrow; diff -bBcr pbmplus10dec91/ppm/picttoppm.c pbmamiga/ppm/picttoppm.c *** pbmplus10dec91/ppm/picttoppm.c Wed Dec 11 01:56:08 1991 --- pbmamiga/ppm/picttoppm.c Tue Feb 18 15:54:58 1992 *************** *** 66,72 **** --- 66,76 ---- struct opdef { char* name; int len; + #ifndef A_FORCEPROTO void (*impl)(); + #else /* A_FORCEPROTO */ + void (*impl)(int); + #endif /* A_FORCEPROTO */ char* description; }; diff -bBcr pbmplus10dec91/ppm/pjtoppm.c pbmamiga/ppm/pjtoppm.c *** pbmplus10dec91/ppm/pjtoppm.c Wed Dec 11 01:56:42 1991 --- pbmamiga/ppm/pjtoppm.c Tue Feb 18 15:56:20 1992 *************** *** 14,19 **** --- 14,23 ---- static char usage[] = "[paintjetfile]"; + #ifdef A_FORCEPROTO + static int egetc( FILE *fp ); + #endif /* A_FORCEPROTO */ + static int egetc(fp) FILE *fp; diff -bBcr pbmplus10dec91/ppm/ppmdither.c pbmamiga/ppm/ppmdither.c *** pbmplus10dec91/ppm/ppmdither.c Wed Dec 11 01:56:46 1991 --- pbmamiga/ppm/ppmdither.c Tue Feb 18 16:00:38 1992 *************** *** 13,18 **** --- 13,26 ---- #include "ppm.h" + #ifdef A_FORCEPROTO + static int dith_value( int y, int x, int size ); + static void dith_matrix( int dim ); + void dith_setup( int dim, int nr, int ng, int nb, pixel *ptab ); + int dith_color( float r, float g, float b ); + void dith_dither( int w, int h, register pixel *t, register pixel *i, register pixel *o ); + #endif /* A_FORCEPROTO */ + #define NC 256 /* Total number of colors */ #define NS 256 /* Max number of shades in primary */ *** pbmplus10dec91/ppm/ppmdraw.h Wed Dec 11 01:55:32 1991 --- pbmamiga/ppm/ppmdraw.h Thu Mar 26 14:42:19 1992 *************** *** 86,92 **** ** you can draw with the outline routines. */ ! char* ppmd_fill_init( ); /* Returns a blank fillhandle. */ --- 86,92 ---- ** you can draw with the outline routines. */ ! char* ppmd_fill_init ARGS(( void )); /* Returns a blank fillhandle. */ diff -bBcr pbmplus10dec91/ppm/ppmforge.c pbmamiga/ppm/ppmforge.c *** pbmplus10dec91/ppm/ppmforge.c Wed Dec 11 01:56:58 1991 --- pbmamiga/ppm/ppmforge.c Tue Feb 18 18:24:04 1992 *************** *** 99,104 **** --- 99,116 ---- #define V (void) + #ifdef A_FORCEPROTO + static void fourn( float data[], int nn[], int ndim, int isign ); + static void initgauss( unsigned int seed ); + static double gauss(void); + static void spectralsynth( float **x, unsigned int n, double h ); + static void initseed(void); + static void temprgb( double temp, double *r, double *g, double *b ); + static void etoile( pixel *pix ); + static void genplanet( float *a, unsigned int n ); + static Boolean planet(void); + #endif /* A_FORCEPROTO */ + /* Display parameters */ #define SCRSAT 255 /* Screen maximum intensity */ diff -bBcr pbmplus10dec91/ppm/ppmhist.c pbmamiga/ppm/ppmhist.c *** pbmplus10dec91/ppm/ppmhist.c Wed Dec 11 01:55:58 1991 --- pbmamiga/ppm/ppmhist.c Tue Feb 18 16:01:08 1992 *************** *** 32,38 **** --- 32,40 ---- colorhist_vector chv; int argn, rows, cols, colors, i; pixval maxval; + #ifndef A_FORCEPROTO int countcompare(); + #endif /* A_FORCEPROTO */ char* usage = "[ppmfile]"; ppm_init( &argc, argv ); diff -bBcr pbmplus10dec91/ppm/ppmtoacad.c pbmamiga/ppm/ppmtoacad.c *** pbmplus10dec91/ppm/ppmtoacad.c Wed Dec 11 01:57:04 1991 --- pbmamiga/ppm/ppmtoacad.c Tue Feb 18 16:12:48 1992 *************** *** 23,28 **** --- 23,34 ---- #include "ppm.h" #include "ppmcmap.h" + #ifdef A_FORCEPROTO + static void outrun(int colour, int ysize, int y, int xstart, int xend); + static void slideout(int xdots, int ydots, int ncolours, unsigned char *red, + unsigned char *green, unsigned char *blue); + #endif /* A_FORCEPROTO */ + #define TRUE 1 #define FALSE 0 diff -bBcr pbmplus10dec91/ppm/ppmtogif.c pbmamiga/ppm/ppmtogif.c *** pbmplus10dec91/ppm/ppmtogif.c Wed Dec 11 01:55:50 1991 --- pbmamiga/ppm/ppmtogif.c Tue Feb 18 17:07:40 1992 *************** *** 25,31 **** --- 25,35 ---- /* * Pointer to function returning an int */ + #ifndef A_FORCEPROTO typedef int (* ifunptr)(); + #else /* A_FORCEPROTO */ + typedef int (* ifunptr)( int, int ); + #endif /* A_FORCEPROTO */ /* * a code_int must be able to hold 2**BITS values of type int, and also -1 diff -bBcr pbmplus10dec91/ppm/ppmtoilbm.c pbmamiga/ppm/ppmtoilbm.c *** pbmplus10dec91/ppm/ppmtoilbm.c Wed Dec 11 01:55:52 1991 --- pbmamiga/ppm/ppmtoilbm.c Fri Feb 07 15:54:20 1992 *************** *** 39,45 **** colorhist_vector chv; unsigned char* raw_rowbuf; unsigned char* coded_rowbuf; ! char* usage = "[-hamif] [ppmfile]"; ppm_init( &argc, argv ); --- 39,45 ---- colorhist_vector chv; unsigned char* raw_rowbuf; unsigned char* coded_rowbuf; ! char* usage = "[-hamif|-hamforce] [ppmfile]"; ppm_init( &argc, argv ); *************** *** 46,57 **** argn = 1; hamif = 0; ! if ( argn < argc && argv[argn][0] == '-' && argv[argn][1] != '\0' ) { ! if ( pm_keymatch( argv[argn], "-hamif", 2 ) ) hamif = 1; else if ( pm_keymatch( argv[argn], "-nohamif", 2 ) ) hamif = 0; else pm_usage( usage ); ++argn; --- 46,61 ---- argn = 1; hamif = 0; ! while ( argn < argc && argv[argn][0] == '-' && argv[argn][1] != '\0' ) { ! if ( pm_keymatch( argv[argn], "-hamif", 5 ) ) hamif = 1; else if ( pm_keymatch( argv[argn], "-nohamif", 2 ) ) hamif = 0; + else if ( pm_keymatch( argv[argn], "-hamforce", 5 ) ) + hamif = -1; + else if ( pm_keymatch( argv[argn], "-nohamforce", 2 ) ) + hamif = 0; else pm_usage( usage ); ++argn; *************** *** 72,77 **** --- 76,90 ---- pm_close( ifp ); + if( hamif < 0 ) + { + pm_message("hamforce option used - proceeding to write a HAM file"); + ham = 1; + colors = 16; + nPlanes = 6; + } + else + { /* Figure out the colormap. */ pm_message( "computing colormap..." ); chv = ppm_computecolorhist( pixels, cols, rows, MAX_COLORS, &colors ); *************** *** 107,112 **** --- 120,126 ---- /* Make a hash table for fast color lookup. */ cht = ppm_colorhisttocolorhash( chv, colors ); } + } /* Start off the ILBM with a FORM ILBM. */ cmapsize = colors * 3; *************** *** 250,268 **** unsigned char *cp; mask = 1 << plane; ! cp = coded_rowbuf; ! *cp = 0; for ( col = 0; col < cols; col++ ) { int b; ! b = ( raw_rowbuf[col] & mask ) ? 1 : 0; ! *cp |= b << ( 7 - col % 8 ); ! if ( col % 8 == 7 ) { cp++; *cp = 0; } } fwrite( coded_rowbuf, RowBytes(cols), 1, stdout ); } --- 264,282 ---- unsigned char *cp; mask = 1 << plane; ! cp = coded_rowbuf-1; for ( col = 0; col < cols; col++ ) { int b; ! if( col % 8 == 0 ) { cp++; *cp = 0; } + + b = ( raw_rowbuf[col] & mask ) ? 1 : 0; + *cp |= b << ( 7 - col % 8 ); } fwrite( coded_rowbuf, RowBytes(cols), 1, stdout ); } diff -bBcr pbmplus10dec91/ppm/ppmtopi1.c pbmamiga/ppm/ppmtopi1.c *** pbmplus10dec91/ppm/ppmtopi1.c Wed Dec 11 01:56:36 1991 --- pbmamiga/ppm/ppmtopi1.c Tue Jan 28 18:32:48 1992 *************** *** 18,23 **** --- 18,27 ---- #define MAXVAL 7 #define MAXCOLORS 16 + #ifdef A_SMALLSTACK + static short screen[ROWS*COLS/4]; /* simulate the ST's video RAM */ + #endif /* A_SMALLSTACK */ + void main( argc, argv ) int argc; *************** *** 31,37 **** --- 35,43 ---- int rows, cols, row, colors, i; register int col; pixval maxval; + #ifndef A_SMALLSTACK short screen[ROWS*COLS/4]; /* simulate the ST's video RAM */ + #endif /* A_SMALLSTACK */ ppm_init( &argc, argv ); diff -bBcr pbmplus10dec91/ppm/ppmtopj.c pbmamiga/ppm/ppmtopj.c *** pbmplus10dec91/ppm/ppmtopj.c Wed Dec 11 01:56:44 1991 --- pbmamiga/ppm/ppmtopj.c Tue Feb 18 16:04:52 1992 *************** *** 12,17 **** --- 12,21 ---- #include "ppm.h" + #ifdef A_FORCEPROTO + static int compress_row( unsigned char *op, unsigned char *oe, unsigned char *cp ); + #endif /* A_FORCEPROTO */ + /* * XXX: Only 8.5 x 11 paper */ diff -bBcr pbmplus10dec91/ppm/ppmtosixel.c pbmamiga/ppm/ppmtosixel.c *** pbmplus10dec91/ppm/ppmtosixel.c Wed Dec 11 01:56:50 1991 --- pbmamiga/ppm/ppmtosixel.c Tue Feb 18 16:09:22 1992 *************** *** 13,18 **** --- 13,26 ---- #include "ppm.h" #include "ppmcmap.h" + #ifdef A_FORCEPROTO + int WriteHeader(void); + int WriteColorMap( colorhist_vector chv, int colors, pixval maxval ); + int WriteRawImage( colorhash_table cht, int rows, int cols ); + int WritePackedImage( colorhash_table cht, int rows, int cols ); + int WriteEnd(void); + #endif /* A_FORCEPROTO */ + #define MAXVAL 100 #define MAXCOLORS 256 diff -bBcr pbmplus10dec91/ppm/rawtoppm.c pbmamiga/ppm/rawtoppm.c *** pbmplus10dec91/ppm/rawtoppm.c Wed Dec 11 01:55:54 1991 --- pbmamiga/ppm/rawtoppm.c Tue Feb 18 16:10:28 1992 *************** *** 42,48 **** --- 42,50 ---- register gray* g2P; register gray* g3P; char* usage = "[-headerskip N] [-rowskip N] [-rgb|-rbg|-grb|-gbr|-brg|-bgr] [-interpixel|-interrow] [rawfile]"; + #ifndef A_FORCEPROTO double atof(); + #endif /* A_FORCEPROTO */ ppm_init( &argc, argv ); diff -bBcr pbmplus10dec91/ppm/sldtoppm.c pbmamiga/ppm/sldtoppm.c *** pbmplus10dec91/ppm/sldtoppm.c Wed Dec 11 01:57:02 1991 --- pbmamiga/ppm/sldtoppm.c Tue Feb 18 18:26:12 1992 *************** *** 62,67 **** --- 62,78 ---- struct spoint t; /* To point */ }; + #ifdef A_FORCEPROTO + static int extend( smallint ch ); + static int sli( void ); + static int slib( void ); + static void vscale( int *px, int *py ); + static void slider( void (*slvec)(struct svector *vec, int colour), + void (*slflood)(struct spolygon *poly, int colour) ); + static void slidefind( char *sname, int dironly, int ucasen ); + static void draw( struct svector *vec, int colour ); + static void flood( struct spolygon *poly, int colour ); + #endif /* A_FORCEPROTO */ static int ixdots, iydots; /* Screen size in dots */ static FILE *slfile; /* Slide file descriptor */ *************** *** 147,154 **** --- 158,170 ---- */ static void slider(slvec, slflood) + #ifndef A_FORCEPROTO void (*slvec)(); void (*slflood)(); + #else /* A_FORCEPROTO */ + void (*slvec)(struct svector *vec, int colour); + void (*slflood)(struct spolygon *poly, int colour); + #endif /* A_FORCEPROTO */ { int i, rescale; unsigned char ubfr[4]; /* Utility character buffer */ diff -bBcr pbmplus10dec91/ppm/sputoppm.c pbmamiga/ppm/sputoppm.c *** pbmplus10dec91/ppm/sputoppm.c Wed Dec 11 01:56:40 1991 --- pbmamiga/ppm/sputoppm.c Tue Jan 28 18:32:50 1992 *************** *** 16,21 **** --- 16,26 ---- #define COLS 320 #define MAXVAL 7 + #ifdef A_SMALLSTACK + static pixel pal[ROWS][48]; /* Spectrum palettes, three per row */ + static short screen[ROWS*COLS/4]; /* simulates the Atari's video RAM */ + #endif /* A_SMALLSTACK */ + void main( argc, argv ) int argc; *************** *** 22,29 **** --- 27,36 ---- char* argv[]; { FILE* ifp; + #ifndef A_SMALLSTACK pixel pal[ROWS][48]; /* Spectrum palettes, three per row */ short screen[ROWS*COLS/4]; /* simulates the Atari's video RAM */ + #endif /* A_SMALLSTACK */ int i, j; pixel* pixelrow; register pixel* pP;