mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
added xmlStrVPrintf function
This commit is contained in:
parent
82cb31994f
commit
b5a46da41d
@ -1,3 +1,7 @@
|
||||
Wed Oct 29 07:49:52 2003 Aleksey Sanin <aleksey@aleksey.com>
|
||||
|
||||
* include/libxml/parser.h parser.c: added xmlStrVPrintf function
|
||||
|
||||
Wed Oct 29 14:37:40 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* nanoftp.c nanohttp.c testThreads.c threads.c: applied patch from
|
||||
|
@ -9,6 +9,8 @@
|
||||
#ifndef __XML_PARSER_H__
|
||||
#define __XML_PARSER_H__
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/dict.h>
|
||||
@ -864,6 +866,12 @@ XMLPUBFUN int XMLCALL
|
||||
const xmlChar *msg,
|
||||
...);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlStrVPrintf (xmlChar *buf,
|
||||
int len,
|
||||
const xmlChar *msg,
|
||||
va_list ap);
|
||||
|
||||
/*
|
||||
* Basic parsing Interfaces
|
||||
*/
|
||||
|
24
parser.c
24
parser.c
@ -2482,6 +2482,30 @@ xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrVPrintf:
|
||||
* @buf: the result buffer.
|
||||
* @len: the result buffer length.
|
||||
* @msg: the message with printf formatting.
|
||||
* @ap: extra parameters for the message.
|
||||
*
|
||||
* Formats @msg and places result into @buf.
|
||||
*
|
||||
* Returns the number of characters written to @buf or -1 if an error occurs.
|
||||
*/
|
||||
int
|
||||
xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) {
|
||||
int ret;
|
||||
|
||||
if((buf == NULL) || (msg == NULL)) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
ret = vsnprintf((char *) buf, len, (const char *) msg, ap);
|
||||
buf[len - 1] = 0; /* be safe ! */
|
||||
|
||||
return(ret);
|
||||
}
|
||||
/************************************************************************
|
||||
* *
|
||||
* Commodity functions, cleanup needed ? *
|
||||
|
Loading…
x
Reference in New Issue
Block a user