ReactOS  0.4.15-dev-2522-g9e0a3cd
atexit.c
Go to the documentation of this file.
1 /* taken from wine exit.c */
2 #include <precomp.h>
3 
4 /*********************************************************************
5  * __dllonexit (MSVCRT.@)
6  */
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 realloc
Definition: debug_ros.c:6
GLenum func
Definition: glext.h:6028
_onexit_t CDECL __dllonexit(_onexit_t func, _onexit_t **start, _onexit_t **end)
Definition: atexit.c:7
int(__cdecl * _onexit_t)(void)
Definition: stdlib.h:40
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
GLuint GLuint end
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
#define CDECL
Definition: compat.h:29
GLuint start
Definition: gl.h:1545
#define NULL
Definition: types.h:112