]>
git.saurik.com Git - apple/libc.git/blob - stdio/xprintf_domain.h
2 * Copyright (c) 2012 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef __XPRINTF_DOMAIN_H_
25 #define __XPRINTF_DOMAIN_H_
27 #include <sys/cdefs.h>
31 #define PRINTF_TBL_FIRST '!'
32 #define PRINTF_TBL_LAST '~'
33 #define PRINTF_TBL_SIZE (PRINTF_TBL_LAST - PRINTF_TBL_FIRST + 1)
35 #define printf_tbl_index(x) ((x) - PRINTF_TBL_FIRST)
36 #define printf_tbl_in_range(x) ((x) >= PRINTF_TBL_FIRST && (x) <= PRINTF_TBL_LAST)
39 PRINTF_DOMAIN_UNUSED
= 0,
40 PRINTF_DOMAIN_GLIBC_API
,
41 PRINTF_DOMAIN_FBSD_API
,
44 #define printf_domain_fbsd_api(d,x) ((d)->type[x] == PRINTF_DOMAIN_FBSD_API)
45 #define printf_domain_flag(d,x) ((d)->type[x] == PRINTF_DOMAIN_FLAG)
46 #define printf_domain_glibc_api(d,x) ((d)->type[x] == PRINTF_DOMAIN_GLIBC_API)
47 #define printf_domain_unused(d,x) ((d)->type[x] == PRINTF_DOMAIN_UNUSED)
50 printf_arginfo_function
*arginfo
;
51 void *render
; /* either typedef printf_function or printf_render */
54 struct _printf_domain
{
55 pthread_rwlock_t rwlock
;
56 char type
[PRINTF_TBL_SIZE
];
57 struct _printf_tbl tbl
[PRINTF_TBL_SIZE
];
63 #endif /* __XPRINTF_DOMAIN_H_ */