2001-12-17 14:31:42 +00:00
|
|
|
/** Implementation of NSCopyObject() for GNUStep
|
1995-03-18 16:39:48 +00:00
|
|
|
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
2005-02-22 11:22:44 +00:00
|
|
|
|
1996-04-17 20:17:45 +00:00
|
|
|
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
1995-03-18 16:39:48 +00:00
|
|
|
Date: August 1994
|
2005-02-22 11:22:44 +00:00
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-03-18 16:39:48 +00:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1995-03-18 16:39:48 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2005-02-22 11:22:44 +00:00
|
|
|
|
1995-03-18 16:39:48 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
2005-02-22 11:22:44 +00:00
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
1995-03-18 16:39:48 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-10-20 10:56:27 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
2001-12-18 16:54:15 +00:00
|
|
|
|
|
|
|
<title>NSCopyObject class reference</title>
|
|
|
|
$Date$ $Revision$
|
2005-02-22 11:22:44 +00:00
|
|
|
*/
|
1995-03-18 16:39:48 +00:00
|
|
|
|
2003-06-07 01:24:41 +00:00
|
|
|
#include "config.h"
|
2003-07-31 23:49:32 +00:00
|
|
|
#include "GNUstepBase/preface.h"
|
2003-06-07 01:24:41 +00:00
|
|
|
#include "Foundation/NSObject.h"
|
1995-03-18 16:39:48 +00:00
|
|
|
|
2009-02-23 20:42:32 +00:00
|
|
|
NSObject *NSCopyObject(NSObject *anObject, NSUInteger extraBytes, NSZone *zone)
|
1995-03-18 16:39:48 +00:00
|
|
|
{
|
|
|
|
id copy = NSAllocateObject(((id)anObject)->class_pointer, extraBytes, zone);
|
2005-02-22 11:22:44 +00:00
|
|
|
memcpy(copy, anObject,
|
1995-03-18 16:39:48 +00:00
|
|
|
((id)anObject)->class_pointer->instance_size + extraBytes);
|
|
|
|
return copy;
|
|
|
|
}
|