- Timestamp:
- Jul 19, 2024 1:52:30 PM (6 months ago)
- Location:
- trunk/src/libs/libxml2-2.13.2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/libxml2-2.13.2/dict.c
r105420 r105421 1018 1018 return(result & 0xFFFFFFFF); 1019 1019 } 1020 #endif1021 1020 1022 1021 /* … … 1024 1023 * 1025 1024 * Generate a pseudo-random value using the global PRNG. 1025 * 1026 * Returns a random value. 1027 */ 1028 unsigned 1029 xmlGlobalRandom(void) { 1030 unsigned ret; 1031 1032 xmlMutexLock(&xmlRngMutex); 1033 ret = xoroshiro64ss(globalRngState); 1034 xmlMutexUnlock(&xmlRngMutex); 1035 1036 return(ret); 1037 } 1038 #endif //VBOX 1039 1040 /* 1041 * xmlRandom: 1042 * 1043 * Generate a pseudo-random value using the thread-local PRNG. 1026 1044 * 1027 1045 * Returns a random value. … … 1048 1066 1049 1067 return(ret); 1050 }1051 1052 /*1053 * xmlRandom:1054 *1055 * Generate a pseudo-random value using the thread-local PRNG.1056 *1057 * Returns a random value.1058 */1059 unsigned1060 xmlRandom(void) {1061 #ifdef LIBXML_THREAD_ENABLED1062 return(xoroshiro64ss(xmlGetLocalRngState()));1063 #else1064 return(xmlGlobalRandom());1065 1068 #endif 1066 1069 #else -
trunk/src/libs/libxml2-2.13.2/include/libxml/xmlexports.h
r105420 r105421 31 31 #define XMLPUBVAR XMLPUBLIC extern 32 32 33 /* bird/VirtualBox: Visibility attributes - start */34 /* frank: changed to "hidden" */35 #if defined(VBOX_HAVE_VISIBILITY_HIDDEN) && !defined(LIBXML_STATIC) && defined(IN_LIBXML)36 #undef XMLPUBFUN37 #undef XMLPUBVAR38 #define XMLPUBFUN __attribute__((visibility("hidden")))39 #define XMLPUBVAR __attribute__((visibility("hidden"))) extern40 #endif41 /* bird/VirtualBox: Visibility attributes - end */42 43 44 33 /* Compatibility */ 45 34 #define XMLCALL … … 52 41 * Attributes 53 42 */ 43 // VBOX. Get rid of warning C4668 44 //#ifndef __GNUC__ 45 //#define __GNUC__ 0 46 //#endif 54 47 55 48 #ifndef ATTRIBUTE_UNUSED … … 139 132 #endif 140 133 134 /* bird/VirtualBox: Visibility attributes - start */ 135 /* frank: changed to "hidden" */ 136 #if defined(VBOX_HAVE_VISIBILITY_HIDDEN) && !defined(LIBXML_STATIC) && defined(IN_LIBXML) 137 #undef XMLPUBFUN 138 #undef XMLPUBVAR 139 #define XMLPUBFUN __attribute__((visibility("hidden"))) 140 #define XMLPUBVAR __attribute__((visibility("hidden"))) extern 141 #endif 142 /* bird/VirtualBox: Visibility attributes - end */ 143 144 141 145 /* 142 146 * Originally declared in xmlversion.h which is generated -
trunk/src/libs/libxml2-2.13.2/xmlIO.c
r105420 r105421 115 115 ************************************************************************/ 116 116 117 static const char* const IOerr[] = {118 "Unknown IO error", /* UNKNOWN */119 "Permission denied", /* EACCES */120 "Resource temporarily unavailable",/* EAGAIN */121 "Bad file descriptor", /* EBADF */122 "Bad message", /* EBADMSG */123 "Resource busy", /* EBUSY */124 "Operation canceled", /* ECANCELED */125 "No child processes", /* ECHILD */126 "Resource deadlock avoided",/* EDEADLK */127 "Domain error", /* EDOM */128 "File exists", /* EEXIST */129 "Bad address", /* EFAULT */130 "File too large", /* EFBIG */131 "Operation in progress", /* EINPROGRESS */132 "Interrupted function call",/* EINTR */133 "Invalid argument", /* EINVAL */134 "Input/output error", /* EIO */135 "Is a directory", /* EISDIR */136 "Too many open files", /* EMFILE */137 "Too many links", /* EMLINK */138 "Inappropriate message buffer length",/* EMSGSIZE */139 "Filename too long", /* ENAMETOOLONG */140 "Too many open files in system",/* ENFILE */141 "No such device", /* ENODEV */142 "No such file or directory",/* ENOENT */143 "Exec format error", /* ENOEXEC */144 "No locks available", /* ENOLCK */145 "Not enough space", /* ENOMEM */146 "No space left on device", /* ENOSPC */147 "Function not implemented", /* ENOSYS */148 "Not a directory", /* ENOTDIR */149 "Directory not empty", /* ENOTEMPTY */150 "Not supported", /* ENOTSUP */151 "Inappropriate I/O control operation",/* ENOTTY */152 "No such device or address",/* ENXIO */153 "Operation not permitted", /* EPERM */154 "Broken pipe", /* EPIPE */155 "Result too large", /* ERANGE */156 "Read-only file system", /* EROFS */157 "Invalid seek", /* ESPIPE */158 "No such process", /* ESRCH */159 "Operation timed out", /* ETIMEDOUT */160 "Improper link", /* EXDEV */161 "Attempt to load network entity %s", /* XML_IO_NETWORK_ATTEMPT */162 "encoder error", /* XML_IO_ENCODER */163 "flush error",164 "write error",165 "no input",166 "buffer full",167 "loading error",168 "not a socket", /* ENOTSOCK */169 "already connected", /* EISCONN */170 "connection refused", /* ECONNREFUSED */171 "unreachable network", /* ENETUNREACH */172 "address in use", /* EADDRINUSE */173 "already in use", /* EALREADY */174 "unknown address family", /* EAFNOSUPPORT */175 };176 177 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT)178 117 /** 179 118 * xmlIOErrMemory: … … 411 350 ************************************************************************/ 412 351 413 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT)352 #if defined(_WIN32) 414 353 415 354 /** … … 484 423 { 485 424 #ifdef HAVE_STAT 486 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT)425 #if defined(_WIN32) 487 426 struct _stat stat_buffer; 488 427 #else … … 496 435 497 436 #ifdef HAVE_STAT 498 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT)437 #if defined(_WIN32) 499 438 { 500 439 wchar_t *wpath; … … 760 699 wchar_t *wpath; 761 700 762 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT) 763 fd = xmlWrapOpenUtf8(path, 0); 701 wpath = __xmlIOWin32UTF8ToWChar(filename); 702 if (wpath == NULL) { 703 xmlFree(fromUri); 704 return(XML_ERR_NO_MEMORY); 705 } 706 fd = _wfopen(wpath, write ? L"wb" : L"rb"); 707 xmlFree(wpath); 708 } 764 709 #else 765 710 fd = fopen(filename, write ? "wb" : "rb"); … … 799 744 void *context; 800 745 801 if (!strcmp(filename, "-")) { 802 fd = stdout; 803 return((void *) fd); 804 } 805 806 if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) 807 #if defined (_WIN32) 808 path = &filename[17]; 809 #else 810 path = &filename[16]; 811 #endif 812 else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { 813 #if defined (_WIN32) 814 path = &filename[8]; 815 #else 816 path = &filename[7]; 817 #endif 818 } else 819 path = filename; 820 821 if (path == NULL) 822 return(NULL); 823 824 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT) 825 fd = xmlWrapOpenUtf8(path, 1); 826 #elif(__MVS__) 827 fd = fopen(path, "w"); 828 #else 829 fd = fopen(path, "wb"); 830 #endif /* WIN32 */ 831 832 if (fd == NULL) xmlIOErr(0, path); 833 return((void *) fd); 746 xmlFileOpenSafe(filename, 0, &context); 747 return(context); 834 748 } 835 749 … … 968 882 * * 969 883 ************************************************************************/ 970 971 /**972 * xmlGzfileOpen_real:973 * @filename: the URI for matching974 *975 * input from compressed file open976 * if @filename is " " then the standard input is used977 *978 * Returns an I/O context or NULL in case of error979 */980 static void *981 xmlGzfileOpen_real (const char *filename) {982 const char *path = NULL;983 gzFile fd;984 985 if (!strcmp(filename, "-")) {986 int duped_fd = dup(fileno(stdin));987 fd = gzdopen(duped_fd, "rb");988 if (fd == Z_NULL && duped_fd >= 0) {989 close(duped_fd); /* gzdOpen() does not close on failure */990 }991 992 return((void *) fd);993 }994 995 if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17))996 #if defined (_WIN32)997 path = &filename[17];998 #else999 path = &filename[16];1000 #endif1001 else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) {1002 #if defined (_WIN32)1003 path = &filename[8];1004 #else1005 path = &filename[7];1006 #endif1007 } else1008 path = filename;1009 1010 if (path == NULL)1011 return(NULL);1012 if (!xmlCheckFilename(path))1013 return(NULL);1014 1015 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT)1016 fd = xmlWrapGzOpenUtf8(path, "rb");1017 #else1018 fd = gzopen(path, "rb");1019 #endif1020 return((void *) fd);1021 }1022 1023 /**1024 * xmlGzfileOpen:1025 * @filename: the URI for matching1026 *1027 * Wrapper around xmlGzfileOpen_real if the open fails, it will1028 * try to unescape @filename1029 */1030 static void *1031 xmlGzfileOpen (const char *filename) {1032 char *unescaped;1033 void *retval;1034 1035 retval = xmlGzfileOpen_real(filename);1036 if (retval == NULL) {1037 unescaped = xmlURIUnescapeString(filename, 0, NULL);1038 if (unescaped != NULL) {1039 retval = xmlGzfileOpen_real(unescaped);1040 }1041 xmlFree(unescaped);1042 }1043 return retval;1044 }1045 1046 #ifdef LIBXML_OUTPUT_ENABLED1047 /**1048 * xmlGzfileOpenW:1049 * @filename: the URI for matching1050 * @compression: the compression factor (0 - 9 included)1051 *1052 * input from compressed file open1053 * if @filename is " " then the standard input is used1054 *1055 * Returns an I/O context or NULL in case of error1056 */1057 static void *1058 xmlGzfileOpenW (const char *filename, int compression) {1059 const char *path = NULL;1060 char mode[15];1061 gzFile fd;1062 1063 snprintf(mode, sizeof(mode), "wb%d", compression);1064 if (!strcmp(filename, "-")) {1065 int duped_fd = dup(fileno(stdout));1066 fd = gzdopen(duped_fd, "rb");1067 if (fd == Z_NULL && duped_fd >= 0) {1068 close(duped_fd); /* gzdOpen() does not close on failure */1069 }1070 1071 return((void *) fd);1072 }1073 1074 if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17))1075 #if defined (_WIN32)1076 path = &filename[17];1077 #else1078 path = &filename[16];1079 #endif1080 else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) {1081 #if defined (_WIN32)1082 path = &filename[8];1083 #else1084 path = &filename[7];1085 #endif1086 } else1087 path = filename;1088 1089 if (path == NULL)1090 return(NULL);1091 1092 #if (defined(_WIN32) || defined (__DJGPP__)) && !defined (__CYGWIN__) && !defined(IPRT_NO_CRT)1093 fd = xmlWrapGzOpenUtf8(path, mode);1094 #else1095 fd = gzopen(path, mode);1096 #endif1097 return((void *) fd);1098 }1099 #endif /* LIBXML_OUTPUT_ENABLED */1100 884 1101 885 /** -
trunk/src/libs/libxml2-2.13.2/xmlmemory.c
r105420 r105421 13 13 #include <time.h> 14 14 15 /**16 * MEM_LIST:17 *18 * keep track of all allocated blocks for error reporting19 * Always build the memory list !20 */21 #ifdef DEBUG_MEMORY_LOCATION22 #ifndef MEM_LIST23 #define MEM_LIST /* keep a list of all the allocated memory blocks */24 #endif25 #endif26 27 15 #include <libxml/xmlmemory.h> 28 16 #include <libxml/xmlerror.h> … … 33 21 #include "private/threads.h" 34 22 35 static int xmlMemInitialized = 0;36 23 static unsigned long debugMemSize = 0; 37 24 static unsigned long debugMemBlocks = 0; … … 44 31 ************************************************************************/ 45 32 46 #if !defined(LIBXML_THREAD_ENABLED) && !defined(LIBXML_THREAD_ALLOC_ENABLED)47 #ifdef xmlMalloc48 #undef xmlMalloc49 #endif50 51 #ifdef xmlRealloc52 #undef xmlRealloc53 #endif54 55 #ifdef xmlMemStrdup56 #undef xmlMemStrdup57 #endif58 #endif59 60 33 /* 61 34 * Each of the blocks allocated begin with a header containing information … … 74 47 #define ALIGN_SIZE sizeof(double) 75 48 #endif 76 77 #define HDR_SIZE sizeof(MEMHDR) 78 #define RESERVE_SIZE (((HDR_SIZE + (ALIGN_SIZE-1)) \ 49 #define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \ 79 50 / ALIGN_SIZE ) * ALIGN_SIZE) 80 51 … … 441 412 void 442 413 xmlInitMemoryInternal(void) { 443 444 #ifdef VBOX 445 const char *breakpoint; 446 #else 447 char *breakpoint; 448 #endif 449 450 #ifdef DEBUG_MEMORY 451 xmlGenericError(xmlGenericErrorContext, 452 "xmlInitMemory()\n"); 453 #endif 454 455 xmlInitMutex(&xmlMemMutex); 456 457 breakpoint = getenv("XML_MEM_BREAKPOINT"); 458 if (breakpoint != NULL) { 459 sscanf(breakpoint, "%ud", &xmlMemStopAtBlock); 460 } 461 breakpoint = getenv("XML_MEM_TRACE"); 462 if (breakpoint != NULL) { 463 sscanf(breakpoint, "%p", &xmlMemTraceBlockAt); 464 } 414 xmlInitMutex(&xmlMemMutex); 465 415 } 466 416
Note:
See TracChangeset
for help on using the changeset viewer.