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