DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T r

⟦176206b7f⟧ TextFile

    Length: 3001 (0xbb9)
    Types: TextFile
    Names: »ryopblock.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/rosy/ryopblock.c« 

TextFile

/* ryopblock.c - manage operation blocks */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/rosy/RCS/ryopblock.c,v 7.0 89/11/23 22:22:01 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/rosy/RCS/ryopblock.c,v 7.0 89/11/23 22:22:01 mrose Rel $
 *
 *
 * $Log:	ryopblock.c,v $
 * Revision 7.0  89/11/23  22:22:01  mrose
 * Release 6.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