.\" Title: ieee1284_ref
.\" Author: Tim Waugh <twaugh@redhat.com>
.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
.\" Date: 09/18/2007
.\" Manual: Functions
.\" Source:
.\"
.TH "IEEE1284_REF" "3" "09/18/2007" "" "Functions"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
ieee1284_ref, ieee1284_unref \- modify a port's reference count
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <ieee1284.h>
.fi
.ft
.HP 17
.BI "int ieee1284_ref(struct\ parport\ *" "port" ");"
.HP 19
.BI "int ieee1284_unref(struct\ parport\ *" "port" ");"
.SH "DESCRIPTION"
.PP
If you want to free the port list from
\fBieee1284_find_ports\fR
but open one of the ports later on, you will need to prevent it from being destroyed in
\fBieee1284_free_ports\fR. Each port has a reference count, and you can use
\fBieee1284_ref\fR
to increment it and
\fBieee1284_unref\fR
to decrement it.
.PP
If you use
\fBieee1284_ref\fR
at any stage, you must later call
\fBieee1284_unref\fR
to relinquish the extra reference. If you do not do this, the resources associated with the port will not be cleaned up.
.PP
If you have not previously used
\fBieee1284_ref\fR
on a port, you must not use
\fBieee1284_unref\fR
on it.
.SH "RETURN VALUE"
.PP
These functions return the number of references held after the increment or decrement.
.SH "SEE ALSO"
.PP
\fBieee1284_open\fR(3)
.SH "AUTHOR"
.PP
\fBTim Waugh\fR <\&twaugh@redhat.com\&>
.sp -1n
.IP "" 4
Author.
.SH "COPYRIGHT"
Copyright \(co 2001\-2003 Tim Waugh
.br