|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 3001 (0xbb9)
Types: TextFile
Names: »ryopblock.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/rosy/ryopblock.c«
/* ryopblock.c - manage operation blocks */
#ifndef lint
static char *rcsid = "$Header: /f/osi/rosy/RCS/ryopblock.c,v 6.0 89/03/18 23:42:55 mrose Rel $";
#endif
/*
* $Header: /f/osi/rosy/RCS/ryopblock.c,v 6.0 89/03/18 23:42:55 mrose Rel $
*
*
* $Log: ryopblock.c,v $
* Revision 6.0 89/03/18 23:42:55 mrose
* Release 5.0
*
*/
/*
* NOTICE
*
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
* this agreement.
*
*/
/* LINTLIBRARY */
#include <stdio.h>
#include "rosy.h"
/* \f
DATA */
static int once_only = 0;
static struct opsblk opsque;
static struct opsblk *OPHead = &opsque;
/* \f
OPERATION BLOCKS */
struct opsblk *newopblk (sd, id)
int sd,
id;
{
register struct opsblk *opb;
opb = (struct opsblk *) calloc (1, sizeof *opb);
if (opb == NULL)
return NULL;
opb -> opb_flags |= OPB_INITIATOR;
opb -> opb_fd = sd;
opb -> opb_id = id;
if (once_only == 0) {
OPHead -> opb_forw = OPHead -> opb_back = OPHead;
once_only++;
}
insque (opb, OPHead -> opb_back);
return opb;
}
/* \f
*/
freeopblk (opb)
register struct opsblk *opb;
{
if (opb == NULL)
return;
if (opb -> opb_out && opb -> opb_free)
(void) (*opb -> opb_free) (opb -> opb_out);
if (opb -> opb_pe)
pe_free (opb -> opb_pe);
remque (opb);
free ((char *) opb);
}
/* \f
*/
struct opsblk *findopblk (sd, id, flags)
register int sd,
id,
flags;
{
register struct opsblk *opb;
if (once_only == 0)
return NULL;
flags &= OPB_INITIATOR | OPB_RESPONDER;
for (opb = OPHead -> opb_forw; opb != OPHead; opb = opb -> opb_forw)
if (opb -> opb_fd == sd
&& opb -> opb_id == id
&& (opb -> opb_flags & flags))
return opb;
return NULL;
}
/* \f
*/
struct opsblk *firstopblk (sd)
register int sd;
{
register struct opsblk *opb,
*op2;
if (once_only == 0)
return NULL;
op2 = NULLOPB;
for (opb = OPHead -> opb_forw; opb != OPHead; opb = opb -> opb_forw)
if (opb -> opb_fd == sd && (opb -> opb_flags & OPB_INITIATOR)) {
if (opb -> opb_flags & OPB_EVENT)
return opb;
if (op2 == NULLOPB)
op2 = opb;
}
return op2;
}
/* \f
*/
loseopblk (sd, reason)
register int sd;
int reason;
{
register struct opsblk *opb,
*op2;
struct RoSAPindication rois;
if (once_only == 0)
return;
for (opb = OPHead -> opb_forw; opb != OPHead; opb = op2) {
op2 = opb -> opb_forw;
if (opb -> opb_fd == sd) {
if (opb -> opb_errfnx)
(*opb -> opb_errfnx) (sd, opb -> opb_id, RY_REJECT,
(caddr_t) reason, &rois);
freeopblk (opb);
}
}
}
/* \f
*/
#ifdef lint
/* VARARGS */
int rosaplose (roi, reason, what, fmt)
struct RoSAPindication *roi;
int reason;
char *what,
*fmt;
{
return rosaplose (roi, reason, what, fmt);
}
#endif