Mercurial > hg > Gears > Gears
view src/parallel_execution/examples/DebughelloWorld/HelloImpl.cbc @ 1016:3e8d89f271e2 debugger
debugger branch
author | Takato Matsuoka <t.matsuoka@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 19 Jan 2022 17:51:07 +0900 |
parents | e6778c866876 |
children | a747a99ae1f2 |
line wrap: on
line source
#include "../../../context.h" #include <stdio.h> #impl "Hello.h" as "HelloImpl.h" #interface "Hello.h" #interface "Worker.h" #interface "TaskManager.h" extern __code debugMeta(struct Context*, enum Code); // ---- // typedef struct HelloImpl <> impl Hello { // char* hString; // char* wString; // } HelloImpl; // ---- Hello* createHelloImpl(struct Context* context) { struct Hello* hello = new Hello(); struct HelloImpl* hello_impl = new HelloImpl(); hello->hello = (union Data*)hello_impl; hello->string = NULL; hello_impl->hString = NULL; hello_impl->wString = NULL; hello->h = C_hHelloImpl; hello->w = C_wHelloImpl; return hello; } __code h(struct HelloImpl* hello, __code next(...)) { hello->hString = "Hello, "; //createImpl部分では_implなのだが動く printf("%s", hello->hString); goto w(hello, next); } __code w(struct HelloImpl* hello, __code next(...)) { hello->wString = "World.\n"; printf("%s", hello->wString); goto next(...); }