xref: /onnv-gate/usr/src/cmd/logadm/fn.h (revision 2876:704713fd1071)
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
52016Sbasabi  * Common Development and Distribution License (the "License").
62016Sbasabi  * 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  */
210Sstevel@tonic-gate /*
222016Sbasabi  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
232016Sbasabi  * Use is subject to license terms.
240Sstevel@tonic-gate  *
250Sstevel@tonic-gate  * logadm/fn.h -- public definitions for fn module
260Sstevel@tonic-gate  */
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifndef	_LOGADM_FN_H
290Sstevel@tonic-gate #define	_LOGADM_FN_H
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #ifdef	__cplusplus
340Sstevel@tonic-gate extern "C" {
350Sstevel@tonic-gate #endif
360Sstevel@tonic-gate 
370Sstevel@tonic-gate /* functions that deal with single strings */
380Sstevel@tonic-gate struct fn *fn_new(const char *s);
390Sstevel@tonic-gate struct fn *fn_dup(struct fn *fnp);
400Sstevel@tonic-gate struct fn *fn_dirname(struct fn *fnp);
410Sstevel@tonic-gate void fn_setn(struct fn *fnp, int n);
420Sstevel@tonic-gate int fn_getn(struct fn *fnp);
430Sstevel@tonic-gate void fn_setstat(struct fn *fnp, struct stat *stp);
440Sstevel@tonic-gate struct stat *fn_getstat(struct fn *fnp);
450Sstevel@tonic-gate void fn_free(struct fn *fnp);
460Sstevel@tonic-gate void fn_renew(struct fn *fnp, const char *s);
470Sstevel@tonic-gate void fn_putc(struct fn *fnp, int c);
480Sstevel@tonic-gate void fn_puts(struct fn *fnp, const char *s);
490Sstevel@tonic-gate void fn_putfn(struct fn *fnp, struct fn *srcfnp);
500Sstevel@tonic-gate void fn_rewind(struct fn *fnp);
510Sstevel@tonic-gate int fn_getc(struct fn *fnp);
520Sstevel@tonic-gate int fn_peekc(struct fn *fnp);
530Sstevel@tonic-gate char *fn_s(struct fn *fnp);
54*2876Snakanon boolean_t fn_isgz(struct fn *fnp);
550Sstevel@tonic-gate 
560Sstevel@tonic-gate /* functions that deal with lists of strings */
570Sstevel@tonic-gate struct fn_list *fn_list_new(const char * const *slist);
580Sstevel@tonic-gate struct fn_list *fn_list_dup(struct fn_list *fnlp);
590Sstevel@tonic-gate void fn_list_free(struct fn_list *fnlp);
600Sstevel@tonic-gate void fn_list_adds(struct fn_list *fnlp, const char *s);
610Sstevel@tonic-gate void fn_list_addfn(struct fn_list *fnlp, struct fn *fnp);
620Sstevel@tonic-gate void fn_list_rewind(struct fn_list *fnlp);
630Sstevel@tonic-gate struct fn *fn_list_next(struct fn_list *fnlp);
640Sstevel@tonic-gate void fn_list_addfn_list(struct fn_list *fnlp, struct fn_list *fnlp2);
650Sstevel@tonic-gate void fn_list_appendrange(struct fn_list *fnlp,
660Sstevel@tonic-gate     const char *s, const char *limit);
670Sstevel@tonic-gate void fn_list_print(struct fn_list *fnlp, FILE *stream);
682016Sbasabi off_t fn_list_totalsize(struct fn_list *fnlp);
690Sstevel@tonic-gate struct fn *fn_list_popoldest(struct fn_list *fnlp);
700Sstevel@tonic-gate boolean_t fn_list_empty(struct fn_list *fnlp);
710Sstevel@tonic-gate int fn_list_count(struct fn_list *fnlp);
720Sstevel@tonic-gate 
730Sstevel@tonic-gate #ifdef	__cplusplus
740Sstevel@tonic-gate }
750Sstevel@tonic-gate #endif
760Sstevel@tonic-gate 
770Sstevel@tonic-gate #endif	/* _LOGADM_FN_H */
78