---
name: "addphref"
section: "3"
platform: "linux"
package: "alliance"
version: "5.1.1-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/addphref"
---

# addphref(3)

create a physical reference

## NAME

addphref - create a physical reference

## SYNOPSYS

```
#include "mph.h"
phref_list ∗addphref(ptfig, type, name, x, y)
phfig_list ∗ptfig;
char ∗type;
char ∗name;
long x, y;
```

## PARAMETERS

- *ptfig*

  Pointer to the figure in which the reference should be added

- *type*

  Reference type

- *name*

  Reference name

- *x, y*

  Coordinates of the center of the reference.

## DESCRIPTION

**addphref** creates a new reference whose center is at the given coordinates, and adds it to the list of references pointed to by *ptfig-\>PHREF*. The new reference is  added in front of the list, and becomes itself the list head.\
 The parameters *type*, *name*, *x* and *y* fill respectivly the *FIGNAME*, *NAME*, *XREF* and *YREF* fields of the *phref* structure.\
 The *type*s may have any value, but only two type are now recognized by tools based upon mbk :

- **"ref\_con"**

  for multi-access connectors

- **"ref\_ref"**

  for cell programming

For details on the structure, see [**phref**(3)](/phref/3.md).

## RETURN VALUE

**addphref** returns a pointer to the newly created reference.

## EXAMPLE

```
#include "mph.h"
phref_list ∗ref_dup(pfd, pfs) /∗ duplicate refs ∗/
phfig_list ∗pfd, ∗pfs;
{
phref_list ∗pr;
	for (pr = pfs->phref; pr != NULL; pr = pr->NEXT)
		addphref(pfd, pr->FIGNAME, pr->NAME, pr->XREF, pr->YREF);
	return pfd->PHREF;
}
```

## SEE ALSO

**mbk**(1), [**phfig**(3)](/phfig/3.md), [**phref**(3)](/phref/3.md), [**getphref**(3)](/getphref/3.md), [**delphref**(3)](/delphref/3.md).
