mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-19 14:50:07 +03:00
globals: Remove functions related to global state handling
- xmlGetGlobalState - xmlInitializeGlobalState - xmlGetThreadId - xmlIsMainThread
This commit is contained in:
parent
03a8d5f93d
commit
85bd58ef56
@ -1311,7 +1311,7 @@ xmlParseXMLCatalogFile(xmlCatalogPrefer prefer, const xmlChar *filename) {
|
||||
|
||||
if (xmlDebugCatalogs)
|
||||
xmlCatalogPrintDebug(
|
||||
"%d Parsing catalog %s\n", xmlGetThreadId(), filename);
|
||||
"Parsing catalog %s\n", filename);
|
||||
|
||||
cur = xmlDocGetRootElement(doc);
|
||||
if ((cur != NULL) && (xmlStrEqual(cur->name, BAD_CAST "catalog")) &&
|
||||
|
@ -417,10 +417,6 @@
|
||||
<file name='globals'>
|
||||
<summary>interface for all global variables of the library</summary>
|
||||
<description>Deprecated, don't use </description>
|
||||
<exports symbol='xmlGlobalState' type='typedef'/>
|
||||
<exports symbol='xmlGlobalStatePtr' type='typedef'/>
|
||||
<exports symbol='xmlGetGlobalState' type='function'/>
|
||||
<exports symbol='xmlInitializeGlobalState' type='function'/>
|
||||
</file>
|
||||
<file name='hash'>
|
||||
<summary>Chained hash tables</summary>
|
||||
@ -1289,9 +1285,7 @@
|
||||
<exports symbol='xmlCleanupThreads' type='function'/>
|
||||
<exports symbol='xmlFreeMutex' type='function'/>
|
||||
<exports symbol='xmlFreeRMutex' type='function'/>
|
||||
<exports symbol='xmlGetThreadId' type='function'/>
|
||||
<exports symbol='xmlInitThreads' type='function'/>
|
||||
<exports symbol='xmlIsMainThread' type='function'/>
|
||||
<exports symbol='xmlLockLibrary' type='function'/>
|
||||
<exports symbol='xmlMutexLock' type='function'/>
|
||||
<exports symbol='xmlMutexUnlock' type='function'/>
|
||||
@ -5867,8 +5861,6 @@ crash if you try to modify the tree)'/>
|
||||
<typedef name='xmlErrorLevel' file='xmlerror' type='enum'/>
|
||||
<typedef name='xmlErrorPtr' file='xmlerror' type='xmlError *'/>
|
||||
<typedef name='xmlFeature' file='parser' type='enum'/>
|
||||
<struct name='xmlGlobalState' file='globals' type='struct _xmlGlobalState'/>
|
||||
<typedef name='xmlGlobalStatePtr' file='globals' type='xmlGlobalState *'/>
|
||||
<struct name='xmlHashTable' file='hash' type='struct _xmlHashTable'/>
|
||||
<typedef name='xmlHashTablePtr' file='hash' type='xmlHashTable *'/>
|
||||
<struct name='xmlID' file='tree' type='struct _xmlID'>
|
||||
@ -9377,10 +9369,6 @@ crash if you try to modify the tree)'/>
|
||||
<info>DEPRECATED: See xmlSetExternalEntityLoader. Get the default external entity resolver function for the application</info>
|
||||
<return type='xmlExternalEntityLoader' info='the xmlExternalEntityLoader function pointer'/>
|
||||
</function>
|
||||
<function name='xmlGetGlobalState' file='globals' module='globals'>
|
||||
<info>DEPRECATED</info>
|
||||
<return type='xmlGlobalStatePtr' info='NULL.'/>
|
||||
</function>
|
||||
<function name='xmlGetID' file='valid' module='valid'>
|
||||
<info>Search the attribute declaring the given ID</info>
|
||||
<return type='xmlAttrPtr' info='NULL if not found, otherwise the xmlAttrPtr defining the ID'/>
|
||||
@ -9460,10 +9448,6 @@ crash if you try to modify the tree)'/>
|
||||
<arg name='doc' type='xmlDocPtr' info='pointer to the document'/>
|
||||
<arg name='ID' type='const xmlChar *' info='the ID value'/>
|
||||
</function>
|
||||
<function name='xmlGetThreadId' file='threads' module='threads'>
|
||||
<info>DEPRECATED: Internal function, do not use. xmlGetThreadId() find the current thread ID number Note that this is likely to be broken on some platforms using pthreads as the specification doesn't mandate pthread_t to be an integer type</info>
|
||||
<return type='int' info='the current thread ID number'/>
|
||||
</function>
|
||||
<function name='xmlGetUTF8Char' file='xmlstring' module='xmlstring'>
|
||||
<info>Read the first UTF8 character from @utf</info>
|
||||
<return type='int' info='the char value or -1 in case of error, and sets *len to the actual number of bytes consumed (0 in case of error)'/>
|
||||
@ -9818,11 +9802,6 @@ crash if you try to modify the tree)'/>
|
||||
<info>DEPRECATED: Alias for xmlInitParser.</info>
|
||||
<return type='int' info='0.'/>
|
||||
</function>
|
||||
<function name='xmlInitializeGlobalState' file='globals' module='globals'>
|
||||
<info>DEPRECATED: No-op.</info>
|
||||
<return type='void'/>
|
||||
<arg name='gs' type='xmlGlobalStatePtr' info='a pointer to a newly allocated global state'/>
|
||||
</function>
|
||||
<functype name='xmlInputCloseCallback' file='xmlIO' module='xmlIO'>
|
||||
<info>Callback used in the I/O Input API to close the resource</info>
|
||||
<return type='int' info='0 or -1 in case of error'/>
|
||||
@ -9903,10 +9882,6 @@ crash if you try to modify the tree)'/>
|
||||
<return type='int' info='0 if not, non-zero otherwise'/>
|
||||
<arg name='c' type='int' info='an unicode character (int)'/>
|
||||
</function>
|
||||
<function name='xmlIsMainThread' file='threads' module='globals'>
|
||||
<info>DEPRECATED: Internal function, do not use. Check whether the current thread is the main thread.</info>
|
||||
<return type='int' info='1 if the current thread is the main thread, 0 otherwise'/>
|
||||
</function>
|
||||
<function name='xmlIsMixedElement' file='valid' module='valid'>
|
||||
<info>Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs</info>
|
||||
<return type='int' info='0 if no, 1 if yes, and -1 if no element description is available'/>
|
||||
|
44
globals.c
44
globals.c
@ -15,14 +15,13 @@
|
||||
#include <string.h>
|
||||
|
||||
#define XML_GLOBALS_NO_REDEFINITION
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/xmlIO.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/threads.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/SAX.h>
|
||||
#include <libxml/xmlsave.h>
|
||||
#include <libxml/SAX2.h>
|
||||
|
||||
#include "private/dict.h"
|
||||
@ -122,6 +121,9 @@ struct _xmlGlobalState {
|
||||
xmlOutputBufferCreateFilenameFunc outputBufferCreateFilenameValue;
|
||||
};
|
||||
|
||||
typedef struct _xmlGlobalState xmlGlobalState;
|
||||
typedef xmlGlobalState *xmlGlobalStatePtr;
|
||||
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
|
||||
/*
|
||||
@ -482,44 +484,6 @@ void xmlCleanupGlobalsInternal(void) {
|
||||
xmlCleanupMutex(&xmlThrDefMutex);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlInitializeGlobalState:
|
||||
* @gs: a pointer to a newly allocated global state
|
||||
*
|
||||
* DEPRECATED: No-op.
|
||||
*/
|
||||
void
|
||||
xmlInitializeGlobalState(xmlGlobalStatePtr gs ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetGlobalState:
|
||||
*
|
||||
* DEPRECATED
|
||||
*
|
||||
* Returns NULL.
|
||||
*/
|
||||
xmlGlobalStatePtr
|
||||
xmlGetGlobalState(void)
|
||||
{
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlIsMainThread:
|
||||
*
|
||||
* DEPRECATED: Internal function, do not use.
|
||||
*
|
||||
* Check whether the current thread is the main thread.
|
||||
*
|
||||
* Returns 1 if the current thread is the main thread, 0 otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsMainThread(void) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void
|
||||
xmlInitGlobalState(xmlGlobalStatePtr gs) {
|
||||
gs->localRngState[0] = xmlGlobalRandom();
|
||||
|
@ -22,20 +22,4 @@
|
||||
#include <libxml/xmlsave.h>
|
||||
#include <libxml/threads.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _xmlGlobalState xmlGlobalState;
|
||||
typedef xmlGlobalState *xmlGlobalStatePtr;
|
||||
|
||||
XML_DEPRECATED XMLPUBFUN void
|
||||
xmlInitializeGlobalState(xmlGlobalStatePtr gs);
|
||||
XML_DEPRECATED XMLPUBFUN
|
||||
xmlGlobalStatePtr xmlGetGlobalState(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __XML_GLOBALS_H */
|
||||
|
@ -61,12 +61,6 @@ XMLPUBFUN void
|
||||
XMLPUBFUN void
|
||||
xmlUnlockLibrary(void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int
|
||||
xmlGetThreadId (void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int
|
||||
xmlIsMainThread (void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void
|
||||
xmlCleanupThreads(void);
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <libxml/xmlregexp.h>
|
||||
#include <libxml/xmlautomata.h>
|
||||
#include <libxml/xmlreader.h>
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/xmlsave.h>
|
||||
#ifdef LIBXML_RELAXNG_ENABLED
|
||||
#include <libxml/relaxng.h>
|
||||
|
29
threads.c
29
threads.c
@ -301,35 +301,6 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlGetThreadId:
|
||||
*
|
||||
* DEPRECATED: Internal function, do not use.
|
||||
*
|
||||
* xmlGetThreadId() find the current thread ID number
|
||||
* Note that this is likely to be broken on some platforms using pthreads
|
||||
* as the specification doesn't mandate pthread_t to be an integer type
|
||||
*
|
||||
* Returns the current thread ID number
|
||||
*/
|
||||
int
|
||||
xmlGetThreadId(void)
|
||||
{
|
||||
#ifdef HAVE_POSIX_THREADS
|
||||
pthread_t id;
|
||||
int ret;
|
||||
|
||||
id = pthread_self();
|
||||
/* horrible but preserves compat, see warning above */
|
||||
memcpy(&ret, &id, sizeof(ret));
|
||||
return (ret);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
return GetCurrentThreadId();
|
||||
#else
|
||||
return ((int) 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlLockLibrary:
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user