CVS update: php31/main
| From: | rasmus | Date: | Sat, 22 Aug 1998 13:46:32 +0000 |
| Subject: | CVS update: php31/main | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-476@lists.php.net to get a copy of this message | ||
Date: Saturday August 22, 1998 @ 9:46
Author: rasmus
Update of /repository/php31/main
In directory asf:/export/home/rasmus/php31/main
Modified Files:
php.h snprintf.c snprintf.h
Log Message:
Unless we SAPI this stuff we should just use it all the time even if it
means that we duplicate code already part of Apache.
Index: php31/main/php.h
diff -c php31/main/php.h:2.9 php31/main/php.h:2.10
*** php31/main/php.h:2.9 Sat Aug 22 08:34:47 1998
--- php31/main/php.h Sat Aug 22 09:46:32 1998
***************
*** 28,34 ****
+----------------------------------------------------------------------+
*/
! /* $Id: php.h,v 2.9 1998/08/22 12:34:47 rasmus Exp $ */
#ifndef _PHP_H
#define _PHP_H
--- 28,34 ----
+----------------------------------------------------------------------+
*/
! /* $Id: php.h,v 2.10 1998/08/22 13:46:32 rasmus Exp $ */
#ifndef _PHP_H
#define _PHP_H
***************
*** 151,160 ****
#endif
#if (!HAVE_SNPRINTF)
! #define snprintf ap_snprintf
! #define vsnprintf ap_vsnprintf
! extern int ap_snprintf(char *, size_t, const char *, ...);
! extern int ap_vsnprintf(char *, size_t, const char *, va_list);
#endif
extern PHPAPI char *empty_string;
--- 151,160 ----
#endif
#if (!HAVE_SNPRINTF)
! #define snprintf php3_ap_snprintf
! #define vsnprintf php3_ap_vsnprintf
! extern int php3_ap_snprintf(char *, size_t, const char *, ...);
! extern int php3_ap_vsnprintf(char *, size_t, const char *, va_list);
#endif
extern PHPAPI char *empty_string;
Index: php31/main/snprintf.c
diff -c php31/main/snprintf.c:2.0 php31/main/snprintf.c:2.1
*** php31/main/snprintf.c:2.0 Fri Jul 3 09:17:31 1998
--- php31/main/snprintf.c Sat Aug 22 09:46:32 1998
***************
*** 55,61 ****
#include "config.h"
- #if !defined(APACHE) || (!APACHE)
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
#include <stdio.h>
--- 55,60 ----
***************
*** 70,78 ****
#ifdef HAVE_GCVT
! #define ap_ecvt ecvt
! #define ap_fcvt fcvt
! #define ap_gcvt gcvt
#else
--- 69,77 ----
#ifdef HAVE_GCVT
! #define php3_ap_ecvt ecvt
! #define php3_ap_fcvt fcvt
! #define php3_ap_gcvt gcvt
#else
***************
*** 82,88 ****
*/
/*
! * ap_ecvt converts to decimal
* the number of digits is specified by ndigit
* decpt is set to the position of the decimal point
* sign is set to 0 for positive, 1 for negative
--- 81,87 ----
*/
/*
! * php3_ap_ecvt converts to decimal
* the number of digits is specified by ndigit
* decpt is set to the position of the decimal point
* sign is set to 0 for positive, 1 for negative
***************
*** 91,97 ****
#define NDIG 80
static char *
! ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag)
{
register int r2;
double fi, fj;
--- 90,96 ----
#define NDIG 80
static char *
! php3_ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag)
{
register int r2;
double fi, fj;
***************
*** 165,194 ****
}
static char *
! ap_ecvt(double arg, int ndigits, int *decpt, int *sign)
{
! return (ap_cvt(arg, ndigits, decpt, sign, 1));
}
static char *
! ap_fcvt(double arg, int ndigits, int *decpt, int *sign)
{
! return (ap_cvt(arg, ndigits, decpt, sign, 0));
}
/*
! * ap_gcvt - Floating output conversion to
* minimal length string
*/
static char *
! ap_gcvt(double number, int ndigit, char *buf)
{
int sign, decpt;
register char *p1, *p2;
register i;
! p1 = ap_ecvt(number, ndigit, &decpt, &sign);
p2 = buf;
if (sign)
*p2++ = '-';
--- 164,193 ----
}
static char *
! php3_ap_ecvt(double arg, int ndigits, int *decpt, int *sign)
{
! return (php3_ap_cvt(arg, ndigits, decpt, sign, 1));
}
static char *
! php3_ap_fcvt(double arg, int ndigits, int *decpt, int *sign)
{
! return (php3_ap_cvt(arg, ndigits, decpt, sign, 0));
}
/*
! * php3_ap_gcvt - Floating output conversion to
* minimal length string
*/
static char *
! php3_ap_gcvt(double number, int ndigit, char *buf)
{
int sign, decpt;
register char *p1, *p2;
register i;
! p1 = php3_ap_ecvt(number, ndigit, &decpt, &sign);
p2 = buf;
if (sign)
*p2++ = '-';
***************
*** 414,422 ****
int decimal_point;
if (format == 'f')
! p = ap_fcvt(num, precision, &decimal_point, is_negative);
else /* either e or E format */
! p = ap_ecvt(num, precision + 1, &decimal_point, is_negative);
/*
* Check for Infinity and NaN
--- 413,421 ----
int decimal_point;
if (format == 'f')
! p = php3_ap_fcvt(num, precision, &decimal_point, is_negative);
else /* either e or E format */
! p = php3_ap_ecvt(num, precision + 1, &decimal_point, is_negative);
/*
* Check for Infinity and NaN
***************
*** 766,772 ****
/*
* * We use &num_buf[ 1 ], so that we have room for the sign
*/
! s = ap_gcvt(va_arg(ap, double), precision, &num_buf[1]);
if (*s == '-')
prefix_char = *s++;
else if (print_sign)
--- 765,771 ----
/*
* * We use &num_buf[ 1 ], so that we have room for the sign
*/
! s = php3_ap_gcvt(va_arg(ap, double), precision, &num_buf[1]);
if (*s == '-')
prefix_char = *s++;
else if (print_sign)
***************
*** 911,917 ****
}
! int ap_snprintf(char *buf, size_t len, const char *format,...)
{
int cc;
va_list ap;
--- 910,916 ----
}
! int php3_ap_snprintf(char *buf, size_t len, const char *format,...)
{
int cc;
va_list ap;
***************
*** 923,929 ****
}
! int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap)
{
int cc;
--- 922,928 ----
}
! int php3_ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap)
{
int cc;
***************
*** 932,935 ****
}
#endif /* HAVE_SNPRINTF */
- #endif /* APACHE */
--- 931,933 ----
Index: php31/main/snprintf.h
diff -c php31/main/snprintf.h:2.0 php31/main/snprintf.h:2.1
*** php31/main/snprintf.h:2.0 Fri Jul 3 09:17:32 1998
--- php31/main/snprintf.h Sat Aug 22 09:46:32 1998
***************
*** 31,43 ****
#define _PHP3_SNPRINTF_H
#ifndef HAVE_SNPRINTF
! extern int ap_snprintf(char *, size_t, const char *, ...);
! #define snprintf ap_snprintf
#endif
#ifndef HAVE_VSNPRINTF
! extern int ap_vsnprintf(char *, size_t, const char *, va_list ap);
! #define vsnprintf ap_vsnprintf
#endif
#if BROKEN_SPRINTF
--- 31,43 ----
#define _PHP3_SNPRINTF_H
#ifndef HAVE_SNPRINTF
! extern int php3_ap_snprintf(char *, size_t, const char *, ...);
! #define snprintf php3_ap_snprintf
#endif
#ifndef HAVE_VSNPRINTF
! extern int php3_ap_vsnprintf(char *, size_t, const char *, va_list ap);
! #define vsnprintf php3_ap_vsnprintf
#endif
#if BROKEN_SPRINTF
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net