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 f

⟦d56d99892⟧ TextFile

    Length: 2593 (0xa21)
    Types: TextFile
    Names: »ftamconctl.c«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/ftam/ftamconctl.c« 

TextFile

/* ftamconctl.c - FPM: encode/decode concurrency control */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/ftam/RCS/ftamconctl.c,v 6.0 89/03/18 23:30:33 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/ftam/RCS/ftamconctl.c,v 6.0 89/03/18 23:30:33 mrose Rel $
 *
 *
 * $Log:	ftamconctl.c,v $
 * Revision 6.0  89/03/18  23:30:33  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 "fpkt.h"

/* \f

   DATA */

static int fc2lock[] = {
    int_FTAM_Lock_shared, int_FTAM_Lock_exclusive,
    int_FTAM_Lock_not__required, int_FTAM_Lock_no__access
};

static int lock2fc[] = {
    FLOCK_NOTREQD, FLOCK_SHARED, FLOCK_EXCLUSIVE, FLOCK_NOACCESS
};

/* \f

 */

struct type_FTAM_Concurrency__Control *conctl2fpm (fsb, fc, fti)
register struct ftamblk *fsb;
register struct FTAMconcurrency *fc;
struct FTAMindication *fti;
{
    register struct type_FTAM_Concurrency__Control *fpm;

    if ((fpm = (struct type_FTAM_Concurrency__Control *)
		    calloc (1, sizeof *fpm)) == NULL) {
no_mem: ;
	(void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP, "out of memory");
	if (fpm)
	    free_FTAM_Concurrency__Control (fpm);
	return NULL;
    }

#define	dolock(s,t) \
{ \
    if ((fpm -> s = (struct type_FTAM_Concurrency__Key *) \
			    calloc (1, sizeof *fpm -> s)) \
	    == NULL) \
	goto no_mem; \
    fpm -> s -> parm = fc2lock [fc -> t & FLOCK_MASK]; \
}
    dolock (read, fc_readlock);
    dolock (insert, fc_insertlock);
    dolock (replace, fc_replacelock);
    dolock (extend, fc_extendlock);
    dolock (erase, fc_eraselock);
    dolock (read__attribute, fc_readattrlock);
    dolock (change__attribute, fc_chngattrlock);
    dolock (delete, fc_deletelock);
#undef	dolock

    return fpm;
}

/* \f

 */

/* ARGSUSED */

int	fpm2conctl (fsb, fpm, fc, fti)
struct ftamblk *fsb;
register struct type_FTAM_Concurrency__Control *fpm;
register struct FTAMconcurrency *fc;
struct FTAMindication *fti;
{
    FCINIT (fc);

#define	dolock(s,t) \
{ \
    fc -> t = lock2fc [fpm -> s -> parm]; \
}
    dolock (read, fc_readlock);
    dolock (insert, fc_insertlock);
    dolock (replace, fc_replacelock);
    dolock (extend, fc_extendlock);
    dolock (erase, fc_eraselock);
    dolock (read__attribute, fc_readattrlock);
    dolock (change__attribute, fc_chngattrlock);
    dolock (delete, fc_deletelock);
#undef	dolock

    return OK;
}