# Synopsis

(macro) PDX_MSGT mda_DuplicateEntity(long option, void *src_ent, void *dst_ent)

# Purpose

Duplicate an entity in memory.

# Description

The entity structure specified by src_ent will be duplicated with the resulting entity structure being placed in @a *dst_ent. src_ent can be either a locked entity or an entity created via mda_MallocEntity. The contents of src_ent are left unchanged by this function. The resulting entity at @a *dst_ent will be identical to src_ent. It is up to the caller to correct any entity references in dst_ent if backpointers are to be established between dst_ent and the referenced entities. The resulting entity can be written to the database by calling mda_CreateEntity or freed by calling mda_FreeEntity. If mda_CreateEntity is called, the entity will be written to whatever model is current when this function is called.

The original database pointer from src_ent will be copied to dst_ent (hence they both will point back to the same original entity). See the mda_intro man page for more information about predecessor entities.

Note that dst_ent is the address of the pointer to the resulting entity structure.

# Input

## option

Options (not used)

## src_ent

Entity to be duplicated

## dst_ent

Address to store the duplicated entity pointer at

# Output

## dst_ent

Duplicate of src_ent

# Return

MDA error code