xref: /onnv-gate/usr/src/cmd/lp/lib/requests/freerequest.c (revision 3125:084bca4d4623)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*3125Sjacobs  * Common Development and Distribution License (the "License").
6*3125Sjacobs  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*3125Sjacobs 
22*3125Sjacobs /*
23*3125Sjacobs  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*3125Sjacobs  * Use is subject to license terms.
25*3125Sjacobs  */
26*3125Sjacobs 
270Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
280Sstevel@tonic-gate /*	  All Rights Reserved  	*/
290Sstevel@tonic-gate 
300Sstevel@tonic-gate 
31*3125Sjacobs #pragma ident	"%Z%%M%	%I%	%E% SMI"
320Sstevel@tonic-gate /* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #include "sys/types.h"
350Sstevel@tonic-gate #include "stdlib.h"
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #include "lp.h"
380Sstevel@tonic-gate #include "requests.h"
390Sstevel@tonic-gate 
400Sstevel@tonic-gate /**
410Sstevel@tonic-gate  ** freerequest() - FREE STRUCTURE ALLOCATED FOR A REQUEST STRUCTURE
420Sstevel@tonic-gate  **/
430Sstevel@tonic-gate 
440Sstevel@tonic-gate void
450Sstevel@tonic-gate #if	defined(__STDC__)
freerequest(REQUEST * reqbufp)460Sstevel@tonic-gate freerequest (
470Sstevel@tonic-gate 	REQUEST *		reqbufp
480Sstevel@tonic-gate )
490Sstevel@tonic-gate #else
500Sstevel@tonic-gate freerequest (reqbufp)
510Sstevel@tonic-gate 	register REQUEST	*reqbufp;
520Sstevel@tonic-gate #endif
530Sstevel@tonic-gate {
540Sstevel@tonic-gate 	if (!reqbufp)
550Sstevel@tonic-gate 		return;
560Sstevel@tonic-gate 	if (reqbufp->destination)
570Sstevel@tonic-gate 		Free (reqbufp->destination);
580Sstevel@tonic-gate 	if (reqbufp->file_list)
590Sstevel@tonic-gate 		freelist (reqbufp->file_list);
600Sstevel@tonic-gate 	if (reqbufp->form)
610Sstevel@tonic-gate 		Free (reqbufp->form);
620Sstevel@tonic-gate 	if (reqbufp->alert)
630Sstevel@tonic-gate 		Free (reqbufp->alert);
640Sstevel@tonic-gate 	if (reqbufp->options)
650Sstevel@tonic-gate 		Free (reqbufp->options);
660Sstevel@tonic-gate 	if (reqbufp->pages)
670Sstevel@tonic-gate 		Free (reqbufp->pages);
680Sstevel@tonic-gate 	if (reqbufp->charset)
690Sstevel@tonic-gate 		Free (reqbufp->charset);
700Sstevel@tonic-gate 	if (reqbufp->modes)
710Sstevel@tonic-gate 		Free (reqbufp->modes);
720Sstevel@tonic-gate 	if (reqbufp->title)
730Sstevel@tonic-gate 		Free (reqbufp->title);
740Sstevel@tonic-gate 	if (reqbufp->input_type)
750Sstevel@tonic-gate 		Free (reqbufp->input_type);
760Sstevel@tonic-gate 	if (reqbufp->user)
770Sstevel@tonic-gate 		Free (reqbufp->user);
78*3125Sjacobs 	Free (reqbufp);
79*3125Sjacobs 
800Sstevel@tonic-gate 	return;
810Sstevel@tonic-gate }
82