1/* BEGIN LICENSE BLOCK
2 * Version: CMPL 1.1
3 *
4 * The contents of this file are subject to the Cisco-style Mozilla Public
5 * License Version 1.1 (the "License"); you may not use this file except
6 * in compliance with the License.  You may obtain a copy of the License
7 * at www.eclipse-clp.org/license.
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11 * the License for the specific language governing rights and limitations
12 * under the License.
13 *
14 * The Original Code is  The ECLiPSe Constraint Logic Programming System.
15 * The Initial Developer of the Original Code is  Cisco Systems, Inc.
16 * Portions created by the Initial Developer are
17 * Copyright (C) 1994-2006 Cisco Systems, Inc.  All Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * END LICENSE BLOCK */
22
23/***********************************************************************
24**      System: Parallel ECLiPSe Scheduler
25**        File: sch_eng_interface.h
26**      Author: Liang-Liang Li
27** Description: Interface Declarations for scheduler, engine, and worker
28**
29***********************************************************************/
30
31/* Two Subtrees share Common Root */
32#define ComnNode(t1,t2) ((t1)->knot==(t2)->knot && (t1)->site==(t2)->site)
33
34/*****  Interfaces: Worker Management Calls Scheduler  *****/
35/***********************************************************/
36
37#if defined(__STDC__)
38void sch_port_upcall    (aport_id_t);
39void sch_create_leaf    (aport_id_t, eng_handle_t, st_handle_t **);
40void sch_create_root    (aport_id_t, st_handle_t *);
41void sch_genesis        (st_handle_t *, st_handle_t *, st_handle_t *, int);
42void sch_init_lodge	(aport_id_t, int, st_handle_t *);
43void sch_idle_eng	(aport_id_t);
44void sch_wake_eng 	(aport_id_t);
45void sch_get_info	(aport_id_t, int *, void_ptr *);
46void sch_set_info	(aport_id_t, void_ptr);
47void sch_reduce_worker	(aport_id_t);
48#else /* __STDC__ */
49void sch_port_upcall    ();
50void sch_create_leaf    ();
51void sch_create_root    ();
52void sch_genesis        ();
53void sch_init_lodge	();
54void sch_idle_eng       ();
55void sch_wake_eng	();
56void sch_get_info	();
57void sch_set_info	();
58void sch_reduce_worker	();
59#endif /* __STDC__ */
60
61
62/*****  Interfaces: Scheduler calls Worker Management *****/
63/***********************************************************/
64
65#if defined(__STDC__)
66void wm_init_lodged	(int, st_handle_t *);
67#else /* __STDC__ */
68void wm_init_lodged	();
69#endif /* __STDC__ */
70
71/*****  Interfaces: Worker Management Calls Engine  ********/
72/***********************************************************/
73
74/*****  Interfaces: Engine Calls Scheduler             *****/
75/***********************************************************/
76
77#if defined(__STDC__)
78extern void sch_load_report     (const st_handle_t *);
79extern void sch_load_publish_one(const st_handle_t *, int, st_handle_t *, int);
80extern void sch_backtrack       (const st_handle_t *);
81extern void sch_cut             (const st_handle_t *, const st_handle_t *);
82extern void sch_engine_migrate  (const st_handle_t *, const st_handle_t *);
83#if defined(PROLOG_LMP)
84extern int  sch_lmp             (const st_handle_t *);
85#endif /* PROLOG_LMP */
86extern void sch_sync_msg_hdls   (const st_handle_t *);
87#else /* __STDC__ */
88extern void sch_load_report     ();
89extern void sch_load_publish_one();
90extern void sch_backtrack       ();
91extern void sch_cut             ();
92extern void sch_engine_migrate  ();
93#if defined(PROLOG_LMP)
94extern int  sch_lmp             ();
95#endif /* PROLOG_LMP */
96extern void sch_sync_msg_hdls   ();
97#endif /* __STDC__ */
98
99/*****  Interfaces: Scheduler Calls Engine            *****/
100/**********************************************************/
101
102#if defined(__STDC__)
103extern int  eng_publish         (eng_handle_t, int, int *);
104extern void eng_backtrack       (eng_handle_t, const st_handle_t *, unsigned);
105extern void eng_trust           (eng_handle_t, unsigned);
106extern void eng_undo_publish    (eng_handle_t, const st_handle_t *);
107extern void eng_cut_ok          (eng_handle_t, const st_handle_t *);
108extern void eng_fail            (eng_handle_t);
109extern void eng_stop            (eng_handle_t);
110extern void eng_lmp             (const eng_handle_t);
111extern void eng_donate_state    (eng_handle_t, const st_handle_t *,
112				     const st_handle_t *, const st_handle_t *);
113extern void eng_msg_trigger     (eng_handle_t);
114extern void eng_msg_reset       (eng_handle_t);
115#else /* __STDC__ */
116extern int  eng_publish         ();
117extern void eng_backtrack       ();
118extern void eng_trust           ();
119extern void eng_undo_publish    ();
120extern void eng_cut_ok          ();
121extern void eng_fail            ();
122extern void eng_stop            ();
123extern void eng_lmp             ();
124extern void eng_donate_state    ();
125extern void eng_msg_trigger     ();
126extern void eng_msg_reset       ();
127#endif /* __STDC__ */
128
129