#ifndef __UNIXLIB_LOADED #define __UNIXLIB_LOADED 1 /**************************************************************************** ** ** - Prototypes for UNIX emulation functions ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright 2006 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries 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. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ #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 */ #if !defined(__VAX) # 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 #ifdef __NAMESPACE_STD namespace std { #endif typedef __size_t size_t; #ifdef __NAMESPACE_STD } /* namespace std */ using std::size_t; #endif #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 */ #if !defined(__VAX) # 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 extern int DECC$$GL___CRTL_VER; # define decc$$gl___crtl_ver DECC$$GL___CRTL_VER #if __CRTL_VER >= 70301000 extern int DECC$$GL___VMS_VER_BUILD; # define decc$$gl___vms_ver_build DECC$$GL___VMS_VER_BUILD extern int DECC$$GL___CRTL_VER_BUILD; # define decc$$gl___crtl_ver_build DECC$$GL___CRTL_VER_BUILD int decc$getmain_argc(void); __char_ptr_ptr32 decc$getmain_argv(void); __char_ptr32 decc$feature_get_name (int __index); int decc$feature_get_index (const char *__feature_name); /* ** Several decc$feature functions take a mode argument: */ #define __FEATURE_MODE_DEFVAL 0 #define __FEATURE_MODE_CURVAL 1 #define __FEATURE_MODE_MINVAL 2 #define __FEATURE_MODE_MAXVAL 3 #define __FEATURE_MODE_INIT_STATE 4 #define __FEATURE_MODE_SYSDEFVAL 5 #define __FEATURE_MODE_GRPDEFVAL 6 #define __FEATURE_MODE_GRP 7 #define __FEATURE_MODE_RESET 8 #if __CRTL_VER >= 70321000 /* ** Acts on DECC$* feature logicals, parameter is feature name string. */ int decc$feature_get(const char* __name, int __mode); int decc$feature_set(const char* __name, int __mode, int __value); int decc$feature_show(const char* __name); int decc$feature_show_all(void); #endif int decc$feature_get_value (int __index, int __mode); int decc$feature_set_value (int __index, int __mode, int __value); int decc$get_filespec_style(void); int decc$set_filespec_style(int __style); 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, ...); #else 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); #endif int decc$set_child_standard_streams (int __fd0, int __fd1, int __fd2); #if __CRTL_VER >= 70311000 int decc$set_child_default_dir(const char * dir); #endif int decc$write_eof_to_mbx (int __fd); int decc$validate_wchar (__wchar_t wc); 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 */