您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ xmlGenericError函数代码示例

51自学网 2021-06-03 11:45:40
  C++
这篇教程C++ xmlGenericError函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中xmlGenericError函数的典型用法代码示例。如果您正苦于以下问题:C++ xmlGenericError函数的具体用法?C++ xmlGenericError怎么用?C++ xmlGenericError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了xmlGenericError函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: xmlReallocLoc

void *xmlReallocLoc(void *ptr,size_t size, const char * file, int line){    MEMHDR *p;    unsigned long number;    if (!xmlMemInitialized) xmlInitMemory();    if (ptr == NULL)        return(NULL);    TEST_POINT    p = CLIENT_2_HDR(ptr);    number = p->mh_number;    if (p->mh_tag != MEMTAG) {       Mem_Tag_Err(p);	 goto error;    }    p->mh_tag = ~MEMTAG;    debugMemSize -= p->mh_size;#ifdef MEM_LIST    debugmem_list_delete(p);#endif    p = (MEMHDR *) realloc(p,RESERVE_SIZE+size);    if (!p) {	 goto error;    }    if (xmlMemTraceBlockAt == ptr) {	xmlGenericError(xmlGenericErrorContext,			"%p : Realloced(%d -> %d) Ok/n",			xmlMemTraceBlockAt, p->mh_size, size);	xmlMallocBreakpoint();    }    p->mh_tag = MEMTAG;    p->mh_number = number;    p->mh_type = REALLOC_TYPE;    p->mh_size = size;    p->mh_file = file;    p->mh_line = line;    debugMemSize += size;    if (debugMemSize > debugMaxMemSize) debugMaxMemSize = debugMemSize;#ifdef MEM_LIST    debugmem_list_add(p);#endif    TEST_POINT    return(HDR_2_CLIENT(p));    error:        return(NULL);}
开发者ID:Reynmar,项目名称:pocketheroes,代码行数:52,


示例2: testRegexpFile

static voidtestRegexpFile(const char *filename) {    xmlRegexpPtr comp = NULL;    FILE *input;    char expression[5000];    int len;    input = fopen(filename, "r");    if (input == NULL) {        xmlGenericError(xmlGenericErrorContext,		"Cannot open %s for reading/n", filename);	return;    }    while (fgets(expression, 4500, input) != NULL) {	len = strlen(expression);	len--;	while ((len >= 0) &&	       ((expression[len] == '/n') || (expression[len] == '/t') ||		(expression[len] == '/r') || (expression[len] == ' '))) len--;	expression[len + 1] = 0;	if (len >= 0) {	    if (expression[0] == '#')		continue;	    if ((expression[0] == '=') && (expression[1] == '>')) {		char *pattern = &expression[2];		if (comp != NULL) {		    xmlRegFreeRegexp(comp);		    comp = NULL;		}		printf("Regexp: %s/n", pattern) ;		comp = xmlRegexpCompile((const xmlChar *) pattern);		if (comp == NULL) {		    printf("   failed to compile/n");		    break;		}	    } else if (comp == NULL) {		printf("Regexp: %s/n", expression) ;		comp = xmlRegexpCompile((const xmlChar *) expression);		if (comp == NULL) {		    printf("   failed to compile/n");		    break;		}	    } else if (comp != NULL) {		testRegexp(comp, expression);	    }	}    }    fclose(input);    if (comp != NULL)	xmlRegFreeRegexp(comp);}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:52,


示例3: xmlNamespaceParseNCName

xmlChar *xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED){  static int deprecated = 0;  if (!deprecated)  {    xmlGenericError(xmlGenericErrorContext,                    "xmlNamespaceParseNCName() deprecated function reached/n");    deprecated = 1;  }  return (NULL);}
开发者ID:vgurev,项目名称:freesurfer,代码行数:13,


示例4: xmlInitMemory

/** * xmlInitMemory: * * Initialize the memory layer. * * Returns 0 on success */intxmlInitMemory(void){#ifdef HAVE_STDLIB_H  char *breakpoint;#endif#ifdef DEBUG_MEMORY  xmlGenericError(xmlGenericErrorContext,                  "xmlInitMemory()/n");#endif  /*   This is really not good code (see Bug 130419).  Suggestions for   improvement will be welcome!  */  if (xmlMemInitialized) return(-1);  xmlMemInitialized = 1;  xmlMemMutex = xmlNewMutex();#ifdef HAVE_STDLIB_H  breakpoint = getenv("XML_MEM_BREAKPOINT");  if (breakpoint != NULL)  {    sscanf(breakpoint, "%ud", &xmlMemStopAtBlock);  }#endif#ifdef HAVE_STDLIB_H  breakpoint = getenv("XML_MEM_TRACE");  if (breakpoint != NULL)  {    sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);  }#endif#ifdef DEBUG_MEMORY  xmlGenericError(xmlGenericErrorContext,                  "xmlInitMemory() Ok/n");#endif  return(0);}
开发者ID:vgurev,项目名称:freesurfer,代码行数:46,


示例5: xmlMemStrdupLoc

char *xmlMemStrdupLoc(const char *str, const char *file, int line){    char *s;    size_t size = strlen(str) + 1;    MEMHDR *p;    if (!xmlMemInitialized) xmlInitMemory();    TEST_POINT    p = (MEMHDR *) malloc(RESERVE_SIZE+size);    if (!p) {      goto error;    }    p->mh_tag = MEMTAG;    p->mh_size = size;    p->mh_type = STRDUP_TYPE;    p->mh_file = file;    p->mh_line = line;    xmlMutexLock(xmlMemMutex);    p->mh_number = ++block;    debugMemSize += size;    debugMemBlocks++;    if (debugMemSize > debugMaxMemSize) debugMaxMemSize = debugMemSize;#ifdef MEM_LIST    debugmem_list_add(p);#endif    xmlMutexUnlock(xmlMemMutex);        s = (char *) HDR_2_CLIENT(p);        if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();    if (s != NULL)      strcpy(s,str);    else      goto error;        TEST_POINT    if (xmlMemTraceBlockAt == s) {        xmlGenericError(xmlGenericErrorContext,                        "%p : Strdup() Ok/n", xmlMemTraceBlockAt);        xmlMallocBreakpoint();    }    return(s);error:    return(NULL);}
开发者ID:151706061,项目名称:VTK,代码行数:51,


示例6: xmlNanoFTPQuit

intxmlNanoFTPQuit(void *ctx) {    xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx;    char buf[200];    int len;    int res;    sprintf(buf, "QUIT/r/n");    len = strlen(buf);#ifdef DEBUG_FTP    xmlGenericError(xmlGenericErrorContext, "%s", buf); /* Just to be consistent, even though we know it can't have a % in it */#endif    res = send(ctxt->controlFd, buf, len, 0);    return(0);}
开发者ID:followheart,项目名称:try-catch-finally,代码行数:15,


示例7: htmlDecodeEntities

/** * htmlDecodeEntities: * @ctxt:  the parser context * @len:  the len to decode (in bytes !), -1 for no size limit * @end:  an end marker xmlChar, 0 if none * @end2:  an end marker xmlChar, 0 if none * @end3:  an end marker xmlChar, 0 if none * * Substitute the HTML entities by their value * * DEPRECATED !!!! * * Returns A newly allocated string with the substitution done. The caller *      must deallocate it ! */xmlChar *htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,                   int len ATTRIBUTE_UNUSED, xmlChar end ATTRIBUTE_UNUSED,                   xmlChar end2 ATTRIBUTE_UNUSED,                   xmlChar end3 ATTRIBUTE_UNUSED){    static int deprecated = 0;    if (!deprecated) {        xmlGenericError(xmlGenericErrorContext,                        "htmlDecodeEntities() deprecated function reached/n");        deprecated = 1;    }    return (NULL);}
开发者ID:AlexanderDenkMA,项目名称:TypeChef-libXMLAnalysis,代码行数:30,


示例8: xmlBufDump

/** * xmlBufDump: * @file:  the file output * @buf:  the buffer to dump * * Dumps an XML buffer to  a FILE *. * Returns the number of #xmlChar written */size_txmlBufDump(FILE *file, xmlBufPtr buf) {    size_t ret;    if ((buf == NULL) || (buf->error != 0)) {#ifdef DEBUG_BUFFER        xmlGenericError(xmlGenericErrorContext,		"xmlBufDump: buf == NULL or in error/n");#endif	return(0);    }    if (buf->content == NULL) {#ifdef DEBUG_BUFFER        xmlGenericError(xmlGenericErrorContext,		"xmlBufDump: buf->content == NULL/n");#endif	return(0);    }    CHECK_COMPAT(buf)    if (file == NULL)	file = stdout;    ret = fwrite(buf->content, sizeof(xmlChar), buf->use, file);    return(ret);}
开发者ID:GerHobbelt,项目名称:libxml2,代码行数:32,


示例9: xmlIsMainThread

/** * xmlIsMainThread: * * xmlIsMainThread() check whether the current thread is the main thread. * * Returns 1 if the current thread is the main thread, 0 otherwise */XMLPUBFUNEXPORT intxmlIsMainThread(void){#ifdef HAVE_PTHREAD_H    pthread_once(&once_control, xmlOnceInit);#endif#ifdef DEBUG_THREADS    xmlGenericError(xmlGenericErrorContext, "xmlIsMainThread()/n");#endif#ifdef HAVE_PTHREAD_H    return(mainthread == pthread_self());#else    return(1);#endif}
开发者ID:jcemelanda,项目名称:wormux,代码行数:23,


示例10: my_xmlXPathEvalExpression

/** * @arg str the XPath expression * @arg ctxt the XPath context * @arg pctxt pointer to a XPath Parser context pointer * * Evaluate the XPath expression in the given context.  The XPath Parser * context is saved in pctxt, so that it can be accessed from another thread. * Especially the error state is interesting, since it can be used to stop a * never ending evaluation. * * Taken from xpath.c in libxml2-2.6.16. * * @return the xmlXPathObjectPtr resulting from the evaluation or NULL. *         The caller has to free the object. */xmlXPathObjectPtrmy_xmlXPathEvalExpression(const xmlChar *str, xmlXPathContextPtr ctxt, xmlXPathParserContextPtr *pctxt) {    xmlXPathObjectPtr res, tmp;    int stack = 0;    xmlXPathInit();    // it is nice that gcc gives no warning anymore,    // but the bad thing is that *pctxt normally is still NULL at this point    CHECK_CONTEXT(ctxt,*pctxt)    g_mutex_lock(find_nodeset_pcontext_mutex);    //g_printerr("Allocating parser context/n");    *pctxt = xmlXPathNewParserContext(str, ctxt);    g_mutex_unlock(find_nodeset_pcontext_mutex);    xmlXPathEvalExpr(*pctxt);    if (*(*pctxt)->cur != 0) {        xmlXPatherror(*pctxt, __FILE__, __LINE__, XPATH_EXPR_ERROR);        res = NULL;    } else {        res = valuePop(*pctxt);    }    do {        tmp = valuePop(*pctxt);        if (tmp != NULL) {            xmlXPathFreeObject(tmp);            stack++;        }    } while (tmp != NULL);    if ((stack != 0) && (res != NULL)) {        xmlGenericError(xmlGenericErrorContext,                "xmlXPathEvalExpression: %d object left on the stack/n",                stack);    }    g_mutex_lock(find_nodeset_pcontext_mutex);    xmlXPathFreeParserContext(*pctxt);    *pctxt = NULL;    //g_printerr("Freed parser context/n");    g_mutex_unlock(find_nodeset_pcontext_mutex);    return(res);}
开发者ID:dhyannataraj,项目名称:fd-dictionaries,代码行数:60,


示例11: exml_fd_write

/** * Write the xml document out to a file descriptor. * @param   xml The xml document * @param   fd The xml output descriptor * @return  @c TRUE if successful, @c FALSE if an error occurs. * @ingroup EXML_Write_Group */int exml_fd_write(EXML *xml, int fd){	xmlTextWriterPtr writer;	xmlOutputBufferPtr out;	out = xmlOutputBufferCreateFd(fd, NULL);	if (out == NULL) {		xmlGenericError(xmlGenericErrorContext,										"xmlNewTextWriterFd : out of memory!/n");		return FALSE;	}	CHECK_PARAM_POINTER_RETURN("xml", xml, FALSE);	writer = xmlNewTextWriter( out );	return _exml_write(xml, writer);}
开发者ID:playya,项目名称:Enlightenment,代码行数:25,


示例12: xmlNanoFTPRead

/** * xmlNanoFTPRead: * @ctx:  the FTP context * @dest:  a buffer * @len:  the buffer length * * This function tries to read @len bytes from the existing FTP connection * and saves them in @dest. This is a blocking call. * * Returns the number of byte read. 0 is an indication of an end of connection. *         -1 indicates a parameter error. */intxmlNanoFTPRead(void *ctx, void *dest, int len) {    xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx;    if (ctx == NULL) return(-1);    if (ctxt->dataFd < 0) return(0);    if (dest == NULL) return(-1);    if (len <= 0) return(0);    len = recv(ctxt->dataFd, dest, len, 0);#ifdef DEBUG_FTP    xmlGenericError(xmlGenericErrorContext, "Recvd %d bytes/n", len);#endif    if (len <= 0) {	xmlNanoFTPCloseConnection(ctxt);    }    return(len);}
开发者ID:followheart,项目名称:try-catch-finally,代码行数:30,


示例13: xmlUTF8Strndup

/** * xmlUTF8Strndup: * @utf:  the input UTF8 * * @len:  the len of @utf (in chars) * * a strndup for array of UTF8's * * Returns a new UTF8 * or NULL */xmlChar *xmlUTF8Strndup(const xmlChar *utf, int len) {    xmlChar *ret;    int i;    if ((utf == NULL) || (len < 0)) return(NULL);    i = xmlUTF8Strsize(utf, len);    ret = (xmlChar *) xmlMallocAtomic((i + 1) * sizeof(xmlChar));    if (ret == NULL) {        xmlGenericError(xmlGenericErrorContext,                "malloc of %ld byte failed/n",                (len + 1) * (long)sizeof(xmlChar));        return(NULL);    }    memcpy(ret, utf, i * sizeof(xmlChar));    ret[i] = 0;    return(ret);}
开发者ID:Cyril2004,项目名称:proto-quic,代码行数:27,


示例14: xmlListPushBack

/** * xmlListPushBack: * @param l a list * @param data new data * * add the new data at the end of the list * * Returns 1 if successful, 0 otherwise */intxmlListPushBack(xmlListPtr list, void *data){    xmlLinkPtr lkPlace, lkNew;    lkPlace = list->sentinel->prev;    /* Add the new link */    if (NULL ==(lkNew = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) {        xmlGenericError(xmlGenericErrorContext,                        EMBED_ERRTXT("Cannot initialize memory for new link"));        return (0);    }    lkNew->data = data;    lkNew->next = lkPlace->next;    (lkPlace->next)->prev = lkNew;    lkPlace->next = lkNew;    lkNew->prev = lkPlace;    return 1;}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:28,


示例15: xmlListAppend

/** * xmlListAppend: * @param l a list * @param data the data * * Insert data in the ordered list at the end for this value * * Returns 0 in case of success, 1 in case of failure */XMLPUBFUNEXPORT int xmlListAppend(xmlListPtr list, void *data){    xmlLinkPtr lkPlace, lkNew;    lkPlace = xmlListHigherSearch(list, data);    /* Add the new link */    lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));    if (lkNew == NULL) {        xmlGenericError(xmlGenericErrorContext,                        EMBED_ERRTXT("Cannot initialize memory for new link"));        return (0);    }    lkNew->data = data;    lkNew->next = lkPlace->next;    (lkPlace->next)->prev = lkNew;    lkPlace->next = lkNew;    lkNew->prev = lkPlace;    return 1;}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:28,


示例16: xmlBufFree

/** * xmlBufFree: * @buf:  the buffer to free * * Frees an XML buffer. It frees both the content and the structure which * encapsulate it. */voidxmlBufFree(xmlBufPtr buf) {    if (buf == NULL) {#ifdef DEBUG_BUFFER        xmlGenericError(xmlGenericErrorContext,		"xmlBufFree: buf == NULL/n");#endif	return;    }    if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&        (buf->contentIO != NULL)) {        xmlFree(buf->contentIO);    } else if ((buf->content != NULL) &&        (buf->alloc != XML_BUFFER_ALLOC_IMMUTABLE)) {        xmlFree(buf->content);    }    xmlFree(buf);}
开发者ID:GerHobbelt,项目名称:libxml2,代码行数:26,


示例17: xmlListPushFront

/** * xmlListPushFront: * @l:  a list * @data:  new data * * add the new data at the beginning of the list * * Returns 1 if successful, 0 otherwise */intxmlListPushFront(xmlListPtr l, void *data) {    xmlLinkPtr lkPlace, lkNew;    lkPlace = l->sentinel;    /* Add the new link */    lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));    if (lkNew == NULL) {        xmlGenericError(xmlGenericErrorContext, 		        "Cannot initialize memory for new link");        return (0);    }    lkNew->data = data;    lkNew->next = lkPlace->next;    (lkPlace->next)->prev = lkNew;    lkPlace->next = lkNew;    lkNew->prev = lkPlace;    return 1;}
开发者ID:AraHaan,项目名称:zlibEx,代码行数:29,


示例18: xmlNanoFTPSendPasswd

static intxmlNanoFTPSendPasswd(void *ctx) {    xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx;    char buf[200];    int len;    int res;    if (ctxt->passwd == NULL)	snprintf(buf, sizeof(buf), "PASS [email
C++ xmlGetGlobalState函数代码示例
C++ xmlFreeTextWriter函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。