Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
860f9a2de442b31a1a55e0415cf7807c3011ea18
[simgrid.git] / src / bindings / ruby / rb_msg_process.h
1 #ifndef RB_MSG_PROCESS
2 #define RB_MSG_PROCESS
3
4 #include <ruby.h>
5 #include <stdio.h>
6 #include "msg/msg.h"
7 #include "msg/datatypes.h"
8
9 #include "msg/private.h"
10 #include "msg/mailbox.h"
11 #include "surf/surfxml_parse.h"
12 #include "simix/simix.h"
13 #include "simix/private.h"
14 #include "xbt/sysdep.h"        
15 #include "xbt/log.h"
16 #include "xbt/asserts.h"
17 #include "rb_msg_host.h"
18
19
20 /**************************************************************************
21 There are 2 section in This File:
22
23 1 - Functions to Manage The Ruby Process  >> Up Call
24 2 - Functions to Manage The Native Process Simulation Bound >> Down Call
25
26 ***************************************************************************/
27 // Init Ruby : To Call Ruby Methods From C
28
29 static void initRuby();
30
31 /***********************************************
32
33 Functions for Ruby Process Management ( Up Call )
34
35 Independant Methods
36
37 ************************************************/
38
39 // Get Name
40 static VALUE process_getName( VALUE ruby_process );
41
42 // Get  Process ID
43 static VALUE process_getID(VALUE ruby_process);
44
45 // Get Bind : return the ID of Bind member
46 static VALUE process_getBind(VALUE ruby_class);
47
48 // Set Bind 
49 static void process_setBind(VALUE ruby_class,long bind);
50
51 // isAlive
52 static VALUE process_isAlive(VALUE ruby_process);
53
54 // Kill Process
55 static void process_kill(VALUE ruby_process);
56
57 // join Process
58 static void process_join( VALUE ruby_process );
59
60 // unschedule Process
61 static void process_unschedule( VALUE ruby_process );
62
63 // schedule Process
64 static void process_schedule( VALUE ruby_process );
65
66
67
68
69 /***************************************************
70
71 Function for Native Process ( Bound ) Management
72
73 Methods Belong to The MSG Module
74 ****************************************************/
75
76 // ProcessBind Method ; Process Ruby >> Process C
77
78 //friend Method // Not belong to the Class but Called within !!
79 static m_process_t process_to_native(VALUE ruby_process);
80
81 // Binding Process >> Friend Method
82 static void processBind(VALUE ruby_class,m_process_t process);
83
84 // CreateProcess Method
85 static void processCreate(VALUE Class,VALUE rb_process,VALUE host);
86
87 // ProcessSuspend
88 static void processSuspend(VALUE Class,VALUE ruby_process);
89
90 // ProcessResume
91 static void processResume(VALUE Class,VALUE ruby_process);
92
93 //ProcessIsSuspend return Boolean ( Qtrue / Qfalse )
94 static VALUE  processIsSuspend(VALUE Class,VALUE ruby_process);
95
96 //Processkill
97 static void processKill(VALUE Class,VALUE ruby_process);
98
99 //ProcessGetHost
100 static VALUE processGetHost(VALUE Class,VALUE ruby_process);
101
102 //ProcessExit
103 static void processExit(VALUE Class,VALUE ruby_process); 
104
105 #endif