36
36
* Message mailbox database.
39
* Revision 1.2 2002/10/14 14:37:49 chanceli
42
* Revision 1.25 2001/02/07 23:15:49 pvmsrc
43
* 2nd Half of CYGWIN Check-ins...
46
* Revision 1.24 2000/02/16 21:59:47 pvmsrc
47
* Fixed up #include <sys/types.h> stuff...
48
* - use <bsd/sys/types.h> for IMA_TITN...
49
* - #include before any NEEDMENDIAN #includes...
52
* Revision 1.23 1999/12/13 18:13:41 pvmsrc
53
* Moved pvmmatchstring() routine to pvmcruft.c (for usage by pvmtester).
54
* Re-integrated two versions of mb_name() into one with #ifdefs for
55
* the USE_GNU_REGEX stuff.
58
* Revision 1.22 1999/12/10 21:30:45 pvmsrc
59
* Yanked GNU Regex Stuff.
60
* - re-activate using -DUSE_GNU_REGEX define... if you must.
61
* - replaced full regular expression matching in mb_names()
62
* with good ole Unix style '*' globbing,
63
* via pvmmatchstring() a la Jeembo.
66
* Revision 1.21 1999/11/08 17:21:16 pvmsrc
67
* Added new PvmMboxDirectIndex() flag handling to mb_insert().
68
* - allow atomic re-insert at a specific index.
71
* Revision 1.20 1999/07/08 19:00:04 kohl
72
* Fixed "Log" keyword placement.
73
* - indent with " * " for new CVS.
75
* Revision 1.19 1999/01/13 00:03:45 pvmsrc
76
* Fixed up mbox insert stuff, bugs & 3.3 compat (insert/lookup/delete).
77
* - changed to always pass in -1 for index (internal arg only).
78
* - handle minst correctly, supercedes overwritable else no way to
79
* build a minst list from within a single task, always just look
80
* for next unused index if minst set.
81
* - check for pvm_insert() compat, if mbox exists and req != -1 (any),
82
* then return PvmDenied (no overwrite in 3.3).
85
* Revision 1.18 1998/11/20 20:04:10 pvmsrc
86
* Changes so that win32 will compile & build. Also, common
87
* Changes so that compiles & builds on NT. Also
88
* common source on win32 & unix.
39
91
* Revision 1.17 1997/06/27 17:32:30 pvmsrc
40
92
* Updated for WIN32 header files & Authors.
265
326
struct pvmmentry *ep;
266
327
struct pvmmentry *ep2 = 0;
329
int dind; /* direct index */
330
int cind; /* current index */
332
/* must change to always pass in -1 for 3.4 calls */
333
/* then can distinguish between 3.4 reinsert which succeeds
334
if !overwritable/minst & 3.3 reinsert which should fail */
335
/* to fix the "if (ep->me_ind == req)" conditional
336
use a "current index": cind = ( req == -1 ) ? 0 : req; */
337
/* also, minst supercedes overwritable, else no way to build
338
a minst list from within a single task... */
268
340
if (!(np = mc_find(name)))
269
341
if (!(np = mc_new(name)))
344
dind = PvmMboxDirectIndexOf( flags );
346
cind = ( req == -1 ) ?
347
( ( dind ) ? dind : 0 )
272
350
for (ep = np->mc_ent->me_link; ep != np->mc_ent; ep = ep->me_link)
273
if (ep->me_ind >= req)
351
if (ep->me_ind >= cind)
276
354
/* default insert is "locked"... */
278
if (flags & PvmMboxMultiInstance) {
279
for (; ep != np->mc_ent; ep = ep->me_link) {
280
if (ep->me_ind != req)
282
if ( (ep->me_flags & PvmMboxOverWritable)
283
|| tid == ep->me_tid ) {
356
if (ep->me_ind == cind) {
357
if (flags & PvmMboxMultiInstance) {
358
if ( req != -1 ) /* hack for 3.3 compat */
360
for (; ep != np->mc_ent; ep = ep->me_link) {
361
if (ep->me_ind != cind)
287
req = ep->me_ind + 1;
290
if (ep->me_ind == req) {
291
366
if ( !(ep->me_flags & PvmMboxOverWritable)
292
367
&& tid != ep->me_tid) {
293
368
return PvmDenied;
423
505
for ( np = pvmmboxclasses->mc_link; np != pvmmboxclasses;
424
506
np = np->mc_link )
427
510
|| ( ( pattbuff ) ?
428
511
( pvmmatchregex( pattbuff, np->mc_name ) )
429
512
: ( !strcmp( pattern, np->mc_name ) ) ) )
514
if ( pvmmatchstring( np->mc_name, pattern ) )
439
525
for ( np = pvmmboxclasses->mc_link; np != pvmmboxclasses;
440
526
np = np->mc_link )
443
530
|| ( ( pattbuff ) ?
444
531
( pvmmatchregex( pattbuff, np->mc_name ) )
445
532
: ( !strcmp( pattern, np->mc_name ) ) ) )
534
if ( pvmmatchstring( np->mc_name, pattern ) )
447
537
pkstr( mp, np->mc_name );