xref: /illumos-gate/usr/src/cmd/logadm/fn.h (revision 2a8bcb4e)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5404720a7Sbasabi  * Common Development and Distribution License (the "License").
6404720a7Sbasabi  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22404720a7Sbasabi  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23404720a7Sbasabi  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  *
257c478bd9Sstevel@tonic-gate  * logadm/fn.h -- public definitions for fn module
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #ifndef	_LOGADM_FN_H
297c478bd9Sstevel@tonic-gate #define	_LOGADM_FN_H
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /* functions that deal with single strings */
367c478bd9Sstevel@tonic-gate struct fn *fn_new(const char *s);
377c478bd9Sstevel@tonic-gate struct fn *fn_dup(struct fn *fnp);
387c478bd9Sstevel@tonic-gate struct fn *fn_dirname(struct fn *fnp);
397c478bd9Sstevel@tonic-gate void fn_setn(struct fn *fnp, int n);
407c478bd9Sstevel@tonic-gate int fn_getn(struct fn *fnp);
417c478bd9Sstevel@tonic-gate void fn_setstat(struct fn *fnp, struct stat *stp);
427c478bd9Sstevel@tonic-gate struct stat *fn_getstat(struct fn *fnp);
437c478bd9Sstevel@tonic-gate void fn_free(struct fn *fnp);
447c478bd9Sstevel@tonic-gate void fn_renew(struct fn *fnp, const char *s);
457c478bd9Sstevel@tonic-gate void fn_putc(struct fn *fnp, int c);
467c478bd9Sstevel@tonic-gate void fn_puts(struct fn *fnp, const char *s);
477c478bd9Sstevel@tonic-gate void fn_putfn(struct fn *fnp, struct fn *srcfnp);
487c478bd9Sstevel@tonic-gate void fn_rewind(struct fn *fnp);
497c478bd9Sstevel@tonic-gate int fn_getc(struct fn *fnp);
507c478bd9Sstevel@tonic-gate int fn_peekc(struct fn *fnp);
517c478bd9Sstevel@tonic-gate char *fn_s(struct fn *fnp);
52*bf8770b4Snakanon boolean_t fn_isgz(struct fn *fnp);
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate /* functions that deal with lists of strings */
557c478bd9Sstevel@tonic-gate struct fn_list *fn_list_new(const char * const *slist);
567c478bd9Sstevel@tonic-gate struct fn_list *fn_list_dup(struct fn_list *fnlp);
577c478bd9Sstevel@tonic-gate void fn_list_free(struct fn_list *fnlp);
587c478bd9Sstevel@tonic-gate void fn_list_adds(struct fn_list *fnlp, const char *s);
597c478bd9Sstevel@tonic-gate void fn_list_addfn(struct fn_list *fnlp, struct fn *fnp);
607c478bd9Sstevel@tonic-gate void fn_list_rewind(struct fn_list *fnlp);
617c478bd9Sstevel@tonic-gate struct fn *fn_list_next(struct fn_list *fnlp);
627c478bd9Sstevel@tonic-gate void fn_list_addfn_list(struct fn_list *fnlp, struct fn_list *fnlp2);
637c478bd9Sstevel@tonic-gate void fn_list_appendrange(struct fn_list *fnlp,
647c478bd9Sstevel@tonic-gate     const char *s, const char *limit);
657c478bd9Sstevel@tonic-gate void fn_list_print(struct fn_list *fnlp, FILE *stream);
66404720a7Sbasabi off_t fn_list_totalsize(struct fn_list *fnlp);
677c478bd9Sstevel@tonic-gate struct fn *fn_list_popoldest(struct fn_list *fnlp);
687c478bd9Sstevel@tonic-gate boolean_t fn_list_empty(struct fn_list *fnlp);
697c478bd9Sstevel@tonic-gate int fn_list_count(struct fn_list *fnlp);
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
727c478bd9Sstevel@tonic-gate }
737c478bd9Sstevel@tonic-gate #endif
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #endif	/* _LOGADM_FN_H */
76