home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume12
/
mdg
/
part05
/
loadconfig.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-04
|
979b
|
58 lines
/*
MDG Multiuser Dungeon Game -- loadconfig.c reads keys
MDG is Copyright 1990 John C. Gonnerman
This program is subject to the general MDG
copyright statement (see enclosed file, Copyright).
*/
static char *sccsvers = "@(#) loadconfig.c\t(1.2)\tcreated 1/2/91";
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/msg.h>
#include "config.h"
#include "files.h"
extern char *progname;
extern int errno;
extern char *sys_errlist[];
long dmsgkey, gsemkey, mapkey, playerkey;
loadconfig()
{
FILE *fp;
char inbuf[40];
dmsgkey = DMSGKEY;
gsemkey = GSEMKEY;
mapkey = MAPKEY;
playerkey = PLAYERKEY;
if((fp = fopen(CONFIGFILE, "r")) == NULL)
return;
fgets(inbuf, 40, fp);
sscanf(inbuf, "%ld", &dmsgkey);
fgets(inbuf, 40, fp);
sscanf(inbuf, "%ld", &gsemkey);
fgets(inbuf, 40, fp);
sscanf(inbuf, "%ld", &playerkey);
fgets(inbuf, 40, fp);
sscanf(inbuf, "%ld", &mapkey);
fclose(fp);
}
/* end of file. */