xref: /titanic_41/usr/src/cmd/genmsg/genmsg.h (revision e11c3f44f531fdff80941ce57c065d2ae861cefc)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * Boolean values.
37  */
38 #define	TRUE	1
39 #define	FALSE	0
40 
41 /*
42  * Default quote character for a message file.
43  */
44 #define	QUOTE	'"'
45 
46 /*
47  * Number to be updated by the auto message numbering.
48  */
49 #define	NOMSGID		-1
50 
51 /*
52  * Genmsg action mode is for genmsg to identify its tasks.
53  */
54 #define	IsActiveMode(mode)	(active_mode & (mode))
55 #define	SetActiveMode(mode)	(active_mode |= (mode))
56 #define	ResetActiveMode(mode)	(active_mode &= ~(mode))
57 
58 typedef long Mode;
59 
60 #define	NoMode		(0L)		/* internal-mode */
61 #define	ReplaceMode	(1L<<0)		/* internal-mode */
62 #define	MessageMode	(1L<<1)		/* -o */
63 #define	AppendMode	(1L<<2)		/* -a */
64 #define	AutoNumMode	(1L<<3)		/* -l projfile */
65 #define	ReverseMode	(1L<<4)		/* -r */
66 #define	OverwriteMode	(1L<<5)		/* -f */
67 #define	ProjectMode	(1L<<6)		/* -g new-projfile */
68 #define	MsgCommentMode	(1L<<7)		/* -c comment-tag */
69 #define	SetCommentMode	(1L<<8)		/* -c comment-tag */
70 #define	BackCommentMode (1L<<9)		/* -b */
71 #define	LineInfoMode	(1L<<10)	/* -n */
72 #define	PrefixMode	(1L<<11)	/* -m prefix */
73 #define	SuffixMode	(1L<<12)	/* -M suffix */
74 #define	TripleMode	(1L<<13)	/* -t */
75 #define	DoubleLineMode	(1L<<14)	/* -d */
76 #define	PreProcessMode	(1L<<15)	/* -p cpp-path */
77 #define	NoErrorMode	(1L<<16)	/* -x */
78 
79 extern Mode active_mode;
80 
81 
82 extern char *srcfile;		/* from main.c */
83 extern FILE *newfp;		/* from main.c */
84 
85 extern void prg_err(char *fmt, ...);
86 extern void src_err(char *file, int line, char *fmt, ...);
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif	/* _GENMSG_H */
93