P99
Macros | Functions
p99_init.h File Reference

Implement initialization functions that are executed early. More...

#include "p99_if.h"
#include "p99_callback.h"
#include "p99_hook.h"
+ Include dependency graph for p99_init.h:

Go to the source code of this file.

Macros

#define main   p99_init_main
 
#define P99_INIT_FUNCTION_DECLARE(FUNC, NR)
 Request that FUNC is to be called at initialization time with priority NR. More...
 
#define P99_INIT_TRIGGER(NAME, ARGC, ARGV)   P99_NOP
 
#define P99_INIT_VARIABLE(NAME, FUNC, NR)
 Request that FUNC is to be called with argument &(NAME) at initialization time with priority NR. More...
 
#define P99_INTERCEPT_MAIN
 Macro to control compilation of initialization features. More...
 
#define P99_MAIN_INTERCEPT(NAME)
 Intercept the main function before it is called and run some startup code. More...
 

Functions

int p99_init_main (int, char *[])
 

Detailed Description

Implement initialization functions that are executed early.

This can emulate gcc's constructor attribute and call init functions for variables with static storage duration.

Deprecated:
This constructor code is too much system dependent and too fragile. Don't use it in regular code, this might be removed from P99, soon.

The only place that uses this in P99 itself is for threads. There is an optional feature to replace main.

Definition in file p99_init.h.

P99_STRINGIFY
#define P99_STRINGIFY(...)
Transform the argument list into one string.
Definition: p99_compiler.h:109
P99_INIT_TRIGGER
#define P99_INIT_TRIGGER(NAME, ARGC, ARGV)
Definition: p99_init.h:251
p99_init_main
int p99_init_main(int, char *[])
P99_PASTE2
#define P99_PASTE2(_1, _2)
Paste two token sequences at their junction.
Definition: p99_paste.h:82
p99_init.h
Implement initialization functions that are executed early.
P99_INIT_FUNCTION_DECLARE
#define P99_INIT_FUNCTION_DECLARE(FUNC, NR)
Request that FUNC is to be called at initialization time with priority NR.
Definition: p99_init.h:143
P99_DECLARE_ONCE_CHAIN
#define P99_DECLARE_ONCE_CHAIN(T)
Declare the symbols that are needed for the macro P99_INIT_CHAIN().
Definition: p99_threads.h:276
P99_INIT_CHAIN
#define P99_INIT_CHAIN(T)
Ensure that the function that was defined with P99_DEFINE_ONCE_CHAIN has been called exactly once bef...
Definition: p99_threads.h:291
main
#define main
P99_DEFINE_ONCE_CHAIN
#define P99_DEFINE_ONCE_CHAIN(T,...)
Define a function that will be called exactly once by P99_INIT_CHAIN(T).
Definition: p99_threads.h:237
P99_MAIN_INTERCEPT
P99_MAIN_INTERCEPT(p99_threads_main)
Definition: p99_threads_posix.h:625