aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/strdupx.hxx
blob: 3f55072b6fc14a49d98e42cb830ab24933321037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// file      : xsde/cxx/strdupx.hxx
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSDE_CXX_STRDUPX_HXX
#define XSDE_CXX_STRDUPX_HXX

#include <stddef.h> // size_t

namespace xsde
{
  namespace cxx
  {
    // C++ versions of strdup and strndup. They allocate the string
    // using new char[] (or custom allocator, if enabled). When
    // exceptions are disabled these functions return 0 if allocation
    // fails.
    //
    char*
    strdupx (const char*);

    char*
    strndupx (const char*, size_t);
  }
}

#endif  // XSDE_CXX_STRDUPX_HXX