#ifndef __STRING_LOADED #define __STRING_LOADED 1 #ifndef __STRING_PROCESSED #define __STRING_PROCESSED /**************************************************************************** ** ** - String Handling ** ***************************************************************************** ** Header introduced by the ANSI C Standard ***************************************************************************** ** ***************************************************************************** ** * ** HPE CONFIDENTIAL. This software is confidential proprietary software * ** licensed by Hewlett Packard Enterprise Development, LP, and is not * ** authorized to be used, duplicated or disclosed to anyone without the * ** prior written permission of HPE. * ** Copyright 2006 Hewlett Packard Enterprise Development, LP * ** * ** VMS SOFTWARE, INC. CONFIDENTIAL. This software is confidential * ** proprietary software licensed by VMS Software, Inc., and is not * ** authorized to be used, duplicated or disclosed to anyone without * ** the prior written permission of VMS Software, Inc. * ** Copyright 2020-2022 VMS Software, Inc. * ** * *****************************************************************************/ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif #ifdef __NAMESPACE_STD namespace std { #endif /* ** Create 'public' typedefs, structure definitions, and definitions which are ** in this header file which are either not sensitive to pointer size or are ** required to be short pointers. */ #ifndef __SIZE_T # define __SIZE_T 1 typedef __size_t size_t; #endif #ifdef __NAMESPACE_STD } /* namespace std */ #endif #ifndef NULL # define NULL __NULL #endif /* ** At this point in the processing, we are done defining those things which ** must always be short pointers. If the user has used the /pointer_size ** qualifier, we will allow long pointers to be used in function calls ** regardless of whether they have specified short or long pointers. */ #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 #ifdef __NAMESPACE_STD namespace std { #endif void *memchr (const void *__s, int __c, __size_t __n); void *memcpy (void *__s1, __const_void_ptr64 __s2, __size_t __n); void *memmove (void *__s1, __const_void_ptr64 __s2, __size_t __n); void *memset (void *__s, int __c, __size_t __n); char *strcat (char *__s1, __const_char_ptr64 __s2); char *strchr (const char *__s, int __c); char *strcpy (char *__s1, __const_char_ptr64 __s2); char *strncat (char *__s1, __const_char_ptr64 __s2, __size_t __n); char *strncpy (char *__s1, __const_char_ptr64 __s2, __size_t __n); char *strpbrk (const char *__s1, __const_char_ptr64 __s2); char *strrchr (const char *__s, int __c); char *strstr (const char *__s1, __const_char_ptr64 __s2); char *strtok (char *__s1, __const_char_ptr64 __s2); #ifdef __NAMESPACE_STD } /* namespace std */ #endif #if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 #endif #if __INITIAL_POINTER_SIZE && !defined _ANSI_C_SOURCE && __CRTL_VER >= 70000000 # pragma __pointer_size 32 void *_memchr32 (const void *__s, int __c, __size_t __n); void *_memcpy32 (void *__s1, __const_void_ptr64 __s2, __size_t __n); void *_memmove32 (void *__s1, __const_void_ptr64 __s2, __size_t __n); void *_memset32 (void *__s, int __c, __size_t __n); char *_strcat32 (char *__s1, __const_char_ptr64 __s2); char *_strchr32 (const char *__s, int __c); char *_strcpy32 (char *__s1, __const_char_ptr64 __s2); char *_strncat32 (char *__s1, __const_char_ptr64 __s2, __size_t __n); char *_strncpy32 (char *__s1, __const_char_ptr64 __s2, __size_t __n); char *_strpbrk32 (const char *__s1, __const_char_ptr64 __s2); char *_strrchr32 (const char *__s, int __c); char *_strstr32 (const char *__s1, __const_char_ptr64 __s2); char *_strtok32 (char *__s1, __const_char_ptr64 __s2); # pragma __pointer_size 64 void *_memchr64 (const void *__s, int __c, __size_t __n); void *_memcpy64 (void *__s1, const void *__s2, __size_t __n); void *_memmove64 (void *__s1, const void *__s2, __size_t __n); void *_memset64 (void *__s, int __c, __size_t __n); char *_strcat64 (char *__s1, const char *__s2); char *_strchr64 (const char *__s, int __c); char *_strcpy64 (char *__s1, const char *__s2); char *_strncat64 (char *__s1, const char *__s2, __size_t __n); char *_strncpy64 (char *__s1, const char *__s2, __size_t __n); char *_strpbrk64 (const char *__s1, const char *__s2); char *_strrchr64 (const char *__s, int __c); char *_strstr64 (const char *__s1, const char *__s2); char *_strtok64 (char *__s1, const char *__s2); #endif #ifdef __NAMESPACE_STD namespace std { #endif /* ** The following functions have only a single interface regardless of the ** pointer size in effect. The parameters can accept both 32 bit and 64 ** bit addresses. */ int memcmp (const void *__s1, const void *__s2, __size_t __n); int strcmp (const char *__s1, const char *__s2); int strcoll (const char *__s1, const char *__s2); int strncmp (const char *__s1, const char *__s2, __size_t __n); __size_t strcspn (const char *__s1, const char *__s2); __size_t strlen (const char *__s); __size_t strspn (const char *__s1, const char *__s2); __size_t strxfrm (char *__s1, const char *__s2, __size_t __n); #ifdef __NAMESPACE_STD } /* namespace std */ #endif #if !defined _ANSI_C_SOURCE && __CRTL_VER >= 60200000 __size_t strnlen (const char *__s, __size_t __n); #endif /* ** The following function has a different prototype based on whether or ** not we are compiling in strict ANSI C compatibility mode. */ #ifdef __NAMESPACE_STD namespace std { #endif #if defined _ANSI_C_SOURCE __char_ptr32 strerror(int __errnum); #else __char_ptr32 strerror(int __errnum, ...); #endif #ifdef __NAMESPACE_STD } /* namespace std */ #endif /* ** X/Open extensions */ #if defined _XOPEN_SOURCE || !defined _ANSI_C_SOURCE # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif # if __CRTL_VER >= 70000000 void *memccpy(void *, __const_void_ptr64, int, __size_t); # endif #endif /* ** X/Open extended */ #if defined _XOPEN_SOURCE_EXTENDED || !defined _ANSI_C_SOURCE # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif # if __CRTL_VER >= 70000000 char *strdup(__const_char_ptr64); # endif # if __CRTL_VER >= 70301000 char *strtok_r(char *__s, __const_char_ptr64 __sep, char **lasts); # endif # if __CRTL_VER >= 80500000 char *strndup(__const_char_ptr64, __size_t); int strerror_r(int, __char_ptr64, __size_t); char *stpcpy(char *, __const_char_ptr64); # define mempcpy(to, from, len) (void *)((char *)memcpy((to), (from), (len)) + (len)) # endif #endif /* ** BSD 4.4 extensions. strsep is specified by BSD 4.4 but not X/Open ** There is not currently a feature test macro defined for BSD44 */ #if !defined _ANSI_C_SOURCE && __CRTL_VER >= 70000000 # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif char *strsep(char **, __const_char_ptr64); # if __INITIAL_POINTER_SIZE # pragma __pointer_size 32 char *_strsep32(char **, __const_char_ptr64); # pragma __pointer_size 64 char *_strsep64(char **, const char *); # endif #endif /* ** DEC C Extensions ** X/Open extended specifies that bcmp, bcopy, bzero, ffs, strcasecmp ** strncasecmp, index and rindex appear in . ** X/Open extended specifies that basename and dirname appear in */ #if !defined _ANSI_C_SOURCE && __CRTL_VER >= 70000000 # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 # endif int bcmp (const void * __s1, const void * __s2, __size_t __n); void (bcopy) (const void * __s1, void * __s2, __size_t __n); void (bzero) (void * __s1, __size_t __n); int ffs (int); int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, __size_t); # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif char *index(const char *, int); char *rindex(const char *, int); char *basename(char *); char *dirname(char *); # if __INITIAL_POINTER_SIZE # pragma __pointer_size 32 char *_strdup32(__const_char_ptr64); void *_memccpy32(void *, __const_void_ptr64, int, __size_t); char *_basename32(char *); char *_dirname32(char *); char *_index32(const char *, int); char *_rindex32(const char *, int); # if __CRTL_VER >= 70301000 char *_strtok_r32 (char *__s, __const_char_ptr64 __sep, char **lasts); # endif # if __CRTL_VER >= 80500000 char *_strndup32(__const_char_ptr64, __size_t); char *_stpcpy32(char *, __const_char_ptr64); # define _mempcpy32(to, from, len) (void *)((char *)_memcpy32((to), (from), (len)) + (len)) # endif # pragma __pointer_size 64 char *_strdup64(const char *); void *_memccpy64(void *, const void *, int, __size_t); char *_basename64(char *); char *_dirname64(char *); char *_index64(const char *, int); char *_rindex64(const char *, int); # if __CRTL_VER >= 70301000 char *_strtok_r64 (char *__s, __const_char_ptr64 __sep, char **lasts); # endif # if __CRTL_VER >= 80500000 char *_strndup64(const char *, __size_t); char *_stpcpy64(char *, const char *); # define _mempcpy64(to, from, len) (void *)((char *)_memcpy64((to), (from), (len)) + (len)) # endif # endif #endif #if !defined(__clang__) /* ** DEC C Performance (Builtins) ** ** Certain DEC C functions are available as compiler builtins. Using ** the builtins offer performance improvements and are enabled here ** for all programs including this header file. ** ** In a 64 bit OpenVMS environment, the builtins accept and return 64 bit ** pointers. We will explicitly use casts */ #if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 #endif #if __DECCXX_VER >= 60590046 void * __MEMCPY (void *__s1, __const_void_ptr64 __s2, __size_t __n); void * __MEMMOVE (void *__s1, __const_void_ptr64 __s2, __size_t __n); #else void * __MEMCPY (void *__s1, const void *__s2, __size_t __n); void * __MEMMOVE (void *__s1, const void *__s2, __size_t __n); #endif void * __MEMSET (void *__s, int __c, __size_t __n); #if (__DECC_VER > 50600000) __size_t __STRLEN (const char *__s); char * __STRCPY (char *__s1, const char *__s2); #endif #ifndef __NAMESPACE_STD # define memcpy(__x, __y, __z) __MEMCPY(__x, __y, __z) # define memmove(__x, __y, __z) __MEMMOVE(__x, __y, __z) # define memset(__x, __y, __z) __MEMSET(__x, __y, __z) #endif #if (__DECC_VER > 50600000) # define strlen(__x) __STRLEN(__x) # define strcpy(__x, __y) __STRCPY(__x, __y) #endif #if !defined _ANSI_C_SOURCE && __CRTL_VER >= 70000000 /* BSD byte string extensions */ # define bcopy(__x, __y, __z) __MEMMOVE(__y, __x, __z) # define bzero(__x, __y) __MEMSET(__x, 0, __y) #endif #if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 #endif #endif /* ** DEC C RTL Performance (Linkages) ** ** Certain DEC C RTL functions are defined with linkages declared ** which gives the compiler more information as to register usage in ** the implementation. */ #if defined(__ALPHA) && defined(__DECC) /* Verified for x86, John Reagan */ # pragma __linkage __str_link1 = (\ __notused(__r1,__r2,__r3,__r4,__r5,__r6,__r7,__r8,__r9,__r10,__r11,\ __r12,__r13,__r14,__r15,__r17,__r18,__r19,__r20,__r21,__r22,\ __r23,__r24,__r25,__r29,\ __f0,__f1,__f2,__f3,__f4,__f5,__f6,__f7,__f8,__f9,__f10,\ __f11,__f12,__f13,__f14,__f15,__f16,__f17,__f18,__f19,__f20,\ __f21,__f22,__f23,__f24,__f25,__f26,__f27,__f28,__f29,__f30),\ __notneeded(__ai)) # pragma __linkage __str_link2 = (\ __notused(__r1,__r2,__r3,__r4,__r5,__r6,__r7,__r8,__r9,__r10,__r11,\ __r12,__r13,__r14,__r15,__r22,__r23,__r24,__r25,__r29,\ __f0,__f1,__f2,__f3,__f4,__f5,__f6,__f7,__f8,__f9,__f10,\ __f11,__f12,__f13,__f14,__f15,__f16,__f17,__f18,__f19,__f20,\ __f21,__f22,__f23,__f24,__f25,__f26,__f27,__f28,__f29,__f30),\ __notneeded(__ai)) # pragma __linkage __str_link3 = (\ __notused(__r2,__r3,__r4,__r5,__r6,__r7,__r8,__r9,__r10,__r11,__r12,\ __r13,__r14,__r15,__r18,__r19,__r20,__r21,__r22,__r23,__r24,\ __r25,__r29,\ __f0,__f1,__f2,__f3,__f4,__f5,__f6,__f7,__f8,__f9,__f10,\ __f11,__f12,__f13,__f14,__f15,__f16,__f17,__f18,__f19,__f20,\ __f21,__f22,__f23,__f24,__f25,__f26,__f27,__f28,__f29,__f30),\ __notneeded(__ai)) # if (__DECC_VER > 50600000) # pragma __use_linkage __str_link2 (strcmp) # pragma __use_linkage __str_link3 (strnlen) # else # pragma __use_linkage __str_link1 (strlen) # pragma __use_linkage __str_link2 (strcpy, strcmp) # pragma __use_linkage __str_link3 (strnlen) # endif #endif /* ** Should define "similar" linkages for ia64, but they cannot be exactly ** the same because the register conventions are different. ** Since we still haven't done this by May 2017, we'll never do it. ** ** And I suspect we'll just keep them as standard calls on x86 but ** some of them might be LLVM intrinsics and it will manage any ** non-standard interfaces. */ /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __STRING_PROCESSED */ #if defined(__NAMESPACE_STD) && !defined(__NAMESPACE_STD_ONLY) # ifndef __USING_STRING_NAMES # define __USING_STRING_NAMES using std::memchr; using std::memcmp; using std::memcpy; using std::memmove; using std::memset; using std::size_t; using std::strcat; using std::strchr; using std::strcmp; using std::strcoll; using std::strcpy; using std::strcspn; using std::strerror; using std::strlen; using std::strncat; using std::strncmp; using std::strncpy; using std::strpbrk; using std::strrchr; using std::strspn; using std::strstr; using std::strtok; using std::strxfrm; # endif #endif #endif /* __STRING_LOADED */