version 1.13, 2000/12/03 21:46:52 |
version 1.14, 2000/12/03 22:09:34 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_math/serv1.c,v 1.12 2000/12/03 15:19:23 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_math/serv1.c,v 1.13 2000/12/03 21:46:52 ohara Exp $ */ |
|
|
/* |
/* |
Copyright (C) Katsuyoshi OHARA, 2000. |
Copyright (C) Katsuyoshi OHARA, 2000. |
|
|
#include <ox_toolkit.h> |
#include <ox_toolkit.h> |
#include "sm.h" |
#include "sm.h" |
|
|
static int send_ox_sync_ball(); |
|
|
|
extern OXFILE *stack_oxfp; |
extern OXFILE *stack_oxfp; |
|
|
static int flag_sigusr1 = 0; |
|
static int flag_sigusr2 = 0; |
|
|
|
/* if in_critical equals to 1 then we do not permit an interrupt. */ |
/* if in_critical equals to 1 then we do not permit an interrupt. */ |
static int in_critical = 0; |
static int in_critical = 0; |
|
static int already_send_ox_sync_ball = 0; |
|
static int flag_sigusr1 = 0; |
|
|
|
static int send_ox_sync_ball(); |
|
|
static int set_critical() |
static int set_critical() |
{ |
{ |
in_critical = 1; |
in_critical = 1; |
Line 42 static int critical_p() { |
|
Line 41 static int critical_p() { |
|
return in_critical; |
return in_critical; |
} |
} |
|
|
static int already_send_ox_sync_ball = 0; |
|
|
|
/* SM_control_reset_connection */ |
/* SM_control_reset_connection */ |
static int handler_reset1() |
static int handler_reset1() |
{ |
{ |
Line 70 static int send_ox_sync_ball() |
|
Line 67 static int send_ox_sync_ball() |
|
send_ox_tag(stack_oxfp, OX_SYNC_BALL); |
send_ox_tag(stack_oxfp, OX_SYNC_BALL); |
} |
} |
|
|
static int exchange_ox_syncball() |
static int exchange_ox_sync_ball() |
{ |
{ |
int tag; |
int tag; |
|
|
Line 85 static int exchange_ox_syncball() |
|
Line 82 static int exchange_ox_syncball() |
|
fprintf(stderr, "received a sync_ball.\n"); |
fprintf(stderr, "received a sync_ball.\n"); |
} |
} |
|
|
|
int shutdown() |
|
{ |
|
oxf_close(stack_oxfp); |
|
ml_exit(); |
|
exit(0); |
|
} |
|
|
|
#define VERSION 0x11121400 |
|
#define ID_STRING "2000/11/29" |
|
|
|
int main() |
|
{ |
|
OXFILE* sv; |
|
|
|
ml_init(); |
|
mathcap_init(VERSION, ID_STRING, "ox_math", NULL, NULL); |
|
|
|
signal(SIGUSR1, handler_reset1); |
|
signal(SIGKILL, handler_kill); |
|
|
|
sv = oxf_open(3); |
|
oxf_determine_byteorder_server(sv); |
|
sm(sv); |
|
shutdown(); |
|
} |
|
|
/* a part of stack machine. */ |
/* a part of stack machine. */ |
int sm_receive_ox() |
int sm_receive_ox() |
{ |
{ |
Line 113 int sm_receive_ox() |
|
Line 136 int sm_receive_ox() |
|
return 1; |
return 1; |
} |
} |
|
|
int shutdown() |
|
{ |
|
oxf_close(stack_oxfp); |
|
ml_exit(); |
|
exit(0); |
|
} |
|
|
|
#define VERSION 0x11121400 |
|
#define ID_STRING "2000/11/29" |
|
|
|
int oxf_error(OXFILE *oxfp) |
|
{ |
|
int e = oxfp->error; |
|
if (e != 0) { |
|
oxfp->error = 0; |
|
} |
|
return e; |
|
} |
|
|
|
int main() |
|
{ |
|
OXFILE* sv; |
|
|
|
ml_init(); |
|
mathcap_init(VERSION, ID_STRING, "ox_math", NULL, NULL); |
|
|
|
signal(SIGUSR1, handler_reset1); |
|
signal(SIGKILL, handler_kill); |
|
|
|
sv = oxf_open(3); |
|
oxf_determine_byteorder_server(sv); |
|
sm(sv); |
|
shutdown(); |
|
} |
|
|
|
int sm(OXFILE *oxfp) |
int sm(OXFILE *oxfp) |
{ |
{ |
stack_oxfp = oxfp; |
stack_oxfp = oxfp; |
Line 158 int sm(OXFILE *oxfp) |
|
Line 146 int sm(OXFILE *oxfp) |
|
send_ox_sync_ball(); |
send_ox_sync_ball(); |
already_send_ox_sync_ball = 1; |
already_send_ox_sync_ball = 1; |
} |
} |
exchange_ox_syncball(); |
exchange_ox_sync_ball(); |
flag_sigusr1 = 0; |
flag_sigusr1 = 0; |
already_send_ox_sync_ball = 0; |
already_send_ox_sync_ball = 0; |
} |
} |