xref: /titanic_41/usr/src/cmd/logadm/fn.h (revision 25cf1a301a396c38e8adf52c15f537b80d2483f7)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  *
26  * logadm/fn.h -- public definitions for fn module
27  */
28 
29 #ifndef	_LOGADM_FN_H
30 #define	_LOGADM_FN_H
31 
32 #pragma ident	"%Z%%M%	%I%	%E% SMI"
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /* functions that deal with single strings */
39 struct fn *fn_new(const char *s);
40 struct fn *fn_dup(struct fn *fnp);
41 struct fn *fn_dirname(struct fn *fnp);
42 void fn_setn(struct fn *fnp, int n);
43 int fn_getn(struct fn *fnp);
44 void fn_setstat(struct fn *fnp, struct stat *stp);
45 struct stat *fn_getstat(struct fn *fnp);
46 void fn_free(struct fn *fnp);
47 void fn_renew(struct fn *fnp, const char *s);
48 void fn_putc(struct fn *fnp, int c);
49 void fn_puts(struct fn *fnp, const char *s);
50 void fn_putfn(struct fn *fnp, struct fn *srcfnp);
51 void fn_rewind(struct fn *fnp);
52 int fn_getc(struct fn *fnp);
53 int fn_peekc(struct fn *fnp);
54 char *fn_s(struct fn *fnp);
55 
56 /* functions that deal with lists of strings */
57 struct fn_list *fn_list_new(const char * const *slist);
58 struct fn_list *fn_list_dup(struct fn_list *fnlp);
59 void fn_list_free(struct fn_list *fnlp);
60 void fn_list_adds(struct fn_list *fnlp, const char *s);
61 void fn_list_addfn(struct fn_list *fnlp, struct fn *fnp);
62 void fn_list_rewind(struct fn_list *fnlp);
63 struct fn *fn_list_next(struct fn_list *fnlp);
64 void fn_list_addfn_list(struct fn_list *fnlp, struct fn_list *fnlp2);
65 void fn_list_appendrange(struct fn_list *fnlp,
66     const char *s, const char *limit);
67 void fn_list_print(struct fn_list *fnlp, FILE *stream);
68 size_t fn_list_totalsize(struct fn_list *fnlp);
69 struct fn *fn_list_popoldest(struct fn_list *fnlp);
70 boolean_t fn_list_empty(struct fn_list *fnlp);
71 int fn_list_count(struct fn_list *fnlp);
72 
73 #ifdef	__cplusplus
74 }
75 #endif
76 
77 #endif	/* _LOGADM_FN_H */
78