Revert "eina: add functions to alloc strings from a printf fmt"

This reverts commit b5fce696c7 and fixes
to NEWS and @since that came later.

These functions are pretty trivial and their functionality can be
obtained with asprintf() and snprintf. The first is not available only
on windows, but there's an implementation for that one on Evil, that
should be used instead.
This commit is contained in:
Lucas De Marchi 2013-09-25 22:51:03 -03:00
parent f03148f9e3
commit ad76ce025c
4 changed files with 0 additions and 76 deletions

View File

@ -14,7 +14,6 @@
2013-09-24 Jorge Zapata
* Eina: add a substraction in rectangles and more helpers,
add functions to alloc strings from a printf format,
add double_from/to and helper defines in f16p16.
2013-09-12 Jihoon Kim

1
NEWS
View File

@ -39,7 +39,6 @@ Additions:
- Add eina_rectangle_is_valid(), eina_rectangle_max_x(), eina_rectangle_max_y(), eina_rectangle_x_cut(),
eina_rectangle_y_cut(), eina_rectangle_width_cut(), eina_rectangle_height_cut(), eina_rectangle_subtract(),
EINA_RECTANGLE_INIT, EINA_RECTANGLE_FORMAT, EINA_RECTANGLE_ARGS.
- Add eina_str_vprintf_length(), eina_str_vprintf_dup(), eina_str_printf_dup().
- Add eina_f16p16_double_from(), eina_f16p16_double_to().
* Eet:
- Add eet_mmap()

View File

@ -652,44 +652,3 @@ eina_str_toupper(char **str)
for (p = *str; (*p); p++)
*p = toupper((unsigned char)(*p));
}
EAPI size_t
eina_str_vprintf_length(const char *format, va_list args)
{
char c;
size_t len;
len = vsnprintf(&c, 1, format, args) + 1;
return len;
}
EAPI char *
eina_str_vprintf_dup(const char *format, va_list args)
{
size_t length;
char *ret;
va_list copy;
/* be sure to use a copy or the printf implementation will
* step into the args
*/
va_copy(copy, args);
length = eina_str_vprintf_length(format, copy);
va_end(copy);
ret = calloc(length, sizeof(char));
vsprintf(ret, format, args);
return ret;
}
EAPI char *
eina_str_printf_dup(const char *format, ...)
{
char *ret;
va_list args;
va_start(args, format);
ret = eina_str_vprintf_dup(format, args);
va_end(args);
return ret;
}

View File

@ -345,39 +345,6 @@ static inline size_t eina_str_join(char *dst, size_t size, char sep, const char
static inline size_t eina_strlen_bounded(const char *str, size_t maxlen) EINA_PURE EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
* @brief Gets the length needed for a string based on a printf format and args
*
* @param format The printf format
* @param args The printf args
* @return The length needed for such format and args
* @since 1.8
*/
EAPI size_t eina_str_vprintf_length(const char *format, va_list args);
/**
* @brief Gets a newly allocated string that represents the printf format and args
*
* @param format The printf format
* @param args The printf args
* @return A newly allocated string
*
* @see eina_str_dup_printf
* @since 1.8
*/
EAPI char * eina_str_vprintf_dup(const char *format, va_list args);
/**
* @brief Gets a newly allocated string that represents the printf format and args
*
* @param format The printf format
* @return A newly allocated string
*
* @see eina_str_dup_vprintf
* @since 1.8
*/
EAPI char * eina_str_printf_dup(const char *format, ...);
#include "eina_inline_str.x"
/**