version 1.1, 1999/12/09 22:44:56 |
version 1.2, 1999/12/13 02:27:15 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM$ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox.c,v 1.1 1999/12/09 22:44:56 ohara Exp $ */ |
|
|
/* |
/* |
関数の名前付け規約(その2): |
関数の名前付け規約(その2): |
Line 89 static int send_cmo_distributed_polynomial(in |
|
Line 89 static int send_cmo_distributed_polynomial(in |
|
|
|
static void resize_mpz(mpz_ptr mpz, int size); |
static void resize_mpz(mpz_ptr mpz, int size); |
|
|
|
int current_fd = 0; |
|
int set_current_fd(int fd) |
|
{ |
|
current_fd = fd; |
|
} |
|
|
|
/* hook 関数 */ |
|
static hook_t hook_before_send_cmo = NULL; |
|
static hook_t hook_after_send_cmo = NULL; |
|
|
|
int add_hook_before_send_cmo(hook_t func) |
|
{ |
|
hook_before_send_cmo = func; |
|
} |
|
|
|
int add_hook_after_send_cmo(hook_t func) |
|
{ |
|
hook_after_send_cmo = func; |
|
} |
|
|
|
static cmo *call_hook_before_send_cmo(int fd, cmo *c) |
|
{ |
|
if (hook_before_send_cmo != NULL) { |
|
return hook_before_send_cmo(fd, c); |
|
} |
|
return c; |
|
} |
|
|
|
static cmo *call_hook_after_send_cmo(int fd, cmo *c) |
|
{ |
|
if (hook_after_send_cmo != NULL) { |
|
return hook_after_send_cmo(fd, c); |
|
} |
|
return c; |
|
} |
|
|
/* エラーハンドリングのため */ |
/* エラーハンドリングのため */ |
static int current_received_serial = 0; |
static int current_received_serial = 0; |
|
|
Line 1132 int send_cmo(int fd, cmo* c) |
|
Line 1167 int send_cmo(int fd, cmo* c) |
|
{ |
{ |
int tag = c->tag; |
int tag = c->tag; |
|
|
|
c = call_hook_before_send_cmo(fd, c); |
|
|
send_int32(fd, tag); |
send_int32(fd, tag); |
switch(tag) { |
switch(tag) { |
case CMO_NULL: |
case CMO_NULL: |
Line 1164 int send_cmo(int fd, cmo* c) |
|
Line 1201 int send_cmo(int fd, cmo* c) |
|
send_cmo_distributed_polynomial(fd, (cmo_distributed_polynomial *)c); |
send_cmo_distributed_polynomial(fd, (cmo_distributed_polynomial *)c); |
break; |
break; |
default: |
default: |
|
call_hook_after_send_cmo(fd, c); |
} |
} |
} |
} |
|
|