Fortran NOT AVAILABLE
recvf returns the old value of the matching function, or 0 if the old function was the default matcher
pvm_recvf is intended for sophisticated C programmers who understand the function of such routines (like signal) and who require a receive routine that can match on more complex message contexts than the default provides.
The matching function should return:
Value Action taken
< 0 return immediately with this error code
0 do not pick this message
1 pick this message and do not scan the rest
> 1 pick this highest ranked message after
scanning them all
#include <pvm3.h>
static int foundit = 0;
static int
foo_match(mid, tid, code)
int mid;
int tid;
int code;
{
int t, c, cc;
if ((cc = pvm_bufinfo(mid, (int*)0, &c, &t)) < 0)
return cc;
if ((tid == -1 || tid == t) && (code == -1 || code == c))
foundit = 1;
return 0;
}
int
probe(src, code)
{
int (*omatch)();
int cc;
omatch = pvm_recvf(foo_match);
foundit = 0;
if ((cc = pvm_nrecv(src, code)) < 0)
return cc;
return foundit;
}