14-Jul-2008

HP freeware available – by package
HP used to allow HTTP and possibly FTP access available on the contents of the Freeware CD’s but during the bootcamp last May, it was noticed this access has been removed, and the only way to get what you want is to download the full package. I got the impression that this is not what most users like, so I downloaded the files, unpcaked and restored them on my system to allow anyone to access the CD content – by package and, in that respect, by file. It’s a plain copy of the CD’s and the only thing I added is a file telling about the packages on the CD – by scanning FREEEWARE_README.TXT on each of the packages. Some don’t have one, and some have no description so for these, you’ll have to access the package to find out.

Just follow the link “Search Freeware” in the OpenVMS links.

MySQL engine now working
I cannot stand it doesn’t built like it should with HP’s kit, so I simply retried with the porting lib included. It compiles but still fails to run – same message, same location. Obviously since this has been changed in PHP sources and so need to be restored, and I forgot about that….Done that, and now I reget the error on realpath that I had before. I found it to be in the STDLIB include and it certainly relates to the CRTL version:

/*
** realpath()
** Not in ANSI standard.
** Optional parameters not in X/Open or Posix specifications.
*/
#if __CRTL_VER >=80300000
# if defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE

# if defined _POSIX_C_SOURCE
char * realpath (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name);
# else
char * realpath (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name, ...);
# endif

# if __INITIAL_POINTER_SIZE

# pragma __pointer_size 32
char * _realpath32 (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name, ...);

# pragma __pointer_size 64
char * _realpath64 (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name, ...);

# endif /* /POINTER_SIZE */

# endif /* realpath() */
#endif /* __CRTL_VER >=80300000 */

I’m on 8.3 and so I’ll have a problem.

The code containing the problem definition shows it is the non-posix version:

#ifndef __REALPATH_H
#define __REALPATH_H 1

/*
** Define the realpath function prototypes
*/
char *realpath (const char *, ...);
#endif /* -_REALPATH_H */
#endif

First one, that’s no problem. The DECC include clearly shows two, at least. The error on type however is weird, because both are defined char *. Or it should be an int64 pointer, if __INITIAL_POINTER_SIZE is false…?. The listing looks promising:

I5 5853
I5 5854 /*
I5 5855 ** realpath()
I5 5856 ** Not in ANSI standard.
I5 5857 ** Optional parameters not in X/Open or Posix specifications.
I5 5858 */
I5 5859 #if __CRTL_VER >=80300000
I5 5860 # if defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE
I5 5861
I5 X 5862 # if defined _POSIX_C_SOURCE
I5 X 5863 char * realpath (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name);
I5 X 5864 # else

Source Listing 14-JUL-2008 13:45:53 HP C V7.3-009-48GBT Page 104
21-NOV-2007 09:42:33 SYS$COMMON:[SYSLIB]DECC$RTLDEF.TLB;1(STDLIB)

I5 5865 char * realpath (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name, ...);
E
E
I5 5866 # endif
I5 5867
I5 5868
I5 X 5869 # if __INITIAL_POINTER_SIZE
I5 X 5870
I5 X 5871 # pragma __pointer_size 32
I5 X 5872 char * _realpath32 (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name, ...);
I5 X 5873
I5 X 5874 # pragma __pointer_size 64
I5 X 5875 char * _realpath64 (const char * __XOPEN_RESTRICT __file_name, char * __XOPEN_RESTRICT __resolved_name, ...);
I5 X 5876
I5 X 5877 # endif /* /POINTER_SIZE */
I5 5878
I5 5879 # endif /* realpath() */
I5 5880 #endif /* __CRTL_VER >=80300000 */
I5 5881

but what is fundamentally wrong with the PHP code?

I3 25358 #ifndef __REALPATH_H
I3 25359 #define __REALPATH_H 1
I3 25360
I3 25361 /*
I3 25362 ** Define the realpath function prototypes
I3 25363 */
I3 25364 char *realpath (const char *, ...);
......1
%CC-W-MISMATPARAM, (1) In this declaration, parameter 2 has a different type than specified in an earlier declaration of this functi
on.

%CC-E-NOTCOMPAT, (1) In this declaration, the type of "realpath" is not compatible with the type of a previous declaration of "realp
ath" at line number 450 in file SYS$COMMON:[SYSLIB]DECC$RTLDEF.TLB;1 (text module STDLIB).

I3 25365
I3 25366 #endif /* -_REALPATH_H */
I2 25367 #endif

Wait: I’m using CXX and that may make a difefrence. The number of arguments doesn’t match, the second MAY now be referred to as an int – and therefore I get an ACCVIO when storing a string “0000” is attempted.
I decided to change the realpath.h code, to match the definition in the C include:

char *realpath (const char *, char *, ...);

Since now equal, it compiles without a problem. But does it work?

After saving this post, stopping what was running PHP_WASD, and re-accessing the editor, it looks it works. No crash, no non-compliant answer, no error messages in the generarted pages. Checked it with PHP-Info, and indeed, it shows 4.1.14 – the one I’m running. And phpMyAdmin, that previously mentioned 3.1.28, now also mentions 4.1.14.

This simple change to realpath.h did the trick.

I mentioned it on JFP.s MySQL forum as well, so anyone will be able to get on. Moreover, since 4.1.4 is now working, could I try 5.1.22?