18 #ifndef _BOILERPLATE_ANCILLARIES_H
19 #define _BOILERPLATE_ANCILLARIES_H
25 #include <boilerplate/signal.h>
26 #include <boilerplate/compiler.h>
27 #include <boilerplate/atomic.h>
29 extern struct timespec __init_date;
31 extern pthread_mutex_t __printlock;
36 struct name_generator {
42 #define DEFINE_NAME_GENERATOR(__name, __radix, __type, __member) \
43 struct name_generator __name = { \
45 .length = sizeof ((__type *)0)->__member, \
46 .serial = ATOMIC_INIT(1), \
49 #define ONE_BILLION 1000000000
51 void __namecpy_requires_character_array_as_destination(
void);
53 #define namecpy(__dst, __src) \
55 if (!__builtin_types_compatible_p(typeof(__dst), char[])) \
56 __namecpy_requires_character_array_as_destination(); \
57 strncpy((__dst), __src, sizeof(__dst) - 1); \
58 __dst[sizeof(__dst) - 1] = '\0'; \
66 void __run_cleanup_block(
struct cleanup_block *cb);
68 void __printout(
const char *name,
70 const char *fmt, va_list ap);
72 void __noreturn __panic(
const char *name,
73 const char *fmt, va_list ap);
75 void early_panic(
const char *fmt, ...);
77 void __noreturn panic(
const char *fmt, ...);
79 void __warning(
const char *name,
80 const char *fmt, va_list ap);
82 void early_warning(
const char *fmt, ...);
84 void warning(
const char *fmt, ...);
86 void __notice(
const char *name,
87 const char *fmt, va_list ap);
89 void early_notice(
const char *fmt, ...);
91 void notice(
const char *fmt, ...);
93 const char *symerror(
int errnum);
95 char *generate_name(
char *buf,
const char *radix,
96 struct name_generator *ngen);
98 void error_hook(
struct error_frame *ef);
100 void boilerplate_init(
void);
102 int get_static_cpu_count(
void);
104 pid_t get_thread_pid(
void);
110 extern const char *config_strings[];
Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org.
Definition: atomic.h:24