import less(1)
[unleashed/tickless.git] / usr / src / lib / libc / port / print / print.h
blobbbc2c8ee7d661b6c070cb203db87b4d2b7f1e051
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 /* Copyright (c) 1988 AT&T */
24 /* All Rights Reserved */
27 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
31 #ifndef _PRINT_H
32 #define _PRINT_H
34 #include "file64.h"
35 #include <floatingpoint.h>
36 #include <thread.h>
37 #include <synch.h>
38 #include <stdio.h>
39 #include "stdiom.h"
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
45 extern ssize_t
46 _doprnt(const char *format, va_list in_args, FILE *iop);
48 extern ssize_t
49 _ndoprnt(const char *format, va_list in_args, FILE *iop, int flag);
51 extern ssize_t
52 _wndoprnt(const wchar_t *format, va_list in_args, FILE *iop, int flag);
54 extern void
55 __aconvert(double arg, int ndigits, int *exp, int *sign, char *buf);
57 extern void
58 __qaconvert(long double *arg, int ndigits, int *exp, int *sign, char *buf);
60 /* Maximum number of digits in any integer representation */
61 #define MAXDIGS 11
63 /* Maximum number of digits in any long long representation */
64 #define MAXLLDIGS 22
66 /* Maximum total number of digits in E format */
67 #define MAXECVT (DECIMAL_STRING_LENGTH-1)
69 /* Maximum number of digits after decimal point in F format */
70 #define MAXFCVT (DECIMAL_STRING_LENGTH-1)
72 /* Maximum significant figures in a floating-point number */
73 /* DECIMAL_STRING_LENGTH in floatingpoint.h is max buffer size */
74 #define MAXFSIG (DECIMAL_STRING_LENGTH-1)
76 /* Maximum number of characters in an exponent */
77 #define MAXESIZ 7 /* Max for quadruple precision */
79 /* Maximum (positive) exponent */
80 #define MAXEXP 4950 /* Max for quadruple precision */
82 /* Number of hex digits in a fp type when normalized with a leading 1 */
83 #define HEXFP_SINGLE_DIG 7
84 #define HEXFP_DOUBLE_DIG 14
85 #define HEXFP_EXTENDED_DIG 17
86 #define HEXFP_QUAD_DIG 29
88 /* Data type for flags */
89 typedef char bool;
91 /* Convert a digit character to the corresponding number */
92 #define tonumber(x) ((x)-'0')
94 /* Convert a number between 0 and 9 to the corresponding digit */
95 #define todigit(x) ((x)+'0')
97 /* Max and Min macros */
98 #define max(a, b) ((a) > (b)? (a): (b))
99 #define min(a, b) ((a) < (b)? (a): (b))
101 /* Max neg. long long */
102 #define HIBITLL (1ULL << 63)
104 #ifdef __cplusplus
106 #endif
108 #endif /* _PRINT_H */