GNU PROLOG with UTF8 support
obj_chain.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog engine *
5  * File : obj_chain.h *
6  * Descr.: object chaining management - header file *
7  * Author: Daniel Diaz *
8  * *
9  * Copyright (C) 1999-2015 Daniel Diaz *
10  * *
11  * This file is part of GNU Prolog *
12  * *
13  * GNU Prolog is free software: you can redistribute it and/or *
14  * modify it under the terms of either: *
15  * *
16  * - the GNU Lesser General Public License as published by the Free *
17  * Software Foundation; either version 3 of the License, or (at your *
18  * option) any later version. *
19  * *
20  * or *
21  * *
22  * - the GNU General Public License as published by the Free *
23  * Software Foundation; either version 2 of the License, or (at your *
24  * option) any later version. *
25  * *
26  * or both in parallel, as here. *
27  * *
28  * GNU Prolog is distributed in the hope that it will be useful, *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
31  * General Public License for more details. *
32  * *
33  * You should have received copies of the GNU General Public License and *
34  * the GNU Lesser General Public License along with this program. If *
35  * not, see http://www.gnu.org/licenses/. *
36  *-------------------------------------------------------------------------*/
37 
38 
39 #include "gp_config.h"
40 #include "pl_long.h"
41 
42 /*---------------------------------*
43  * Constants *
44  *---------------------------------*/
45 
46 /*---------------------------------*
47  * Type Definitions *
48  *---------------------------------*/
49 
50 /*---------------------------------*
51  * Global Variables *
52  *---------------------------------*/
53 
54 /*---------------------------------*
55  * Function Prototypes *
56  *---------------------------------*/
57 
58 void Pl_Find_Linked_Objects(void);
59 
60 void Pl_New_Object(void (*fct_obj_init)(), void (*fct_exec_system) (), void (*fct_exec_user) ());
61 
62 
63 #ifdef OBJ_INIT
64 
65 static void OBJ_INIT(void);
66 
67 #define OBJ_CTOR CPP_CAT(OBJ_INIT,_ctor)
68 
69 
70 #ifdef __GNUC__
71 static void __attribute__ ((constructor))
72 OBJ_CTOR(void)
73 {
74  Pl_New_Object(OBJ_INIT, NULL, NULL);
75 }
76 
77 
78 #else /* _MSC_VER */
79 
80 static void
81 OBJ_CTOR(void)
82 {
83  Pl_New_Object(OBJ_INIT, NULL, NULL);
84 }
85 
86 #pragma data_seg(".GPLC$m")
87 
88 static PlLong obj_chain_start = (PlLong) OBJ_CTOR;
89 
90 #pragma data_seg()
91 
92 #endif /* _MSC_VER */
93 
94 #endif /* OBJ_INIT */
95 
96 
97 
98 #if (defined(_MSC_VER) || defined(M_darwin)) && !defined(OBJ_CHAIN_REVERSE_ORDER)
99 #define OBJ_CHAIN_REVERSE_ORDER
100 #endif
101 
102 #if 0
103 #define OBJ_CHAIN_REVERSE_ORDER
104 #endif
105 
intptr_t PlLong
Definition: gprolog.h:88
#define OBJ_INIT
Definition: fd_bool_c.c:39
void Pl_Find_Linked_Objects(void)
Definition: obj_chain.c:145
void Pl_New_Object(void(*fct_obj_init)(), void(*fct_exec_system)(), void(*fct_exec_user)())
Definition: obj_chain.c:226