---
name: "pdb_CopyRecord"
section: "3"
platform: "linux"
package: "coldsync"
version: "3.0+pre3-3"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/pdb_CopyRecord"
---

# pdb\_CopyRecord(3)

short description

## NAME

**pdb\_CopyRecord** **pdb\_CopyResource** – short description

## LIBRARY

*libpdb*

## SYNOPSIS

**#include \<pdb.h\>**

*struct* *pdb\_record* *\**\

**pdb\_CopyRecord**(*const struct pdb \*db*, *const struct pdb\_record \*rec*);

*struct* *pdb\_resource* *\**\

**pdb\_CopyResource**(*const struct pdb \*db*, *const struct pdb\_resource \*rsrc*);

## DESCRIPTION

**pdb\_CopyRecord** allocates a new *struct* *pdb\_record*, copies to it the record pointed to by *rec* in database *db*, and returns a pointer to the newly-allocated *struct* *pdb\_record*. This pointer must later be freed with **pdb\_FreeRecord**(), unless it is added to another database using a function such as **pdb\_AppendRecord**().

**pdb\_CopyResource** allocates a new *struct* *pdb\_resource*, copies to it the resource pointed to by *rsrc* in database *db*, and returns a pointer to the newly-allocated *struct* *pdb\_resource*. This pointer must later be freed with **pdb\_FreeResource**(), unless it is added to another database using a function such as **pdb\_AppendResource**().

## RETURN VALUE

**pdb\_CopyRecord** and **pdb\_CopyResource** return a pointer to the newly-allocated *struct* *pdb\_record* or *struct* *pdb\_resource* if successful, or NULL otherwise.

## SEE ALSO

[libpdb(3)](/libpdb/3.md), pdb\_FreeRecord(3), pdb\_FreeResource(3).

## AUTHORS

Andrew Arensburger ⟨arensb@ooblick.com⟩
