1
+ #ifndef PRINT_H
2
+ #define PRINT_H
3
+
4
+ #include <stdbool.h>
1
5
#include <stdarg.h>
2
6
#include <stdio.h>
3
7
4
- int __print_enable_color = 1 ;
8
+ static int __print_enable_color = 1 ;
5
9
6
- void __print_color (FILE * fd , int a ) {
10
+ static void __print_color (FILE * fd , int a ) {
7
11
if (!__print_enable_color ) return ;
8
12
if (a == -1 ) fputs ("\x1b(B\x1b[m" , fd );
9
13
else fprintf (fd , "\x1b[38;5;%im" , a );
@@ -24,21 +28,21 @@ void __print_color(FILE* fd, int a) {
24
28
if (n > max_len) fputs("...", fd); \
25
29
fputc(']', fd);
26
30
27
- int __print_color_normal = -1 ; // -1 means default terminal foreground color
28
- int __print_color_number = 4 ;
29
- int __print_color_string = 1 ;
30
- int __print_color_hex = 2 ;
31
- int __print_color_float = 5 ;
31
+ static int __print_color_normal = -1 ; // -1 means default terminal foreground color
32
+ static int __print_color_number = 4 ;
33
+ static int __print_color_string = 1 ;
34
+ static int __print_color_hex = 2 ;
35
+ static int __print_color_float = 5 ;
32
36
33
- void __print_setup_colors (int normal , int number , int string , int hex , int fractional ) {
37
+ static void __print_setup_colors (int normal , int number , int string , int hex , int fractional ) {
34
38
__print_color_string = string ;
35
39
__print_color_number = number ;
36
40
__print_color_hex = hex ;
37
41
__print_color_normal = normal ;
38
42
__print_color_float = fractional ;
39
43
}
40
44
41
- void __print_func (FILE * fd , int count , unsigned short types [], ...) {
45
+ static void __print_func (FILE * fd , int count , unsigned short types [], ...) {
42
46
va_list v ;
43
47
va_start (v , types );
44
48
#ifdef __print_DEBUG
@@ -197,3 +201,4 @@ void __print_func (FILE *fd, int count, unsigned short types[], ...) {
197
201
198
202
#define print (a ...) fprint(stdout, a)
199
203
204
+ #endif
0 commit comments