ReactOS 0.4.16-dev-197-g92996da
atexit.c File Reference
#include <precomp.h>
Include dependency graph for atexit.c:

Go to the source code of this file.

Functions

_onexit_t CDECL __dllonexit (_onexit_t func, _onexit_t **start, _onexit_t **end)
 

Function Documentation

◆ __dllonexit()

_onexit_t CDECL __dllonexit ( _onexit_t  func,
_onexit_t **  start,
_onexit_t **  end 
)

Definition at line 7 of file atexit.c.

8{
9 _onexit_t *tmp;
10 size_t len;
11
12 TRACE("(%p,%p,%p)\n", func, start, end);
13
14 if (!start || !*start || !end || !*end)
15 {
16 FIXME("bad table\n");
17 return NULL;
18 }
19
20 len = (*end - *start);
21
22 TRACE("table start %p-%p, %d entries\n", *start, *end, len);
23
24 if (++len <= 0)
25 return NULL;
26
27 tmp = realloc(*start, len * sizeof(_onexit_t));
28 if (!tmp)
29 return NULL;
30 *start = tmp;
31 *end = tmp + len;
32 tmp[len - 1] = func;
33 TRACE("new table start %p-%p, %d entries\n", *start, *end, len);
34 return func;
35}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define realloc
Definition: debug_ros.c:6
#define NULL
Definition: types.h:112
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLenum func
Definition: glext.h:6028
GLenum GLsizei len
Definition: glext.h:6722
int(__cdecl * _onexit_t)(void)
Definition: stdlib.h:28
#define TRACE(s)
Definition: solgame.cpp:4