1 | /*
|
---|
2 | * ãã®ãã¡ã¤ã«ã¯ tecsgen ã«ãããã³ãã¬ã¼ãã¨ãã¦èªåçæããã¾ãã
|
---|
3 | * ãã®ãã¡ã¤ã«ãç·¨éãã¦ä½¿ç¨ãããã¨ãæå³ããã¦ãã¾ãã
|
---|
4 | * tecsgen ã®åå®è¡ã«ããä¸æ¸ãããã¦ãã¾ããããé常
|
---|
5 | * gen/tBuddy_template.c => src/tBuddy.c
|
---|
6 | * ã®ããã«åå, ãã©ã«ããå¤æ´ãã¦ããä¿®æ£ãã¾ã
|
---|
7 | */
|
---|
8 | /* #[<PREAMBLE>]#
|
---|
9 | * #[<...>]# ãã #[</...>]# ã§å²ã¾ããã³ã¡ã³ãã¯ç·¨éããªãã§ãã ãã
|
---|
10 | * tecsmerge ã«ãããã¼ã¸ã«ä½¿ç¨ããã¾ã
|
---|
11 | *
|
---|
12 | * #[</PREAMBLE>]# */
|
---|
13 |
|
---|
14 | /* ãããã¿ã¤ã宣è¨ãå¤æ°ã®å®ç¾©ãããã«æ¸ãã¾ã #_PAC_# */
|
---|
15 | #include "tBuddy_tecsgen.h"
|
---|
16 |
|
---|
17 | #ifndef E_OK
|
---|
18 | #define E_OK 0 /* success */
|
---|
19 | #define E_ID (-18) /* illegal ID */
|
---|
20 | #endif
|
---|
21 |
|
---|
22 | /* åãå£é¢æ° #_TEPF_# */
|
---|
23 | /* #[<ENTRY_PORT>]# eEnt
|
---|
24 | * entry port: eEnt
|
---|
25 | * signature: sHello
|
---|
26 | * context: task
|
---|
27 | * #[</ENTRY_PORT>]# */
|
---|
28 |
|
---|
29 | /* #[<ENTRY_FUNC>]# eEnt_myMessage
|
---|
30 | * name: eEnt_myMessage
|
---|
31 | * global_name: tBuddy_eEnt_myMessage
|
---|
32 | * oneway: false
|
---|
33 | * #[</ENTRY_FUNC>]# */
|
---|
34 | ER
|
---|
35 | eEnt_myMessage(CELLIDX idx, const char* buf)
|
---|
36 | {
|
---|
37 | ER ercd = E_OK;
|
---|
38 | CELLCB *p_cellcb;
|
---|
39 | if (VALID_IDX(idx)) {
|
---|
40 | p_cellcb = GET_CELLCB(idx);
|
---|
41 | }
|
---|
42 | else {
|
---|
43 | return(E_ID);
|
---|
44 | } /* end if VALID_IDX(idx) */
|
---|
45 |
|
---|
46 | /* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
|
---|
47 | printf( "[Buddy received] %s\n", buf );
|
---|
48 |
|
---|
49 | return(ercd);
|
---|
50 | }
|
---|
51 |
|
---|
52 | /* #[<ENTRY_FUNC>]# eEnt_yourMessage
|
---|
53 | * name: eEnt_yourMessage
|
---|
54 | * global_name: tBuddy_eEnt_yourMessage
|
---|
55 | * oneway: false
|
---|
56 | * #[</ENTRY_FUNC>]# */
|
---|
57 | ER
|
---|
58 | eEnt_yourMessage(CELLIDX idx, char_t* buf, int32_t len)
|
---|
59 | {
|
---|
60 | ER ercd = E_OK;
|
---|
61 | CELLCB *p_cellcb;
|
---|
62 | if (VALID_IDX(idx)) {
|
---|
63 | p_cellcb = GET_CELLCB(idx);
|
---|
64 | }
|
---|
65 | else {
|
---|
66 | return(E_ID);
|
---|
67 | } /* end if VALID_IDX(idx) */
|
---|
68 |
|
---|
69 | /* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
|
---|
70 | #define TECS_MESSAGE "Hello mruby! (from TECS)"
|
---|
71 | strncpy( buf, TECS_MESSAGE, len );
|
---|
72 |
|
---|
73 | return(ercd);
|
---|
74 | }
|
---|
75 |
|
---|
76 | /* #[<POSTAMBLE>]#
|
---|
77 | * ããããä¸ã«éåãå£é¢æ°ãæ¸ãã¾ã
|
---|
78 | * #[</POSTAMBLE>]#*/
|
---|