su_sprintf.c File Reference


Detailed Description

su_*sprintf() functions

Author:
Pekka Pessi <Pekka.Pessi@nokia-email.address.hidden>
Date:
Created: Tue Apr 17 20:05:21 2001 ppessi

#include "config.h"
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "sofia-sip/su_alloc.h"

Include dependency graph for su_sprintf.c:


Functions

char * su_vsprintf (su_home_t *home, char const *fmt, va_list ap)
 Copy a formatted string.
char * su_sprintf (su_home_t *home, char const *fmt,...)
 Copy a formatted string.

Function Documentation

char* su_sprintf ( su_home_t home,
char const *  fmt,
  ... 
)

Copy a formatted string.

The function su_sprintf() print a string according to a fmt like printf() or snprintf(). The resulting string is copied to a memory area freshly allocated from a memory home. The returned string is reclaimed when home is destroyed. It can explicitly be freed with su_free() or free() if home is NULL.

Parameters:
home pointer to memory home (may be NULL)
fmt format string
... argument list (must match with the fmt format string)
Returns:
A pointer to a fresh copy of formatting result, or NULL upon an error.

char* su_vsprintf ( su_home_t home,
char const *  fmt,
va_list  ap 
)

Copy a formatted string.

The function su_vsprintf() print a string according to a fmt like vprintf() or vsnprintf(). The resulting string is copied to a memory area fresly allocated from a memory home. The returned string is reclaimed when home is destroyed. It can explicitly be freed with su_free() or free() if home is NULL.

Parameters:
home pointer to memory home (may be NULL)
fmt format string
ap stdarg argument list (must match with the fmt format string)
Returns:
A pointer to a fresh copy of formatting result, or NULL upon an error.


Sofia-SIP 1.12.1 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.