50 # define LONG_LONG_TYPE long long 51 # define HAVE_LONG_LONG_TYPE 53 # if defined(_MSC_VER) && (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) 54 # define LONG_LONG_TYPE __int64 55 # define HAVE_LONG_LONG_TYPE 57 # undef LONG_LONG_TYPE 58 # undef HAVE_LONG_LONG_TYPE 66 #if (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) || \ 67 (defined(__WATCOMC__) && defined(__386__)) || \ 68 (defined(__POCC__) && defined(_MSC_VER)) || \ 69 (defined(_WIN32_WCE)) || \ 70 (defined(__MINGW32__)) || \ 71 (defined(_MSC_VER) && (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)) 72 # define MP_HAVE_INT_EXTENSIONS 79 #ifdef HAVE_LONG_LONG_TYPE 80 # define mp_intmax_t LONG_LONG_TYPE 81 # define mp_uintmax_t unsigned LONG_LONG_TYPE 83 # define mp_intmax_t long 84 # define mp_uintmax_t unsigned long 89 #define MAX_PARAMETERS 128 96 static const char lower_digits[] =
"0123456789abcdefghijklmnopqrstuvwxyz";
99 static const char upper_digits[] =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
103 if(stream((unsigned char)(x), (FILE *)data) != -1) \ 183 number += *input-
'0';
186 if(number && (
'$'==*input++)) {
195 #if defined(MP_HAVE_INT_EXTENSIONS) 196 if(!strncmp(fmt,
"I32", 3) || !strncmp(fmt,
"I64", 3)) {
202 case '-':
case '+':
case ' ':
case '#':
case '.':
203 case '0':
case '1':
case '2':
case '3':
case '4':
204 case '5':
case '6':
case '7':
case '8':
case '9':
205 case 'h':
case 'l':
case 'L':
case 'z':
case 'q':
207 #if defined(MP_HAVE_INT_EXTENSIONS) 230 char *fmt = (
char *)format;
255 this_param = param_num;
257 if(this_param > max_param)
258 max_param = this_param;
272 #if defined(MP_HAVE_INT_EXTENSIONS) 273 if(!strncmp(fmt,
"I32", 3)) {
277 else if(!strncmp(fmt,
"I64", 3)) {
310 precision = param_num;
312 if(precision > max_param)
313 max_param = precision;
317 precision = strtol(fmt, &fmt, 10);
323 #if defined(MP_HAVE_INT_EXTENSIONS) 325 #if (SIZEOF_CURL_OFF_T > SIZEOF_LONG) 347 #if (SIZEOF_SIZE_T > SIZEOF_LONG) 354 #if (SIZEOF_CURL_OFF_T > SIZEOF_LONG) 364 case '1':
case '2':
case '3':
case '4':
365 case '5':
case '6':
case '7':
case '8':
case '9':
367 width = strtol(fmt-1, &fmt, 10);
378 if(width > max_param)
472 long k = precision - 1;
485 for(i = 0; i<max_param; i++) {
497 switch(vto[i].type) {
499 vto[
i].
data.
str = va_arg(arglist,
char *);
505 vto[
i].
data.
ptr = va_arg(arglist,
void *);
509 #ifdef HAVE_LONG_LONG_TYPE 513 else if(vto[i].flags & FLAGS_LONGLONG)
522 else if(vto[i].flags & FLAGS_LONG)
525 else if(vto[i].flags & FLAGS_UNSIGNED)
535 vto[
i].
data.
dnum = va_arg(arglist,
double);
558 int (*stream)(
int, FILE *),
585 char *workend = &work[
sizeof(work) - 2];
624 }
while(*++f && (
'%' != *f));
704 goto unsigned_number;
711 goto unsigned_number;
716 goto unsigned_number;
726 signed_num = -signed_num;
747 *w-- = digits[num %
base];
750 width -= (long)(workend - w);
751 prec -= (long)(workend - w);
753 if(is_alt && base == 8 && prec <= 0) {
764 if(is_alt && base == 16)
781 if(is_alt && base == 16) {
794 while(++w <= workend) {
806 static const char null[] =
"(nil)";
813 if(prec == -1 || prec >= (
long)
sizeof(null) - 1) {
815 len =
sizeof(null) - 1;
829 width -= (len > LONG_MAX) ? LONG_MAX : (
long)
len;
838 while((len-- > 0) && *str)
865 static const char strnil[] =
"(nil)";
868 width -= (long)(
sizeof(strnil) - 1);
872 for(point = strnil; *point !=
'\0'; ++point)
883 char formatbuf[32]=
"%";
884 char *fptr = &formatbuf[1];
885 size_t left =
sizeof(formatbuf)-strlen(formatbuf);
912 if(width >= (
long)
sizeof(work))
913 width =
sizeof(work)-1;
922 size_t maxprec =
sizeof(work) - 2;
929 if(prec > (
long)maxprec)
930 prec = (
long)maxprec-1;
951 for(fptr = work; *fptr; fptr++)
958 #ifdef HAVE_LONG_LONG_TYPE 960 *(LONG_LONG_TYPE *) p->
data.
ptr = (LONG_LONG_TYPE)done;
964 *(
long *) p->
data.
ptr = (
long)done;
966 *(
int *) p->
data.
ptr = (int)done;
968 *(
short *) p->
data.
ptr = (
short)done;
984 unsigned char outc = (
unsigned char)output;
1004 info.
max = maxlength;
1007 if((retcode != -1) && info.
max) {
1022 va_start(ap_save, format);
1032 unsigned char outc = (
unsigned char)output;
1043 else if(infop->
len + 1 >= infop->
alloc) {
1044 char *newptr = NULL;
1045 size_t newsize = infop->
alloc*2;
1048 if(newsize > infop->
alloc)
1056 infop->
alloc = newsize;
1077 va_start(ap_save, format);
1080 if((-1 == retcode) || info.
fail) {
1103 if((-1 == retcode) || info.
fail) {
1118 char **
buffer = (
char **)data;
1119 unsigned char outc = (
unsigned char)output;
1129 va_start(ap_save, format);
1140 va_start(ap_save, format);
1151 va_start(ap_save, format);
static bool dprintf_IsQualifierNoDollar(const char *fmt)
union va_stack_t::@29::@30 num
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list ap_save)
char * curl_mvaprintf(const char *format, va_list ap_save)
UNITTEST_START char * ptr
int curl_mvprintf(const char *format, va_list ap_save)
#define realloc(ptr, size)
static int dprintf_Pass1(const char *format, va_stack_t *vto, char **endpos, va_list arglist)
static int alloc_addbyter(int output, FILE *data)
int curl_mvsprintf(char *buffer, const char *format, va_list ap_save)
static int storebuffer(int output, FILE *data)
UNITTEST_START char * output
curl_easy_setopt expects a curl_off_t argument for this option curl_easy_setopt expects a curl_write_callback argument for this option curl_easy_setopt expects a curl_ioctl_callback argument for this option curl_easy_setopt expects a curl_opensocket_callback argument for this option curl_easy_setopt expects a curl_debug_callback argument for this option curl_easy_setopt expects a curl_conv_callback argument for this option curl_easy_setopt expects a private data pointer as argument for this option curl_easy_setopt expects a FILE *argument for this option curl_easy_setopt expects a struct curl_httppost *argument for this option curl_easy_setopt expects a struct curl_slist *argument for this option curl_easy_getinfo expects a pointer to char *for this info curl_easy_getinfo expects a pointer to double for this info curl_easy_getinfo expects a pointer to struct curl_tlssessioninfo *for this info curl_easy_getinfo expects a pointer to curl_socket_t for this info size_t
static int dprintf_formatf(void *data, int(*stream)(int, FILE *), const char *format, va_list ap_save)
union va_stack_t::@29 data
int curl_msnprintf(char *buffer, size_t maxlength, const char *format,...)
UNITTEST_START struct Curl_easy data
char * curl_maprintf(const char *format,...)
int curl_mvfprintf(FILE *whereto, const char *format, va_list ap_save)
int curl_mfprintf(FILE *whereto, const char *format,...)
TFSIMD_FORCE_INLINE const tfScalar & w() const
static int addbyter(int output, FILE *data)
static const char upper_digits[]
int curl_msprintf(char *buffer, const char *format,...)
static const char lower_digits[]
static long dprintf_DollarString(char *input, char **end)
int curl_mprintf(const char *format,...)