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

# delptype(3)

delete an element of a ptype\_list

## NAME

delptype - delete an element of a **ptype\_list**

## SYNOPSYS

```
#include "mut.h"
ptype_list ∗delptype(pthead, type)
ptype_list ∗pthead;
long type;
```

## PARAMETERS

- *pthead*

  Pointer to a **ptype** list

- *type*

  The pointer of this type is to be deleted.

## DESCRIPTION

**delptype** deletes the element of the **ptype\_list** that has the type *type* in the list pointed to by *pthead*. The list consistency is maintained, and the element put back in the list of free blocks.

## RETURN VALUE

**delptype** returns a pointer to the new head of list if a *type*d pointer used to belong to the list. In most case, it has the value of *pthead*. If the *type* doesn't belong to the list, **NULL** is returned.

## ERROR

**"∗∗∗ mbk error ∗∗∗ delptype impossible : pthead = NULL"**

The pointer to the head of list is **NULL**, and that clear that such a list can't be ran thru.

## EXAMPLE

```
#include "mut.h"
#include "mph.h"
void delete_user(ptfig)
phfig_list ∗ptfig;
{
phins_list ∗i;
	for (i = ptfig->PHINS; i; i = i->NEXT)
		i->USER = delptype(i->USER, PLACEABOX);
}
```

## SEE ALSO

**mbk**(1), [**ptype**(3)](/ptype/3.md), [**addptype**(3)](/addptype/3.md), [**getptype**(3)](/getptype/3.md), [**freeptype**(3)](/freeptype/3.md).
