home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / LOBE.src.sit / LOBE.src / InitToPrefs.c < prev    next >
C/C++ Source or Header  |  1994-12-13  |  677b  |  22 lines

  1. #include "common.h"
  2.  
  3. // The new lock state is held in a temp variable, in case new and old
  4. // happen to be the same pointer. Otherwise, the old->Locked = -1 would
  5. // trash the new value.
  6.  
  7. // old is assumed to be pointed to the vars currently in use.
  8.  
  9. void InitToPrefs(BusVars *new,BusVars *old) {
  10.     const long DangerStr = 0x50FF8001;
  11.     short    newLock = new->Locked;
  12.         
  13.     old->Locked = Locked_stop;            // lock it so we can change things
  14.     old->Behavior = new->Behavior;        // copy new values
  15.     old->Do4 = new->Do4;
  16.     
  17.     *(long *)(0) = DangerStr;            // init the magic values
  18.     if ( new->Do4 == Do4_yep )
  19.         *(long *)(4) = DangerStr;
  20.     
  21.     old->Locked = newLock;                // free the vbl to run again
  22.     }