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 w

⟦d2750cce6⟧ TextFile

    Length: 887 (0x377)
    Types: TextFile
    Names: »writek.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Adventure/src/kio/writek.c« 

TextFile

/*
**		    Copyright (c) 1985	Ken Wellsch
**
**     Permission is hereby granted to all users to possess, use, copy,
**     distribute, and modify the programs and files in this package
**     provided it is not for direct commercial benefit and secondly,
**     that this notice and all modification information be kept and
**     maintained in the package.
**
*/

#include "kio.h"

int writek (unit,key,buffer,size)
  int unit, key, size ;
  char *buffer ;
{
	struct mkey k ;
	extern long int PutRec () ;

	if ( size < 1 || key < 0 || unit == EXISTING )
		return (ERROR) ;

	MapKey (key,&k) ;

	if ( GetBlk (k.b) != k.b )
		if ( MakBlk (k.b) != k.b )
			error ("Writek","unable to create key %d!",key) ;

	if ( Iblk.i_siz[k.e] > 0 )
		error ("Writek","key %d already exists!",key) ;

	Iblk.i_loc[k.e] = PutRec (buffer,size) ;
	Iblk.i_siz[k.e] = size ;
	Modified++ ;
	return (size) ;
}