xref: /illumos-gate/usr/src/cmd/genmsg/genmsg.h (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_GENMSG_H
27 #define	_GENMSG_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * Boolean values.
35  */
36 #define	TRUE	1
37 #define	FALSE	0
38 
39 /*
40  * Default quote character for a message file.
41  */
42 #define	QUOTE	'"'
43 
44 /*
45  * Number to be updated by the auto message numbering.
46  */
47 #define	NOMSGID		-1
48 
49 /*
50  * Genmsg action mode is for genmsg to identify its tasks.
51  */
52 #define	IsActiveMode(mode)	(active_mode & (mode))
53 #define	SetActiveMode(mode)	(active_mode |= (mode))
54 #define	ResetActiveMode(mode)	(active_mode &= ~(mode))
55 
56 typedef long Mode;
57 
58 #define	NoMode		(0L)		/* internal-mode */
59 #define	ReplaceMode	(1L<<0)		/* internal-mode */
60 #define	MessageMode	(1L<<1)		/* -o */
61 #define	AppendMode	(1L<<2)		/* -a */
62 #define	AutoNumMode	(1L<<3)		/* -l projfile */
63 #define	ReverseMode	(1L<<4)		/* -r */
64 #define	OverwriteMode	(1L<<5)		/* -f */
65 #define	ProjectMode	(1L<<6)		/* -g new-projfile */
66 #define	MsgCommentMode	(1L<<7)		/* -c comment-tag */
67 #define	SetCommentMode	(1L<<8)		/* -c comment-tag */
68 #define	BackCommentMode (1L<<9)		/* -b */
69 #define	LineInfoMode	(1L<<10)	/* -n */
70 #define	PrefixMode	(1L<<11)	/* -m prefix */
71 #define	SuffixMode	(1L<<12)	/* -M suffix */
72 #define	TripleMode	(1L<<13)	/* -t */
73 #define	DoubleLineMode	(1L<<14)	/* -d */
74 #define	PreProcessMode	(1L<<15)	/* -p cpp-path */
75 #define	NoErrorMode	(1L<<16)	/* -x */
76 
77 extern Mode active_mode;
78 
79 
80 extern char *srcfile;		/* from main.c */
81 extern FILE *newfp;		/* from main.c */
82 
83 extern void prg_err(char *fmt, ...);
84 extern void src_err(char *file, int line, char *fmt, ...);
85 
86 #ifdef	__cplusplus
87 }
88 #endif
89 
90 #endif	/* _GENMSG_H */
91