~donmcc/astr

0a436b736adf12b54651c865159156c25cea58ff — Don McCaughey 1 year, 6 months ago cc2e1fd
Made `astr_alloc_formatted_from_va_list()` inline.

Moved definition into the header and added `extern` declaration to the
`.c` file.
2 files changed, 11 insertions(+), 12 deletions(-)

M astr.c
M astr.h
M astr.c => astr.c +3 -9
@@ 15,15 15,6 @@ astr_alloc_formatted(char const *format, ...)
}


char *
astr_alloc_formatted_from_va_list(char const *format, va_list arguments)
{
    char *s = NULL;
    int result = astr_realloc_append_formatted_from_va_list(&s, format, arguments);
    return (0 == result) ? s : NULL;
}


size_t
astr_formatted_length(char const *format, ...)
{


@@ 92,6 83,9 @@ astr_realloc_append_formatted_from_va_list(char **s,
extern char *
astr_alloc_empty(void);

extern char *
astr_alloc_formatted_from_va_list(char const *format, va_list arguments);

extern int 
astr_cmp(char const *s1, char const *s2);


M astr.h => astr.h +8 -3
@@ 11,9 11,6 @@
char *
astr_alloc_formatted(char const *format, ...);

char *
astr_alloc_formatted_from_va_list(char const *format, va_list arguments);

size_t
astr_formatted_length(char const *format, ...);



@@ 35,6 32,14 @@ astr_alloc_empty(void)
    return calloc(1, sizeof(char));
}

inline char *
astr_alloc_formatted_from_va_list(char const *format, va_list arguments)
{
    char *s = NULL;
    int result = astr_realloc_append_formatted_from_va_list(&s, format, arguments);
    return (0 == result) ? s : NULL;
}

inline int
astr_cmp(char const *s1, char const *s2)
{