mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.0.5c.tar
This commit is contained in:
104
contrib/gregbook/makevms.com
Normal file
104
contrib/gregbook/makevms.com
Normal file
@@ -0,0 +1,104 @@
|
||||
$!------------------------------------------------------------------------------
|
||||
$! make Contrib programs of libpng under OpenVMS
|
||||
$!
|
||||
$!
|
||||
$! Look for the compiler used
|
||||
$!
|
||||
$ zlibsrc = "[---.zlib]"
|
||||
$ ccopt="/include=(''zlibsrc',[--])"
|
||||
$ if f$getsyi("HW_MODEL").ge.1024
|
||||
$ then
|
||||
$ ccopt = "/prefix=all"+ccopt
|
||||
$ comp = "__decc__=1"
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
||||
$ else
|
||||
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
||||
$ then
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
||||
$ if f$search("SYS$SYSTEM:VAXC.EXE").eqs.""
|
||||
$ then
|
||||
$ comp = "__gcc__=1"
|
||||
$ CC :== GCC
|
||||
$ else
|
||||
$ comp = "__vaxc__=1"
|
||||
$ endif
|
||||
$ else
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
|
||||
$ ccopt = "/decc/prefix=all"+ccopt
|
||||
$ comp = "__decc__=1"
|
||||
$ endif
|
||||
$ endif
|
||||
$ open/write lopt lib.opt
|
||||
$ write lopt "[--]libpng.olb/lib"
|
||||
$ write lopt "''zlibsrc'libz.olb/lib"
|
||||
$ close lopt
|
||||
$ open/write xopt x11.opt
|
||||
$ write xopt "sys$library:decw$xlibshr.exe/share"
|
||||
$ close xopt
|
||||
$ write sys$output "Compiling PNG contrib programs ..."
|
||||
$ CALL MAKE readpng.OBJ "cc ''CCOPT' readpng" -
|
||||
readpng.c readpng.h
|
||||
$ CALL MAKE readpng2.OBJ "cc ''CCOPT' readpng2" -
|
||||
readpng2.c readpng2.h
|
||||
$ CALL MAKE writepng.OBJ "cc ''CCOPT' writepng" -
|
||||
writepng.c writepng.h
|
||||
$ write sys$output "Building rpng-x..."
|
||||
$ CALL MAKE rpng-x.OBJ "cc ''CCOPT' rpng-x" -
|
||||
rpng-x.c readpng.h
|
||||
$ call make rpng-x.exe -
|
||||
"LINK rpng-x,readpng,lib.opt/opt,x11.opt/opt" -
|
||||
rpng-x.obj readpng.obj
|
||||
$ write sys$output "Building rpng2-x..."
|
||||
$ CALL MAKE rpng2-x.OBJ "cc ''CCOPT' rpng2-x" -
|
||||
rpng2-x.c readpng2.h
|
||||
$ call make rpng2-x.exe -
|
||||
"LINK rpng2-x,readpng2,lib.opt/opt,x11.opt/opt" -
|
||||
rpng2-x.obj readpng2.obj
|
||||
$ write sys$output "Building wpng..."
|
||||
$ CALL MAKE wpng.OBJ "cc ''CCOPT' wpng" -
|
||||
wpng.c writepng.h
|
||||
$ call make wpng.exe -
|
||||
"LINK wpng,writepng,lib.opt/opt" -
|
||||
wpng.obj writepng.obj
|
||||
$ exit
|
||||
$!
|
||||
$!
|
||||
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
|
||||
$ V = 'F$Verify(0)
|
||||
$! P1 = What we are trying to make
|
||||
$! P2 = Command to make it
|
||||
$! P3 - P8 What it depends on
|
||||
$
|
||||
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
|
||||
$ Time = F$CvTime(F$File(P1,"RDT"))
|
||||
$arg=3
|
||||
$Loop:
|
||||
$ Argument = P'arg
|
||||
$ If Argument .Eqs. "" Then Goto Exit
|
||||
$ El=0
|
||||
$Loop2:
|
||||
$ File = F$Element(El," ",Argument)
|
||||
$ If File .Eqs. " " Then Goto Endl
|
||||
$ AFile = ""
|
||||
$Loop3:
|
||||
$ OFile = AFile
|
||||
$ AFile = F$Search(File)
|
||||
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
|
||||
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
|
||||
$ Goto Loop3
|
||||
$NextEL:
|
||||
$ El = El + 1
|
||||
$ Goto Loop2
|
||||
$EndL:
|
||||
$ arg=arg+1
|
||||
$ If arg .Le. 8 Then Goto Loop
|
||||
$ Goto Exit
|
||||
$
|
||||
$Makeit:
|
||||
$ VV=F$VERIFY(0)
|
||||
$ write sys$output P2
|
||||
$ 'P2
|
||||
$ VV='F$Verify(VV)
|
||||
$Exit:
|
||||
$ If V Then Set Verify
|
||||
$ENDSUBROUTINE
|
||||
@@ -222,7 +222,8 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
if ((rc = readpng_init(infile, &image_width, &image_height)) != 0) {
|
||||
if ((rc = readpng_init(infile, (long *)(&image_width),
|
||||
(long *)(&image_height))) != 0) {
|
||||
switch (rc) {
|
||||
case 1:
|
||||
fprintf(stderr, PROGNAME
|
||||
@@ -542,7 +543,8 @@ static int rpng_x_create_window()
|
||||
|
||||
static int rpng_x_display_image()
|
||||
{
|
||||
uch *src, *dest;
|
||||
uch *src;
|
||||
char *dest;
|
||||
uch r, g, b, a;
|
||||
int ximage_rowbytes = ximage->bytes_per_line;
|
||||
ulg i, row, lastrow = 0;
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/keysym.h> /* defines XK_* macros */
|
||||
|
||||
#ifdef VMS
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* all for PvdM background code: */
|
||||
#ifndef PI
|
||||
# define PI 3.141592653589793238
|
||||
@@ -721,7 +725,8 @@ static int rpng2_x_create_window()
|
||||
|
||||
static int rpng2_x_load_bg_image()
|
||||
{
|
||||
uch *src, *dest;
|
||||
uch *src;
|
||||
char *dest;
|
||||
uch r1, r2, g1, g2, b1, b2;
|
||||
uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv;
|
||||
int k, hmax, max;
|
||||
@@ -784,7 +789,7 @@ static int rpng2_x_load_bg_image()
|
||||
g2_inv = g2_min + (g2_diff * (yidx_max-yidx)) / yidx_max;
|
||||
b2_inv = b2_min + (b2_diff * (yidx_max-yidx)) / yidx_max;
|
||||
|
||||
dest = bg_data + row*bg_rowbytes;
|
||||
dest = (char *)(bg_data + row*bg_rowbytes);
|
||||
for (i = 0; i < rpng2_info.width; ++i) {
|
||||
even_odd_horiz = (i / bgscale) & 1;
|
||||
even_odd = even_odd_vert ^ even_odd_horiz;
|
||||
@@ -837,7 +842,7 @@ static int rpng2_x_load_bg_image()
|
||||
yidx = row % bgscale;
|
||||
if (yidx > hmax)
|
||||
yidx = bgscale-1 - yidx;
|
||||
dest = bg_data + row*bg_rowbytes;
|
||||
dest = (char *)(bg_data + row*bg_rowbytes);
|
||||
for (i = 0; i < rpng2_info.width; ++i) {
|
||||
xidx = i % bgscale;
|
||||
if (xidx > hmax)
|
||||
@@ -887,7 +892,7 @@ static int rpng2_x_load_bg_image()
|
||||
|
||||
for (row = 0; row < rpng2_info.height; ++row) {
|
||||
y = row - hh;
|
||||
dest = bg_data + row*bg_rowbytes;
|
||||
dest = (char *)(bg_data + row*bg_rowbytes);
|
||||
for (i = 0; i < rpng2_info.width; ++i) {
|
||||
x = i - hw;
|
||||
angle = (x == 0)? PI_2 : atan((double)y / (double)x);
|
||||
@@ -1001,7 +1006,8 @@ static void rpng2_x_display_row(ulg row)
|
||||
uch bg_red = rpng2_info.bg_red;
|
||||
uch bg_green = rpng2_info.bg_green;
|
||||
uch bg_blue = rpng2_info.bg_blue;
|
||||
uch *src, *src2=NULL, *dest;
|
||||
uch *src, *src2=NULL;
|
||||
char *dest;
|
||||
uch r, g, b, a;
|
||||
int ximage_rowbytes = ximage->bytes_per_line;
|
||||
ulg i, pixel;
|
||||
|
||||
Reference in New Issue
Block a user