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

# new\_Record(3)

short description

## NAME

**new\_Record** – short description

## LIBRARY

*libpdb*

## SYNOPSIS

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

*struct* *pdb* *\**\

**new\_Record**(*const ubyte flags*, *const ubyte category*, *const udword id*, *const uword len*, *const ubyte \*data*);

*void*\

**pdb\_FreeRecord**(*struct pdb\_record \*rec*);

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

**new\_Resource**(*const udword type*, *const uword id*, *const uword len*, *const ubyte \*data*);

*void*\

**pdb\_FreeResource**(*struct pdb\_resource \*rsrc*);

## DESCRIPTION

**new\_Record** allocates space for a new *struct* *pdb\_record* and initializes it from the given variables. *flags* is the bitwise-or of zero or more of the PDB\_REC\_\* flags from *\<pdb.h\>*. *category* is an index into the database's category table, if it has one. *id* is the record's ID. *len* is the length of the data pointed to by *data*. The record's data will be initialized from this. The data is copied.

**new\_Resource** is similar to **new\_Record**, but allocates a new *struct* *pdb\_resource*.

**pdb\_FreeRecord** frees a *struct* *pdb\_record* allocated by **new\_Record**.

**pdb\_FreeResource** frees a *struct* *pdb\_resource* allocated by **new\_Resource**.

## RETURN VALUE

**new\_Record** and **new\_Resource** return a pointer to the new *struct* *pdb\_record* or *struct* *pdb\_resource* if successful, or NULL in case of error.

## SEE ALSO

[libpdb(3)](/libpdb/3.md).
