-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoinit_uuid_main.c
64 lines (52 loc) · 1.79 KB
/
autoinit_uuid_main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
** $Id$
** Generated by IDLTool 53.6
** Do not edit
**
** AutoInit stub for uuid
**
** Copyright (c) 2010 Hyperion Entertainment CVBA.
** All Rights Reserved.
*/
#include <libraries/uuid.h>
#include <interfaces/uuid.h>
#include <proto/exec.h>
#include <assert.h>
struct UuidIFace * IUuid = NULL;
static struct Library * __uuidBase;
static struct UuidIFace * __IUuid;
/****************************************************************************/
extern struct Library * uuidBase;
/****************************************************************************/
void uuid_main_constructor(void)
{
if (uuidBase == NULL) /* Library base is NULL, we need to open it */
{
/* We were called before the base constructor.
* This means we will be called _after_ the base destructor.
* So we cant drop the interface _after_ closing the last library base,
* we just open the library here which ensures that.
*/
__uuidBase = uuidBase = (struct Library *)IExec->OpenLibrary("uuid.library", 0L);
assert(uuidBase != NULL);
}
__IUuid = IUuid = (struct UuidIFace *)IExec->GetInterface((struct Library *)uuidBase, "main", 1, NULL);
assert(IUuid != NULL);
}
__attribute__((section(".ctors.zzzy"))) static void
(*uuid_main_constructor_ptr)(void) USED = uuid_main_constructor;
/****************************************************************************/
void uuid_main_destructor(void)
{
if (__IUuid)
{
IExec->DropInterface ((struct Interface *)__IUuid);
}
if (__uuidBase)
{
IExec->CloseLibrary((struct Library *)__uuidBase);
}
}
__attribute__((section(".dtors.zzzy"))) static void
(*uuid_main_destructor_ptr)(void) USED = uuid_main_destructor;
/****************************************************************************/