123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- #ifndef SNPRINTF_H
- #define SNPRINTF_H
- #include <stdbool.h>
- BEGIN_EXTERN_C()
- PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
- PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap);
- PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
- PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap);
- PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap);
- PHPAPI int ap_php_asprintf(char **buf, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
- PHPAPI char * php_0cvt(double value, int ndigit, char dec_point, char exponent, char *buf);
- PHPAPI char * php_conv_fp(char format, double num,
- bool add_dp, int precision, char dec_point, bool * is_negative, char *buf, size_t *len);
- END_EXTERN_C()
- #define php_gcvt zend_gcvt
- #ifdef slprintf
- #undef slprintf
- #endif
- #define slprintf ap_php_slprintf
- #ifdef vslprintf
- #undef vslprintf
- #endif
- #define vslprintf ap_php_vslprintf
- #ifdef snprintf
- #undef snprintf
- #endif
- #define snprintf ap_php_snprintf
- #ifdef vsnprintf
- #undef vsnprintf
- #endif
- #define vsnprintf ap_php_vsnprintf
- #ifndef HAVE_VASPRINTF
- #define vasprintf ap_php_vasprintf
- #endif
- #ifndef HAVE_ASPRINTF
- #define asprintf ap_php_asprintf
- #endif
- typedef enum {
- LM_STD = 0,
- #if SIZEOF_INTMAX_T
- LM_INTMAX_T,
- #endif
- #if SIZEOF_PTRDIFF_T
- LM_PTRDIFF_T,
- #endif
- #if SIZEOF_LONG_LONG
- LM_LONG_LONG,
- #endif
- LM_SIZE_T,
- LM_LONG,
- LM_LONG_DOUBLE,
- } length_modifier_e;
- PHPAPI char * ap_php_conv_10(int64_t num, bool is_unsigned,
- bool * is_negative, char *buf_end, size_t *len);
- PHPAPI char * ap_php_conv_p2(uint64_t num, int nbits,
- char format, char *buf_end, size_t *len);
- #endif
|