---
name: "ieee1284_ref"
section: "3"
platform: "linux"
package: "libieee1284"
version: "0.2.11-19"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ieee1284_ref"
---

# ieee1284\_ref(3)

modify a port's reference count

## NAME

ieee1284\_ref, ieee1284\_unref - modify a port's reference count

## SYNOPSIS

```
#include <ieee1284.h>
```

**int ieee1284\_ref(struct parport \****port***);**

**int ieee1284\_unref(struct parport \****port***);**

## DESCRIPTION

If you want to free the port list from **ieee1284\_find\_ports** but open one of the ports later on, you will need to prevent it from being destroyed in **ieee1284\_free\_ports**. Each port has a reference count, and you can use **ieee1284\_ref** to increment it and **ieee1284\_unref** to decrement it.

If you use **ieee1284\_ref** at any stage, you must later call **ieee1284\_unref** to relinquish the extra reference. If you do not do this, the resources associated with the port will not be cleaned up.

If you have not previously used **ieee1284\_ref** on a port, you must not use **ieee1284\_unref** on it.

## RETURN VALUE

These functions return the number of references held after the increment or decrement.

## SEE ALSO

[**ieee1284\_open**(3)](/ieee1284_open/3.md)

## AUTHOR

**Tim Waugh** \<twaugh@redhat.com\>

Author.

## COPYRIGHT

Copyright © 2001-2003 Tim Waugh\
