/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2012 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21#pragma prototyped2223#undef VMDEBUG24#define VMDEBUG 02526#if defined(_MSVCRT_H)27#if defined(__STDPP__directive) && defined(__STDPP__hide)28__STDPP__directive pragma pp:hide strdup29#else30#define strdup ______strdup31#endif32#endif3334#include <ast.h>3536#if defined(_MSVCRT_H)37#if defined(__STDPP__directive) && defined(__STDPP__hide)38__STDPP__directive pragma pp:nohide strdup39#else40#undef strdup41#endif42#endif4344/*45* return a copy of s using malloc46*/4748#if defined(__EXPORT__)49#define extern __EXPORT__50#endif5152extern char*53strdup(register const char* s)54{55register char* t;56register int n;5758return (s && (t = oldof(0, char, n = strlen(s) + 1, 0))) ? (char*)memcpy(t, s, n) : (char*)0;59}606162