Changeset 5755:d61e5f9b4111 in roaraudio


Ignore:
Timestamp:
11/16/12 16:54:46 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_mm_strdup2()

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/memmgr.h

    r5602 r5755  
    130130#endif 
    131131 
     132char * roar_mm_strdup2(const char *s, const char *def); 
     133 
    132134#if defined(ROAR_USE_MEMMGR) || !defined(ROAR_HAVE_STRNDUP) 
    133135char *roar_mm_strndup(const char *s, size_t n); 
  • include/libroar/roarfeatures.h

    r5619 r5755  
    5353#define ROAR_FT_FUNC_CTL_C2M2 
    5454#define ROAR_FT_FUNC_CTL_M2C2 
     55#define ROAR_FT_FUNC_MM_STRDUP2 
    5556#define ROAR_FT_FEATURE_VS 
    5657#define ROAR_FT_FEATURE_VS_FILE 
  • libroar/memmgr.c

    r5602 r5755  
    271271#endif 
    272272 
     273char * roar_mm_strdup2(const char *s, const char *def) { 
     274 if ( s == NULL ) 
     275  s = def; 
     276 if ( s == NULL ) { 
     277  roar_err_clear(); 
     278  return NULL; 
     279 } 
     280 
     281 return roar_mm_strdup(s); 
     282} 
     283 
    273284#ifndef ROAR_HAVE_STRLEN 
    274285ssize_t roar_mm_strlen(const char *s) { 
Note: See TracChangeset for help on using the changeset viewer.