#ifndef __UNIXLIB_LOADED #define __UNIXLIB_LOADED 1 /**************************************************************************** ** ** - Prototypes for UNIX emulation functions ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** The environ array is always composed of a list of 32 bit addresses */ #ifdef __ALPHA # define environ (decc$ga_environ) #else # define environ (*decc$ga_environ) #endif #pragma __extern_model __save #pragma __extern_model __strict_refdef extern char **environ; /* Only minimally supported */ #pragma __extern_model __restore /* ** Types shared with that are used later */ #if !defined __MODE_T && !defined _DECC_V4_SOURCE # define __MODE_T 1 typedef __mode_t mode_t; #endif #if !defined __UID_T && !defined _DECC_V4_SOURCE # define __UID_T 1 typedef __uid_t uid_t; #endif #if !defined __SIZE_T && !defined _DECC_V4_SOURCE && defined _POSIX_C_SOURCE # define __SIZE_T 1 typedef __size_t size_t; #endif #if !defined __GID_T && !defined _DECC_V4_SOURCE # define __GID_T 1 typedef __gid_t gid_t; #endif #if !defined __PID_T && !defined _DECC_V4_SOURCE # define __PID_T 1 typedef __pid_t pid_t; #endif /* ** Constants and prototypes for former SHELL$ routines */ # define DECC$K_FOREIGN 0 # define DECC$K_FILE 1 # define DECC$K_DIRECTORY 2 /* ** SHELL$ prototypes are provided for backward compatibility. Use of the ** decc$* routines is recommended. */ #define SHELL$TO_VMS(__s,__a,__n1,__n2) decc$to_vms(__s,__a,__n1,__n2) #define SHELL$FROM_VMS(__s,__a,__n) decc$from_vms(__s,__a,__n) #define SHELL$MATCH_WILD(__s1,__s2) decc$match_wild(__s1,__s2) #define SHELL$FIX_TIME(__n) decc$fix_time(__n) #define SHELL$TRANSLATE_VMS(__s) decc$translate_vms(__s) #define shell$to_vms(__s,__a,__n1,__n2) decc$to_vms(__s,__a,__n1,__n2) #define shell$from_vms(__s,__a,__n) decc$from_vms(__s,__a,__n) #define shell$match_wild(__s1,__s2) decc$match_wild(__s1,__s2) #define shell$fix_time(__n) decc$fix_time(__n) #define shell$translate_vms(__s) decc$translate_vms(__s) /* ** These former SHELL$ routines are unavailable on Alpha/VMS. Also ** SHELL$GET_ARGV, and SHELL$$RMS_PARSE */ #ifdef __ALPHA # define SHELL$IS_SHELL() (0) # define SHELL$CLI_NAME(_x) (0) #endif /* ** The callback routines for the decc$to_vms and decc$from_vms functions are ** always passed 32 bit addresses. */ typedef int (*__to_vms_callback) (char *, int); typedef int (*__from_vms_callback) (char *); /* ** We are done defining things which must always be 32 bit pointers. If the ** user has used /pointer_size=32 or /pointer_size=64, we will allow 64 bit ** pointers to be used in function calls. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** The following functions have interfaces of XXX, _XXX32, and _XXX64 due only ** to the fact that the return argument is a pointer that is relative to one ** of the arguments. */ #if __INITIAL_POINTER_SIZE == 32 #pragma __pointer_size 32 #endif #if defined _POSIX_C_SOURCE char *getcwd(char *__buffer, __size_t __size); #else char *getcwd(char *__buffer, unsigned int __size, ...); #endif char *gcvt(double __value, int __ndigit, char *__buffer); #if __INITIAL_POINTER_SIZE == 32 #pragma __pointer_size 64 #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size 32 char *_getcwd32 (char *__buffer, unsigned int __size, ...); char *_gcvt32 (double __value, int __ndigit, char *__buffer); # pragma __pointer_size 64 char *_getcwd64 (char *__buffer, unsigned int __size, ...); char *_gcvt64 (double __value, int __ndigit, char *__buffer); #endif /* ** Function prototypes */ __char_ptr32 ecvt (double __value, int __ndigit, int *__decpt, int *__sign); __char_ptr32 fcvt (double __value, int __ndigit, int *__decpt, int *__sign); __char_ptr32 getenv (const char *__name); #if defined _POSIX_C_SOURCE int mkdir (const char *__dir_spec, __mode_t __mode); #else int mkdir (const char *__dir_spec, __mode_t __mode, ...); #endif #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #elif __CRTL_VER >= 70000000 && !defined(_VMS_V6_SOURCE) # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__unix_" # else # define geteuid() __unix_geteuid() # define getuid() __unix_getuid() # endif #endif __uid_t geteuid (void); __uid_t getuid (void); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #elif __CRTL_VER >= 70000000 && !defined(_VMS_V6_SOURCE) # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif #endif #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #endif __gid_t getgid (void); __gid_t getegid (void); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif __pid_t getpid (void); __pid_t getppid (void); /* ** DEC C V5.2 changed the prototypes to ISO POSIX-1 definitions in a way ** that was binary upward compatible but not source upward compatibile. ** The old definitions are retained for compatibility with old source. */ #ifndef _DECC_V4_SOURCE #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #endif int setgid (__gid_t); int setuid (__uid_t); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif #else __gid_t setgid (__gid_t); __uid_t setuid (__uid_t); #endif int decc$to_vms (const char *__filename, __to_vms_callback, int __allow_wild, int __no_directory); int decc$from_vms (const char *__filename, __from_vms_callback, int __allow_wild); int decc$match_wild (char *__text, char *__pattern); __char_ptr32 decc$translate_vms (const char *__vms_filespec ); unsigned int decc$fix_time (void *__vms_time); /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __UNIXLIB_LOADED */